diff --git a/project/fengdu/AppOutSource/AppArchives/components/Add.vue b/project/fengdu/AppOutSource/AppArchives/components/Add.vue index c61e61cf..b503e1b4 100644 --- a/project/fengdu/AppOutSource/AppArchives/components/Add.vue +++ b/project/fengdu/AppOutSource/AppArchives/components/Add.vue @@ -17,9 +17,7 @@ show-word-limit> - + @@ -33,7 +31,7 @@ @@ -181,9 +179,25 @@ export default { children: "children", label: "girdName", }, - rules: { + } + }, + + computed:{ + rules(){ + const IdNumberPass = (rule, value, callback) => { + if (value) { + if (ID.check(value)) { + callback(); + } else { + callback(new Error("身份证号格式错误")); + } + } else { + callback(new Error("请输入身份证号")); + } + }; + return { name: [{required: true, message: '请输入经营者姓名', trigger: 'blur'}], - idNumber: [{required: true, message: '请输入身份证号', trigger: 'blur'}], + idNumber: [{required: true, validator: IdNumberPass, trigger: 'change'}], sex: [{required: true, message: '请选择性别', trigger: 'change'}], phone: [{required: true, message: '请输入手机号', trigger: 'blur'}], shopName: [{required: true, message: '请输入门店名称', trigger: 'blur'}], @@ -207,6 +221,14 @@ export default { methods: { + getInfoByIdNumber(code) { + if (ID.check(code)) { + let info = new ID(code) + this.form.age = info.age + this.form.birthday = info.birthday + this.$forceUpdate() + } + }, beforeSelectTree() { this.treeObj.checkedKeys = []; this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => { @@ -277,19 +299,6 @@ export default { } }, - idChange(val) { - if (val.length == 18) { - this.IdCard(val); - } - }, - - IdCard(UUserCard) { - if (UUserCard) { - const idCard = new ID(UUserCard) - this.form.age = idCard.age - this.form.birthday = idCard.birthday - } - }, async addOrUpdate() { try { diff --git a/project/fengdu/AppOutSource/AppArchives/components/List.vue b/project/fengdu/AppOutSource/AppArchives/components/List.vue index cfcf81b8..6611b15f 100644 --- a/project/fengdu/AppOutSource/AppArchives/components/List.vue +++ b/project/fengdu/AppOutSource/AppArchives/components/List.vue @@ -17,7 +17,6 @@ v-model="search.storeLevel" @change="(search.current = 1), getList()" placeholder="门店等级" - multiple :selectList="$dict.getDict('storeLevel')"> @@ -168,7 +167,7 @@ export default { size: 10, girdCode:'', girdName:'', - storeLevel:[], + storeLevel:'', girdInfoList:[] }, ids: [], @@ -297,8 +296,7 @@ export default { getList() { this.instance.post(`/app/appshoparchives/list`, null, { params: { - ...this.search, - storeLevel:this.search.storeLevel.join(',') + ...this.search } }).then(res => { if (res.code == 0) {