diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/serviceCenter/index.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/serviceCenter/index.vue index 003c5fa3..3f3e0f14 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/serviceCenter/index.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/serviceCenter/index.vue @@ -38,22 +38,22 @@ - - - - - + + + + + @@ -251,36 +254,38 @@ - - - 通过 - - - 不通过 - - - - - - - - - + + + 通过 + + + 不通过 + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { - this.showBatchButtons = this.detailTableList.some(item => item.taskStatus === '122'); - }, { deep: true }); - }, + mounted() { + // 监听数据的变化,当 taskStatus 符合条件时显示批量按钮 + this.$watch( + 'detailTableList', + () => { + this.showBatchButtons = this.detailTableList.some( + (item) => item.taskStatus === '122', + ) + }, + { deep: true }, + ) + }, created() { this.getList() this.getTypeList() @@ -708,14 +719,14 @@ export default { return false } }, - // 多选框选中数据 - handleSelectionChange() { - console.log(this.ids) - this.ids = this.detailTableList.map((item) => item) // 假设数据的唯一标识为 id - console.log(this.ids) - // this.single = selection.length != 1 - // this.multiple = !selection.length - }, + // 多选框选中数据 + handleSelectionChange() { + console.log(this.ids) + this.ids = this.detailTableList.map((item) => item) // 假设数据的唯一标识为 id + console.log(this.ids) + // this.single = selection.length != 1 + // this.multiple = !selection.length + }, /** 修改按钮操作 */ handleUpdate(row) { // this.reset(); diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index cdfe73ad..de7f293e 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -384,13 +384,13 @@ export default { } }, }, - watch: { - 'maForm.purchaseTime'() { - if (this.maForm.purchaseTime != '') { - this.maForm.arrivalTime = '' - } - }, - }, + // watch: { + // 'maForm.purchaseTime'() { + // if (this.maForm.purchaseTime != '') { + // this.maForm.arrivalTime = '' + // } + // }, + // }, mounted() { // const taskId = this.$route.query && this.$route.query.taskId // this.taskId = taskId @@ -493,6 +493,8 @@ export default { keyWord: this.queryParams.keyWord, }).then((response) => { // this.taskInfo = response.data + + console.log(response, '编辑时的详情-------') this.maForm.purchaseTime = response.data.purchaseTime this.maForm.arrivalTime = response.data.arrivalTime this.maForm.purchaser = response.data.purchaser diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/codingTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/codingTools.vue index 973d68da..dd6d85a3 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/codingTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/codingTools.vue @@ -155,61 +155,56 @@ - - - - - - - - - - -
- - - - -
-
-
- - - - - - - - - - - 填充 - -
+ + 填充 + + + + + 剩余待编码数量:{{ + surplusNoBindNum + }} @@ -381,6 +381,9 @@ export default { str1: '', fixCode: '1', typeId: '', + + suffixOneCode: 0, + suffixTwoCode: 0, }, codeList: [], //弹窗列表list getCodeList: [], //已成过的编码list @@ -397,7 +400,36 @@ export default { // { required: true, message: "设备编号不能为空", trigger: "blur" } // ], }, + + codeRules: { + suffixOneCode: [ + { + required: true, + message: '请输入后缀范围', + trigger: 'blur', + }, + // { + // pattern: /^[1-9]\d*$/, + // message: '请输入正整数', + // trigger: 'blur', + // }, + ], + suffixTwoCode: [ + { + required: true, + message: '请输入后缀范围', + trigger: 'blur', + }, + // { + // pattern: /^[1-9]\d*$/, + // message: '请输入正整数', + // trigger: 'blur', + // }, + ], + }, isDetail: false, + + surplusNoBindNum: 0, } }, mounted() { @@ -509,6 +541,9 @@ export default { // this.codeList = response.data; // }); + + this.surplusNoBindNum = + parseInt(this.form.checkNum) - parseInt(this.form.bindNum) }, //生成列表codeList createCodeList() { @@ -532,15 +567,94 @@ export default { }, //填充按钮 fillingCodeList() { - console.log(Number(this.form.str)) - this.codeList = [] - let num = Number(this.form.str) - // console.log(Number(this.form.str1)) - let num1 = Number(this.form.str1) - let count = num1 - num + 1 //生成数量 - console.log() - let sum = count + this.form.bindNum - console.log(sum) + // console.log(Number(this.form.str)) + // this.codeList = [] + // let num = Number(this.form.str) + // // console.log(Number(this.form.str1)) + // let num1 = Number(this.form.str1) + // let count = num1 - num + 1 //生成数量 + // console.log() + // let sum = count + this.form.bindNum + // console.log(sum) + if (this.codeList.length === this.surplusNoBindNum) { + this.$modal.msgError('当前编码已填充,不可重复操作!') + return + } + + this.$refs['formCodeRef'].validate((valid) => { + if (valid) { + if ( + isNaN(this.form.suffixOneCode) || + isNaN(this.form.suffixTwoCode) || + parseInt(this.form.suffixOneCode) > + parseInt(this.form.suffixTwoCode) + ) { + this.$modal.msgError('编码后缀范围输入格式不正确') + return + } + let suffixOneCode = parseInt(this.form.suffixOneCode) + let suffixTwoCode = parseInt(this.form.suffixTwoCode) + let sumNum = suffixTwoCode - suffixOneCode + 1 + // // 剩余待绑定数量 + // let surplusNoBindNum = + // parseInt(this.form.checkNum) - + // parseInt(this.form.bindNum) + + if (sumNum > this.surplusNoBindNum) { + this.$modal.msgError( + '当前选择的编码数量已超过剩余未编码数量!', + ) + + return + } + + if (this.codeList.length === 0) { + for (let i = 0; i < sumNum; i++) { + let obj = { + typeName: this.form.typeName, + specificationType: this.form.specificationType, + typeId: this.form.typeId, + taskId: this.form.taskId, + maCode: + this.form.exCode + + ('00000' + (suffixOneCode + i)).slice(-4), + assetsCode: '', + fixCode: this.form.fixCode, + id: ('00000' + (suffixOneCode + i)).slice(-4), + } + this.codeList.push(obj) + } + } else { + for (let i = 0; i < sumNum; i++) { + let obj = { + typeName: this.form.typeName, + specificationType: this.form.specificationType, + typeId: this.form.typeId, + taskId: this.form.taskId, + maCode: + this.form.exCode + + ('00000' + (suffixOneCode + i)).slice(-4), + assetsCode: '', + fixCode: this.form.fixCode, + id: ('00000' + (suffixOneCode + i)).slice(-4), + } + + const isRepeat = this.codeList.every( + (e) => e.id != obj.id, + ) + if (isRepeat) { + this.codeList.push(obj) + } + } + } + + this.surplusNoBindNum -= this.codeList.length + } + }) + + if (true) { + return + } if (sum > this.form.checkNum) { this.$modal.msgError( '已绑定编码' + @@ -644,6 +758,8 @@ export default { this.codeList.splice(index, 1) } }) + + this.surplusNoBindNum += 1 // const maCode = row.maCode ; // this.$modal.confirm('是否确认删除该数据项?').then(function() { // return delMacodeList(maCode); @@ -684,4 +800,10 @@ export default { width: 60px !important; margin-bottom: 10px; } + +.surplus-code { + padding-bottom: 10px; + padding-left: 8px; + font-size: 16px; +} diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue index 0138b806..17f12419 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue @@ -353,10 +353,15 @@ font-size: 14px; " > - 供应商:{{ - printTableData[0].supplier - }} + 供应商: + + + + {{ supplierListNew }} + { + console.log(response, '验收单返回的数据') this.printData = response.data this.printTableData = response.data.checkDetailsList + + let supplierList = [] + this.printTableData.map((e) => { + if (e.supplier) { + supplierList.push(e.supplier) + } + }) + + const supplierListNew = [...new Set(supplierList)] + this.supplierListNew = supplierListNew.join(',') }) }, //查看验收单 diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue index 97678653..ce827f2d 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue @@ -141,14 +141,31 @@ prop="checkUrlName" > + + + @@ -159,14 +176,14 @@ width="180" > +
请上传.png、.jpg,、.jpeg类型文件,且文件个数不可超过5个
@@ -273,6 +294,7 @@ @@ -302,7 +324,11 @@ :on-remove="handleRemove" > - + + +
请上传.png、.jpg,、.jpeg类型文件,且文件个数不可超过5个
@@ -318,6 +344,7 @@ @@ -773,6 +800,11 @@ export default { //添加人员 addUser() { // console.log(this.chosenUserList,"chosenUserList") + + if (this.chosenUserList.length < 1) { + this.$message.error('请选择添加的人员!') + return + } addNoticeUser(this.chosenUserList).then((response) => { if (response.code == 200) { this.getNoticeUserList() @@ -876,13 +908,13 @@ export default { }, /** 提交按钮 */ submitForm: function () { - // console.log(this.form) this.form.checkUrl = this.checkUrlList.join(',') this.form.checkUrlName = this.checkUrlNameList.join(',') - let equipments = [this.form] - console.log(equipments) + // console.log(this.form) + // console.log(equipments) this.$refs['form'].validate((valid) => { if (valid) { + let equipments = [this.form] updatePurchaseCheckDetails(equipments).then((response) => { if (response.code == 200) { this.$message({ @@ -900,20 +932,20 @@ export default { }) }, submitListForm: function () { - // console.log(this.aform) this.aform.checkUrl = this.checkUrlList1.join(',') this.aform.checkUrlName = this.checkUrlNameList1.join(',') - this.ids.forEach((item) => { - item.checkNum = item.purchaseNum - item.checkResult = this.aform.checkResult - item.checkUrl = this.aform.checkUrl - item.checkUrlName = this.aform.checkUrlName - }) - // console.log(this.ids) - let equipments = this.ids - console.log(equipments) + // console.log(this.aform) + // console.log(equipments) this.$refs['aform'].validate((valid) => { if (valid) { + this.ids.forEach((item) => { + item.checkNum = item.purchaseNum + item.checkResult = this.aform.checkResult + item.checkUrl = this.aform.checkUrl + item.checkUrlName = this.aform.checkUrlName + }) + // console.log(this.ids) + let equipments = this.ids updatePurchaseCheckDetails(equipments).then((response) => { if (response.code == 200) { this.$message({ @@ -1034,4 +1066,15 @@ export default { display: none; } } +.img-box { + margin-right: 8px; +} +.img-box:last-child { + margin: 0; +} + +.el-upload__tip { + font-size: 14px; + color: red; +} diff --git a/sgzb-ui/src/views/warehouseManage/warehousing/newTools/index.vue b/sgzb-ui/src/views/warehouseManage/warehousing/newTools/index.vue index ae3406a9..148c4a89 100644 --- a/sgzb-ui/src/views/warehouseManage/warehousing/newTools/index.vue +++ b/sgzb-ui/src/views/warehouseManage/warehousing/newTools/index.vue @@ -9,40 +9,39 @@ v-show="showSearch" label-width="100px" > + + + + + - - - - - - - - - - - + + + + + @@ -198,9 +197,7 @@ size="mini" type="text" icon="el-icon-edit" - v-if=" - scope.row.taskStatus == '105' - " + v-if="scope.row.taskStatus == '105'" @click="handleUpdate(scope.row)" v-hasPermi="['warehousing:newTools:auditing']" >审核入库单 @@ -358,10 +359,10 @@ @@ -384,7 +385,8 @@ size="mini" type="text" v-if=" - (scope.row.status == '0' || scope.row.status == '3') && + (scope.row.status == '0' || + scope.row.status == '3') && scope.row.userIds.includes(userId) " @click="pass(scope.row)" @@ -394,7 +396,8 @@ size="mini" type="text" v-if=" - (scope.row.status == '0' || scope.row.status == '3') && + (scope.row.status == '0' || + scope.row.status == '3') && scope.row.userIds.includes(userId) " @click="refused(scope.row)" @@ -702,19 +705,19 @@ export default { }, //是否可用勾选框 selectable(row) { - console.log(row) - if (row.status == '0' || row.status == '3') { - if ( - (row.manageType == '0' && row.maCode) || - row.manageType == '1' - ) { - return true + console.log(row) + if (row.status == '0' || row.status == '3') { + if ( + (row.manageType == '0' && row.maCode) || + row.manageType == '1' + ) { + return true + } else { + return false + } } else { - return false + return false } - } else { - return false - } }, // 多选框选中数据 handleSelectionChange(selection) { @@ -877,6 +880,17 @@ export default { ) }, }, + + watch: { + open: { + handler(newValue) { + if (!newValue) { + this.query.dictName = '' + } + }, + deep: true, + }, + }, }