From fc0ad32f815535a5a4aee55f92eaac92cbd4d97b Mon Sep 17 00:00:00 2001 From: jiang <893224616@qq.com> Date: 星期二, 19 七月 2022 18:13:19 +0800 Subject: [PATCH] 1.修复新增用户没有pushkey的问题 2.将重置pushkey改为修改pushkey --- web_src/src/components/dialog/catalogEdit.vue | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue index 13cabfb..22ff181 100644 --- a/web_src/src/components/dialog/catalogEdit.vue +++ b/web_src/src/components/dialog/catalogEdit.vue @@ -49,11 +49,43 @@ props: ['platformId'], created() {}, data() { + let checkId = (rule, value, callback) => { + console.log("checkId") + console.log(this.treeType) + console.log(rule) + console.log(value) + console.log(value.length) + console.log(this.level) + if (!value) { + return callback(new Error('缂栧彿涓嶈兘涓虹┖')); + } + if (this.treeType === "BusinessGroup" && value.length !== 20) { + return callback(new Error('缂栧彿蹇呴』鐢�20浣嶆暟瀛楃粍鎴�')); + } + if (this.treeType === "CivilCode" && value.length <= 8 && value.length%2 !== 0) { + return callback(new Error('琛屾斂鍖哄垝蹇呴』鏄叓浣嶄互涓嬬殑鍋舵暟涓暟瀛楃粍鎴�')); + } + if (this.treeType === "BusinessGroup") { + let catalogType = value.substring(10, 13); + console.log(catalogType) + // 216 涓鸿櫄鎷熺粍缁� 215 涓轰笟鍔″垎缁勶紱鐩綍绗竴绾у繀椤讳负涓氬姟鍒嗙粍锛� 涓氬姟鍒嗙粍涓嬩负铏氭嫙缁勭粐锛岃櫄鎷熺粍缁囦笅鍙互鏈夊叾浠栬櫄鎷熺粍缁� + if (this.level === 1 && catalogType !== "215") { + return callback(new Error('涓氬姟鍒嗙粍妯″紡涓嬬涓�灞傜洰褰曠殑缂栧彿10鍒�13浣嶅繀椤讳负215')); + } + if (this.level > 1 && catalogType !== "216") { + return callback(new Error('涓氬姟鍒嗙粍妯″紡涓嬬涓�灞備互涓嬬洰褰曠殑缂栧彿10鍒�13浣嶅繀椤讳负216')); + } + + } + callback(); + } return { submitCallback: null, showDialog: false, isLoging: false, isEdit: false, + treeType: null, + level: 0, form: { id: null, name: null, @@ -62,12 +94,12 @@ }, rules: { name: [{ required: true, message: "璇疯緭鍏ュ悕绉�", trigger: "blur" }], - id: [{ required: true, message: "璇疯緭鍏D", trigger: "blur" }] + id: [{ trigger: "blur",validator: checkId }] }, }; }, methods: { - openDialog: function (isEdit, id, name, parentId, callback) { + openDialog: function (isEdit, id, name, parentId, treeType, level, callback) { console.log("parentId: " + parentId) console.log(this.form) this.isEdit = isEdit; @@ -77,6 +109,8 @@ this.form.parentId = parentId; this.showDialog = true; this.submitCallback = callback; + this.treeType = treeType; + this.level = level; }, onSubmit: function () { console.log("onSubmit"); -- Gitblit v1.8.0