Jelajahi Sumber

客户管理-修复页签确定后报错和不返回BUG;增加产线必填;增加手机号校验。

DongZ 1 tahun lalu
induk
melakukan
248e1798d9

+ 13 - 4
src/views/business/spd/cm/customers/index.vue

@@ -470,8 +470,8 @@
       </div>
     </div>
 
-    <AddPerson v-model="isAdd1" v-if="isAdd1" :pageStu="page" :disable="disable" :row="rowDetail"
-      :customersId="form.id" :customersName="form.name" />
+    <AddPerson v-model="isAdd1" v-if="isAdd1" :pageStu="page" :disable="disable" :row="rowDetail" :customersId="form.id"
+      :customersName="form.name" />
 
     <AddDepartment v-model="isAdd2" v-if="isAdd2" :pageStu="page" :disable="disable" :row="rowDetail"
       :customersId="form.id" :customersName="form.name" />
@@ -522,6 +522,8 @@
         loading: true,
         // 选中数组
         ids: [],
+        // 选中数组中的客户编码
+        codes: [],
         // 子表选中数据
         checkedMkCmCustomersResponsiblePerson: [],
         checkedMkCmCustomersDepartment: [],
@@ -710,6 +712,7 @@
       // 多选框选中数据
       handleSelectionChange(selection) {
         this.ids = selection.map(item => item.id)
+        this.codes = selection.map(item => item.code)
         this.single = selection.length !== 1
         this.multiple = !selection.length
       },
@@ -793,8 +796,14 @@
       },
       /** 删除按钮操作 */
       handleDelete(row) {
-        const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除客户编码为"' + row.code + '"的数据项?').then(function () {
+        let ids = row.id || this.ids;
+        // for (let i = 0; i < ids.length; i++) {
+        //   ids[i] = parseInt(ids[i]);
+        // }
+        // ids = ids.join();
+        console.log(ids, 'ids')
+        const codes = row.code || this.codes;
+        this.$modal.confirm('是否确认删除客户编码为"' + codes + '"的数据项?').then(function () {
           return delCustomers(ids);
         }).then(() => {
           this.getList();

+ 10 - 29
src/views/business/spd/cm/customersDepartment/index.vue

@@ -134,7 +134,16 @@
             message: '科室名称不能为空',
             trigger: 'blur'
           }],
-        }
+          phone: [{
+            required: true,
+            message: "手机号不能为空",
+            trigger: "blur"
+          }, {
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入正确的手机号码",
+            trigger: "blur"
+          }],
+        },
       };
     },
     created() {
@@ -147,36 +156,8 @@
     methods: {
       // 取消按钮
       cancel() {
-        this.reset();
         this.$emit('jugislist', false);
       },
-      reset() {
-        this.form = {
-          id: null,
-          name: null,
-          customersName: this.customersName,
-          responsiblePerson: null,
-          responsiblePersonName: null,
-          phone: null,
-          address: null,
-          conventionalTherapy: null,
-          characteristic: null,
-          marketingArea: null,
-          marketingAreaName: null,
-          memo: null,
-          state: null,
-          tenantId: null,
-          revision: null,
-          createBy: null,
-          createTime: null,
-          createByName: null,
-          updateBy: null,
-          updateTime: null,
-          updateByName: null,
-          delFlag: null
-        };
-        this.resetForm("form");
-      },
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {

+ 5 - 21
src/views/business/spd/cm/customersResponsiblePerson/index.vue

@@ -131,6 +131,11 @@
             message: '开始日期不能为空',
             trigger: 'blur'
           }],
+          productionLine: [{
+            required: true,
+            message: '产线不能为空',
+            trigger: 'blur'
+          }],
         },
       };
     },
@@ -144,29 +149,8 @@
     methods: {
       // 取消按钮
       cancel() {
-        this.reset();
         this.$emit('jugislist', false);
       },
-      reset() {
-        form = {
-          id: null,
-          person: null,
-          personName: null,
-          customersName: this.customersName,
-          relationshipType: null,
-          productionLine: null,
-          startDate: null,
-          endDate: null,
-          tenantId: null,
-          revision: null,
-          createBy: null,
-          createTime: null,
-          updateBy: null,
-          updateTime: null,
-          delFlag: null
-        };
-        this.resetForm("form");
-      },
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {