From 4af2fdeefee2899533853642a01d6af65e8c5dfb Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 9 Sep 2024 14:44:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/home/getMaterialsDialog.vue | 143 +++++++++++++----- .../cost/csotSettlement/costApplyAdd.vue | 2 +- .../partsAcceptance/component/home.vue | 13 +- .../toolsAcceptance/component/codingTools.vue | 95 +++++++----- .../toolsAcceptance/component/home.vue | 7 +- .../warehousing/Inventory/index.vue | 143 ++++++++++++------ sgzb-ui/vue.config.js | 2 +- 7 files changed, 273 insertions(+), 132 deletions(-) diff --git a/sgzb-screen/src/components/home/getMaterialsDialog.vue b/sgzb-screen/src/components/home/getMaterialsDialog.vue index 21c5e4a4..9f722ce5 100644 --- a/sgzb-screen/src/components/home/getMaterialsDialog.vue +++ b/sgzb-screen/src/components/home/getMaterialsDialog.vue @@ -8,12 +8,36 @@ :close-on-click-modal="false" >
- + - + - - + + - - + + - - - + + + :value="item.typeId" + > - 查询 - 重置 + 查询 + 重置 @@ -58,7 +114,7 @@ :align="item.align" :type="item.type" show-overflow-tooltip - > + > @@ -69,7 +125,6 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> -
@@ -478,7 +481,7 @@ type="textarea" placeholder="请输入备注" maxlength="100" - rows="4" + rows="1" show-word-limit style="width: 400px" /> @@ -533,10 +536,10 @@ --> @@ -552,7 +555,7 @@ :show-overflow-tooltip="true" > @@ -930,7 +939,7 @@ export default { remarks: undefined, typeId: undefined, num: undefined, - codePrefix: undefined, + codePrefix: 'PD-CODE', codeSuffixStart: undefined, codeSuffixEnd: undefined, buyPrice: undefined, @@ -960,6 +969,20 @@ export default { ], }, codeFormRules: { + codePrefix: [ + { required: true, message: '请输入前缀', trigger: 'blur' }, + ], + codeSuffixStart: [ + { + required: true, + message: '请输入后缀起始值', + trigger: 'blur', + }, + { + pattern: /^[1-9][0-9]*$/, + message: '请输入大于0且不能以0开头的正整数', + }, + ], putInType: [ { required: true, @@ -1054,7 +1077,7 @@ export default { remarks: undefined, typeId: null, num: undefined, - codePrefix: undefined, + codePrefix: 'PD-CODE', codeSuffixStart: undefined, codeSuffixEnd: undefined, buyPrice: undefined, @@ -1096,23 +1119,23 @@ export default { this.numTableList.push(this.numTable) } else { // 根据this.codeForm.num的数量, 往this.codeTableList中添加this.codeForm的数据 - for (let i = 0; i < this.codeForm.num; i++) { + for (let i = 0; i < this.codeForm.num * 1; i++) { // 设备编码: 前缀 拼接 后缀 - let suffix = parseInt(this.codeForm.codeSuffixStart) + i - if (suffix > parseInt(this.codeForm.codeSuffixEnd)) { - suffix = parseInt(this.codeForm.codeSuffixEnd) - } - suffix = suffix - .toString() - .padStart( - this.codeForm.codeSuffixStart?.length, - '0', - ) - // console.log('🚀 ~ fillCodeForm ~ suffix:', suffix); - suffix = isNaN(suffix) ? '' : suffix - const maCode = `${ - this.codeForm.codePrefix || '' - }${suffix}` + // let suffix = parseInt(this.codeForm.codeSuffixStart) + i + // if (suffix > parseInt(this.codeForm.codeSuffixEnd)) { + // suffix = parseInt(this.codeForm.codeSuffixEnd) + // } + // suffix = suffix + // .toString() + // .padStart( + // this.codeForm.codeSuffixStart?.length, + // '0', + // ) + // // console.log('🚀 ~ fillCodeForm ~ suffix:', suffix); + // suffix = isNaN(suffix) ? '' : suffix + // const maCode = `${ + // this.codeForm.codePrefix || '' + // }${suffix}` // 出厂编码 const outFacCode = '' // 生产厂家 @@ -1129,7 +1152,7 @@ export default { // 单价: codeForm.buyPrice const buyPrice = this.codeForm.buyPrice || 0 this.codeTableList.push({ - maCode, + maCode: this.codeForm.codeSuffixStart * 1 + i, outFacCode, maVender, thisCheckTime, @@ -1137,6 +1160,21 @@ export default { buyPrice, }) } + + this.codeTableList.forEach((e) => { + if (e.maCode < 10) { + e.maCode = `000${e.maCode}` + } else if (e.maCode < 100) { + e.maCode = `00${e.maCode}` + } else if (e.maCode < 1000) { + e.maCode = `0${e.maCode}` + } else { + } + }) + + this.codeTableList.forEach((e) => { + e.maCode = this.codeForm.codePrefix + e.maCode + }) } }) }, @@ -1147,7 +1185,10 @@ export default { this.codeForm.codeSuffixStart = this.codeForm.codeSuffixStart.replace(/[^\d]/g, '') } - if (isNaN(this.codeForm.codeSuffixStart) || this.codeForm.codeSuffixStart.includes('.')) { + if ( + isNaN(this.codeForm.codeSuffixStart) || + this.codeForm.codeSuffixStart.includes('.') + ) { this.$message.error('后缀范围请输入整数类型') this.codeForm.codeSuffixStart = '' } @@ -1156,7 +1197,10 @@ export default { if (!this.codeForm.codeSuffixStart) { this.$message.error('请输入后缀范围起始值') this.codeForm.codeSuffixEnd = '' - } else if (isNaN(this.codeForm.codeSuffixEnd) || this.codeForm.codeSuffixEnd.includes('.')) { + } else if ( + isNaN(this.codeForm.codeSuffixEnd) || + this.codeForm.codeSuffixEnd.includes('.') + ) { this.$message.error('后缀范围请输入整数类型') this.codeForm.codeSuffixEnd = this.codeForm.codeSuffixStart.replace(/[^\d]/g, '') @@ -1415,24 +1459,28 @@ export default { } const res = await getDeviceTypeTree(params) if (type) { - this.disableNodes(res.data, '1'); + this.disableNodes(res.data, '1') } else { - this.disableNodes(res.data, '0'); + this.disableNodes(res.data, '0') } this.deviceTypeTree = res.data }, // 递归禁用节点 disableNodes(nodes, manageType, level = 1) { - nodes.forEach(node => { + nodes.forEach((node) => { node.level = level if (node.children) { - this.disableNodes(node.children, manageType, level + 1); + this.disableNodes(node.children, manageType, level + 1) } else if (!node.children && node.level < 4) { node.disabled = true - } else if(node.manageType && node.level == 4 && node.manageType != manageType) { + } else if ( + node.manageType && + node.level == 4 && + node.manageType != manageType + ) { node.disabled = true } - }); + }) }, /////// 设备类型树 切换 deviceTypeChange(val) { @@ -1571,7 +1619,10 @@ export default { }, // 校验检验日期 changeCheckTime() { - if (this.codeForm.nextCheckTime && this.codeForm.thisCheckTime > this.codeForm.nextCheckTime) { + if ( + this.codeForm.nextCheckTime && + this.codeForm.thisCheckTime > this.codeForm.nextCheckTime + ) { this.codeForm.nextCheckTime = '' this.$message.warning('下次检验日期不能早于检验日期!') } else if (!this.codeForm.thisCheckTime) { @@ -1600,4 +1651,4 @@ export default { ::v-deep .el-input-number.is-without-controls .el-input__inner { text-align: start; } - \ No newline at end of file + diff --git a/sgzb-ui/vue.config.js b/sgzb-ui/vue.config.js index 7826630e..204cf0c9 100644 --- a/sgzb-ui/vue.config.js +++ b/sgzb-ui/vue.config.js @@ -48,7 +48,7 @@ module.exports = { // target: `http://192.168.2.82:28080`,//旭/ // target: `http://192.168.2.248:28080`, //帅 // target: `http://192.168.2.218:28080`, //福 - // target: `http://192.168.2.125:39080`, //王 + // target: `http://192.168.2.118:28080`, //王 //******** 注意事项 ********* */ //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target;