Prechádzať zdrojové kódy

Merge branch 'ecp' into dev

纪新园 1 mesiac pred
rodič
commit
c1d8437082

+ 82 - 28
src/components/uploadFile/index.vue

@@ -2,8 +2,14 @@
   <div>
     <avue-crud :option="option" :data="data" id="out-table" ref="crud" @selection-change="selectionChange">
       <template slot="menuLeft">
-        <div style="display: flex;">
-          <el-upload :headers="headers" action="/api/blade-resource/oss/endpoint/put-file" :on-success="onSuccess" :on-error="onError">
+        <div style="display: flex">
+          <el-upload
+            :headers="headers"
+            action="/api/blade-resource/oss/endpoint/put-file"
+            :on-success="onSuccess"
+            :on-error="onError"
+            :before-upload="beforeUpload"
+          >
             <el-button icon="el-icon-upload" type="primary" size="mini" :disabled="disabled">点击上传</el-button>
           </el-upload>
           <!-- <el-button type="success" size="mini" :disabled="disabled" @click.stop="submit">一键保存</el-button> -->
@@ -11,30 +17,46 @@
       </template>
       <template slot="fileUrl" slot-scope="{ row, index }">
         <span v-if="row.$cellEdit" @click.stop="rowPick(row, index)">
-          <el-upload :headers="headers" action="/api/blade-resource/oss/endpoint/put-file" :on-success="rowonSuccess" :on-error="onError">
+          <el-upload
+            :headers="headers"
+            action="/api/blade-resource/oss/endpoint/put-file"
+            :on-success="rowonSuccess"
+            :on-error="onError"
+            :before-upload="beforeUpload"
+          >
             <el-input placeholder="请选择上传文件" v-model="row.fileUrl" readonly size="small"></el-input>
           </el-upload>
         </span>
-        <span v-else>
+        <span v-else style="color: #1e9fff; cursor: pointer" @click="download(row, index)">
           {{ row.fileUrl }}
         </span>
       </template>
       <template slot="menu" slot-scope="{ row, index }">
-        <el-button size="small" type="text" icon="el-icon-edit" :disabled="disabled" @click="rowEdit(row)">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
-        <el-button size="small" type="text" icon="el-icon-delete" @click="rowDel(row, index)" :disabled="disabled">删 除 </el-button>
+        <el-button size="small" type="text" icon="el-icon-edit" :disabled="disabled" @click="rowEdit(row)">{{
+          row.$cellEdit ? "保存" : "编辑"
+        }}</el-button>
+        <el-button size="small" type="text" icon="el-icon-delete" @click="rowDel(row, index)" :disabled="disabled"
+          >删 除
+        </el-button>
       </template>
     </avue-crud>
+    <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
   </div>
 </template>
 
 <script>
+// @ts-nocheck
 import { getToken } from "@/util/auth";
 import { updateListRemove, submitList } from "@/api/uploadFile/upload-file";
+import PreviewImage from "@/components/PreviewImage/index.vue";
 export default {
   name: "detailsPage",
+  components: { PreviewImage },
   data() {
     return {
-      rowIndex:null,
+      innerVisible: false,
+      imgUrl: "",
+      rowIndex: null,
       headers: { "Blade-Auth": "Bearer " + getToken() },
       option: {
         maxHeight: 340,
@@ -58,51 +80,54 @@ export default {
             label: "原始文件名",
             prop: "fileName",
             cell: true,
-            overHidden: true
+            overHidden: true,
           },
           {
             label: "文件地址",
             prop: "fileUrl",
             // cell: true,
-            overHidden: true
+            overHidden: true,
           },
           {
             label: "文件类型",
             prop: "fileType",
             // cell: true,
-            overHidden: true
+            overHidden: true,
           },
           {
             label: "备注",
             prop: "remarks",
             cell: true,
             width: 150,
-            overHidden: true
-          }
-        ]
-      }
+            overHidden: true,
+          },
+        ],
+      },
     };
   },
-  components: {},
   props: {
     data: {
       type: Array,
-      default: function() {
+      default: function () {
         return [];
-      }
+      },
     },
     linkKey: {
       type: String,
-      default: "link"
+      default: "link",
     },
     delUrl: {
       type: String,
-      default: "/gubersail-admin/bladeclaimattachment/remove"
+      default: "/gubersail-admin/bladeclaimattachment/remove",
     },
     disabled: {
       type: Boolean,
-      default: false
-    }
+      default: false,
+    },
+    isImage: {
+      type: Boolean,
+      default: false,
+    },
   },
   created() {},
   methods: {
@@ -120,10 +145,10 @@ export default {
         lock: true,
         text: "加载中",
         spinner: "el-icon-loading",
-        background: "rgba(255,255,255,0.7)"
+        background: "rgba(255,255,255,0.7)",
       });
       submitList(this.data)
-        .then(res => {
+        .then((res) => {
           this.$emit("upDate", res.data.data);
         })
         .finally(() => {
@@ -142,6 +167,24 @@ export default {
         this.$set(row, "$cellEdit", true);
       }
     },
+    // /**
+    //  * @param {{ id: any; }} row
+    //  * @param {any} index
+    //  */
+    download(row) {
+      if (row.fileUrl) {
+        const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"];
+        const fileExt = row.fileUrl.substring(row.fileUrl.lastIndexOf(".")).toLowerCase();
+        if (imageExtensions.includes(fileExt)) {
+          this.innerVisible = true;
+          this.imgUrl = row.fileUrl;
+        } else {
+          window.open(row.fileUrl);
+        }
+      } else {
+        this.$message.error("请上传附件");
+      }
+    },
     /**
      * @param {{ id: any; }} row
      * @param {any} index
@@ -150,10 +193,10 @@ export default {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         if (row.id) {
-          updateListRemove(row.id, this.delUrl).then(res => {
+          updateListRemove(row.id, this.delUrl).then((res) => {
             if (res.data.success) {
               this.$message.success("操作成功!");
               this.data.splice(index, 1);
@@ -181,7 +224,7 @@ export default {
         fileName: res.data.originalName,
         fileUrl: res.data[this.linkKey],
         fileType: this.getFileExtension(res.data.originalName),
-        $cellEdit: true
+        $cellEdit: true,
       });
     },
     rowonSuccess(res, file, fileList) {
@@ -201,8 +244,19 @@ export default {
     onError(err, file, fileList) {
       console.log(err);
       this.$message.error(err);
-    }
-  }
+    },
+    beforeUpload(file) {
+      if (this.isImage) {
+        const isImage = file.type.includes("image/");
+
+        if (!isImage) {
+          this.$message.error("只能上传图片文件!");
+          return false;
+        }
+        return isImage;
+      }
+    },
+  },
 };
 </script>
 

+ 69 - 34
src/views/claimSettlement/detailsPage.vue

@@ -10,7 +10,7 @@
           >返回列表
         </el-button>
       </div>
-      <div class="add-customer-btn">
+      <div class="add-customer-btn" v-if="form.claimSourceType==1">
         <el-button
           class="el-button--small-yh"
           style="margin-left: 6px"
@@ -57,16 +57,15 @@
         <avue-form :option="optionForm" v-model="form" ref="form"> </avue-form>
       </trade-card>
       <trade-card title="文件中心">
-        <upload-file :data="form.claimAttachmentList" :disabled="editDis" @upDate="upDate"></upload-file>
+        <upload-file
+          :data="form.claimAttachmentList"
+          :disabled="editDis"
+          @upDate="upDate"
+          :isImage="true"
+        ></upload-file>
       </trade-card>
       <trade-card title="反馈表">
-        <avue-crud
-          :option="option"
-          :data="form.bladeClaimAuditList"
-          id="out-table"
-          ref="crud"
-        >
-        </avue-crud>
+        <avue-crud :option="option" :data="form.bladeClaimAuditList" id="out-table" ref="crud"> </avue-crud>
       </trade-card>
       <trade-card title="操作记录">
         <avue-form :option="optionForm2" v-model="form" ref="form2"> </avue-form>
@@ -86,6 +85,7 @@ export default {
       editBtn: false,
       editDis: false,
       form: {
+        claimSourceType:1,
         claimAttachmentList: [],
         bladeClaimAuditList: [],
       },
@@ -113,18 +113,12 @@ export default {
                 label: "门店",
                 value: 2,
               },
-              {
-                label: "终端消费者",
-                value: 3,
-              },
-            ],
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur",
-              },
+              // {
+              //   label: "终端消费者",
+              //   value: 3,
+              // },
             ],
+            disabled: true,
           },
           {
             label: "来源方名称",
@@ -132,11 +126,11 @@ export default {
             disabled: true,
           },
           {
-            label: "消费者姓名",
+            label: "联系人",
             prop: "consumerName",
           },
           {
-            label: "消费者电话",
+            label: "电话",
             prop: "consumerPhone",
           },
           {
@@ -151,10 +145,35 @@ export default {
             ],
           },
           {
+            label: "车牌号",
+            prop: "vehicleNumber",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
             label: "规格型号",
             prop: "tyreSpecs",
           },
           {
+            label: "轮胎数量",
+            prop: "tireQuantity",
+            type: "number",
+            controls: false,
+            precision: 0,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
             label: "购买日期",
             prop: "purchaseDate",
             type: "date",
@@ -411,18 +430,30 @@ export default {
     },
     allClick(name) {
       if (name == "提交审批") {
-        this.$confirm("是否提交审批?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }).then(() => {
-          let obj = {
-            id: this.form.id,
-          };
-          submitApprova(obj).then((res) => {
-            this.$message.success("操作成功");
-            this.getDetail(this.form.id);
-          });
+        this.$refs.form.validate((valid, done) => {
+          done();
+          if (valid) {
+            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)
+            this.$confirm("是否提交审批?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(() => {
+              let obj = {
+                id: this.form.id,
+              };
+              submitApprova(obj).then((res) => {
+                this.$message.success("操作成功");
+                this.getDetail(this.form.id);
+              });
+            });
+          } else {
+            return false;
+          }
         });
       }
       if (name == "撤销审批") {
@@ -449,6 +480,10 @@ export default {
       this.$refs.form.validate((valid, done) => {
         done();
         if (valid) {
+          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("请上传鼓包处照片");
           const loading = this.$loading({
             lock: true,
             text: "加载中",

+ 4 - 8
src/views/claimSettlement/index.vue

@@ -23,9 +23,9 @@
           <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>
         </template>
-        <template slot="contractNo" slot-scope="{ row }">
+        <template slot="claimNo" slot-scope="{ row }">
           <span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">
-            {{ row.contractNo }}
+            {{ row.claimNo }}
           </span>
         </template>
       </avue-crud>
@@ -89,10 +89,6 @@ export default {
               {
                 label: "门店",
                 value: 2
-              },
-              {
-                label: "终端消费者",
-                value: 3
               }
             ],
             overHidden: true
@@ -105,14 +101,14 @@ export default {
             overHidden: true
           },
           {
-            label: "消费者姓名",
+            label: "联系人",
             prop: "consumerName",
             width: 90,
             search: true,
             overHidden: true
           },
           {
-            label: "消费者电话",
+            label: "电话",
             prop: "consumerPhone",
             width: 90,
             overHidden: true

+ 1 - 1
src/views/dealer/store/detailsPage.vue

@@ -735,7 +735,7 @@ export default {
             for (let item in this.data) {
                 if (index != item) {
                     if (this.data[item].defaultAddres == 1) {
-                        this.$message.warning("默认地址只能唯一")
+                        this.$message.warning("开启默认地址")
                         return row.defaultAddres = 0
                     }
                 }

+ 4 - 4
src/views/fc/customer/components/index.vue

@@ -89,7 +89,7 @@ export default {
     },
     //修改时的修改按钮点击触发
     rowUpdate(row, index, done, loading) {
-      row.corpType = customerParameter.code;
+      row.corpType = 'JXS';
       typeSave(row).then(
         () => {
           this.$message({
@@ -109,7 +109,7 @@ export default {
     //新增修改时保存触发
     rowSave(row, done, loading) {
       console.log('33333333333333');
-      row.corpType = customerParameter.code;
+      row.corpType = 'JXS';
       typeSave(row).then(
         res => {
           this.$message({
@@ -127,7 +127,7 @@ export default {
     },
     //查询全部
     initData() {
-      customerList({corpType: customerParameter.code}).then(res => {
+      customerList({corpType: 'JXS'}).then(res => {
         const column = this.findObject(this.option.column, "parentId");
         column.dicData = res.data.data.records;
       });
@@ -189,7 +189,7 @@ export default {
       const {createTimeA} = this.query;
       let values = {
         ...params,
-        corpType: customerParameter.code,
+        corpType: 'JXS',
         size: this.page.pageSize,
         current: this.page.currentPage
       };

+ 4 - 4
src/views/fc/customer/detailsPage.vue

@@ -557,7 +557,7 @@ export default {
       for (let item in this.data) {
         if (index != item) {
           if (this.data[item].defaultAddres == 1) {
-            this.$message.warning("默认地址只能唯一");
+            this.$message.warning("开启默认地址");
             return (row.defaultAddres = 0);
           }
         }
@@ -601,7 +601,7 @@ export default {
       });
     },
     getAllWorkDicts() {
-      customerList({ corpType: "KH" }).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"))
@@ -690,7 +690,7 @@ export default {
       // this.form4 = this.$options.data().form4
     },
     getCorpType() {
-      getCorpType({ corpType: "KH" }).then(res => {
+      getCorpType({ corpType: "JXS" }).then(res => {
         this.corpTypeList = res.data.data;
       });
     },
@@ -713,7 +713,7 @@ export default {
           submit({
             ...this.form,
             code: this.form.cname,
-            corpType: "KH",
+            corpType: "JXS",
             corpsAddrList: this.data,
             corpsFilesList: this.corpsFiles,
             corpsAttnList: this.contactsData,

+ 12 - 5
src/views/fc/customer/index.vue

@@ -3,7 +3,7 @@
     <basic-container v-show="show" class="page-crad">
       <el-row>
         <el-col :span="4">
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" @save="corpTypeVisible = true">
+          <avue-tree ref="tree" :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" @save="corpTypeVisible = true">
             <template slot="addBtn">
               <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
                 <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;" @click="corpTypeVisible = true"></i>
@@ -19,6 +19,7 @@
             :page.sync="page"
             :search.sync="search"
             @search-change="searchChange"
+            @search-reset="searchReset"
             @current-change="currentChange"
             @size-change="sizeChange"
             @refresh-change="refreshChange"
@@ -121,6 +122,7 @@
 </template>
 
 <script>
+// @ts-nocheck
 import detailsPage from "./detailsPage.vue";
 import {getList, getCorpType, remove, customerList, submit, delCustomer} from "@/api/fc/customerInformation";
 import corpType from "./components/index.vue";
@@ -316,7 +318,7 @@ export default {
           {
             label: "上级类型",
             prop: "parentId",
-            dicUrl: "/api/gubersail-admin/corpstype/page?corpType=KH",
+            dicUrl: "/api/gubersail-admin/corpstype/page?corpType=JXS",
             type: "tree",
             props: {
               label: "cname",
@@ -608,10 +610,10 @@ export default {
       this.onLoad(this.page, this.search);
     },
     getAllWorkDicts() {
-      getCorpType({ corpType: "KH" }).then(res => {
+      getCorpType({ corpType: "JXS" }).then(res => {
         this.treeData = res.data.data;
       });
-      customerList({ corpType: "KH" }).then(res => {
+      customerList({ corpType: "JXS" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records;
       });
       this.$refs.crud.init();
@@ -628,6 +630,11 @@ export default {
       this.onLoad(this.page, params);
       done();
     },
+    searchReset() {
+      this.$refs.tree.setCurrentKey(null);
+      this.search = this.$options.data().search;
+      this.onLoad(this.page);
+    },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
@@ -645,7 +652,7 @@ export default {
         data.endTime = data.date[1];
       }
       delete data.date;
-      data.corpType = "KH";
+      data.corpType = "JXS";
       this.loading = true;
       getList({
         current: page.currentPage,

+ 1 - 0
src/views/goodsManage/index.vue

@@ -306,6 +306,7 @@ export default {
       });
     },
     searchReset() {
+      this.$refs.tree.setCurrentKey(null);
       this.query = this.$options.data().query;
       this.onLoad(this.page);
     },

+ 71 - 24
src/views/store/detailsPage.vue

@@ -43,15 +43,15 @@
         </div>
       </div>
       <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
-        <avue-form ref="form" class="trading-form" v-model="form" :option="option">
+        <avue-form ref="form" class="trading-form" v-model="form" :option="option" :upload-after="uploadAfter">
           <template slot="corpsTypeIdLabel">
-            <span style="color: #409eff; cursor: pointer" @click="corpTypeVisible = true"> 客户分类 </span>
+            <span style="color: #409eff; cursor: pointer" @click="corpTypeVisible = true"> 店面分类 </span>
           </template>
           <template slot="corpsTypeId">
             <avue-input-tree
               v-model="form.corpsTypeId"
               :disabled="option.disabled"
-              placeholder="请选择客户分类"
+              placeholder="请选择店面分类"
               :dic="corpTypeList"
               :props="props"
             >
@@ -96,6 +96,9 @@
               :remote="true"
               dataName="label"
               :disabled="option.disabled"
+              @selectChange="dicChange('label', $event)"
+              :multiple="true"
+              dataType="string"
             ></dic-select>
           </tempalte>
           <tempalte slot="brandName">
@@ -211,7 +214,7 @@
           </template>
         </avue-crud>
       </trade-card>
-      <containerTitle title="上传附件"></containerTitle>
+      <containerTitle title="店面照片"></containerTitle>
       <c-upload
         v-loading="loadingBtn"
         typeUpload="CD"
@@ -223,7 +226,7 @@
         :mainImageType="true"
       ></c-upload>
       <el-dialog
-        title="设置客户分类"
+        title="设置店面分类"
         v-dialogDrag
         :visible.sync="corpTypeVisible"
         class="avue-dialog"
@@ -387,7 +390,7 @@ export default {
         span: 6,
         column: [
           {
-            label: "客户名称",
+            label: "店铺名称",
             prop: "cname",
             rules: [
               {
@@ -398,7 +401,7 @@ export default {
             ],
           },
           {
-            label: "客户分类",
+            label: "店面分类",
             prop: "corpsTypeId",
             rules: [
               {
@@ -411,6 +414,13 @@ export default {
           {
             label: "电话",
             prop: "tel",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "业务员",
@@ -589,14 +599,15 @@ export default {
             ],
           },
           {
-            label: "地址",
+            label: "所属地区",
             prop: "belongtoarea",
             dicData: [],
             dataType: "string",
             type: "cascader",
+            emitPath: false,
             props: {
               label: "name",
-              value: "name",
+              value: "code",
             },
             rules: [
               {
@@ -750,20 +761,47 @@ export default {
     }, 100);
   },
   methods: {
+    uploadAfter(res, done, loading, column) {
+      let obj = {
+        url: res.link,
+        name: res.originalName,
+        extname: this.getFileExtension(res.originalName),
+      };
+      this.form.businessLicense = JSON.stringify(obj);
+      done();
+    },
+    getFileExtension(filename) {
+      return filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2);
+    },
     allClick(name) {
       if (name == "提交审批") {
-        this.$confirm("是否提交审批?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }).then(() => {
-          let obj = {
-            id: this.form.id,
-          };
-          submitApply(obj).then((res) => {
-            this.$message.success("操作成功");
-            this.getDetail(this.form.id);
-          });
+        this.$refs.form.validate((valid, done) => {
+          done();
+          if (valid) {
+            if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
+            if (this.data.length == 0) 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("门店照片主图只允许选一个");
+            if (this.corpsFiles.filter((item) => item.mainImage == 1).length == 0) {
+              this.corpsFiles[0].mainImage = 1;
+            }
+            this.$confirm("是否提交审批?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(() => {
+              let obj = {
+                id: this.form.id,
+              };
+              submitApply(obj).then((res) => {
+                this.$message.success("操作成功");
+                this.getDetail(this.form.id);
+              });
+            });
+          } else {
+            return false;
+          }
         });
       }
       if (name == "审批") {
@@ -823,11 +861,16 @@ export default {
           this.form.deliveryWarehouseName = null;
         }
       }
+      if (name == "label") {
+        this.form.label = row.names;
+      }
     },
     // 启用或禁用
     editEnable() {
-      if (this.form.checkStatus != "审核通过") {
-        return this.$message.error("审核通过以后可以启用");
+      if (this.form.enableOrNot == 0) {
+        if (this.form.checkStatus != "审核通过") {
+          return this.$message.error("审核通过以后可以启用");
+        }
       }
       let data = this.form;
       editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then((res) => {
@@ -843,7 +886,7 @@ export default {
       for (let item in this.data) {
         if (index != item) {
           if (this.data[item].defaultAddres == 1) {
-            this.$message.warning("默认地址只能唯一");
+            this.$message.warning("开启默认地址");
             return (row.defaultAddres = 0);
           }
         }
@@ -995,8 +1038,12 @@ export default {
         if (valid) {
           if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
           if (this.data.length == 0) 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("附件主图只允许选一个");
+          if (this.corpsFiles.filter((item) => item.mainImage == 1).length == 0) {
+            this.corpsFiles[0].mainImage = 1;
+          }
           this.loadingBtn = true;
           submit({
             ...this.form,

+ 13 - 10
src/views/store/index.vue

@@ -4,6 +4,7 @@
       <el-row>
         <el-col :span="4">
           <avue-tree
+            ref="tree"
             :option="treeOption"
             :data="treeData"
             @node-click="nodeClick"
@@ -29,6 +30,7 @@
             :page.sync="page"
             :search.sync="search"
             @search-change="searchChange"
+            @search-reset="searchReset"
             @current-change="currentChange"
             @size-change="sizeChange"
             @refresh-change="refreshChange"
@@ -38,7 +40,7 @@
             @search-criteria-switch="searchCriteriaSwitch"
           >
             <template slot="menuLeft">
-              <el-button type="primary" size="mini"  icon="el-icon-plus" @click.stop="newAdd()">新建客户 </el-button>
+              <el-button type="primary" size="mini" icon="el-icon-plus" @click.stop="newAdd()">新建客户 </el-button>
               <!-- <el-button type="primary" size="mini" icon="el-icon-bottom" @click="excelBox = true">导入 </el-button>
               <el-button type="primary" size="mini" icon="el-icon-top" @click="outExport">导出 </el-button>
               <el-button type="primary" size="mini" icon="el-icon-download" @click="brandBox = true">
@@ -80,11 +82,7 @@
                 @click.stop="passThrough(row, '驳回')"
                 >驳回
               </el-button> -->
-              <el-button
-                :size="size"
-                :type="type"
-                :disabled="row.enableOrNot == 1"
-                @click.stop="rowDel(row)"
+              <el-button :size="size" :type="type" :disabled="row.enableOrNot == 1" @click.stop="rowDel(row)"
                 >删除
               </el-button>
             </template>
@@ -94,7 +92,7 @@
     </basic-container>
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
     <el-dialog
-      title="设置客户分类"
+      title="设置门店分类"
       v-dialogDrag
       :visible.sync="corpTypeVisible"
       class="avue-dialog"
@@ -391,7 +389,7 @@ export default {
         columnBtn: false,
         column: [
           {
-            label: "客户名称",
+            label: "店铺名称",
             prop: "cname",
             overHidden: true,
             width: 140,
@@ -409,7 +407,7 @@ export default {
             overHidden: true,
           },
           {
-            label: "客户分类",
+            label: "店面分类",
             prop: "corpsTypeName",
             overHidden: true,
           },
@@ -673,7 +671,7 @@ export default {
       customerList({ corpType: "KH" }).then((res) => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records;
       });
-      this.$refs.crud.init();
+      // this.$refs.crud.init();
     },
     searchCriteriaSwitch(type) {
       this.$refs.crud.getTableHeight();
@@ -687,6 +685,11 @@ export default {
       this.onLoad(this.page, params);
       done();
     },
+    searchReset() {
+      this.$refs.tree.setCurrentKey(null);
+      this.search = this.$options.data().search;
+      this.onLoad(this.page);
+    },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },