From 1c54fbe9a3ae114c43fadb161c04cf589ed715f6 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 18 Jun 2024 15:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A2=86=E6=96=99=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=A1=B5=E9=9D=A2=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=95=B0=E9=87=8F=E9=80=80=E6=96=99=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E5=BA=9F=E4=BF=A1=E6=81=AF=E5=A1=AB=E5=86=99?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E9=A2=84=E6=8A=A5=E5=BA=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=AD=89=E5=9C=B0=E6=96=B9=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../picking/apply/component/AddPicking.vue | 4 +- .../return/receive/component/handlePage.vue | 253 +++++++++++++++++- .../return/receive/component/upload.vue | 110 ++++++++ .../forecastWaste/auditing/index.vue | 4 +- .../forecastWaste/listing/index.vue | 8 +- .../scrapManage/scrap/disposition/index.vue | 4 +- .../scrapManage/scrap/scrapAuditing/index.vue | 4 +- 7 files changed, 378 insertions(+), 9 deletions(-) create mode 100644 sgzb-ui/src/views/claimAndreturn/return/receive/component/upload.vue diff --git a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking.vue b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking.vue index 11db4e93..05fe78de 100644 --- a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking.vue +++ b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking.vue @@ -565,7 +565,7 @@ export default { this.queryParams.examineStatusId = '32' } this.queryParams.unitId = data.unitId - this.queryParams.companyId = data.companyId + this.queryParams.companyId = data.companyId.toString() this.queryParams.proId = data.proId this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone @@ -595,7 +595,7 @@ export default { this.queryParams.examineStatusId = '32' } this.queryParams.unitId = data.unitId - this.queryParams.companyId = data.companyId + this.queryParams.companyId = data.companyId.toString() this.queryParams.proId = data.proId this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone diff --git a/sgzb-ui/src/views/claimAndreturn/return/receive/component/handlePage.vue b/sgzb-ui/src/views/claimAndreturn/return/receive/component/handlePage.vue index 3a9dfe93..263c4323 100644 --- a/sgzb-ui/src/views/claimAndreturn/return/receive/component/handlePage.vue +++ b/sgzb-ui/src/views/claimAndreturn/return/receive/component/handlePage.vue @@ -590,6 +590,7 @@ 编 辑 @@ -600,6 +601,68 @@ + + + + + + + + + + 人为 + 自然 + + + + + + + + + + + + + @@ -620,9 +683,10 @@ import { equipmentTypeTree } from '@/api/store/tools' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import { getInfo } from '@/api/login' +import Upload from './upload.vue' export default { // name: "returnInDetail", - components: { Treeselect }, + components: { Treeselect, Upload }, props: { isView: { type: Boolean, @@ -693,6 +757,17 @@ export default { codeTotal: 0, //编码弹窗分页-总数 codeList: [], //编码弹窗表格数据 numList: [], //数量弹窗表格数据 + innerVisible: false, + + // 报废信息参数 + scrapInfoParams: { + scrapReason: '', // 报废原因 + scrapType: '', // 损坏原因 + fileUrl: '', + }, + fileList: [], + imgUrlList: [], + actionUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload', } }, mounted() { @@ -924,6 +999,9 @@ export default { this.openNum = true this.dialogIsView = false this.$set(row, 'backNum', row.num) //退料数量 + this.$set(row, 'scrapReason', '') //报废原因 + this.$set(row, 'scrapType', '') //损坏原因 + this.$set(row, 'fileUrl', '') //损坏图片 this.returnNum = Number(row.num) this.dialogData.typeMange = row.manageType this.dialogData.typeName = row.typeName @@ -979,6 +1057,13 @@ export default { getCodeList() { getBackMachine(this.codeQuery).then((response) => { this.codeList = response.data.rows + + this.codeList.map((item) => { + item.scrapReason = '' + item.scrapType = '' + item.fileUrl = '' + return item + }) this.codeTotal = response.data.total }) }, @@ -1053,6 +1138,9 @@ export default { createBy: this.createBy, backStatus: 3, backNum: item.scrapNum, + scrapReason: item.scrapReason, + scrapType: item.scrapType, + fileUrl: item.fileUrl, } arr.push(obj) } @@ -1074,7 +1162,7 @@ export default { saveCodeBack(row, type) { if (this.returnNum == 0) { this.$modal.msgError('退料数量为零,无法操作!') - } else { + } else if (type == 1 || type == 2 || type == 3) { let arr = [ { parentId: this.codeQuery.parentId, @@ -1099,6 +1187,9 @@ export default { this.handleQuery() } }) + } else { + // this.currentCode = row.maCode + // this.innerVisible = true } }, // 多选框选中数据 @@ -1111,7 +1202,7 @@ export default { saveCodeBackBatch(type) { if (this.codeSelectList.length > this.returnNum) { this.$modal.msgError('退料总量已大于待退料数量!') - } else { + } else if (type == 1 || type == 2 || type == 3) { let arr = [] arr = this.codeSelectList.map((item) => { return { @@ -1139,8 +1230,141 @@ export default { this.handleQuery() } }) + } else { + // if (this.codeSelectList.length < 0) { + // this.$modal.msgError('请先勾选数据!') + // } else { + // this.scrapAll = true + // this.innerVisible = true + // } } }, + + // 编辑报废信息 + editScrapInfo() { + console.log('编辑报废信息') + this.innerVisible = true + }, + // 移除报废图片 + handleRemove(file) { + this.imgUrlList = this.imgUrlList.filter( + (e) => e !== file.response.data.fileUrl, + ) + }, + // 图片上传成功 + handleSuccess(res) { + if (res.code == 200) { + this.imgUrlList.push(res.data.fileUrl) + } + }, + + // 报废信息填写弹框取消按钮 + cancelScrap() { + this.innerVisible = false + }, + // 报废信息填写弹框保存按钮 + submitScrapInfo() { + if (!this.currentCode && !this.scrapAll) { + this.numList[0].scrapReason = this.scrapInfoParams.scrapReason + this.numList[0].scrapType = this.scrapInfoParams.scrapType + if (this.imgUrlList.length > 0) { + this.numList[0].fileUrl = this.imgUrlList.join(',') + } + } else { + console.log('当前为编码退料---------') + this.codeList.map((item) => { + if (item.maCode === this.currentCode) { + console.log(item.maCode, '当前数据', item, '------') + let arr = [ + { + parentId: this.codeQuery.parentId, + typeId: item.typeId, + backNum: 1, + backStatus: 3, + manageType: 0, + createBy: this.createBy, + maId: item.maId, + scrapReason: this.scrapInfoParams.scrapReason, + scrapType: this.scrapInfoParams.scrapType, + fileUrl: '', + }, + ] + + if (this.imgUrlList.length > 0) { + arr[0].fileUrl = this.imgUrlList.join(',') + } + let param = { + taskId: this.codeQuery.taskId, + arr: arr, + } + setCodeBack(param).then((response) => { + if (response.code == 200) { + this.$modal.msgSuccess('操作成功') + // this.openCode = false; + this.returnNum = Number(this.returnNum) - 1 + this.handleCodeQuery() + this.handleQuery() + } + }) + } + }) + } + + if (this.scrapAll) { + console.log('批量报废功能!!!') + let arr = [] + arr = this.codeSelectList.map((item) => { + return { + parentId: this.codeQuery.parentId, + typeId: item.typeId, + backNum: 1, + backStatus: 3, + manageType: 0, + createBy: this.createBy, + maId: item.maId, + scrapReason: this.scrapInfoParams.scrapReason, + scrapType: this.scrapInfoParams.scrapType, + fileUrl: '', + } + }) + + if (this.imgUrlList.length > 0) { + arr.map((e) => (e.fileUrl = this.imgUrlList.join(','))) + } + let param = { + taskId: this.codeQuery.taskId, + arr: arr, + } + console.log(param) + setCodeBack(param).then((response) => { + if (response.code == 200) { + this.$modal.msgSuccess('操作成功') + // this.openCode = false; + this.returnNum = + Number(this.returnNum) - this.codeSelectList.length + this.handleCodeQuery() + this.handleQuery() + } + }) + } + this.innerVisible = false + }, + }, + watch: { + innerVisible: { + handler(newValue) { + if (!newValue) { + this.scrapInfoParams.scrapReason = '' + this.scrapInfoParams.scrapType = '' + this.scrapInfoParams.fileUrl = '' + this.currentCode = null + this.scrapAll = false + this.fileList = [] + this.imgUrlList = [] + } + }, + deep: true, + }, }, } @@ -1154,4 +1378,27 @@ export default { color: #02a7f0; cursor: pointer; } +.upload-tip { + text-align: left; + + .tip-text { + font-size: 13px; + color: red; + letter-spacing: 1px; + } +} + +.upload-box { + display: flex; + + .Upload-tip { + text-align: left; + } +} + +.dialog-footer { + display: flex; + justify-content: flex-end; + align-items: center; +} diff --git a/sgzb-ui/src/views/claimAndreturn/return/receive/component/upload.vue b/sgzb-ui/src/views/claimAndreturn/return/receive/component/upload.vue new file mode 100644 index 00000000..b097245f --- /dev/null +++ b/sgzb-ui/src/views/claimAndreturn/return/receive/component/upload.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/sgzb-ui/src/views/scrapManage/forecastWaste/auditing/index.vue b/sgzb-ui/src/views/scrapManage/forecastWaste/auditing/index.vue index a688680d..0b8d49a7 100644 --- a/sgzb-ui/src/views/scrapManage/forecastWaste/auditing/index.vue +++ b/sgzb-ui/src/views/scrapManage/forecastWaste/auditing/index.vue @@ -114,7 +114,9 @@