Parcourir la source

修改附件 品牌管理 客户信息

Qukatie il y a 8 mois
Parent
commit
eb8039145a

+ 2 - 1
README.md

@@ -16,7 +16,8 @@ lodash.js
 
 github访问不了,看这个例子就行
 
-
+# 强烈建议不要用直接使用 cnpm 安装,会有各种诡异的 bug,可以通过重新指定 registry 来解决 npm 安装速度慢的问题。
+npm install --registry=https://registry.npmmirror.com
 
 ## 版权声明
 

+ 2 - 1
package-lock.json

@@ -15835,7 +15835,8 @@
       "dependencies": {
         "ansi-regex": {
           "version": "5.0.0",
-          "resolved": "",
+          "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.0.tgz",
+          "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
           "dev": true
         },
         "cliui": {

+ 16 - 1
src/components/annex/main.vue

@@ -13,7 +13,7 @@
                             (res, file) => {
                                 handleSucces(row, res, file);
                             }
-                        " :headers="headers" :disabled="disabled" :show-file-list="false" :limit="1">
+                        " :headers="headers" :disabled="disabled" :show-file-list="false" :limit="1" :before-upload="beforeUpload">
                             <el-button size="small" type="text" :disabled="browseStatus">点击上传</el-button>
                         </el-upload>
                     </div>
@@ -58,6 +58,21 @@ export default {
         );
     },
     methods: {
+        beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
         cellStyle() {
             return "padding:0;height:40px;";
         },

+ 196 - 310
src/components/upload/index.vue

@@ -1,85 +1,37 @@
 <template>
   <div>
     <basic-container v-if="!basic">
-      <avue-crud
-          :data="data"
-          ref="crud"
-          :option="option"
-          :key="key"
-          @resetColumn="resetColumn"
-          @saveColumn="saveColumn"
-      >
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
+        @saveColumn="saveColumn">
         <template slot="menuLeft">
-          <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-edit"
-              @click="addDetail"
-              :disabled="disabled"
-              v-if="display"
-          >上传
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled"
+            v-if="display">上传
           </el-button>
           <slot name="c_button"></slot>
         </template>
         <template slot="url" slot-scope="{ row }">
-          <el-input
-              placeholder="请输入内容"
-              size="small"
-              v-if="row.$cellEdit"
-              v-model="row.url"
-              class="input-with-select"
-          >
-            <el-button slot="append" @click="singleLineUpload(row)"
-            >附件</el-button
-            >
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
           </el-input>
           <span v-else>{{ row.url }}</span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-              icon="el-icon-download"
-              :size="scope.size"
-              :type="scope.type"
-              @click="download(scope)"
-          >查看
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-edit"
-              @click.stop="rowCell(scope.row, scope.index)"
-              :disabled="disabled"
-          >
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
+            @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
             {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-delete"
-              @click.stop="rowDel(scope.row, scope.index)"
-              :disabled="disabled"
-          >删除
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
+            @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog
-          title="上传附件"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            ref="upload"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :on-success="onSuccess"
-            multiple
-        >
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center" ref="upload"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :on-success="onSuccess" multiple
+          :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -87,23 +39,11 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          title="修改附件"
-          append-to-body
-          :visible.sync="excelTwo"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :show-file-list="false"
-            :on-success="onSuccessTwo"
-        >
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
+          :on-success="onSuccessTwo" :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -111,7 +51,7 @@
           </div>
         </el-upload>
       </el-dialog>
-        <!--之前的查看图片弹窗-->
+      <!--之前的查看图片弹窗-->
       <!--<el-dialog-->
       <!--    width="80%"-->
       <!--    title="附件"-->
@@ -124,91 +64,38 @@
       <!--  </div>-->
       <!--</el-dialog>-->
 
-        <!--  新的查看图片弹窗-->
-        <PreviewImage
-            :visible.sync="innerVisible"
-            :currentIndex="0"
-            :previewImgList="[imgUrl]"
-        />
+      <!--  新的查看图片弹窗-->
+      <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
     </basic-container>
     <span v-else-if="true">
-      <avue-crud
-          :data="data"
-          ref="crud"
-          :option="option"
-          :key="key"
-          @resetColumn="resetColumn"
-          @saveColumn="saveColumn"
-      >
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
+        @saveColumn="saveColumn">
         <template slot="menuLeft">
-          <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-edit"
-              @click="addDetail"
-              :disabled="disabled"
-          >上传
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled">上传
           </el-button>
         </template>
         <template slot="url" slot-scope="{ row }">
-          <el-input
-              placeholder="请输入内容"
-              size="small"
-              v-if="row.$cellEdit"
-              v-model="row.url"
-              class="input-with-select"
-          >
-            <el-button slot="append" @click="singleLineUpload(row)"
-            >附件</el-button
-            >
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
           </el-input>
           <span v-else>{{ row.url }}</span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-              icon="el-icon-download"
-              :size="scope.size"
-              :type="scope.type"
-              @click="download(scope)"
-          >查看
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-edit"
-              @click.stop="rowCell(scope.row, scope.index)"
-              :disabled="disabled"
-          >
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
+            @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
             {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-delete"
-              @click.stop="rowDel(scope.row, scope.index)"
-              :disabled="disabled"
-          >删除
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
+            @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog
-          title="上传附件"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            ref="upload"
-            :action="action"
-            :headers="headers"
-            :on-success="onSuccess"
-            multiple
-        >
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center" ref="upload" :action="action" :headers="headers"
+          :on-success="onSuccess" multiple :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -216,23 +103,11 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          title="修改附件"
-          append-to-body
-          :visible.sync="excelTwo"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :show-file-list="false"
-            :on-success="onSuccessTwo"
-        >
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
+          :on-success="onSuccessTwo" :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -240,7 +115,7 @@
           </div>
         </el-upload>
       </el-dialog>
-        <!--之前的查看图片弹窗-->
+      <!--之前的查看图片弹窗-->
       <!--<el-dialog-->
       <!--    width="80%"-->
       <!--    title="附件"-->
@@ -254,26 +129,22 @@
       <!--</el-dialog>-->
 
       <!--  新的查看图片弹窗-->
-        <PreviewImage
-            :visible.sync="innerVisible"
-            :currentIndex="0"
-            :previewImgList="[imgUrl]"
-        />
+      <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
     </span>
   </div>
 </template>
 
 <script>
 import { getToken } from "@/util/auth";
-import {LTfujianDelete, sharedDeletion} from "@/api/user";
+import { LTfujianDelete, sharedDeletion } from "@/api/user";
 import option from "@/views/exportTrade/customerInquiry/config/mainList.json";
 import { gainUser } from "@/api/basicData/customerInquiry";
 import { updateListRemove } from "@/api/uploadFile/upload-file";
-import {deleteImg} from "../../api/basicData/EquipmentArchives";
+import { deleteImg } from "../../api/basicData/EquipmentArchives";
 import PreviewImage from '@/components/PreviewImage/index.vue'
 export default {
   name: "index",
-    components:{PreviewImage},
+  components: { PreviewImage },
   props: {
     data: {
       type: Object
@@ -310,7 +181,7 @@ export default {
       action: "/api/blade-resource/oss/endpoint/put-file",
       headers: { "Blade-Auth": "Bearer " + getToken() },
       option: {},
-      key:0,
+      key: 0,
       originalOptions: {
         dialogDrag: true,
         index: true,
@@ -335,7 +206,7 @@ export default {
             prop: "url",
             index: 2,
             overHidden: true
-          },{
+          }, {
             type: "select",
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
             props: {
@@ -383,7 +254,7 @@ export default {
             prop: "url",
             index: 2,
             overHidden: true
-          },{
+          }, {
             type: "select",
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
             props: {
@@ -407,55 +278,55 @@ export default {
           }
         ]
       },
-        // 基础信息轮胎附件
-        originalOptionsTwo_LT: {
-            dialogDrag: true,
-            index: true,
-            refreshBtn: false,
-            cellBtn: false,
-            cancelBtn: false,
-            delBtn: false,
-            editBtn: false,
-            addBtn: false,
-            align: "center",
-            column: [
-                {
-                    label: "文件名称",
-                    prop: "fileName",
-                    index: 1,
-                    width: 140,
-                    cell: true,
-                    overHidden: true
-                },
-                {
-                    label: "文件地址",
-                    prop: "url",
-                    index: 2,
-                    overHidden: true
-                },{
-                    type: "select",
-                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
-                    props: {
-                        label: "dictValue",
-                        value: "dictKey"
-                    },
-                    label: "文件属性",
-                    prop: "mainImage",
-                    search: false,
-                    index: 3,
-                    width: 140,
-                    overHidden: true,
-                    cell: true,
-                },
-                {
-                    label: "备注",
-                    prop: "remarks",
-                    index: 4,
-                    cell: true,
-                    overHidden: true
-                }
-            ]
-        },
+      // 基础信息轮胎附件
+      originalOptionsTwo_LT: {
+        dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "文件名称",
+            prop: "fileName",
+            index: 1,
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            index: 2,
+            overHidden: true
+          }, {
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            label: "文件属性",
+            prop: "mainImage",
+            search: false,
+            index: 3,
+            width: 140,
+            overHidden: true,
+            cell: true,
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
       originalOptionsThree: {
         dialogDrag: true,
         index: true,
@@ -490,47 +361,47 @@ export default {
           }
         ]
       },
-        originalOptionsThree_HW: {
-            dialogDrag: true,
-            index: true,
-            refreshBtn: false,
-            cellBtn: false,
-            cancelBtn: false,
-            delBtn: false,
-            editBtn: false,
-            addBtn: false,
-            align: "center",
-            column: [
-                {
-                    label: "花纹名称",
-                    prop: "figure",
-                    index: 1,
-                    cell: true,
-                    overHidden: true
-                },
-                {
-                    label: "文件名称",
-                    prop: "fileName",
-                    index: 1,
-                    width: 140,
-                    cell: true,
-                    overHidden: true
-                },
-                {
-                    label: "文件地址",
-                    prop: "url",
-                    index: 2,
-                    overHidden: true
-                },
-                {
-                    label: "备注",
-                    prop: "remarks",
-                    index: 4,
-                    cell: true,
-                    overHidden: true
-                }
-            ]
-        },
+      originalOptionsThree_HW: {
+        dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "花纹名称",
+            prop: "figure",
+            index: 1,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件名称",
+            prop: "fileName",
+            index: 1,
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            index: 2,
+            overHidden: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
       uploadCount: 0
     };
   },
@@ -549,10 +420,10 @@ export default {
       this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
     } else if (this.enumerationValue === 35.1) {
       this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree);
-    }else if (this.enumerationValue === 160.1) {
-        this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
-    }else if (this.enumerationValue === 338) {
-        this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
+    } else if (this.enumerationValue === 160.1) {
+      this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
+    } else if (this.enumerationValue === 338) {
+      this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
     } else {
       this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptions);
       this.getWorkDicts("picture_type").then(res => {
@@ -571,7 +442,7 @@ export default {
        * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
        * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
        */
-      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue),this.option);
+      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue), this.option);
       if (inSave) {
         this.$message.success("保存成功");
         //关闭窗口
@@ -608,20 +479,20 @@ export default {
           this.$message.success("重置成功");
           this.$refs.crud.$refs.dialogColumn.columnBox = false;
         }
-      }else if (this.enumerationValue === 160.1) {
-          this.option = this.originalOptionsTwo_LT;
-          const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
-          if (inSave) {
-              this.$message.success("重置成功");
-              this.$refs.crud.$refs.dialogColumn.columnBox = false;
-          }
-      }else if (this.enumerationValue === 338) {
-          this.option = this.originalOptionsThree_HW;
-          const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
-          if (inSave) {
-              this.$message.success("重置成功");
-              this.$refs.crud.$refs.dialogColumn.columnBox = false;
-          }
+      } else if (this.enumerationValue === 160.1) {
+        this.option = this.originalOptionsTwo_LT;
+        const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      } else if (this.enumerationValue === 338) {
+        this.option = this.originalOptionsThree_HW;
+        const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
       } else {
         this.option = this.originalOptions;
         const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptions);
@@ -634,6 +505,21 @@ export default {
         }
       }
     },
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
     //新增上传成功
     onSuccess(response, file, fileList) {
       this.$refs.crud.rowCellAdd({
@@ -667,18 +553,18 @@ export default {
     download(scope) {
       if (scope.row.url) {
         if (
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".jpg" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".png" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".jpeg" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".JPG" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".PNG" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".JPEG"
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".jpg" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".png" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".jpeg" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".JPG" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".PNG" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".JPEG"
         ) {
           this.imgUrl = scope.row.url;
           this.innerVisible = true;
@@ -704,7 +590,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-          console.log(row,657)
+        console.log(row, 657)
         if (row.id) {
           if (this.typeUpload == "CK") {
             updateListRemove(row.id, this.deleteUrl).then(res => {
@@ -713,15 +599,15 @@ export default {
                 this.data.splice(index, 1);
               }
             });
-          }else if (this.typeUpload == "LT") {
-              LTfujianDelete({ids:row.id}).then(res=>{
-                  if (res.data.success) {
-                      this.$message.success("操作成功!");
-                      this.data.splice(index, 1);
-                  }
-              })
+          } else if (this.typeUpload == "LT") {
+            LTfujianDelete({ ids: row.id }).then(res => {
+              if (res.data.success) {
+                this.$message.success("操作成功!");
+                this.data.splice(index, 1);
+              }
+            })
           } else if (this.typeUpload == "SBDAFJ") {
-            deleteImg({ids:row.id}).then(res=>{
+            deleteImg({ ids: row.id }).then(res => {
               if (res.data.success) {
                 this.$message.success("操作成功!");
                 this.data.splice(index, 1);

+ 77 - 195
src/components/uploadTwo/index.vue

@@ -1,85 +1,37 @@
 <template>
   <div>
     <basic-container v-if="!basic">
-      <avue-crud
-          :data="data"
-          ref="crud"
-          :option="option"
-          :key="key"
-          @resetColumn="resetColumn"
-          @saveColumn="saveColumn"
-      >
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
+        @saveColumn="saveColumn">
         <template slot="menuLeft">
-          <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-edit"
-              @click="addDetail"
-              :disabled="disabled"
-              v-if="display"
-          >上传
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled"
+            v-if="display">上传
           </el-button>
           <slot name="c_button"></slot>
         </template>
         <template slot="url" slot-scope="{ row }">
-          <el-input
-              placeholder="请输入内容"
-              size="small"
-              v-if="row.$cellEdit"
-              v-model="row.url"
-              class="input-with-select"
-          >
-            <el-button slot="append" @click="singleLineUpload(row)"
-            >附件</el-button
-            >
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
           </el-input>
           <span v-else>{{ row.url }}</span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-              icon="el-icon-download"
-              :size="scope.size"
-              :type="scope.type"
-              @click="download(scope)"
-          >查看
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-edit"
-              @click.stop="rowCell(scope.row, scope.index)"
-              :disabled="disabled"
-          >
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
+            @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
             {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-delete"
-              @click.stop="rowDel(scope.row, scope.index)"
-              :disabled="disabled"
-          >删除
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
+            @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog
-          title="上传附件"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            ref="upload"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :on-success="onSuccess"
-            multiple
-        >
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center" ref="upload"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :on-success="onSuccess" multiple
+          :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -87,23 +39,11 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          title="修改附件"
-          append-to-body
-          :visible.sync="excelTwo"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :show-file-list="false"
-            :on-success="onSuccessTwo"
-        >
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
+          :on-success="onSuccessTwo" :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -111,96 +51,41 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          width="80%"
-          title="附件"
-          :visible.sync="innerVisible"
-          :close-on-click-modal="false"
-          append-to-body
-      >
+      <el-dialog width="80%" title="附件" :visible.sync="innerVisible" :close-on-click-modal="false" append-to-body>
         <div style="width: 50%;height: 50%;margin: 0 auto">
           <img :src="imgUrl" alt="" style="width: 100%;height: 100%;" />
         </div>
       </el-dialog>
     </basic-container>
     <span v-else-if="true">
-      <avue-crud
-          :data="data"
-          ref="crud"
-          :option="option"
-          :key="key"
-          @resetColumn="resetColumn"
-          @saveColumn="saveColumn"
-      >
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
+        @saveColumn="saveColumn">
         <template slot="menuLeft">
-          <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-edit"
-              @click="addDetail"
-              :disabled="disabled"
-          >上传
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled">上传
           </el-button>
         </template>
         <template slot="url" slot-scope="{ row }">
-          <el-input
-              placeholder="请输入内容"
-              size="small"
-              v-if="row.$cellEdit"
-              v-model="row.url"
-              class="input-with-select"
-          >
-            <el-button slot="append" @click="singleLineUpload(row)"
-            >附件</el-button
-            >
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
           </el-input>
           <span v-else>{{ row.url }}</span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-              icon="el-icon-download"
-              :size="scope.size"
-              :type="scope.type"
-              @click="download(scope)"
-          >查看
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-edit"
-              @click.stop="rowCell(scope.row, scope.index)"
-              :disabled="disabled"
-          >
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
+            @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
             {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button
-              :type="scope.type"
-              :size="scope.size"
-              icon="el-icon-delete"
-              @click.stop="rowDel(scope.row, scope.index)"
-              :disabled="disabled"
-          >删除
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
+            @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog
-          title="上传附件"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            ref="upload"
-            :action="action"
-            :headers="headers"
-            :on-success="onSuccess"
-            multiple
-        >
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center" ref="upload" :action="action" :headers="headers"
+          :on-success="onSuccess" multiple :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -208,23 +93,11 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          title="修改附件"
-          append-to-body
-          :visible.sync="excelTwo"
-          width="555px"
-          :close-on-click-modal="false"
-          v-dialog-drag
-      >
-        <el-upload
-            class="upload-demo"
-            drag
-            style="text-align: center"
-            :action="incomingAction ? incomingAction : action"
-            :headers="headers"
-            :show-file-list="false"
-            :on-success="onSuccessTwo"
-        >
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
+        v-dialog-drag>
+        <el-upload class="upload-demo" drag style="text-align: center"
+          :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
+          :on-success="onSuccessTwo" :before-upload="beforeUpload">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -232,13 +105,7 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog
-          width="80%"
-          title="附件"
-          :visible.sync="innerVisible"
-          :close-on-click-modal="false"
-          append-to-body
-      >
+      <el-dialog width="80%" title="附件" :visible.sync="innerVisible" :close-on-click-modal="false" append-to-body>
         <div style="width: 50%;height: 50%;margin: 0 auto">
           <img :src="imgUrl" alt="" style="width: 100%;height: 100%;" />
         </div>
@@ -249,7 +116,7 @@
 
 <script>
 import { getToken } from "@/util/auth";
-import {LTfujianDelete, sharedDeletion} from "@/api/user";
+import { LTfujianDelete, sharedDeletion } from "@/api/user";
 import option from "@/views/exportTrade/customerInquiry/config/mainList.json";
 import { gainUser } from "@/api/basicData/customerInquiry";
 import { updateListRemove } from "@/api/uploadFile/upload-file";
@@ -291,7 +158,7 @@ export default {
       action: "/api/blade-resource/oss/endpoint/put-file",
       headers: { "Blade-Auth": "Bearer " + getToken() },
       option: {},
-      key:0,
+      key: 0,
       originalOptions: {
         dialogDrag: true,
         index: true,
@@ -316,7 +183,7 @@ export default {
             prop: "url",
             index: 2,
             overHidden: true
-          },{
+          }, {
             type: "select",
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=facility_img",
             props: {
@@ -364,7 +231,7 @@ export default {
             prop: "url",
             index: 2,
             overHidden: true
-          },{
+          }, {
             type: "select",
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=facility_img",
             props: {
@@ -459,7 +326,7 @@ export default {
        * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
        * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
        */
-      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue),this.option);
+      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue), this.option);
       if (inSave) {
         this.$message.success("保存成功");
         //关闭窗口
@@ -508,6 +375,21 @@ export default {
         }
       }
     },
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
     //新增上传成功
     onSuccess(response, file, fileList) {
       this.$refs.crud.rowCellAdd({
@@ -541,14 +423,14 @@ export default {
     download(scope) {
       if (scope.row.url) {
         if (
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".jpg" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".png" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".JPG" ||
-            scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-            ".PNG"
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".jpg" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".png" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".JPG" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
+          ".PNG"
         ) {
           this.imgUrl = scope.row.url;
           this.innerVisible = true;
@@ -582,13 +464,13 @@ export default {
                 this.data.splice(index, 1);
               }
             });
-          }else if (this.typeUpload == "LT") {
-              LTfujianDelete({ids:row.id}).then(res=>{
-                  if (res.data.success) {
-                      this.$message.success("操作成功!");
-                      this.data.splice(index, 1);
-                  }
-              })
+          } else if (this.typeUpload == "LT") {
+            LTfujianDelete({ ids: row.id }).then(res => {
+              if (res.data.success) {
+                this.$message.success("操作成功!");
+                this.data.splice(index, 1);
+              }
+            })
           } else {
             sharedDeletion(this.deleteUrl, row.id).then(res => {
               if (res.data.success) {

+ 16 - 0
src/views/agreementManagement/storageFeeAgreement/index.vue

@@ -801,6 +801,7 @@
                   :disabled="browseStatus"
                   :show-file-list="false"
                   :limit="1"
+                  :before-upload="beforeUpload"
               >
                 <el-button size="small" type="text" :disabled="browseStatus"
                 >点击上传
@@ -1287,6 +1288,21 @@ export default {
         this.$refs[ref].$refs.dialogColumn.columnBox = false;
       }
     },
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
     full() {
       this.dialogFull = !this.dialogFull
     },

+ 175 - 194
src/views/basicData/landTransportation/driverInformation/index.vue

@@ -1,117 +1,85 @@
 <template>
-<div>
-  <basic-container>
-    <avue-crud
-        ref="crud"
-        :data="dataList"
-        :option="option"
-        v-model="form"
-        :table-loading="loading"
-        :page.sync="page"
-        @on-load="onLoad"
-        @row-del="rowDel"
-        @search-change="searchChange"
-        @row-update="rowUpdate"
-        :before-open="beforeOpen"
-        @search-criteria-switch="searchCriteriaSwitch"
-        @row-save="rowSave">
-      <template slot="menuLeft">
-        <el-button type="primary"
-                   size="small"
-                   icon="el-icon-upload2"
-                   @click="handleImport">导入
-        </el-button>
-      </template>
-      <template slot="urlForm" slot-scope="{ row }">
-        <el-input
-            placeholder="文件地址"
-            size="small"
-            v-if="row.$cellEdit"
-            v-model="row.url"
-            class="input-with-select">
-          <el-button size="small" type="primary" slot="prepend" @click="download(row)">查看</el-button>
-          <el-upload
-              class="upload-demo"
-              :show-file-list="false"
-              slot="append"
-              :action="action"
-              :headers="headers"
-              :on-success="(response)=>{onSuccessTwo(response,row)}"
-              :multiple="false">
-            <el-button size="small" type="primary">上传</el-button>
-          </el-upload>
-        </el-input>
-        <span v-else>{{ row.url }}</span>
-      </template>
-      <template slot-scope="scope" slot="fleetIdForm">
-        <crop-select corpType="CD" v-model="form.fleetId"/>
-      </template>
-      <template slot-scope="scope" slot="fleetIdSearch">
-        <crop-select corpType="CD" v-model="scope.row.fleetId"/>
-      </template>
-      <template slot-scope="scope" slot="fleetId">
-        <span>{{scope.row.fleetName}}</span>
-      </template>
-      <template slot-scope="{type,size,row}" slot="menu">
-        <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
-      </template>
-    </avue-crud>
-    <el-dialog
-        title="创建用户"
-        :visible.sync="dialogVisible"
-        append-to-body
-        width="60%">
-      <avue-form ref="formData" v-model="formData" :option="optionData">
-
-      </avue-form>
-      <span slot="footer" class="dialog-footer">
-    <el-button @click="dialogVisible = false">取 消</el-button>
-    <el-button type="primary" @click="confirmSynchronization">确 定</el-button>
-  </span>
-    </el-dialog>
-    <el-dialog title="导入"
-               append-to-body
-               :visible.sync="excelBox"
-               width="555px">
-      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
-        <template slot="excelTemplate">
-          <el-button type="primary" @click="handleTemplate">
-            点击下载<i class="el-icon-download el-icon--right"></i>
+  <div>
+    <basic-container>
+      <avue-crud ref="crud" :data="dataList" :option="option" v-model="form" :table-loading="loading" :page.sync="page"
+        @on-load="onLoad" @row-del="rowDel" @search-change="searchChange" @row-update="rowUpdate"
+        :before-open="beforeOpen" @search-criteria-switch="searchCriteriaSwitch" @row-save="rowSave">
+        <template slot="menuLeft">
+          <el-button type="primary" size="small" icon="el-icon-upload2" @click="handleImport">导入
           </el-button>
         </template>
-      </avue-form>
-      <p style="text-align: center;color: #DC0505">
-        温馨提示 第一次导入时请先下载模板
-      </p>
-    </el-dialog>
-  </basic-container>
-</div>
+        <template slot="urlForm" slot-scope="{ row }">
+          <el-input placeholder="文件地址" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button size="small" type="primary" slot="prepend" @click="download(row)">查看</el-button>
+            <el-upload class="upload-demo" :show-file-list="false" slot="append" :action="action" :headers="headers"
+              :on-success="(response) => { onSuccessTwo(response, row) }" :multiple="false" :before-upload="beforeUpload">
+              <el-button size="small" type="primary">上传</el-button>
+            </el-upload>
+          </el-input>
+          <span v-else>{{ row.url }}</span>
+        </template>
+        <template slot-scope="scope" slot="fleetIdForm">
+          <crop-select corpType="CD" v-model="form.fleetId" />
+        </template>
+        <template slot-scope="scope" slot="fleetIdSearch">
+          <crop-select corpType="CD" v-model="scope.row.fleetId" />
+        </template>
+        <template slot-scope="scope" slot="fleetId">
+          <span>{{ scope.row.fleetName }}</span>
+        </template>
+        <template slot-scope="{type,size,row}" slot="menu">
+          <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
+        </template>
+      </avue-crud>
+      <el-dialog title="创建用户" :visible.sync="dialogVisible" append-to-body width="60%">
+        <avue-form ref="formData" v-model="formData" :option="optionData">
+
+        </avue-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="confirmSynchronization">确 定</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog title="导入" append-to-body :visible.sync="excelBox" width="555px">
+        <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+          <template slot="excelTemplate">
+            <el-button type="primary" @click="handleTemplate">
+              点击下载<i class="el-icon-download el-icon--right"></i>
+            </el-button>
+          </template>
+        </avue-form>
+        <p style="text-align: center;color: #DC0505">
+          温馨提示 第一次导入时请先下载模板
+        </p>
+      </el-dialog>
+    </basic-container>
+  </div>
 </template>
 
 <script>
-import {getToken} from "@/util/auth";
+import { getToken } from "@/util/auth";
 import {
   saveDelegationList,
   removeDelegationList,
   selectInvoiceList,
-  detailDelegationList, removeFile,driverUser
+  detailDelegationList, removeFile, driverUser
 } from "@/api/landTransportation/driver";
 import website from "@/config/website";
-import {getRoleTree} from "@/api/system/role";
-import {getDeptTree} from "@/api/system/dept";
-import {getPostList} from "@/api/system/post";
+import { getRoleTree } from "@/api/system/role";
+import { getDeptTree } from "@/api/system/dept";
+import { getPostList } from "@/api/system/post";
 export default {
   name: "index",
-  data(){
-    return{
-      form:{},
-      formRow:{},
-      dataList:[],
-      formData:{},
-      optionData:{
-        span:8,
-        menuBtn:false,
-        column:[{
+  data() {
+    return {
+      form: {},
+      formRow: {},
+      dataList: [],
+      formData: {},
+      optionData: {
+        span: 8,
+        menuBtn: false,
+        column: [{
           label: "所属角色",
           prop: "roleId",
           multiple: true,
@@ -127,7 +95,7 @@ export default {
             message: "请选择所属角色",
             trigger: "click"
           }]
-        },{
+        }, {
           label: "所属部门",
           prop: "deptId",
           type: "tree",
@@ -144,22 +112,22 @@ export default {
             trigger: "click"
           }]
         },
-          {
-            label: "所属岗位",
-            prop: "postId",
-            type: "tree",
-            multiple: true,
-            dicData: [],
-            props: {
-              label: "postName",
-              value: "id"
-            },
-            rules: [{
-              required: true,
-              message: "请选择所属岗位",
-              trigger: "click"
-            }],
-          }]
+        {
+          label: "所属岗位",
+          prop: "postId",
+          type: "tree",
+          multiple: true,
+          dicData: [],
+          props: {
+            label: "postName",
+            value: "id"
+          },
+          rules: [{
+            required: true,
+            message: "请选择所属岗位",
+            trigger: "click"
+          }],
+        }]
       },
       excelOption: {
         submitBtn: false,
@@ -196,7 +164,7 @@ export default {
             prop: 'excelTemplate',
             formslot: true,
             span: 24,
-          },{
+          }, {
             label: '模板上传',
             prop: 'excelFile',
             type: 'upload',
@@ -211,27 +179,27 @@ export default {
           }
         ]
       },
-      excelForm:{},
-      dialogVisible:false,
-      loading:false,
+      excelForm: {},
+      dialogVisible: false,
+      loading: false,
       page: {
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,50,100,200,300]
+        pageSizes: [10, 50, 100, 200, 300]
       },
-      excelBox:false,
+      excelBox: false,
       action: "/api/blade-resource/oss/endpoint/put-file",
       headers: { "Blade-Auth": "Bearer " + getToken() },
-      option:{
-        align:'center',
-        dialogWidth:'85%',
+      option: {
+        align: 'center',
+        dialogWidth: '85%',
         index: true,
         searchIcon: true,
         searchIndex: 2,
-        searchLabelWidth:100,
-        searchSpan:8,
-        column:[{
+        searchLabelWidth: 100,
+        searchSpan: 8,
+        column: [{
           label: '司机姓名',
           prop: 'name',
           index: 1,
@@ -239,16 +207,16 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
-          allowCreate:true,
+          search: true,
+          allowCreate: true,
           type: 'select',
-          filterable:true,
+          filterable: true,
           dicUrl: "/api/blade-client/land-driver/driver-list",
           props: {
             label: "name",
             value: "name"
           },
-        },{
+        }, {
           label: '身份证号',
           prop: 'idCard',
           index: 1,
@@ -256,8 +224,8 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
-        },{
+          search: true,
+        }, {
           label: '准驾车型',
           prop: 'permitModel',
           index: 1,
@@ -265,8 +233,8 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
-        },{
+          search: true,
+        }, {
           label: '电话',
           prop: 'tel',
           index: 1,
@@ -274,13 +242,13 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
+          search: true,
           rules: [{
             required: true,
             message: " ",
             trigger: "blur"
           }]
-        },{
+        }, {
           label: '所属车队',
           prop: 'fleetId',
           index: 1,
@@ -288,13 +256,13 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
+          search: true,
           rules: [{
-              required: true,
-              message: " ",
-              trigger: "blur"
+            required: true,
+            message: " ",
+            trigger: "blur"
           }]
-        },{
+        }, {
           label: '性别',
           prop: 'sex',
           index: 1,
@@ -302,7 +270,7 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
+          search: true,
           type: 'select',
           dicUrl: "/api/blade-system/dict/dictionary?code=sex",
           props: {
@@ -310,7 +278,7 @@ export default {
             value: "dictKey"
           },
           dataType: "number",
-        },{
+        }, {
           label: '驾驶证有效期',
           prop: 'driveExpire',
           type: "date",
@@ -323,7 +291,7 @@ export default {
           valueFormat: "yyyy-MM-dd HH:mm:ss",
           index: 1,
           width: 140,
-        },{
+        }, {
           label: '资格证证件号',
           prop: 'qualifiedNo',
           index: 1,
@@ -331,8 +299,8 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
-        },{
+          search: true,
+        }, {
           label: '资格证有效期',
           prop: 'qualifiedExpire',
           type: "date",
@@ -345,7 +313,7 @@ export default {
           valueFormat: "yyyy-MM-dd HH:mm:ss",
           index: 1,
           width: 140
-        },{
+        }, {
           label: '押运证证件号',
           prop: 'escortNo',
           index: 1,
@@ -353,8 +321,8 @@ export default {
           span: 8,
           cell: true,
           overHidden: true,
-          search:true,
-        },{
+          search: true,
+        }, {
           label: '押运证有效期',
           prop: 'escortExpire',
           type: "date",
@@ -379,26 +347,26 @@ export default {
             label: "dictValue",
             value: "dictKey"
           },
-        },{
+        }, {
           label: '附件',
           prop: 'fileList',
           type: 'dynamic',
-          span:24,
-          hide:true,
-          showColumn:false,
+          span: 24,
+          hide: true,
+          showColumn: false,
           children: {
             align: 'center',
             headerAlign: 'center',
-            rowAdd:(done)=>{
+            rowAdd: (done) => {
               // this.$message.success('新增回调');
               done()
             },
-            rowDel:(row,done)=>{
+            rowDel: (row, done) => {
               if (row.id) {
-                removeFile(row.id).then(res=>{
+                removeFile(row.id).then(res => {
                   done();
                 })
-              }else {
+              } else {
                 done();
               }
             },
@@ -411,7 +379,7 @@ export default {
               label: '文件名称',
               prop: "fileName",
               formslot: true
-            },{
+            }, {
               width: 200,
               label: '文件属性',
               type: "select",
@@ -435,13 +403,28 @@ export default {
       if (item.search) i++
     })
     this.initData(JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id)
-    if (i % 3 !== 0){
+    if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
     }
   },
-  methods:{
+  methods: {
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
     handleImport() {
       this.excelBox = true;
     },
@@ -457,7 +440,7 @@ export default {
       window.open(`/api/blade-client/land-driver/import-template?${this.website.tokenHeader}=${getToken()}`);
     },
     //确认创建用户
-    confirmSynchronization(){
+    confirmSynchronization() {
       this.$refs['formData'].validate((valid, done) => {
         done()
         if (valid) {
@@ -467,8 +450,8 @@ export default {
           data.postId = data.postId.join(",");
           driverUser({
             ...data,
-            id:this.formRow.id
-          }).then(res=>{
+            id: this.formRow.id
+          }).then(res => {
             this.dialogVisible = false
             this.$message.success('创建用户成功,默认帐号:司机名称。默认密码:123456');
           })
@@ -477,13 +460,13 @@ export default {
         }
       });
     },
-    creatingUsers(row){
+    creatingUsers(row) {
       console.log(row)
-      if (row.tel){
+      if (row.tel) {
         this.dialogVisible = true
         this.formData = {}
         this.formRow = row
-      }else {
+      } else {
         this.$message.error('请输入手机号');
       }
     },
@@ -502,31 +485,31 @@ export default {
       });
     },
     // 获得高度
-    searchCriteriaSwitch(type){
-      if (type){
+    searchCriteriaSwitch(type) {
+      if (type) {
         this.option.height = this.option.height - 138
-      }else {
+      } else {
         this.option.height = this.option.height + 138
       }
       this.$refs.crud.getTableHeight()
     },
     //附件上传成功
-    onSuccessTwo(response,row){
+    onSuccessTwo(response, row) {
       row.url = response.data.link
       row.fileName = response.data.originalName
     },
     //下载附件
-    download(row){
-      if (row.url){
+    download(row) {
+      if (row.url) {
         window.open(row.url)
-      }else {
+      } else {
         this.$message.warning('无附件,请上传附件后再查看');
       }
     },
     //新增
-    rowSave(row,done,loading){
+    rowSave(row, done, loading) {
       console.log(row)
-      saveDelegationList(row).then(res=>{
+      saveDelegationList(row).then(res => {
         this.$message.success('保存成功');
         this.onLoad(this.page)
         done()
@@ -536,19 +519,19 @@ export default {
       })
     },
     //点击行编辑时查看
-    beforeOpen(done,type){
-      if (this.form.id){
-        detailDelegationList(this.form.id).then(res=>{
+    beforeOpen(done, type) {
+      if (this.form.id) {
+        detailDelegationList(this.form.id).then(res => {
           this.form = res.data.data
           done()
         })
-      }else {
+      } else {
         done()
       }
     },
     //修改
-    rowUpdate(row,index,done,loading){
-      saveDelegationList(row).then(res=>{
+    rowUpdate(row, index, done, loading) {
+      saveDelegationList(row).then(res => {
         this.$message.success('保存成功');
         this.onLoad(this.page)
         loading();
@@ -575,17 +558,17 @@ export default {
       })
     },
     //搜索
-    searchChange(params,done) {
+    searchChange(params, done) {
       let data = params
-      if (data.driveExpire){
+      if (data.driveExpire) {
         data.beginDriveExpire = data.driveExpire[0]
         data.endDriveExpire = data.driveExpire[1]
       }
-      if (data.qualifiedExpire){
+      if (data.qualifiedExpire) {
         data.beginQualifiedExpire = data.qualifiedExpire[0]
         data.endQualifiedExpire = data.qualifiedExpire[1]
       }
-      if (data.escortExpire){
+      if (data.escortExpire) {
         data.beginEscortExpire = data.escortExpire[0]
         data.endEscortExpire = data.escortExpire[1]
       }
@@ -593,17 +576,17 @@ export default {
       delete data.qualifiedExpire
       delete data.escortExpire
       this.query = data
-      this.onLoad(this.page,data)
+      this.onLoad(this.page, data)
       done();
     },
     //列表删除
-    rowDel(row){
+    rowDel(row) {
       this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        removeDelegationList({ids:row.id}).then(res=>{
+        removeDelegationList({ ids: row.id }).then(res => {
           this.$message.success('删除成功');
           this.onLoad(this.page)
         })
@@ -618,6 +601,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 121 - 143
src/views/basicData/landTransportation/vehicleInformation/index.vue

@@ -1,49 +1,20 @@
 <template>
   <div>
     <basic-container>
-      <avue-crud
-          ref="crud"
-          :data="dataList"
-          :option="option"
-          :page.sync="page"
-          :search.sync="search"
-          :table-loading="loading"
-          v-model="form"
-          @on-load="onLoad"
-          @row-save="rowSave"
-          @row-update="rowUpdate"
-          @row-del="rowDel"
-          @search-change="searchChange"
-          :before-open="beforeOpen"
-          @search-reset="searchReset"
-          @refresh-change="refreshChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @search-criteria-switch="searchCriteriaSwitch"
-      >
+      <avue-crud ref="crud" :data="dataList" :option="option" :page.sync="page" :search.sync="search"
+        :table-loading="loading" v-model="form" @on-load="onLoad" @row-save="rowSave" @row-update="rowUpdate"
+        @row-del="rowDel" @search-change="searchChange" :before-open="beforeOpen" @search-reset="searchReset"
+        @refresh-change="refreshChange" @current-change="currentChange" @size-change="sizeChange"
+        @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button type="primary"
-                     size="small"
-                     icon="el-icon-upload2"
-                     @click="handleImport">导入
+          <el-button type="primary" size="small" icon="el-icon-upload2" @click="handleImport">导入
           </el-button>
         </template>
         <template slot="urlForm" slot-scope="{ row }">
-          <el-input
-              placeholder="文件地址"
-              size="small"
-              v-if="row.$cellEdit"
-              v-model="row.url"
-              class="input-with-select">
+          <el-input placeholder="文件地址" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
             <el-button size="small" type="primary" slot="prepend" @click="download(row)">查看</el-button>
-            <el-upload
-                class="upload-demo"
-                :show-file-list="false"
-                slot="append"
-                :action="action"
-                :headers="headers"
-                :on-success="(response)=>{onSuccessTwo(response,row)}"
-                :multiple="false">
+            <el-upload class="upload-demo" :show-file-list="false" slot="append" :action="action" :headers="headers"
+              :on-success="(response) => { onSuccessTwo(response, row) }" :multiple="false" :before-upload="beforeUpload">
               <el-button size="small" type="primary">上传</el-button>
             </el-upload>
           </el-input>
@@ -51,10 +22,7 @@
         </template>
         <template slot="fleetIdForm" slot-scope="{ row }">
           <span>{{ row }}</span>
-          <crop-select
-              v-model="form.fleetId"
-              corpType="CD"
-          />
+          <crop-select v-model="form.fleetId" corpType="CD" />
         </template>
         <template slot="fleetIdSearch">
           <crop-select v-model="search.fleetId" corpType="CD"></crop-select>
@@ -66,10 +34,7 @@
           <span>{{ row.driverName }}</span>
         </template>
       </avue-crud>
-      <el-dialog title="导入"
-                 append-to-body
-                 :visible.sync="excelBox"
-                 width="555px">
+      <el-dialog title="导入" append-to-body :visible.sync="excelBox" width="555px">
         <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
           <template slot="excelTemplate">
             <el-button type="primary" @click="handleTemplate">
@@ -86,8 +51,8 @@
 </template>
 
 <script>
-import {getCarList, carSubmit, carRemove, detailDelegationList, removeFile} from "@/api/landTransportation/car";
-import {getToken} from '@/util/auth';
+import { getCarList, carSubmit, carRemove, detailDelegationList, removeFile } from "@/api/landTransportation/car";
+import { getToken } from '@/util/auth';
 
 export default {
   name: "index",
@@ -164,7 +129,7 @@ export default {
           span: 8,
           searchSpan: 8,
           type: 'select',
-          filterable:true,
+          filterable: true,
           dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
           props: {
             label: "name",
@@ -418,99 +383,99 @@ export default {
           searchSpan: 8,
         },
 
-          //   {
-          //   label: '信用等级',
-          //   width: 150,
-          //   span: 8,
-          //   searchSpan: 8,
-          //   prop: 'salesman',
-          //   search: true,
-          //   overHidden: true,
-          //   type: "select",
-          //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=credit_rating",
-          //   props: {
-          //     label: "dictValue",
-          //     value: "dictKey"
-          //   },
-          // },
-          {
-            label: '附件',
-            prop: 'fileList',
-            type: 'dynamic',
-            hide: true,
-            showColumn: false,
-            span: 24,
-            children: {
-              align: 'center',
-              stripe: true,
-              headerAlign: 'center',
-              rowAdd: (done) => {
-                // this.$message.success('新增回调');
-                done()
-              },
-              rowDel: (row, done) => {
-                if (row.id) {
-                  removeFile(row.id).then(res => {
-                    done();
-                  })
-                } else {
+        //   {
+        //   label: '信用等级',
+        //   width: 150,
+        //   span: 8,
+        //   searchSpan: 8,
+        //   prop: 'salesman',
+        //   search: true,
+        //   overHidden: true,
+        //   type: "select",
+        //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=credit_rating",
+        //   props: {
+        //     label: "dictValue",
+        //     value: "dictKey"
+        //   },
+        // },
+        {
+          label: '附件',
+          prop: 'fileList',
+          type: 'dynamic',
+          hide: true,
+          showColumn: false,
+          span: 24,
+          children: {
+            align: 'center',
+            stripe: true,
+            headerAlign: 'center',
+            rowAdd: (done) => {
+              // this.$message.success('新增回调');
+              done()
+            },
+            rowDel: (row, done) => {
+              if (row.id) {
+                removeFile(row.id).then(res => {
                   done();
-                }
-              },
-              column: [{
-                width: 360,
-                label: '文件地址',
-                prop: "url"
-              }, {
-                width: 200,
-                label: '文件名称',
-                prop: "fileName",
-                formslot: true
+                })
+              } else {
+                done();
+              }
+            },
+            column: [{
+              width: 360,
+              label: '文件地址',
+              prop: "url"
+            }, {
+              width: 200,
+              label: '文件名称',
+              prop: "fileName",
+              formslot: true
+            }, {
+              width: 200,
+              label: '文件属性',
+              type: "select",
+              dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
+              props: {
+                label: "dictValue",
+                value: "dictValue"
+              }
+            }, {
+              label: '备注',
+              prop: "remarks",
+            }]
+          }
+        },
+        {
+          label: '司机变更记录',
+          prop: 'vehicleChangeList',
+          type: 'dynamic',
+          span: 24,
+          hide: true,
+          showColumn: false,
+          children: {
+            align: 'center',
+            headerAlign: 'center',
+            addBtn: false,
+            stripe: true,
+            delBtn: false,
+            cellBtn: false,
+            column: [
+              {
+                label: '司机名',
+                prop: "driverName",
+                cell: false
               }, {
-                width: 200,
-                label: '文件属性',
-                type: "select",
-                dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
-                props: {
-                  label: "dictValue",
-                  value: "dictValue"
-                }
+                label: '变更人',
+                prop: "changeUserName",
+                cell: false
               }, {
-                label: '备注',
-                prop: "remarks",
+                label: '变更日期',
+                prop: "changeTime",
+                cell: false
               }]
-            }
-          },
-          {
-            label: '司机变更记录',
-            prop: 'vehicleChangeList',
-            type: 'dynamic',
-            span: 24,
-            hide: true,
-            showColumn: false,
-            children: {
-              align: 'center',
-              headerAlign: 'center',
-              addBtn: false,
-              stripe: true,
-              delBtn: false,
-              cellBtn: false,
-              column: [
-                {
-                  label: '司机名',
-                  prop: "driverName",
-                  cell: false
-                }, {
-                  label: '变更人',
-                  prop: "changeUserName",
-                  cell: false
-                }, {
-                  label: '变更日期',
-                  prop: "changeTime",
-                  cell: false
-                }]
-            }
           }
+        }
         ]
       },
       page: {
@@ -519,11 +484,11 @@ export default {
         total: 0,
         pageSizes: [10, 50, 100, 200, 300]
       },
-      query:{},
+      query: {},
       search: {},
       loading: false,
       action: "/api/blade-resource/oss/endpoint/put-file",
-      headers: {"Blade-Auth": "Bearer " + getToken()},
+      headers: { "Blade-Auth": "Bearer " + getToken() },
       ids: [], // id集合
       form: {},
       excelBox: false
@@ -541,6 +506,21 @@ export default {
     }
   },
   methods: {
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
     handleImport() {
       this.excelBox = true;
     },
@@ -604,7 +584,7 @@ export default {
         type: "warning"
       }).then(() => {
         const ids = this.ids.length == 0 ? row.id : this.ids.join(',');
-        carRemove({ids}).then(res => {
+        carRemove({ ids }).then(res => {
           this.$message.success('删除成功');
           this.onLoad(this.page);
         })
@@ -673,6 +653,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

Fichier diff supprimé car celui-ci est trop grand
+ 245 - 585
src/views/businessManagement/proxyOrder/detailsPageEdit.vue


+ 52 - 70
src/views/tirePartsMall/basicData/brandPage/detailsPage.vue

@@ -3,26 +3,18 @@
     <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(0)">返回列表
+          @click="backToList(0)">返回列表
         </el-button>
       </div>
       <div class="add-customer-btn">
         <!--        <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"-->
         <!--                   @click="confirmEditing">编辑-->
         <!--        </el-button>-->
-        <el-button
-            class="el-button--small-yh"
-            type="primary"
-            size="small"
-            @click="editCustomer">保存数据
+        <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据
         </el-button>
-        <el-button
-            class="el-button--small-yh"
-            :type="form.enableOrNot == 0?'primary':''"
-            size="small"
-            @click="enableNot"
-            v-if="form.id">
-          {{form.enableOrNot == 0 ?'启用':'禁用'}}
+        <el-button class="el-button--small-yh" :type="form.enableOrNot == 0 ? 'primary' : ''" size="small"
+          @click="enableNot" v-if="form.id">
+          {{ form.enableOrNot == 0 ? '启用' : '禁用' }}
         </el-button>
       </div>
     </div>
@@ -30,27 +22,15 @@
       <trade-card title="基础信息">
         <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
       </trade-card>
-        <trade-card title="花纹附件信息  (图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)">
-            <c-upload
-                basic
-                :data="form.brandFigureList"
-                :disabled="disabled"
-                deleteUrl="/api/blade-sales-part/brandfigure/remove"
-                :enumerationValue="338"
-                display
-            />
-            <!-- <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span> -->
-        </trade-card>
+      <trade-card title="花纹附件信息">
+        <c-upload basic :data="form.brandFigureList" :disabled="disabled"
+          deleteUrl="/api/blade-sales-part/brandfigure/remove" :enumerationValue="338" display />
+        <!-- <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span> -->
+      </trade-card>
 
-      <trade-card title="附件信息  (图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)">
-        <c-upload
-        basic
-        :data="form.brandFilesList"
-        :disabled="disabled"
-        deleteUrl="/api/blade-sales-part/brandfiles/remove"
-        :enumerationValue="272.1"
-        display
-        />
+      <trade-card title="附件信息">
+        <c-upload basic :data="form.brandFilesList" :disabled="disabled"
+          deleteUrl="/api/blade-sales-part/brandfiles/remove" :enumerationValue="272.1" display />
         <!-- <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span> -->
       </trade-card>
     </div>
@@ -59,7 +39,7 @@
 
 <script>
 // import {submit} from "@/api/tirePartsMall/basicData/customerInformation";
-import {submit,getDetails,updateEnableOrNot} from "@/api/tirePartsMall/basicData/brandPage";
+import { submit, getDetails, updateEnableOrNot } from "@/api/tirePartsMall/basicData/brandPage";
 import it from "element-ui/src/locale/lang/it";
 export default {
   name: "detailsPage",
@@ -68,7 +48,7 @@ export default {
       disabled: false,
       form: {
         brandFilesList: [],
-          brandFigureList:[]
+        brandFigureList: []
       },
       optionForm: {
         menuBtn: false,
@@ -84,15 +64,15 @@ export default {
         }, {
           label: '制单人',
           prop: "createUserName",
-          disabled:true
+          disabled: true
         }, {
           label: '制单日期',
           prop: "createTime",
-          disabled:true
+          disabled: true
         }, {
           label: '排序',
           prop: "sort",
-          type:'number'
+          type: 'number'
         }, {
           label: '备注',
           prop: "remarks",
@@ -123,20 +103,20 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(255,255,255,0.7)'
       })
-      getDetails({id: id}).then(res => {
+      getDetails({ id: id }).then(res => {
         this.form = res.data.data
-          if (this.form.enableOrNot == 1) {
-              this.$set(this.optionForm,'disabled',true)
-          }else {
-              this.$set(this.optionForm,'disabled',false)
-          }
+        if (this.form.enableOrNot == 1) {
+          this.$set(this.optionForm, 'disabled', true)
+        } else {
+          this.$set(this.optionForm, 'disabled', false)
+        }
         loading.close();
       }).catch(() => {
         loading.close();
       })
     },
     //是否启用
-    enableNot(){
+    enableNot() {
       // const { brandFilesList, ...formWithoutBrandFilesList } = this.form;
       // const { brandFigureList, ...formWithoutbrandFigureListList } = this.form;
       const loading = this.$loading({
@@ -145,41 +125,43 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(255,255,255,0.7)'
       })
-      this.form.enableOrNot=this.form.enableOrNot == 0?1:0
-       delete this.form.brandFigureList
-       delete this.form.brandFilesList
+      this.form.enableOrNot = this.form.enableOrNot == 0 ? 1 : 0
+      delete this.form.brandFigureList
+      delete this.form.brandFilesList
       updateEnableOrNot({
         ...this.form
-      }).then(res=>{
+      }).then(res => {
         loading.close()
         this.$message.success("操作成功")
         this.refresh(this.form.id)
-      }).catch(()=>{
+      }).catch(() => {
         loading.close()
       })
     },
     //修改提交触发
     editCustomer() {
-        if (this.form.createDept && JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id.indexOf(this.form.createDept) == -1) {
-            this.$message.warning('暂无权限')
-            return
-        }
-        if (this.form.brandFigureList.length === 0 && this.form.brandFilesList.length === 0) {
-            return this.$message.error('请上传图片')
-        }
-        if (this.form.brandFilesList.length != 0) {
-            this.form.brandFilesList[0].version = '0'
-        }
-      // if (this.form.brandFilesList.length === 0){
-      //   return this.$message.error("请上传主图")
-      // }
+      if (this.form.createDept && JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id.indexOf(this.form.createDept) == -1) {
+        this.$message.warning('暂无权限')
+        return
+      }
+      if (this.form.brandFigureList.length === 0 && this.form.brandFilesList.length === 0) {
+        return this.$message.error('请上传图片')
+      }
+      if (this.form.brandFilesList.length != 0) {
+        this.form.brandFilesList[0].version = '0'
+      }
       let num = 0
-      for (let item of this.form.brandFilesList){
-        if (item.version == 0){
+      for (let item of this.form.brandFilesList) {
+        if (item.version == 0) {
           num++
         }
       }
-      if (num > 1){
+      for (let item of this.form.brandFigureList) {
+        if (this.form.brandFigureList.filter(e => e.figure == item.figure).length > 1) {
+          return this.$message.error('花纹名称'+item.figure+'不能重复!')
+        }
+      }
+      if (num > 1) {
         return this.$message.error("主图类型重复")
       }
       this.$refs["form"].validate((valid, done) => {
@@ -187,10 +169,10 @@ export default {
         if (valid) {
           this.loadingBtn = true;
           this.form.type = 'PP'
-            // 把花纹数组里的全部默认0
-            for (let item of this.form.brandFigureList) {
-                item.version = '0'
-            }
+          // 把花纹数组里的全部默认0
+          for (let item of this.form.brandFigureList) {
+            item.version = '0'
+          }
           submit({
             ...this.form
           }).then(res => {

+ 7 - 1
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -529,6 +529,7 @@ export default {
             multiple:true,
             dicUrl: '/api/blade-sales-part/brandDesc/listAllV1?type=PP',
             type:"tree",
+            dataType: "string",
             rules: [{
                       message: "请选择品牌",
                       trigger: "click"
@@ -986,7 +987,12 @@ export default {
           if(!this.form.id) {
               this.form.checkStatus = '通过'
 
-              typeof(this.form.brandId) == 'Array' ? this.form.prandId.join(',') : this.form.brandId = ''
+              // typeof(this.form.brandId) == 'Array' ? this.form.prandId.join(',') : this.form.brandId = ''
+          }
+          if(this.form.$brandId){
+            this.form.brandName=this.form.$brandId.splice('|').join(',')
+          }else{
+            this.form.brandName=null
           }
           submit({
             ...this.form,

+ 0 - 6
src/views/tradeAgency/oceanFreightImport/index.vue

@@ -400,12 +400,6 @@ export default {
                         overHidden: true
                     },
                     {
-                        label: '操作员',
-                        prop: 'operatorName',
-                        width: "80",
-                        overHidden: true
-                    },
-                    {
                         label: "创建日期",
                         prop: "createTime",
                         width: "100",

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff