Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into dev

yz 3 viikkoa sitten
vanhempi
commit
34e7874f54

+ 9 - 3
src/views/claimSettlement/detailsPage.vue

@@ -10,7 +10,7 @@
           >返回列表
         </el-button>
       </div>
-      <div class="add-customer-btn" v-if="form.claimSourceType==1">
+      <div class="add-customer-btn" v-if="form.claimSourceType == 1">
         <el-button
           class="el-button--small-yh"
           style="margin-left: 6px"
@@ -85,7 +85,7 @@ export default {
       editBtn: false,
       editDis: false,
       form: {
-        claimSourceType:1,
+        claimSourceType: 1,
         claimAttachmentList: [],
         bladeClaimAuditList: [],
       },
@@ -433,11 +433,14 @@ export default {
         this.$refs.form.validate((valid, done) => {
           done();
           if (valid) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.consumerPhone)) {
+              return this.$message.error("请输入正确电话");
+            }
             if (this.form.claimAttachmentList.length == 0) return this.$message.error("请上传车辆整体照片");
             if (this.form.claimAttachmentList.length == 1) return this.$message.error("请上传轮胎DOT");
             if (this.form.claimAttachmentList.length == 2) return this.$message.error("请上传花纹深度");
             if (this.form.claimAttachmentList.length == 3) return this.$message.error("请上传鼓包处照片");
-            submit(this.form)
+            submit(this.form);
             this.$confirm("是否提交审批?", "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
@@ -480,6 +483,9 @@ export default {
       this.$refs.form.validate((valid, done) => {
         done();
         if (valid) {
+          if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.consumerPhone)) {
+            return this.$message.error("请输入正确电话");
+          }
           if (this.form.claimAttachmentList.length == 0) return this.$message.error("请上传车辆整体照片");
           if (this.form.claimAttachmentList.length == 1) return this.$message.error("请上传轮胎DOT");
           if (this.form.claimAttachmentList.length == 2) return this.$message.error("请上传花纹深度");

+ 1 - 1
src/views/claimSettlement/index.vue

@@ -21,7 +21,7 @@
         </template>
         <template slot="menu" slot-scope="{ row, index }">
           <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">编辑 </el-button>
-          <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.auditStatus > 0">删 除 </el-button>
+          <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.auditStatus > 0||row.claimSourceType==2">删 除 </el-button>
         </template>
         <template slot="claimNo" slot-scope="{ row }">
           <span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">

+ 161 - 108
src/views/fc/customer/detailsPage.vue

@@ -3,15 +3,23 @@
     <div class="borderless">
       <div class="customer-head">
         <div class="customer-back">
-          <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList"
+          <el-button
+            type="danger"
+            style="border: none; background: none; color: red"
+            icon="el-icon-arrow-left"
+            @click="backToList"
             >返回列表
           </el-button>
         </div>
         <div class="add-customer-btn">
-          <el-button type="primary" size="small" @click="editCustomer">
-            保存数据
-          </el-button>
-          <el-button class="el-button--small-yh" :type="form.enableOrNot == 0 ? 'primary' : ''" size="small" v-if="form.id" @click="editEnable">
+          <el-button type="primary" size="small" @click="editCustomer"> 保存数据 </el-button>
+          <el-button
+            class="el-button--small-yh"
+            :type="form.enableOrNot == 0 ? 'primary' : ''"
+            size="small"
+            v-if="form.id"
+            @click="editEnable"
+          >
             {{ form.enableOrNot == 0 ? "启用" : "禁用" }}
           </el-button>
         </div>
@@ -19,10 +27,20 @@
       <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
-            <div style="display:flex;">
-              <avue-input-tree v-model="form.corpsTypeId" :disabled="option.disabled" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
+            <div style="display: flex">
+              <avue-input-tree
+                v-model="form.corpsTypeId"
+                :disabled="option.disabled"
+                placeholder="请选择客户分类"
+                :dic="corpTypeList"
+                :props="props"
+              >
               </avue-input-tree>
-              <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px" @click="corpTypeVisible = true"></i>
+              <i
+                class="el-icon-circle-plus-outline"
+                style="font-size: 18px; line-height: 32px; margin-left: 4px"
+                @click="corpTypeVisible = true"
+              ></i>
             </div>
           </template>
           <tempalte slot="salesmanName">
@@ -72,7 +90,14 @@
               @click="$refs.crudTwo.rowEdit(row, index)"
               >{{ row.$cellEdit ? "确认" : "修改" }}
             </el-button>
-            <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDelTwo(row, index)">删除 </el-button>
+            <el-button
+              icon="el-icon-delete"
+              :size="size"
+              :disabled="disabled"
+              :type="type"
+              @click="rowDelTwo(row, index)"
+              >删除
+            </el-button>
             <!-- <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户 </el-button> -->
           </template>
         </avue-crud>
@@ -80,7 +105,14 @@
       <trade-card title="地址信息" v-loading="loadingBtn">
         <avue-crud :option="option2" ref="crud" :data="data" @row-save="rowSave" @row-update="rowUpdate">
           <template slot="headerSerial">
-            <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow" :disabled="detailData.status == 1" circle></el-button>
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="mini"
+              @click.stop="addRow"
+              :disabled="detailData.status == 1"
+              circle
+            ></el-button>
           </template>
           <template slot="menuLeft">
             <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addRow">录入明细 </el-button>
@@ -94,10 +126,18 @@
               @click="$refs.crud.rowCell(row, index)"
               >{{ row.$cellEdit ? "确认" : "修改" }}
             </el-button>
-            <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index)">删除 </el-button>
+            <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index)"
+              >删除
+            </el-button>
           </template>
           <template slot="defaultAddres" slot-scope="{ row, index, disabled }">
-            <el-switch active-value="1" inactive-value="0" :disabled="disabled" v-model="row.defaultAddres" @change="addressUnique(row, index)">
+            <el-switch
+              active-value="1"
+              inactive-value="0"
+              :disabled="disabled"
+              v-model="row.defaultAddres"
+              @change="addressUnique(row, index)"
+            >
             </el-switch>
           </template>
         </avue-crud>
@@ -142,6 +182,7 @@
 </template>
 
 <script>
+// @ts-nocheck
 import {
   getDetails,
   getCorpType,
@@ -153,7 +194,7 @@ import {
   editenable,
   getUserByRole,
   getBrandDesc,
-  creatingUsersTwo
+  creatingUsersTwo,
 } from "@/api/fc/customerInformation";
 import { getRoleTree } from "@/api/system/role";
 import { getDeptTree } from "@/api/system/dept";
@@ -168,11 +209,11 @@ export default {
     return {
       propsCk: {
         label: "cname",
-        value: "id"
+        value: "id",
       },
       props: {
         label: "title",
-        value: "value"
+        value: "value",
       },
       optionData: {
         span: 8,
@@ -185,7 +226,7 @@ export default {
             type: "tree",
             dicData: [],
             props: {
-              label: "title"
+              label: "title",
             },
             checkStrictly: true,
             slot: true,
@@ -193,9 +234,9 @@ export default {
               {
                 required: true,
                 message: "请选择所属角色",
-                trigger: "click"
-              }
-            ]
+                trigger: "click",
+              },
+            ],
           },
           {
             label: "所属部门",
@@ -204,7 +245,7 @@ export default {
             multiple: true,
             dicData: [],
             props: {
-              label: "title"
+              label: "title",
             },
             checkStrictly: true,
             slot: true,
@@ -212,9 +253,9 @@ export default {
               {
                 required: true,
                 message: "请选择所属部门",
-                trigger: "click"
-              }
-            ]
+                trigger: "click",
+              },
+            ],
           },
           {
             label: "所属岗位",
@@ -224,17 +265,17 @@ export default {
             dicData: [],
             props: {
               label: "postName",
-              value: "id"
+              value: "id",
             },
             rules: [
               {
                 required: true,
                 message: "请选择所属岗位",
-                trigger: "click"
-              }
-            ]
-          }
-        ]
+                trigger: "click",
+              },
+            ],
+          },
+        ],
       },
       dialogVisibleBt: false,
       formDataTwo: false,
@@ -245,7 +286,7 @@ export default {
       corpTypeVisible: false,
       loadingBtn: false,
       form: {
-        ifLimitAmount: "0"
+        ifLimitAmount: "0",
       },
       form4: {},
       data: [],
@@ -261,10 +302,10 @@ export default {
               {
                 required: true,
                 message: "",
-                trigger: "blur"
-              }
+                trigger: "blur",
+              },
             ],
-            span: 8
+            span: 8,
           },
           {
             label: "客户分类",
@@ -274,14 +315,14 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "电话",
             prop: "tel",
-            span: 8
+            span: 8,
           },
           {
             label: "业务员",
@@ -291,9 +332,9 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "品牌",
@@ -302,18 +343,18 @@ export default {
             rules: [
               {
                 message: "请选择品牌",
-                trigger: "click"
-              }
-            ]
+                trigger: "click",
+              },
+            ],
           },
           {
             label: "备注",
             prop: "remarks",
             type: "textarea",
             minRows: 2,
-            span: 24
-          }
-        ]
+            span: 24,
+          },
+        ],
       },
       option2: {
         align: "center",
@@ -344,9 +385,9 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "电话",
@@ -356,9 +397,9 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "地址",
@@ -368,17 +409,17 @@ export default {
             type: "cascader",
             props: {
               label: "name",
-              value: "name"
+              value: "name",
             },
             rules: [
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
+                trigger: "blur",
+              },
             ],
             filterable: true,
-            cell: true
+            cell: true,
           },
           {
             label: "详细地址",
@@ -388,22 +429,22 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "备注",
             prop: "remarks",
-            cell: true
+            cell: true,
           },
           {
             label: "默认地址",
             prop: "defaultAddres",
             display: false,
-            width: 100
-          }
-        ]
+            width: 100,
+          },
+        ],
       },
       option3: {},
       option4: {
@@ -417,10 +458,10 @@ export default {
               {
                 required: true,
                 message: "",
-                trigger: "blur"
-              }
+                trigger: "blur",
+              },
             ],
-            span: 24
+            span: 24,
           },
           {
             label: "上级类型",
@@ -429,11 +470,11 @@ export default {
             type: "tree",
             props: {
               label: "cname",
-              value: "id"
+              value: "id",
             },
-            span: 24
-          }
-        ]
+            span: 24,
+          },
+        ],
       },
       corpsFiles: [],
       customerContactBack: {
@@ -461,9 +502,9 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "电话",
@@ -473,9 +514,9 @@ export default {
               {
                 required: true,
                 message: " ",
-                trigger: "blur"
-              }
-            ]
+                trigger: "blur",
+              },
+            ],
           },
           // {
           //   label: "登录用户id",
@@ -485,18 +526,18 @@ export default {
           {
             label: "备注",
             prop: "remarks",
-            cell: true
-          }
-        ]
+            cell: true,
+          },
+        ],
       },
-      userObj: {}
+      userObj: {},
     };
   },
   components: { corpType, dicSelect },
   props: {
     detailData: {
-      type: Object
-    }
+      type: Object,
+    },
   },
   async created() {
     if (this.detailData.id) {
@@ -544,10 +585,10 @@ export default {
     // 启用或禁用
     editEnable() {
       let data = this.form;
-      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
+      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then((res) => {
         this.$message({
           type: "success",
-          message: data.enableOrNot ? "禁用成功!" : "启用成功!"
+          message: data.enableOrNot ? "禁用成功!" : "启用成功!",
         });
         this.getDetail(this.detailData.id);
         // this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
@@ -564,15 +605,15 @@ export default {
       }
     },
     initData(tenantId) {
-      getRoleTree(tenantId).then(res => {
+      getRoleTree(tenantId).then((res) => {
         const column = this.findObject(this.optionData.column, "roleId");
         column.dicData = res.data.data;
       });
-      getDeptTree(tenantId).then(res => {
+      getDeptTree(tenantId).then((res) => {
         const column = this.findObject(this.optionData.column, "deptId");
         column.dicData = res.data.data;
       });
-      getPostList(tenantId).then(res => {
+      getPostList(tenantId).then((res) => {
         const column = this.findObject(this.optionData.column, "postId");
         column.dicData = res.data.data;
       });
@@ -588,8 +629,8 @@ export default {
           data.postId = data.postId.join(",");
           creatingUsersTwo({
             ...data,
-            id: this.formRow.id
-          }).then(res => {
+            id: this.formRow.id,
+          }).then((res) => {
             this.dialogVisibleBt = false;
             this.formDataTwo = {};
             this.$message.success("创建用户成功,默认帐号:手机号。默认密码:123456");
@@ -601,7 +642,7 @@ export default {
       });
     },
     getAllWorkDicts() {
-      customerList({ corpType: "JXS" }).then(res => {
+      customerList({ corpType: "JXS" }).then((res) => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records;
       });
       this.findObject(this.option2.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem("areaTypeTree"))
@@ -611,7 +652,7 @@ export default {
     getDetail(id) {
       this.loadingBtn = true;
       getDetails({ id: id })
-        .then(res => {
+        .then((res) => {
           if (res.data.data.enableOrNot == 1) {
             this.$set(this.option, "disabled", true);
           } else {
@@ -633,20 +674,20 @@ export default {
       this.$confirm("确定删除数据?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         if (row.id) {
-          itemDel(row.id).then(res => {
+          itemDel(row.id).then((res) => {
             this.$message({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.data.splice(index, 1);
           });
         } else {
           this.$message({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.data.splice(index, 1);
         }
@@ -666,7 +707,7 @@ export default {
       this.$confirm("确定删除数据?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         if (row.id) {
           // itemDel(row.id).then(res => {
@@ -679,7 +720,7 @@ export default {
         } else {
           this.$message({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.data2.splice(index, 1);
         }
@@ -690,7 +731,7 @@ export default {
       // this.form4 = this.$options.data().form4
     },
     getCorpType() {
-      getCorpType({ corpType: "JXS" }).then(res => {
+      getCorpType({ corpType: "JXS" }).then((res) => {
         this.corpTypeList = res.data.data;
       });
     },
@@ -703,8 +744,16 @@ export default {
       this.$refs.form.validate((valid, done) => {
         done();
         if (valid) {
+          if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.tel)) {
+            return this.$message.error("请输入正确电话");
+          }
           if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
           if (this.data.length == 0) return this.$message.error("请添加地址信息");
+          for (let item of this.data) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(item.tel)) {
+              return this.$message.error("地址信息:请输入正确电话");
+            }
+          }
           this.loadingBtn = true;
           if (!this.form.id) {
             this.form.checkStatus = "通过";
@@ -717,9 +766,9 @@ export default {
             corpsAddrList: this.data,
             corpsFilesList: this.corpsFiles,
             corpsAttnList: this.contactsData,
-            billType: 1
+            billType: 1,
           })
-            .then(res => {
+            .then((res) => {
               this.$message.success("保存成功");
               this.form = res.data.data;
               this.data = res.data.data.corpsAddrList;
@@ -728,7 +777,7 @@ export default {
               if (!this.form.id) {
                 //添加成功后默认启用
                 let data = this.form;
-                editenable({ id: res.data.data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
+                editenable({ id: res.data.data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then((res) => {
                   this.$set(this.form, "enableOrNot", data.enableOrNot == 1 ? 0 : 1);
                 });
               }
@@ -750,7 +799,7 @@ export default {
             this.formDataTwo = {
               roleId: ["1658417787548205058"],
               postId: ["1742709504333688834"],
-              deptId: [this.userObj.dept_id]
+              deptId: [this.userObj.dept_id],
             };
             this.formRow = row;
           } else {
@@ -765,6 +814,10 @@ export default {
     },
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
+       if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(row.tel)) {
+        loading();
+        return this.$message.error("请输入正确电话");
+      }
       if (this.data.length == 1) {
         this.$set(row, "defaultAddres", "1");
       }
@@ -779,21 +832,21 @@ export default {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         // 数据回调进行刷新
         if (row.id) {
-          corpsattn(row.id).then(res => {
+          corpsattn(row.id).then((res) => {
             this.$message({
               type: "success",
-              message: "操作成功!"
+              message: "操作成功!",
             });
             this.contactsData.splice(index, 1);
           });
         } else {
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           this.contactsData.splice(index, 1);
         }
@@ -802,8 +855,8 @@ export default {
     //返回列表
     backToList() {
       this.$emit("goBack");
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 20 - 0
src/views/store/detailsPage.vue

@@ -778,8 +778,16 @@ export default {
         this.$refs.form.validate((valid, done) => {
           done();
           if (valid) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.tel)) {
+              return this.$message.error("请输入正确电话");
+            }
             if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
             if (this.data.length == 0) return this.$message.error("请添加地址信息");
+            for (let item of this.data) {
+              if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(item.tel)) {
+                return this.$message.error("地址信息:请输入正确电话");
+              }
+            }
             if (this.corpsFiles.length == 0) return this.$message.error("请添加门店照片");
             if (this.corpsFiles.filter((item) => item.mainImage == 1).length > 1)
               return this.$message.error("门店照片主图只允许选一个");
@@ -1036,8 +1044,16 @@ export default {
       this.$refs.form.validate((valid, done) => {
         done();
         if (valid) {
+          if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.tel)) {
+            return this.$message.error("请输入正确电话");
+          }
           if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
           if (this.data.length == 0) return this.$message.error("请添加地址信息");
+          for (let item of this.data) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(item.tel)) {
+              return this.$message.error("地址信息:请输入正确电话");
+            }
+          }
           if (this.corpsFiles.length == 0) return this.$message.error("请添加门店照片");
           if (this.corpsFiles.filter((item) => item.mainImage == 1).length > 1)
             return this.$message.error("附件主图只允许选一个");
@@ -1098,6 +1114,10 @@ export default {
     },
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
+      if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(row.tel)) {
+        loading();
+        return this.$message.error("请输入正确电话");
+      }
       if (this.data.length == 1) {
         this.$set(row, "defaultAddres", "1");
       }