From 51b4d6c84f4e0300e3e4b2160d38bf048eb76c63 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Tue, 18 Feb 2025 11:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=85=8D=E4=BB=B6=E9=94=80?= =?UTF-8?q?=E5=94=AE=E6=8F=90=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sparePartsCommission.vue | 20 +++++++++++---- .../sparePartsCommissionFilingAdd.vue | 25 ++++++++++++++++++- .../sparePartsCommissionFilingEdit.vue | 24 +++++++++++++++++- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/yxt-as-ui/src/views/basicinformation/sparePartsCommission/sparePartsCommission.vue b/yxt-as-ui/src/views/basicinformation/sparePartsCommission/sparePartsCommission.vue index 761afd0963..7243bcb08c 100644 --- a/yxt-as-ui/src/views/basicinformation/sparePartsCommission/sparePartsCommission.vue +++ b/yxt-as-ui/src/views/basicinformation/sparePartsCommission/sparePartsCommission.vue @@ -31,9 +31,10 @@ - + + @@ -58,7 +59,7 @@
*岗位名称
- + @@ -67,7 +68,7 @@
*提成比例(%)
- +
@@ -114,6 +115,7 @@ export default { dialogVisible: false, post_list: [], formobj: { + sid: '', createBySid: '', remarks: '', postName: '', @@ -355,6 +357,7 @@ export default { this.dialogVisible = false this.$refs['form_obj'].resetFields() this.formobj = { + sid: '', createBySid: '', remarks: '', postName: '', @@ -379,8 +382,15 @@ export default { // 删除 doDel() { if (this.sids.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) + this.$message({showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作'}) return + } else { + for (var i = 0; i < this.multipleSelection.length; i++) { + if (this.multipleSelection[i].state === '2') { + this.$message({ showClose: true, type: 'error', message: '备案中的数据无法删除' }) + return + } + } } const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' this.$confirm(tip, '提示', { diff --git a/yxt-as-ui/src/views/basicinformation/sparePartsCommissionFiling/sparePartsCommissionFilingAdd.vue b/yxt-as-ui/src/views/basicinformation/sparePartsCommissionFiling/sparePartsCommissionFilingAdd.vue index e8967d6182..0ad14a8948 100644 --- a/yxt-as-ui/src/views/basicinformation/sparePartsCommissionFiling/sparePartsCommissionFilingAdd.vue +++ b/yxt-as-ui/src/views/basicinformation/sparePartsCommissionFiling/sparePartsCommissionFilingAdd.vue @@ -48,7 +48,11 @@
- + + +
@@ -98,6 +102,24 @@ export default { } }, methods: { + getNumber(val, limit) { + val = val.replace(/[^0-9.]/g, '') // 保留数字 + val = val.replace(/^00/, '0.') // 开头不能有两个0 + val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. + val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 + val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 + /^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 + const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' + const reg = new RegExp(str) + if (limit === 0) { + // 不需要小数点 + val = val.replace(reg, '$1') + } else { + // 通过正则保留小数点后指定的位数 + val = val.replace(reg, '$1.$2') + } + return val + }, showAdd(row) { this.viewTitle = '【新增】配件销售提成备案申请' this.$nextTick(() => { @@ -130,6 +152,7 @@ export default { this.formobj.asServiceAccommDetailList.push({ sid: '', mainSid: '', + accommSid: e.sid, postSid: e.postSid, postName: e.postName, commRatio: e.commRatio, diff --git a/yxt-as-ui/src/views/workFlow/peijianbeianFlow/sparePartsCommissionFilingEdit.vue b/yxt-as-ui/src/views/workFlow/peijianbeianFlow/sparePartsCommissionFilingEdit.vue index bca076b33d..a72032f90a 100644 --- a/yxt-as-ui/src/views/workFlow/peijianbeianFlow/sparePartsCommissionFilingEdit.vue +++ b/yxt-as-ui/src/views/workFlow/peijianbeianFlow/sparePartsCommissionFilingEdit.vue @@ -47,7 +47,11 @@ - + + + @@ -113,6 +117,24 @@ export default { }, '*') }, methods: { + getNumber(val, limit) { + val = val.replace(/[^0-9.]/g, '') // 保留数字 + val = val.replace(/^00/, '0.') // 开头不能有两个0 + val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. + val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 + val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 + /^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 + const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' + const reg = new RegExp(str) + if (limit === 0) { + // 不需要小数点 + val = val.replace(reg, '$1') + } else { + // 通过正则保留小数点后指定的位数 + val = val.replace(reg, '$1.$2') + } + return val + }, showInfo(sid) { this.viewTitle = '【编辑】配件销售提成备案申请' this.$nextTick(() => {