Forráskód Böngészése

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

qukaidi 3 éve
szülő
commit
d4bc671dd1

+ 67 - 8
src/components/upload/index.vue

@@ -315,8 +315,7 @@ export default {
             prop: "url",
             index: 2,
             overHidden: true
-          },
-          {
+          },{
             type: "select",
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
             props: {
@@ -340,6 +339,54 @@ export default {
           }
         ]
       },
+      originalOptionsTwo: {
+        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: "version",
+            search: false,
+            index: 3,
+            width: 140,
+            overHidden: true,
+            cell: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
       uploadCount: 0
     };
   },
@@ -349,7 +396,11 @@ export default {
      * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
      * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
      */
-    this.option = await this.getColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
+    if (this.enumerationValue === 160){
+      this.option = await this.getColumnData(this.getColumnName(this.enumerationValue),this.originalOptionsTwo);
+    }else {
+      this.option = await this.getColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
+    }
     this.key++
   },
   methods: {
@@ -369,11 +420,19 @@ export default {
     },
     //自定义列重置
     async resetColumn() {
-      this.option = this.originalOptions;
-      const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
-      if (inSave) {
-        this.$message.success("重置成功");
-        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      if (this.enumerationValue === 160){
+        this.option = this.originalOptionsTwo;
+        const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue),this.originalOptionsTwo);
+        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);if (inSave) {
+          this.$message.success("重置成功");
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
       }
     },
     //新增上传成功

+ 5 - 0
src/enums/column-name.js

@@ -617,6 +617,11 @@ const columnName = [{
     code: 159,
     name: '统计分析销售对账明细'
   },
+  {
+    code: 160,
+    name: '产品信息-主图附件'
+  }
+
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 96 - 69
src/views/basicData/productInformation/detailsPageEdit.vue

@@ -3,20 +3,20 @@
     <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"
-          >返回列表
+            type="danger"
+            style="border: none;background: none;color: red"
+            icon="el-icon-arrow-left"
+            @click="backToList"
+        >返回列表
         </el-button>
       </div>
       <el-button
-        class="el-button--small-yh add-customer-btn"
-        type="primary"
-        :disabled="disabled"
-        @click="editProductInfo"
-        size="small"
-        >{{ form.id ? "确认修改" : "确认新增" }}
+          class="el-button--small-yh add-customer-btn"
+          type="primary"
+          :disabled="disabled"
+          @click="editProductInfo"
+          size="small"
+      >{{ form.id ? "确认修改" : "确认新增" }}
       </el-button>
     </div>
     <div style="margin-top: 60px">
@@ -25,107 +25,113 @@
         <avue-form ref="form" v-model="form" :option="option">
           <template slot="goodsTypeId" slot-scope="scope">
             <avue-input-tree
-              v-model="form.goodsTypeId"
-              :props="{ label: 'title', value: 'id' }"
-              multiple
-              placeholder=" "
-              type="tree"
-              :dic="dicData"
+                v-model="form.goodsTypeId"
+                :props="{ label: 'title', value: 'id' }"
+                multiple
+                placeholder=" "
+                type="tree"
+                :dic="dicData"
             />
           </template>
           <template slot="corpId" slot-scope="scope">
             <selectComponent
-              v-model="form.corpId"
-              :configuration="configuration"
-              style="width: 100%"
-              typeData="GYS"
+                v-model="form.corpId"
+                :configuration="configuration"
+                style="width: 100%"
+                typeData="GYS"
             />
           </template>
           <template slot="artsVision">
             <crop-select
-              v-model="form.artsVision"
-              @getCorpData="getCorpName"
-              @getCorpList="getCorpList"
-              corpType="GS"
-              :multiple="true"
-              :collapseTags="true"
+                v-model="form.artsVision"
+                @getCorpData="getCorpName"
+                @getCorpList="getCorpList"
+                corpType="GS"
+                :multiple="true"
+                :collapseTags="true"
             ></crop-select>
           </template>
           <template slot="brand">
             <el-select
-              v-model="form.brand"
-              clearable
-              filterable
-              placeholder="请选择 品牌"
+                v-model="form.brand"
+                clearable
+                filterable
+                placeholder="请选择 品牌"
             >
               <el-option
-                v-for="(item, index) in brandOption"
-                :key="index"
-                :label="item.dictValue"
-                :value="item.dictValue"
+                  v-for="(item, index) in brandOption"
+                  :key="index"
+                  :label="item.dictValue"
+                  :value="item.dictValue"
               />
             </el-select>
           </template>
           <template slot="cntrVolumn">
             <el-input
-              v-input-limit="2"
-              v-model="form.cntrVolumn"
-              clearable
-              placeholder="请输入 箱立方"
+                v-input-limit="2"
+                v-model="form.cntrVolumn"
+                clearable
+                placeholder="请输入 箱立方"
             ></el-input>
           </template>
           <template slot="cartonWeight">
             <el-input
-              v-input-limit="2"
-              v-model="form.cartonWeight"
-              clearable
-              placeholder="请输入 箱重量"
+                v-input-limit="2"
+                v-model="form.cartonWeight"
+                clearable
+                placeholder="请输入 箱重量"
             >
               <template slot="append">kg</template>
             </el-input>
           </template>
           <template slot="integralMultiples">
             <el-input
-              v-input-limit="2"
-              v-model="form.integralMultiples"
-              clearable
-              placeholder="请输入 积分倍数"
+                v-input-limit="2"
+                v-model="form.integralMultiples"
+                clearable
+                placeholder="请输入 积分倍数"
             ></el-input>
           </template>
           <template slot="integral">
             <el-input
-              v-input-limit="2"
-              v-model="form.integral"
-              clearable
-              placeholder="请输入 兑换积分"
+                v-input-limit="2"
+                v-model="form.integral"
+                clearable
+                placeholder="请输入 兑换积分"
             ></el-input>
           </template>
           <template slot="batch">
             <el-switch
-              v-model="form.batch"
-              active-text="是"
-              inactive-text="否"
-              :active-value="1"
-              :inactive-value="0"
+                v-model="form.batch"
+                active-text="是"
+                inactive-text="否"
+                :active-value="1"
+                :inactive-value="0"
             />
           </template>
           <template slot="unit">
             <el-select
-              v-model="form.unit"
-              clearable
-              filterable
-              placeholder="请选择 计量单位"
+                v-model="form.unit"
+                clearable
+                filterable
+                placeholder="请选择 计量单位"
             >
               <el-option
-                v-for="(item, index) in unitOption"
-                :key="index"
-                :label="item.dictValue"
-                :value="item.dictValue"
+                  v-for="(item, index) in unitOption"
+                  :key="index"
+                  :label="item.dictValue"
+                  :value="item.dictValue"
               />
             </el-select>
           </template>
         </avue-form>
       </basic-container>
+      <containerTitle title="主图附件"></containerTitle>
+      <c-upload
+          :data="bankOfDepositData"
+          display
+          deleteUrl="/api/blade-client/goodsfiles/delete"
+          :enumerationValue="160"/>
     </div>
   </div>
 </template>
@@ -138,8 +144,8 @@ import {
 } from "@/api/basicData/commodityType";
 
 export default {
-  props:{
-    detailData:Object
+  props: {
+    detailData: Object
   },
   name: "detailsPage",
   data() {
@@ -151,7 +157,9 @@ export default {
         placeholder: "请点击右边按钮选择",
         dicData: []
       },
+      optionTwo:[],
       form: {},
+      bankOfDepositData:[],
       disabled: false,
       userDialog: false, //供应商导入窗口
       dicData: [],
@@ -229,7 +237,7 @@ export default {
           {
             label: "供应商",
             prop: "corpId",
-            span:16,
+            span: 16,
             rules: [
               {
                 required: true,
@@ -253,7 +261,7 @@ export default {
           {
             label: "所属公司",
             prop: "artsVision",
-            span:16,
+            span: 16,
             rules: [
               {
                 required: false,
@@ -424,7 +432,9 @@ export default {
       this.openFullScreen(false, '正在努力的加载...');
       getDetail(id).then(res => {
         this.form = res.data.data;
-        this.form.artsVision = this.form.artsVision? this.form.artsVision.split(','): null;
+        this.bankOfDepositData = res.data.data.filesList
+        delete this.form.filesList
+        this.form.artsVision = this.form.artsVision ? this.form.artsVision.split(',') : null;
       }).finally(() => {
         this.openFullScreen(true);
       });
@@ -447,6 +457,22 @@ export default {
     },
     //修改提交触发
     editProductInfo() {
+      let list = []
+      if(this.bankOfDepositData.length>0){
+        for (let item of this.bankOfDepositData){
+          if (item.version == 0){
+            list.push(item.version)
+          }
+        }
+      }else {
+        return this.$message.error("请上传附件!");
+      }
+      if (!(list.indexOf('0') !== -1)){
+        return this.$message.error("附件无主图,请选择其中一个文件属性为主图!");
+      }
+      if (new Set(list).size !== list.length){
+        return this.$message.error("主图重复");
+      }
       this.$refs["form"].validate((valid, done) => {
         done();
         //校验明细列表
@@ -465,6 +491,7 @@ export default {
           }
           const params = {
             ...this.form,
+            filesList:this.bankOfDepositData,
             type: 0
           };
           this.openFullScreen(false, '正在努力的加载...');

+ 2 - 2
src/views/landTransportation/motorcadeDriver/index.vue

@@ -463,11 +463,11 @@ export default {
         },
           {
             label: '车队',
-            width: 200,
+            width: 90,
             search: true,
             index: 7,
             // hide:true,
-            showColumn: false,
+            // showColumn: false,
             filterable: true,
             disabled: true,
             type: 'select',