Browse Source

1.理赔 文件中心 新加图片预览 限制只上传图片 保存 提交审核判断必须有4张图片
2.门店管理 营业执照 新加JSON字段给app用来显示图片
3.门店管理 保存 提交审核新增门店照片校验 门店照片没有主图是默认第一张作为主图

Qukatie 2 weeks ago
parent
commit
b7b46150fa

+ 18 - 1
src/components/uploadFile/index.vue

@@ -8,6 +8,7 @@
             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>
@@ -21,6 +22,7 @@
             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>
@@ -38,7 +40,7 @@
         </el-button>
       </template>
     </avue-crud>
-    <PreviewImage :visible="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
+    <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
   </div>
 </template>
 
@@ -122,6 +124,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    isImage: {
+      type: Boolean,
+      default: false,
+    },
   },
   created() {},
   methods: {
@@ -239,6 +245,17 @@ export default {
       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>

+ 33 - 25
src/views/claimSettlement/detailsPage.vue

@@ -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>
@@ -161,16 +160,16 @@ export default {
               },
             ],
           },
-           {
+          {
             label: "规格型号",
             prop: "tyreSpecs",
           },
-           {
+          {
             label: "轮胎数量",
             prop: "tireQuantity",
-            type:'number',
-            controls:false,
-            precision:0,
+            type: "number",
+            controls: false,
+            precision: 0,
             rules: [
               {
                 required: true,
@@ -436,18 +435,26 @@ 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 != 4) return this.$message.error("请上传4张图片");
+            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 == "撤销审批") {
@@ -474,6 +481,7 @@ export default {
       this.$refs.form.validate((valid, done) => {
         done();
         if (valid) {
+          if (this.form.claimAttachmentList.length != 4) return this.$message.error("请上传4张图片");
           const loading = this.$loading({
             lock: true,
             text: "加载中",

+ 2 - 2
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>

+ 48 - 16
src/views/store/detailsPage.vue

@@ -43,7 +43,7 @@
         </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>
           </template>
@@ -604,7 +604,7 @@ export default {
             dicData: [],
             dataType: "string",
             type: "cascader",
-            emitPath:false,
+            emitPath: false,
             props: {
               label: "name",
               value: "code",
@@ -761,20 +761,48 @@ 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();
+      this.$message.success("上传后的方法");
+    },
+    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 == "审批") {
@@ -834,8 +862,8 @@ export default {
           this.form.deliveryWarehouseName = null;
         }
       }
-      if(name=='label'){
-        this.form.label=row.names
+      if (name == "label") {
+        this.form.label = row.names;
       }
     },
     // 启用或禁用
@@ -1011,8 +1039,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,