入库管理
This commit is contained in:
parent
10c6840eb9
commit
892b40d904
|
|
@ -291,4 +291,55 @@ export const updateWarehousingApi = (data) => {
|
|||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 入库申请-工具详情
|
||||
export const getListByApplyIdApi = (data) => {
|
||||
return request({
|
||||
url: '/material-mall/toolApply/listByApplyId',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 工具删除
|
||||
export const deleteToolApi = (data) => {
|
||||
return request({
|
||||
url: '/material-mall/toolApply/deleteTool',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteByIdApi = (data) => {
|
||||
return request({
|
||||
url: '/material-mall/warehousing/deleteById',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量/单个-提交
|
||||
export const batchSubmissionApi = (data) => {
|
||||
return request({
|
||||
url: `/material-mall/warehousing/batchSubmission/${data}`,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
// 批量单个-审核
|
||||
export const batchApprovalApi = (data) => {
|
||||
return request({
|
||||
url: `/material-mall/warehousing/batchApproval/${data}`,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
// 批量单个-驳回
|
||||
export const batchRejectionApi = (data) => {
|
||||
return request({
|
||||
url: `/material-mall/warehousing/batchRejection/${data}`,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:class="{ hide: this.fileList.length >= this.limit }"
|
||||
:class="{ hide: fileList.length >= limit }"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
<template #file="{ file }">
|
||||
|
|
@ -236,6 +236,11 @@ export default {
|
|||
return
|
||||
}
|
||||
|
||||
if (!this.isImage(file)) {
|
||||
window.open(url, '_blank')
|
||||
return
|
||||
}
|
||||
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -213,7 +213,15 @@
|
|||
<el-col :span="24">
|
||||
<el-form-item label="维保附件" prop="fileInfoList">
|
||||
<!-- 使用el-upload替换自定义上传组件 -->
|
||||
<el-upload
|
||||
<FileImageUpload
|
||||
v-model="fileList"
|
||||
:value="fileList"
|
||||
:limit="1"
|
||||
:fileSize="10"
|
||||
:fileType="['jpg', 'png', 'pdf', 'doc', 'docx']"
|
||||
@input="handleFileList"
|
||||
/>
|
||||
<!-- <el-upload
|
||||
:action="uploadUrl"
|
||||
:headers="{ Authorization: getToken() }"
|
||||
:file-list="fileList"
|
||||
|
|
@ -230,7 +238,7 @@
|
|||
<div slot="tip" class="el-upload__tip">
|
||||
支持格式:.jpg、.png、.pdf、.doc、.docx 单个文件大小不能超过10M
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -397,8 +405,10 @@ import {
|
|||
} from '@/api/EquipmentServicing/index'
|
||||
import { getSelectEquipmentListAPI } from '@/api/EquipmentLedger/equ-out'
|
||||
import { getToken } from '@/utils/auth' // 引入获取token的工具函数
|
||||
import FileImageUpload from '@/components/FileImageUpload'
|
||||
|
||||
export default {
|
||||
components: { FileImageUpload },
|
||||
data() {
|
||||
return {
|
||||
// 列表数据相关
|
||||
|
|
@ -461,7 +471,7 @@ export default {
|
|||
},
|
||||
|
||||
// 文件上传相关
|
||||
fileList: [], // el-upload使用的文件列表
|
||||
fileList: null, // el-upload使用的文件列表
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload',
|
||||
warningDays: 0
|
||||
}
|
||||
|
|
@ -730,6 +740,23 @@ export default {
|
|||
this.addOrEditForm.fileInfoList = []
|
||||
}
|
||||
},
|
||||
handleFileList(file) {
|
||||
console.log('🚀 ~ file:', file)
|
||||
if (!file) {
|
||||
this.fileList = null
|
||||
this.addOrEditForm.fileInfoList = []
|
||||
return
|
||||
}
|
||||
this.fileList = file
|
||||
const arr = file.split(',')
|
||||
this.addOrEditForm.fileInfoList = arr.map((item) => {
|
||||
const parts = item.split('/')
|
||||
return {
|
||||
fileName: parts[parts.length - 1],
|
||||
fileUrl: item,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 文件上传成功处理
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<GoBack :title="'入库申请'" @goBack="goBack" />
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" :before-leave="beforeClick">
|
||||
<el-tab-pane label="装备" name="equip"></el-tab-pane>
|
||||
<el-tab-pane label="数量工具" name="toolNum"></el-tab-pane>
|
||||
<el-tab-pane label="编码工具" name="toolCode"></el-tab-pane>
|
||||
<el-tabs v-model="activeName" :before-leave="beforeClick">
|
||||
<el-tab-pane label="施工装备" name="EquipmentAdd"></el-tab-pane>
|
||||
<el-tab-pane label="数量工具" name="AddNum"></el-tab-pane>
|
||||
<el-tab-pane label="编码工具" name="AddCode"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<component ref="componentRef" :is="isShowComponent" @isSubmit="isSubmit" />
|
||||
<component ref="componentRef" :is="isShowComponent" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -27,7 +27,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
isShowComponent: 'EquipmentAdd',
|
||||
activeName: 'equip',
|
||||
activeName: 'EquipmentAdd',
|
||||
leaving: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -45,61 +46,71 @@ export default {
|
|||
this.$tab.closePage({ path: '/stockManagement/entryApply/apply' })
|
||||
})
|
||||
},
|
||||
beforeClick(activeName, oldActiveName) {
|
||||
console.log('🚀 ~ oldActiveName:', oldActiveName)
|
||||
console.log('🚀 ~ activeName:', activeName)
|
||||
// this.$refs.componentRef
|
||||
console.log('🚀 ~ this.$refs.componentRef:', this.$refs.componentRef)
|
||||
async beforeClick(activeName, oldActiveName) {
|
||||
if (this.leaving) return false
|
||||
// 如果是同一个 tab,直接放行
|
||||
if (activeName === oldActiveName) return true
|
||||
let isEmpty = false
|
||||
let allHasOrderId = false
|
||||
if (oldActiveName == 'equip') {
|
||||
if (oldActiveName == 'EquipmentAdd') {
|
||||
const tableList = this.$refs.componentRef.tableData || []
|
||||
isEmpty = tableList.length === 0
|
||||
allHasOrderId = tableList.every((item) => !!item.orderId)
|
||||
} else if (oldActiveName == 'toolNum') {
|
||||
allHasOrderId = tableList.every((item) => !!item.maId)
|
||||
} else if (oldActiveName == 'AddNum' || oldActiveName == 'AddCode') {
|
||||
const tableList = this.$refs.componentRef.dialogList || []
|
||||
isEmpty = tableList.length === 0
|
||||
allHasOrderId = tableList.every((item) => !!item.applyId)
|
||||
} else if (oldActiveName == 'toolCode') {
|
||||
const tableList = this.$refs.componentRef.dialogList || []
|
||||
isEmpty = tableList.length === 0
|
||||
allHasOrderId = tableList.every((item) => !!item.applyId)
|
||||
allHasOrderId = tableList.every((item) => !!item.id)
|
||||
}
|
||||
console.log('🚀 ~ isEmpty:', isEmpty)
|
||||
console.log('🚀 ~ allHasOrderId:', allHasOrderId)
|
||||
|
||||
if (isEmpty || allHasOrderId) {
|
||||
if (activeName == 'equip') {
|
||||
this.isShowComponent = 'EquipmentAdd'
|
||||
} else if (activeName == 'toolNum') {
|
||||
this.isShowComponent = 'AddNum'
|
||||
} else if (activeName == 'toolCode') {
|
||||
this.isShowComponent = 'AddCode'
|
||||
}
|
||||
this.isShowComponent = activeName
|
||||
return true
|
||||
}
|
||||
|
||||
return this.confirmLeave().then(async (res) => {
|
||||
console.log('🚀 ~ res-确定保存:', res)
|
||||
console.log('🚀 ~ 确定保存-->>>:')
|
||||
if (!res) {
|
||||
if (activeName == 'equip') {
|
||||
this.isShowComponent = 'EquipmentAdd'
|
||||
} else if (activeName == 'toolNum') {
|
||||
this.isShowComponent = 'AddNum'
|
||||
} else if (activeName == 'toolCode') {
|
||||
this.isShowComponent = 'AddCode'
|
||||
}
|
||||
return
|
||||
}
|
||||
if (oldActiveName == 'equip') {
|
||||
const confirm = await this.confirmLeave()
|
||||
if (!confirm) {
|
||||
// ❌ 用户取消
|
||||
this.isShowComponent = activeName
|
||||
return true
|
||||
}
|
||||
try {
|
||||
let result = null
|
||||
if (oldActiveName == 'EquipmentAdd') {
|
||||
// 调用保存
|
||||
// this.$refs.componentRef.submit()
|
||||
} else if (oldActiveName == 'toolNum') {
|
||||
} else if (oldActiveName == 'code') {
|
||||
const tableList = this.$refs.componentRef.tableData || []
|
||||
|
||||
for (let i = 0; i < tableList.length; i++) {
|
||||
const row = tableList[i]
|
||||
const res = await this.$refs.componentRef.submitRow(row)
|
||||
if (!res) {
|
||||
result = false
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if (oldActiveName == 'AddNum' || oldActiveName == 'AddCode') {
|
||||
result = await this.$refs.componentRef.submit()
|
||||
console.log('🚀 ~ result:', result)
|
||||
}
|
||||
})
|
||||
if (!result) {
|
||||
setTimeout(() => {
|
||||
this.leaving = true
|
||||
this.activeName = oldActiveName
|
||||
setTimeout(() => {
|
||||
this.leaving = false
|
||||
}, 200)
|
||||
}, 200)
|
||||
return false
|
||||
} else {
|
||||
this.isShowComponent = activeName
|
||||
return true
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('error', error)
|
||||
setTimeout(() => {
|
||||
this.activeName = oldActiveName
|
||||
}, 200)
|
||||
return false
|
||||
}
|
||||
},
|
||||
confirmLeave(message = '是否暂存已添加的装备?', title = '提示') {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
@ -118,19 +129,6 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log('🚀 ~ tab, event:', tab.index)
|
||||
// if (tab.index == 0) {
|
||||
// this.isShowComponent = 'EquipmentAdd'
|
||||
// } else if (tab.index == 1) {
|
||||
// this.isShowComponent = 'AddNum'
|
||||
// } else if (tab.index == 2) {
|
||||
// this.isShowComponent = 'AddCode'
|
||||
// }
|
||||
},
|
||||
isSubmit(val) {
|
||||
console.log('🚀 ~ val:', val)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -139,7 +139,12 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{ row, $index }">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete($index)" style="color: red"
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(row, $index)"
|
||||
style="color: red"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
|
|
@ -290,7 +295,7 @@
|
|||
import { getTreeSelectApi, addApplyCodeApi, addToolApi } from '@/api/toolsManage'
|
||||
import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
|
||||
import { addFacturer } from '@/api/ma/supplier'
|
||||
import { addWarehousingApi, updateWarehousingApi } from '@/api/EquipmentEntryApply'
|
||||
import { addWarehousingApi, updateWarehousingApi, getListByApplyIdApi, deleteToolApi } from '@/api/EquipmentEntryApply'
|
||||
import FileUpload from '@/components/FileImageUpload'
|
||||
|
||||
export default {
|
||||
|
|
@ -346,7 +351,7 @@ export default {
|
|||
currentRow: null,
|
||||
uploadTitle: '',
|
||||
uploadVisible: false,
|
||||
fileList: [],
|
||||
fileList: null,
|
||||
viewVisible: false,
|
||||
viewTitle: '',
|
||||
viewList: [],
|
||||
|
|
@ -385,6 +390,8 @@ export default {
|
|||
},
|
||||
async getList() {
|
||||
try {
|
||||
const res = await getListByApplyIdApi({ applyId: this.dialogForm.applyId, manageType: 0 })
|
||||
this.dialogList = res.rows
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
|
|
@ -463,12 +470,21 @@ export default {
|
|||
})
|
||||
}
|
||||
},
|
||||
handleDelete(index) {
|
||||
this.dialogList.splice(index, 1)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
async handleDelete(row, index) {
|
||||
try {
|
||||
if (row.id) {
|
||||
await deleteToolApi({ id: row.id })
|
||||
this.getList()
|
||||
} else {
|
||||
this.dialogList.splice(index, 1)
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
},
|
||||
// 获取厂家
|
||||
async getManufacturerSelect() {
|
||||
|
|
@ -515,32 +531,53 @@ export default {
|
|||
this.isLoading = true
|
||||
this.dialogForm.applyId = this.$route.query.applyId || ''
|
||||
if (!this.dialogForm.applyId) {
|
||||
const routerParams = this.$route.query || {}
|
||||
const res = await addApplyCodeApi()
|
||||
this.dialogForm.applyId = res.data.id
|
||||
// 更新路由传参
|
||||
this.$router.replace({
|
||||
query: {
|
||||
applyId: res.data.id,
|
||||
id: routerParams.id || '',
|
||||
applyId: this.dialogForm.applyId || '',
|
||||
orderId: routerParams.orderId || '',
|
||||
isAddVisible: routerParams.isAddVisible || '',
|
||||
isApprovalVisible: routerParams.isApprovalVisible || '',
|
||||
},
|
||||
})
|
||||
this.dialogList.forEach((item) => {
|
||||
item.applyId = res.data.id
|
||||
})
|
||||
} else {
|
||||
this.dialogList.forEach((item) => {
|
||||
item.applyId = this.dialogForm.applyId
|
||||
})
|
||||
}
|
||||
const orderId = this.$route.query.orderId || ''
|
||||
const isEdit = this.$route.query.isEdit || ''
|
||||
const id = this.$route.query.id || ''
|
||||
if (isEdit && id) {
|
||||
await updateWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
|
||||
await addToolApi(this.dialogList)
|
||||
if (id) {
|
||||
await updateWarehousingApi({ id, orderId, applyId: this.dialogForm.applyId })
|
||||
} else {
|
||||
await addToolApi(this.dialogList)
|
||||
await addWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
const routerParams = this.$route.query || {}
|
||||
const res = await addWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
this.$router.replace({
|
||||
query: {
|
||||
id: res.data.id || '',
|
||||
applyId: routerParams.applyId || '',
|
||||
orderId: routerParams.orderId || '',
|
||||
isAddVisible: routerParams.isAddVisible || '',
|
||||
isApprovalVisible: routerParams.isApprovalVisible || '',
|
||||
},
|
||||
})
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
})
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
return true
|
||||
// this.$emit('getList', { applyId: this.dialogForm.applyId })
|
||||
} catch (error) {
|
||||
} finally {
|
||||
|
|
@ -602,13 +639,13 @@ export default {
|
|||
// this.currentRow = row
|
||||
if (type == 2) {
|
||||
this.uploadTitle = '合格证'
|
||||
this.fileList = this.currentRow.fileList2
|
||||
this.fileList = this.joinFileUrls(this.currentRow.certificates)
|
||||
} else if (type == 3) {
|
||||
this.uploadTitle = '定期检验报告'
|
||||
this.fileList = this.currentRow.fileList3
|
||||
this.fileList = this.joinFileUrls(this.currentRow.inspectionReports)
|
||||
} else if (type == 4) {
|
||||
this.uploadTitle = '采购发票'
|
||||
this.fileList = this.currentRow.fileList4
|
||||
this.fileList = this.joinFileUrls(this.currentRow.purchaseInvoices)
|
||||
}
|
||||
this.uploadVisible = true
|
||||
},
|
||||
|
|
@ -646,6 +683,14 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
joinFileUrls(list) {
|
||||
if (!Array.isArray(list) || list.length === 0) return ''
|
||||
|
||||
return list
|
||||
.filter((item) => item && item.fileUrl)
|
||||
.map((item) => item.fileUrl)
|
||||
.join(',')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,12 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{ row, $index }">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(index)" style="color: red"
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(row, $index)"
|
||||
style="color: red"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
|
|
@ -134,7 +139,7 @@
|
|||
|
||||
<script>
|
||||
import { getTreeSelectApi, addApplyCodeApi, addToolApi } from '@/api/toolsManage'
|
||||
import { addWarehousingApi, updateWarehousingApi } from '@/api/EquipmentEntryApply'
|
||||
import { addWarehousingApi, updateWarehousingApi, getListByApplyIdApi, deleteToolApi } from '@/api/EquipmentEntryApply'
|
||||
import FileUpload from '@/components/FileImageUpload'
|
||||
|
||||
export default {
|
||||
|
|
@ -204,6 +209,8 @@ export default {
|
|||
},
|
||||
async getList() {
|
||||
try {
|
||||
const res = await getListByApplyIdApi({ applyId: this.dialogForm.applyId, manageType: 1 })
|
||||
this.dialogList = res.rows
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
|
|
@ -309,12 +316,21 @@ export default {
|
|||
}
|
||||
return null // 没找到
|
||||
},
|
||||
handleDelete(index) {
|
||||
this.dialogList.splice(index, 1)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
async handleDelete(row, index) {
|
||||
try {
|
||||
if (row.id) {
|
||||
await deleteToolApi({ id: row.id })
|
||||
this.getList()
|
||||
} else {
|
||||
this.dialogList.splice(index, 1)
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
try {
|
||||
|
|
@ -324,30 +340,51 @@ export default {
|
|||
const res = await addApplyCodeApi()
|
||||
console.log('🚀 ~ res:', res)
|
||||
this.dialogForm.applyId = res.data.id
|
||||
const routerParams = this.$route.query
|
||||
// 更新路由传参
|
||||
this.$router.replace({
|
||||
query: {
|
||||
applyId: res.data.id,
|
||||
id: routerParams.id || '',
|
||||
applyId: this.dialogForm.applyId || '',
|
||||
orderId: routerParams.orderId || '',
|
||||
isAddVisible: routerParams.isAddVisible || '',
|
||||
isApprovalVisible: routerParams.isApprovalVisible || '',
|
||||
},
|
||||
})
|
||||
this.dialogList.forEach((item) => {
|
||||
item.applyId = res.data.id
|
||||
item.applyId = this.dialogForm.applyId
|
||||
})
|
||||
} else {
|
||||
this.dialogList.forEach((item) => {
|
||||
item.applyId = this.dialogForm.applyId
|
||||
})
|
||||
}
|
||||
const orderId = this.$route.query.orderId || ''
|
||||
const isEdit = this.$route.query.isEdit || ''
|
||||
const id = this.$route.query.id || ''
|
||||
if (isEdit && id) {
|
||||
await updateWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
|
||||
await addToolApi(this.dialogList)
|
||||
if (id) {
|
||||
await updateWarehousingApi({ id, orderId, applyId: this.dialogForm.applyId })
|
||||
} else {
|
||||
await addToolApi(this.dialogList)
|
||||
await addWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
const routerParams = this.$route.query || {}
|
||||
const res = await addWarehousingApi({ orderId, applyId: this.dialogForm.applyId })
|
||||
this.$router.replace({
|
||||
query: {
|
||||
id: res.data.id || '',
|
||||
applyId: routerParams.applyId || '',
|
||||
orderId: routerParams.orderId || '',
|
||||
isAddVisible: routerParams.isAddVisible || '',
|
||||
isApprovalVisible: routerParams.isApprovalVisible || '',
|
||||
},
|
||||
})
|
||||
}
|
||||
this.getList()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
})
|
||||
this.dialogVisible = false
|
||||
return true
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
} finally {
|
||||
|
|
@ -382,13 +419,13 @@ export default {
|
|||
// this.currentRow = row
|
||||
if (type == 2) {
|
||||
this.uploadTitle = '合格证'
|
||||
this.fileList = this.currentRow.fileList2
|
||||
this.fileList = this.joinFileUrls(this.currentRow.certificates)
|
||||
} else if (type == 3) {
|
||||
this.uploadTitle = '定期检验报告'
|
||||
this.fileList = this.currentRow.fileList3
|
||||
this.fileList = this.joinFileUrls(this.currentRow.inspectionReports)
|
||||
} else if (type == 4) {
|
||||
this.uploadTitle = '采购发票'
|
||||
this.fileList = this.currentRow.fileList4
|
||||
this.fileList = this.joinFileUrls(this.currentRow.purchaseInvoices)
|
||||
}
|
||||
this.uploadVisible = true
|
||||
},
|
||||
|
|
@ -427,6 +464,14 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
joinFileUrls(list) {
|
||||
if (!Array.isArray(list) || list.length === 0) return ''
|
||||
|
||||
return list
|
||||
.filter((item) => item && item.fileUrl)
|
||||
.map((item) => item.fileUrl)
|
||||
.join(',')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
v-show="!isAddVisible"
|
||||
:disabled="tableData.length == 0"
|
||||
>
|
||||
批量导入图片
|
||||
批量导入文件
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
|
|
@ -1093,14 +1093,24 @@ export default {
|
|||
this.isSubmit = true
|
||||
const loading = this.$loading()
|
||||
const applyId = this.$route.query.applyId || ''
|
||||
const isEdit = this.$route.query.isEdit || ''
|
||||
const id = this.$route.query.id || ''
|
||||
console.log('🚀 ~ applyId:', applyId)
|
||||
|
||||
try {
|
||||
if (isEdit && id) {
|
||||
await updateWarehousingApi({ orderId: this.orderId, applyId })
|
||||
if (id) {
|
||||
await updateWarehousingApi({ id, orderId: this.orderId, applyId })
|
||||
} else {
|
||||
await addWarehousingApi({ orderId: this.orderId, applyId })
|
||||
const routerParams = this.$route.query || {}
|
||||
const res = await addWarehousingApi({ orderId: this.orderId, applyId })
|
||||
this.$router.replace({
|
||||
query: {
|
||||
id: res.data.id || '',
|
||||
applyId: routerParams.applyId || '',
|
||||
orderId: routerParams.orderId || '',
|
||||
isAddVisible: routerParams.isAddVisible || '',
|
||||
isApprovalVisible: routerParams.isApprovalVisible || ''
|
||||
},
|
||||
})
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
|
|
@ -1225,25 +1235,25 @@ export default {
|
|||
// this.currentRow = row
|
||||
if (type == 1) {
|
||||
this.uploadTitle = '装备外观'
|
||||
this.fileList = this.currentRow.fileList1
|
||||
this.fileList = this.joinFileUrls(this.currentRow.appearanceImages)
|
||||
this.uploadLimit = 6
|
||||
this.fileSize = 5
|
||||
this.uploadFileType = ['jpg', 'png', 'jpeg']
|
||||
} else if (type == 2) {
|
||||
this.uploadTitle = '合格证'
|
||||
this.fileList = this.currentRow.fileList2
|
||||
this.fileList = this.joinFileUrls(this.currentRow.certificates)
|
||||
this.uploadLimit = 3
|
||||
this.fileSize = 10
|
||||
this.uploadFileType = ['jpg', 'png', 'pdf']
|
||||
} else if (type == 3) {
|
||||
this.uploadTitle = '定期检验报告'
|
||||
this.fileList = this.currentRow.fileList3
|
||||
this.fileList = this.joinFileUrls(this.currentRow.inspectionReports)
|
||||
this.uploadLimit = 3
|
||||
this.fileSize = 10
|
||||
this.uploadFileType = ['jpg', 'png', 'pdf']
|
||||
} else if (type == 4) {
|
||||
this.uploadTitle = '采购发票'
|
||||
this.fileList = this.currentRow.fileList4
|
||||
this.fileList = this.joinFileUrls(this.currentRow.purchaseInvoices)
|
||||
this.uploadLimit = 3
|
||||
this.fileSize = 10
|
||||
this.uploadFileType = ['jpg', 'png', 'pdf']
|
||||
|
|
@ -1292,6 +1302,14 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
joinFileUrls(list) {
|
||||
if (!Array.isArray(list) || list.length === 0) return ''
|
||||
|
||||
return list
|
||||
.filter((item) => item && item.fileUrl)
|
||||
.map((item) => item.fileUrl)
|
||||
.join(',')
|
||||
},
|
||||
importTemplate() {
|
||||
this.download('/material-mall/order/template', {}, `装备信息导入模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
|
@ -1305,10 +1323,13 @@ export default {
|
|||
async addList() {
|
||||
try {
|
||||
if (!this.$route.query.orderId) {
|
||||
const routerParams = this.$route.query || {}
|
||||
const result = await getEquipmentAddIdApi()
|
||||
this.orderId = result.data.id
|
||||
this.$router.replace({
|
||||
query: {
|
||||
id: routerParams.id || '',
|
||||
applyId: routerParams.applyId || '',
|
||||
orderId: result.data.id,
|
||||
isAddVisible: this.isAddVisible,
|
||||
isApprovalVisible: this.isApprovalVisible,
|
||||
|
|
|
|||
|
|
@ -94,9 +94,11 @@
|
|||
<!-- 操作 -->
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template v-slot="{ row }">
|
||||
<el-button type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button type="text" style="color: red" size="mini" @click="handleDelete">删除</el-button>
|
||||
<el-button type="text" size="mini" @click="submit">提交</el-button>
|
||||
<el-button v-if="row.status != 1" type="text" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button v-if="row.status != 1" type="text" style="color: red" size="mini" @click="handleDelete(row)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button v-if="row.status != 1" type="text" size="mini" @click="submit(row)">提交</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -113,7 +115,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getWarehousingListApi } from '@/api/EquipmentEntryApply'
|
||||
import { getWarehousingListApi, deleteByIdApi, batchSubmissionApi } from '@/api/EquipmentEntryApply'
|
||||
|
||||
export default {
|
||||
name: 'EntryApply',
|
||||
|
|
@ -134,7 +136,7 @@ export default {
|
|||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '录入单号', prop: 'code' },
|
||||
{ label: '装备数量', prop: 'equipNum' },
|
||||
{ label: '装备数量', prop: 'maNum' },
|
||||
{ label: '工具数量', prop: 'toolNum' },
|
||||
{ label: '申请人', prop: 'createUser' },
|
||||
{ label: '申请时间', prop: 'createTime' },
|
||||
|
|
@ -145,7 +147,7 @@ export default {
|
|||
statusList: [
|
||||
{ label: '草稿', value: '0' },
|
||||
{ label: '待审批', value: '1' },
|
||||
{ label: '审批通过', value: '2' },
|
||||
// { label: '审批通过', value: '2' },
|
||||
{ label: '驳回', value: '3' },
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
|
|
@ -194,36 +196,44 @@ export default {
|
|||
selectionChange(val) {
|
||||
if (!val.length) this.selectedRowKeys = []
|
||||
this.selectedRowKeys = val.map((item) => item.id)
|
||||
console.log('🚀 ~ this.selectedRowKeys:', this.selectedRowKeys)
|
||||
},
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.$router.push({
|
||||
path: '/stockManagement/entryApply/apply',
|
||||
query: { isAddVisible: false, isApprovalVisible: false },
|
||||
}).then(() => {
|
||||
this.$tab.closePage({ path: '/stockManagement/entryApply' })
|
||||
})
|
||||
this.$router
|
||||
.push({
|
||||
path: '/stockManagement/entryApply/apply',
|
||||
query: { isAddVisible: false, isApprovalVisible: false },
|
||||
})
|
||||
.then(() => {
|
||||
this.$tab.closePage({ path: '/stockManagement/entryApply' })
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
handleEdit(row) {
|
||||
this.$router.push({
|
||||
path: '/stockManagement/entryApply/apply',
|
||||
query: {
|
||||
id: row.id,
|
||||
orderId: row.orderId,
|
||||
applyId: row.applyId,
|
||||
isAddVisible: false,
|
||||
isApprovalVisible: false,
|
||||
isEdit: true,
|
||||
},
|
||||
})
|
||||
this.$router
|
||||
.push({
|
||||
path: '/stockManagement/entryApply/apply',
|
||||
query: {
|
||||
id: row.id,
|
||||
orderId: row.orderId,
|
||||
applyId: row.applyId,
|
||||
isAddVisible: false,
|
||||
isApprovalVisible: false,
|
||||
isEdit: true,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.$tab.closePage({ path: '/stockManagement/entryApply' })
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
async handleDelete() {
|
||||
async handleDelete(row) {
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认删除该数据项?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
await deleteByIdApi({ id: row.id })
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
|
|
@ -231,11 +241,13 @@ export default {
|
|||
})
|
||||
},
|
||||
// 提交
|
||||
async submit() {
|
||||
async submit(row) {
|
||||
console.log('🚀 ~ row:', row)
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认提交?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
await batchSubmissionApi(row.id)
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
|
|
@ -251,7 +263,10 @@ export default {
|
|||
// 确认
|
||||
this.$modal.confirm('是否确认提交?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
const params = this.selectedRowKeys.join(',')
|
||||
console.log('🚀 ~ params:', params)
|
||||
await batchSubmissionApi(params)
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
|
|
|
|||
|
|
@ -10,11 +10,6 @@
|
|||
label-width="80px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="审批类型:" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" clearable style="width: 240px">
|
||||
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人:" prop="applyName">
|
||||
<el-input
|
||||
v-model="queryParams.applyName"
|
||||
|
|
@ -113,7 +108,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getWarehousingListApi } from '@/api/EquipmentEntryApply'
|
||||
import { getWarehousingListApi, batchApprovalApi , batchRejectionApi} from '@/api/EquipmentEntryApply'
|
||||
|
||||
export default {
|
||||
name: 'InventoryAudit',
|
||||
|
|
@ -139,17 +134,9 @@ export default {
|
|||
{ label: '申请人', prop: 'applyName' },
|
||||
{ label: '申请时间', prop: 'applyTime' },
|
||||
{ label: '审批状态', prop: 'status' },
|
||||
{ label: '专业', prop: 'major' },
|
||||
{ label: '装备/工具名称', prop: 'name' },
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [{ status: 1 }, { status: 2 }, { status: 3 }, { status: 0 }],
|
||||
typeList: [
|
||||
{ label: '设备', value: '1' },
|
||||
{ label: '全部工具', value: '2' },
|
||||
{ label: '编码工具', value: '3' },
|
||||
{ label: '数量工具', value: '4' },
|
||||
],
|
||||
tableList: [],
|
||||
selectedRowKeys: [],
|
||||
}
|
||||
},
|
||||
|
|
@ -178,6 +165,7 @@ export default {
|
|||
...this.queryParams,
|
||||
startTime: this.queryParams.timeRange ? this.queryParams.timeRange[0] : '',
|
||||
endTime: this.queryParams.timeRange ? this.queryParams.timeRange[1] : '',
|
||||
status: '1'
|
||||
}
|
||||
delete params.timeRange
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
|
|
|
|||
Loading…
Reference in New Issue