戴艳蓉 пре 3 година
родитељ
комит
9a67c2acb3

+ 1 - 1
src/apis/components/search-metal-kind.js

@@ -2,7 +2,7 @@ import http from "@/apis/axios";
 const api = "admin/";
 export default {
   // 列表
-  list: (data, params) => http(api + "brandlist", data, "post", params),
+  list: (data, params) => http(api + "goldlinst", data, "post", params),
   //  // 获取仓库  供应商仓/自建仓
   //  warequery: (data, params) => http(api + "warequery", data, "post", params),
 };

+ 7 - 0
src/apis/components/search-spec.js

@@ -0,0 +1,7 @@
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 列表
+  list: (data, params) => http(api + "specstitle", data, "post", params),
+};
+   

+ 1 - 1
src/apis/components/search-tax.js

@@ -2,7 +2,7 @@ import http from "@/apis/axios";
 const api = "admin/";
 export default {
   // 列表
-  list: (data, params) => http(api + "brandlist", data, "post", params),
+  list: (data, params) => http(api + "goldratelist", data, "post", params),
   //  // 获取仓库  供应商仓/自建仓
   //  warequery: (data, params) => http(api + "warequery", data, "post", params),
 };

+ 22 - 9
src/components/globalComponents/file-upload/main.vue

@@ -67,10 +67,10 @@ export default {
           let str = await that.httpupLoad(files, i);
           if (str === "error") {
             that.$emit("UploadErrorEvent");
+          } else if (str === "break") {
+            that.$emit("UploadErrorEvent", "break");
           } else {
-            that.$emit("UploadSuccessEvent", {
-              url: str,
-            });
+            that.$emit("UploadSuccessEvent", str);
           }
         }
       }
@@ -87,15 +87,28 @@ export default {
           axios
             .post(`${that.imgAPI}admin/uploadimg`, form)
             .then((res) => {
-              if (res && res.data && res.status === 200 && res.data.data) {
-                const { url, name } = res.data.data[0];
-                resolve({
-                  url: `${that.imgAPI}storage/${url}`,
-                  name: name,
-                });
+              const { status } = res;
+              if (status === 200) {
+                let item = res.data;
+                const { code, data } = item;
+                if (code === 0) {
+                  const { url, name } = data[0];
+                  resolve({
+                    url: `${that.imgAPI}storage/${url}`,
+                    name: name,
+                  });
+                } else {
+                  resolve({
+                    url: `noToken`,
+                    name: "",
+                  });
+                }
               } else {
                 reject();
               }
+              if (res && res.data && res.status === 200 && res.data.data) {
+              } else {
+              }
             })
             .catch((error) => {
               reject();

+ 5 - 14
src/components/globalComponents/search-metal-kind/main.vue

@@ -58,19 +58,10 @@ export default {
       options: [],
       selectLoading: false,
       searchName: "",
-      formValue: {
-        page: 1,
-        size: 100,
-        supplierNo: "",
-        wsm_code: "",
-        start: "",
-        end: "",
-        mobile: "",
-        contactor: "",
-      },
+      formValue: {},
     };
   },
-  watch: {
+  // watch: {
    
     //  names: function (val, old) {
     //   // console.log(val, old);
@@ -79,7 +70,7 @@ export default {
     //     this.remoteMethod(this.searchName);
     //   }
     // },
-  },
+  // },
   mounted() {
     this.options = [];
     this.selectLoading = false;
@@ -91,8 +82,8 @@ export default {
         if (index !== -1) {
           let model = {
             id: this.options[index].id,
-            code: this.options[index].wsm_code,
-            label: this.options[index].name,
+            code: this.options[index].type,
+            label: this.options[index].type_cn,
           };
           this.$emit("searchChange", model);
         } else {

+ 2 - 0
src/components/globalComponents/search-spec/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 126 - 0
src/components/globalComponents/search-spec/main.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- multiple
+    filterable
+    remote
+    :multiple-limit="1" :remote-method="remoteMethod" -->
+  <el-select
+    v-model="value"
+    filterable
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + index + 'spec'"
+      :label="item.spec_name"
+      :value="item.id"
+      :disabled="item.status === '1'"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-spec";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchSpec",
+  mixins: [resToken],
+  props: [
+    "size",
+    "value",
+    "placeholder",
+    "isDetail",
+    "disabled",
+    "type",
+    "names",
+  ],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        start: "",
+        end: "",
+        creater: "",
+        status: "",
+        spec_name: "",
+      },
+    };
+  },
+  watch: {
+    //  names: function (val, old) {
+    //   // console.log(val, old);
+    //   this.searchName = val;
+    //   if (this.isDetail && this.searchName) {
+    //     this.remoteMethod(this.searchName);
+    //   }
+    // },
+  },
+  mounted() {
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod();
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        let index = this.options.findIndex((v) => v.id === e[0]);
+        if (index !== -1) {
+          let model = {
+            id: this.options[index].id,
+            code: this.options[index].id,
+            label: this.options[index].spec_name,
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    //query
+    async remoteMethod() {
+      this.selectLoading = true;
+      // if (query !== "") {
+      this.options = [];
+      // this.formValue.spec_name = query;
+      const { code, data, message } = await asyncRequest.list(this.formValue);
+      if (code === 0) {
+        this.options = data;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+      // } else {
+      //   this.options = [];
+      // }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 0 - 0
src/components/globalComponents/search-spec/规格类型选择框


+ 32 - 59
src/components/globalComponents/search-tax/main.vue

@@ -1,27 +1,21 @@
 <template>
   <el-select
     v-model="value"
-    multiple
-    filterable
-    remote
-    :multiple-limit="1"
-    reserve-keyword
     :size="size || 'medium'"
     style="width: 100%"
+    filterable
     :placeholder="placeholder || ''"
     :disabled="disabled"
-    :remote-method="remoteMethod"
     :loading="selectLoading"
     @change="selectChange"
   >
     <el-option
       v-for="(item, index) in options"
-      :key="item.id + index"
-      :label="item.name"
-      :value="item.id"
+      :key="item.rate + index + ''"
+      :label="item.rate + '%'"
+      :value="item.rate + '%'"
       :disabled="item.status === '0'"
-    >
-    </el-option>
+    />
   </el-select>
 </template>
 
@@ -58,69 +52,48 @@ export default {
       options: [],
       selectLoading: false,
       searchName: "",
-      formValue: {
-        page: 1,
-        size: 100,
-        name: "",
-      },
     };
   },
-  watch: {
-    //  names: function (val, old) {
-    //   // console.log(val, old);
-    //   this.searchName = val;
-    //   if (this.isDetail && this.searchName) {
-    //     this.remoteMethod(this.searchName);
-    //   }
-    // },
-  },
+  // watch: {
+  //  names: function (val, old) {
+  //   // console.log(val, old);
+  //   this.searchName = val;
+  //   if (this.isDetail && this.searchName) {
+  //     this.remoteMethod(this.searchName);
+  //   }
+  // },
+  // },
   mounted() {
     this.options = [];
     this.selectLoading = false;
+    this.remoteMethod();
   },
   methods: {
     async selectChange(e) {
-      if (e && e.length > 0) {
-        let index = this.options.findIndex((v) => v.id === e[0]);
-        if (index !== -1) {
-          let model = {
-            id: this.options[index].id,
-            code: this.options[index].code,
-            label: this.options[index].name,
-          };
-          this.$emit("searchChange", model);
-        } else {
-          this.$emit("searchChange", {});
-        }
+      // console.log(e);
+      let index = this.options.findIndex((v) => v.rate + "%" === e);
+      if (index !== -1) {
+        let model = {
+          id: this.options[index].rate,
+          code: this.options[index].rate,
+          label: this.options[index].rate+"%",
+        };
+        this.$emit("searchChange", model);
       } else {
         this.$emit("searchChange", {});
       }
     },
-    async remoteMethod(query) {
+    async remoteMethod() {
       this.selectLoading = true;
-      if (query !== "") {
-        this.options = [];
-        this.formValue.name = query;
-        const { code, data, message } = await asyncRequest.list(this.formValue);
-        if (code === 0) {
-          const { list } = data;
-          // this.options = list;
-          this.options = [
-            { id: "0", name: "0%" },
-            { id: "1", name: "1%" },
-            { id: "3", name: "3%" },
-            { id: "6", name: "6%" },
-            { id: "9", name: "9%" },
-            { id: "13", name: "13%" },
-          ];
-        } else if (code >= 100 && code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(message);
-        }
+      const { code, data, message } = await asyncRequest.list({});
+      if (code === 0) {
+        this.options = data;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
       } else {
-        this.options = [];
+        this.$message.warning(message);
       }
+
       this.selectLoading = false;
     },
   },

+ 13 - 13
src/components/globalComponents/select-area/main.vue

@@ -37,23 +37,23 @@ export default {
    * 事件集合
    * @selectChange            : 选中值变化调用   抛出选中数据
    */
-  watch: {
-    value: function (val, old) {
-      if (val) {
-        this.loading = true;
-        setTimeout(() => {
-          this.loading = false;
-        }, 10);
-      }
-    },
-  },
+  // watch: {
+  //   value: function (val, old) {
+  //     // if (val) {
+  //     //   this.loading = true;
+  //     //   setTimeout(() => {
+  //     //     this.loading = false;
+  //     //   }, 10);
+  //     // }
+  //   },
+  // },
   data() {
     return {
       loading: false,
       props: {
         lazy: true, //开启远程加载
         async lazyLoad(node, resolve) {
-          console.log(node);
+          // console.log(node);
           const { level, value ,root,loading} = node;
           let list = [];
           let res = {};
@@ -64,8 +64,8 @@ export default {
           } else {
             res = await asyncRequest.areaList({ code: value });
           }
-          if (res && res.code === 0 && res.data) {
-            let { data } = res;
+          const {code,data}=res
+          if (code === 0 ) {
             data.forEach((v1) => {
               let province = {
                 value:

+ 1 - 1
src/styles/index.scss

@@ -603,7 +603,7 @@ aside {
 .activity-upload {
   .btnupload {
     float: left;
-    border: 1px solid #cccccc;
+    border: 1px solid rgb(220, 223, 230);
     box-sizing: border-box;
     width: 102px;
     height: 102px;

+ 4 - 2
src/views/goodStore/brand/addEdit.vue

@@ -48,7 +48,7 @@
                 <file-upload
                   class="Upload"
                   :disabled="id == '007'"
-                  :accept="'.jpg,.png,.bmp,.jpeg,.gif'"
+                  :accept="'.jpg,.png,.jpeg'"
                   :multiple="true"
                   :uploadcondition="beforeAvatarUpload"
                   @UploadErrorEvent="UploadErrorEvent"
@@ -188,7 +188,6 @@ export default {
         if (
           file.type === "image/jpg" ||
           file.type === "image/png" ||
-          file.type === "image/bmp" ||
           file.type === "image/jpeg"
         ) {
           isJPG = true;
@@ -212,6 +211,9 @@ export default {
     },
     //图片上传成功
     UploadSuccessEvent(data) {
+
+
+
       let res = data.url;
       const { url } = res;
       this.ruleForm.logo_url = url;

+ 9 - 280
src/views/goodStore/goodsCost/add.vue

@@ -20,7 +20,6 @@
 import asyncRequest from "@/apis/service/goodStore/goodsCost";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import { options1, options2, options3, options4, options5 } from "./columns";
 import baseForm from "./components/baseForm";
 import costForm from "./components/costForm";
 import packForm from "./components/packForm";
@@ -49,97 +48,14 @@ export default {
   data() {
     return {
       size: "small",
-      rulesThis: this.rules,
-      activeName: "1",
+      activeName: "3",
       loading: false,
-      tableData: [],
-      options1: options1,
-      options2: options2,
-      options3: options3,
-      options4: options4,
-      options5: options5,
-      supplierOptions4: [
-        { id: "0", name: "0%" },
-        { id: "1", name: "1%" },
-        { id: "3", name: "3%" },
-        { id: "6", name: "6%" },
-        { id: "9", name: "9%" },
-        { id: "13", name: "13%" },
-      ],
-      supplierOptions6: [
-        { id: "0", name: "供应商1" },
-        { id: "1", name: "供应商1" },
-      ],
+   
+     
 
-      ruleForm: {
-        id: this.id,
-        catid: [],
-        good_name: "",
-        unit: "",
-        supplier: "",
-        brandid: "",
-        image: [],
-        spec: "",
-        table: "",
-      },
+    
 
-      rules: {
-        supplier: [
-          {
-            required: true,
-            message: "供应商联系人",
-            trigger: "change",
-          },
-        ],
-        image: [
-          {
-            required: true,
-            message: "商品主图",
-            trigger: "change",
-          },
-        ],
-        catid: [
-          {
-            required: true,
-            message: "商品分类",
-            trigger: "change",
-          },
-        ],
-        brandid: [
-          {
-            required: true,
-            message: "商品品牌",
-            trigger: "change",
-          },
-        ],
-        good_name: [
-          {
-            required: true,
-            message: "请输入商品名称",
-            trigger: "blur",
-          },
-          {
-            min: 2,
-            max: 50,
-            message: "长度在 2 到 50 个字符",
-            trigger: "blur",
-          },
-        ],
-        unit: [
-          {
-            required: true,
-            message: "请输入商品单位",
-            trigger: "blur",
-          },
-          {
-            min: 1,
-            max: 10,
-            message: "长度在 1 到 10 个字符",
-            trigger: "blur",
-          },
-        ],
-      },
-      ruleForm: {},
+   
     };
   },
   mounted() {
@@ -148,8 +64,7 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
-      this.rulesThis = this.rules;
-      await this.resetForm();
+    
       this.loading = false;
     },
     handleClick(row) {
@@ -163,197 +78,11 @@ export default {
         await this.resetForm(res.data);
       }
     },
-    async resetForm() {
-      // 重置
-      await this.$nextTick(async () => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            id: this.id,
-            catid: ["1", "2", "3"],
-            good_name:
-              "2018春秋新款V领修身丝绒西装女 双排扣复古极简中长款工装外套",
-            unit: "件",
-            supplier: "8",
-            brandid: "3",
-            image: [
-              "http://cum.sit.wanyuhengtong.com/20210425/1edfa0da4eee9b24d1f35d52b6a0ec0a.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/cc70a4c06c83d9d8ac27ae35b118a23f.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/a5e05dc1c5c75030bcc95f1da1d2d9cb.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/9d505e7632891459a29f2fafe28d6705.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/714914d7545184e99e240b3affeada07.jpg",
-            ],
-            // };
-          };
-
-          // this.ruleForm = {
-          //   spec: "",
-          //   table: "",
-          // };
-        }
-      });
-    },
-
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          let change = false;
-          this.mock.forEach((v1) => {
-            if (v1.change && v1.change.length > 0) {
-              change = true;
-            }
-          });
-          if (!change) {
-            this.ruleForm.spec = "规格!";
-            return;
-          } else {
-            this.ruleForm.spec = "";
-            let table = false;
-            let hasnot = false;
-            let stock = [];
-            this.right.specList.forEach((v1) => {
-              if (v1) {
-                v1.forEach((v2) => {
-                  if (v2 && v2.limit && v2.limit.length > 0) {
-                    let list = [];
-                    v2.limit.forEach((v3) => {
-                      if (v3.num != 0 && v3.price != 0) {
-                        table = true;
-                        list.push(v3);
-                      }
-                      if (
-                        (v3.num != 0 && v3.price == 0) ||
-                        (v3.num == 0 && v3.price !== 0)
-                      ) {
-                        hasnot = true;
-                      }
-                    });
-                    if (list.length > 0) {
-                      let model = Object.assign({}, v2);
-                      model.limit = list;
-                      stock.push(model);
-                    }
-                  }
-                });
-              }
-            });
+  
 
-            if (hasnot) {
-              this.ruleForm.table =
-                "起订量与成本价需成对填写,未成对请设为零!";
-            } else {
-              if (!table) {
-                this.ruleForm.table = "至少填写一堆起订量与成本价!";
-              } else {
-                this.ruleForm.table = "";
-                this.loading = true;
-                let obj = JSON.parse(JSON.stringify(this.ruleForm));
-                obj.stock = stock;
-                obj.catid = obj.catid[obj.catid.length - 1];
-                obj.image = obj.image.join();
-                //split(",");
-                console.log(obj);
-                let res = {};
-                if (this.id === "add") {
-                  delete obj["id"];
-                  res = await asyncRequest.add(obj);
-                } else {
-                  res = await asyncRequest.update(obj);
-                }
-                this.loading = false;
-                if (res.code === 0) {
-                  let title = this.id === "add" ? "添加成功" : "修改成功";
-                  this.$notify.success({
-                    title,
-                    message: "",
-                  });
-                  // 刷新
-                  this.$emit("refresh");
-                }
-              }
-            }
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    //图片上传失败
-    UploadErrorEvent() {
-      this.$message.error("图片上传失败!");
-      this.$refs.ruleForm.validateField("image");
-    },
-    closeImg(index) {
-      this.ruleForm.image.splice(index, 1);
-      this.$refs.ruleForm.validateField("image");
-    },
-    //图片上传成功
-    UploadSuccessEvent(data) {
-      console.log(data);
-      this.ruleForm.image.push(data.url);
-      this.$message.success("图片上传成功!");
-      this.$refs.ruleForm.validateField("image");
-    },
-    //判断图片规格
-    beforeAvatarUpload(file) {
-      console.log(file);
-      let isJPG = false;
-      if (
-        file.type === "image/jpg" ||
-        file.type === "image/png" ||
-        file.type === "image/bmp" ||
-        file.type === "image/jpeg" ||
-        file.type === "image/gif"
-      ) {
-        isJPG = true;
-      }
-      const isLt2M = file.size / 1024 / 1024 < 1;
-      if (!isJPG) {
-        this.$message.error("图片格式不正确!");
-      }
-      if (!isLt2M) {
-        this.$message.error("图片大小不能超过 1MB!");
-      }
-      return isJPG && isLt2M;
-    },
-    doExchange(arr) {
-      let len = arr.length;
-      // 当数组大于等于2个的时候
-      if (len >= 2) {
-        // 第一个数组的长度
-        let len1 = arr[0].length;
-        // 第二个数组的长度
-        let len2 = arr[1].length;
-        // 2个数组产生的组合数
-        let lenBoth = len1 * len2;
-        //  申明一个新数组
-        let items = new Array(lenBoth);
-        // 申明新数组的索引
-        let index = 0;
-        for (let i = 0; i < len1; i++) {
-          for (let j = 0; j < len2; j++) {
-            if (arr[0][i] instanceof Array) {
-              items[index] = arr[0][i].concat(arr[1][j]);
-            } else {
-              items[index] = [arr[0][i]].concat(arr[1][j]);
-            }
-            index++;
-          }
-        }
-        let newArr = new Array(len - 1);
-        for (let i = 2; i < arr.length; i++) {
-          newArr[i - 1] = arr[i];
-        }
-        newArr[0] = items;
-        return this.doExchange(newArr);
-      } else {
-        return arr[0];
-      }
-    },
+  
+   
   },
-  watch: {},
 };
 </script>
    <style lang="scss" scoped>

+ 34 - 8
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -261,8 +261,8 @@
       </el-col>
       <el-col :span="23" class="dmain" style="padding-left: 18px">
         <el-table :data="tableData" :size="'mini'" border style="width: 100%">
-          <el-table-column prop="index" label="序号"> </el-table-column>
-          <el-table-column prop="name" label="规格类型"> </el-table-column>
+          <!-- <el-table-column prop="index" label="序号"> </el-table-column> -->
+          <el-table-column prop="name" label="规格类型"  />
           <el-table-column prop="address" label="规格值"> </el-table-column>
           <el-table-column fixed="right">
             <template slot="header" slot-scope="scope">
@@ -273,7 +273,11 @@
                 content="添加规格类型"
                 placement="top"
               >
-                <i class="el-icon-circle-plus-outline fr"  style="font-size:18px;margin-top:2px" />
+                <i
+                  class="el-icon-circle-plus-outline fr"
+                  style="font-size: 18px; margin-top: 2px"
+                  @click="openEdit('add', {})"
+                />
               </el-tooltip>
             </template>
             <template slot-scope="scope">
@@ -293,6 +297,14 @@
             </template>
           </el-table-column>
         </el-table>
+        <!-- 弹窗 新增/修改 -->
+        <base-form-add-edit
+          :id="modelId"
+          :show-model="showModel"
+          :sitem="sitem"
+          @refresh="refreshEdit"
+          @cancel="showModel = false"
+        />
       </el-col>
     </el-row>
   </el-form>
@@ -301,10 +313,14 @@
 import asyncRequest from "@/apis/service/goodStore/goodsCost";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
+import baseFormAddEdit from "./baseFormAddEdit";
 import { options1, options2, options3, options4, options5 } from "../columns";
 export default {
   name: "goodsCostAdd",
   mixins: [resToken],
+  components: {
+    baseFormAddEdit,
+  },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -321,6 +337,9 @@ export default {
   },
   data() {
     return {
+      showModel: false,
+      modelId: "000",
+      sitem: {},
       size: "small",
       rulesThis: this.rules,
       activeName: "1",
@@ -386,7 +405,6 @@ export default {
         ],
         a8: [
           {
-            type: "array",
             required: true,
             message: "请选择税率",
             trigger: "change",
@@ -474,6 +492,11 @@ export default {
     handleClick(row) {
       console.log(row);
     },
+    openEdit(type, sitem) {
+      this.sitem = sitem;
+      this.modelId = type;
+      this.showModel = true;
+    },
     async initData() {
       this.loading = true;
       const { code, data, message } = await asyncRequest.detail({
@@ -507,7 +530,7 @@ export default {
         a5: "",
         a6: [],
         a7: "",
-        a8: [],
+        a8: "",
         b1: "2018春秋新款V领修身丝绒西装女 双排扣复古极简中长款工装外套",
         b2: "",
         b3: "",
@@ -520,6 +543,9 @@ export default {
         bb1: "",
       };
     },
+    refreshEdit(e) {
+      console.log(e);
+    },
     //商品分类选择
     goods_class_change(e) {
       this.ruleForm.a1 = e;
@@ -547,12 +573,12 @@ export default {
     },
     //税点选择
     a8searchChange(e) {
+      // console.log(e);
       const { id, code, label } = e;
-      console.log(e);
       if (id) {
-        this.ruleForm.a8 = [id];
+        this.ruleForm.a8 = label;
       } else {
-        this.ruleForm.a8 = [];
+        this.ruleForm.a8 = "";
       }
       this.$refs.ruleForm.validateField("a8");
     },

+ 260 - 0
src/views/goodStore/goodsCost/components/baseFormAddEdit.vue

@@ -0,0 +1,260 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="18vh"
+    width="500px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'small'"
+            :rules="rulesThis"
+            label-width="80px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="规格类型" prop="brand_name">
+              <search-spec
+                :value="ruleForm.brand_name"
+                :disabled="false"
+                :size="'mini'"
+                :isDetail="false"
+                :placeholder="'规格类型'"
+                @searchChange="brand_namesearchChange"
+              />
+            </el-form-item>
+            <el-form-item label="规格值" prop="logo_url">
+              <el-radio-group v-model="ruleForm.logo_url">
+                <el-radio
+                  v-for="item in specVlist"
+                  :key="item.id + item.name"
+                  :label="item.id"
+                  >{{ item.name }}</el-radio
+                >
+              </el-radio-group>
+            </el-form-item>
+            <div style="width: 100%; padding: 0 0 0 80px">
+              <el-input
+                style="width: 209px"
+                v-model="sinput"
+                :disabled="id == 'edit'"
+                :size="'small'"
+                placeholder="规格值名称,如红色"
+                maxlength="20"
+              />
+              <el-button
+                style="margin: 0 0 0 10px"
+                icon="el-icon-plus"
+                :size="'small'"
+                >新增规格值</el-button
+              >
+            </div>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right; padding-top: 18px">
+          <el-button
+            v-if="id !== 'edit'"
+            :size="'small'"
+            type="primary"
+            @click="submitForm"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false" :size="'small'">{{
+            id == "edit" ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/goodStore/brand";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "brand",
+  props: ["showModel", "id", "sitem"],
+  mixins: [resToken],
+  data() {
+    return {
+      loading: false,
+      title: "",
+      sinput: "",
+      showModelThis: this.showModel,
+      select: "1",
+      specVlist: [
+        { id: "1", name: "111" },
+        { id: "2", name: "222" },
+      ],
+      activeOptions: [],
+      actionList: [],
+      ruleForm: {
+        id: "",
+        brand_name: "",
+        logo_url: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        brand_name: [
+          { required: true, message: "品牌名称不能为空", trigger: "change" },
+        ],
+        logo_url: [
+          { required: true, message: "品牌名称不能为空", trigger: "change" },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      if (this.id === "add") {
+        this.title = "添加商品类型";
+        this.rulesThis = this.rules;
+      } else if (this.id === "005") {
+        this.title = "修改商品类型";
+        this.rulesThis = this.rules;
+      } else {
+        this.title = "品牌商品类型";
+        this.rulesThis = {};
+      }
+      await this.resetForm();
+      this.loading = false;
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { id, brand_name, logo_url } = this.sitem;
+          this.ruleForm = {
+            id: id || "",
+            brand_name: brand_name || "",
+            logo_url: logo_url || "",
+          };
+        }
+      });
+    },
+
+    brand_namesearchChange(e) {
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.brand_name = code;
+      } else {
+        this.ruleForm.brand_name = "";
+      }
+      this.$refs.ruleForm.validateField("brand_name");
+      this.getlist();
+    },
+    async getlist() {
+      const { brand_name } = this.ruleForm;
+      const { code, data, message } = await asyncRequest.list({
+        brand_name: brand_name,
+      });
+      if (code === 0) {
+        this.options = data;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = {};
+          if (this.id === "003") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+     async submitForm1() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = {};
+          if (this.id === "003") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.brand {
+}
+</style>

+ 85 - 418
src/views/goodStore/goodsCost/components/costForm.vue

@@ -10,7 +10,7 @@
   >
     <el-row>
       <el-col :span="1" class="dtitle">
-        <ul style="padding:40px 0 0 0">
+        <ul style="padding: 40px 0 0 0">
           <li>固</li>
           <li>定</li>
           <li>成</li>
@@ -157,7 +157,7 @@
           <li>本</li>
         </ul></el-col
       >
-      <el-col :span="23" class="dmain" style="padding-left:18px">
+      <el-col :span="23" class="dmain" style="padding-left: 18px">
         <el-table
           :data="tableData"
           :size="'mini'"
@@ -165,31 +165,43 @@
           stripe
           style="width: 100%"
         >
-          <el-table-column prop="num" label="起订量(>=)" />
-          <el-table-column prop="name" label="成本裸价" />
-          <el-table-column prop="address" label="成本合计" />
-          <el-table-column prop="address" label="其中运费" />
+          <el-table-column prop="s1" label="起订量(>=)" />
+          <el-table-column prop="s2" label="成本裸价" />
+          <el-table-column prop="s3" label="成本合计" />
+          <el-table-column prop="s4" label="其中运费" />
+          <el-table-column prop="s5" label="使用状态" />
           <el-table-column fixed="right">
             <template slot="header" slot-scope="scope">
               <span>操作</span>
               <el-tooltip effect="dark" content="添加阶梯" placement="top">
                 <i
                   class="el-icon-circle-plus-outline tb-icon fr"
-                  @click="openModal('')"
+                  @click="openEdit('add', {})"
                 ></i>
               </el-tooltip>
             </template>
             <template slot-scope="scope">
               <el-tooltip effect="dark" content="修改" placement="top">
-                <i class="el-icon-edit tb-icon" @click="openModal('')"></i>
+                <i class="el-icon-edit tb-icon" @click="openEdit('')"></i>
               </el-tooltip>
               <el-tooltip effect="dark" content="禁/启用" placement="top">
-                <i class="el-icon-video-pause tb-icon" @click="openModal('')"></i>
+                <i
+                  class="el-icon-video-pause tb-icon"
+                  @click="openEdit('')"
+                ></i>
                 <!-- el-icon-video-play -->
               </el-tooltip>
             </template>
           </el-table-column>
-        </el-table> </el-col
+        </el-table>
+        <!-- 弹窗 新增/修改 -->
+        <cost-form-add-edit
+          :id="modelId"
+          :show-model="showModel"
+          :sitem="sitem"
+          @refresh="refreshEdit"
+          @cancel="showModel = false"
+        /> </el-col
     ></el-row>
   </el-form>
 </template>
@@ -197,10 +209,13 @@
 import asyncRequest from "@/apis/service/goodStore/goodsCost";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import { options1, options2, options3, options4, options5 } from "../columns";
+import costFormAddEdit from "./costFormAddEdit";
 export default {
   name: "goodsCostAdd",
   mixins: [resToken],
+  components: {
+    costFormAddEdit,
+  },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -217,93 +232,75 @@ export default {
   },
   data() {
     return {
+      showModel: false,
+      modelId: "000",
+      sitem: {},
       size: "small",
       rulesThis: this.rules,
       activeName: "1",
       loading: false,
-      tableData: [{ num: 1 }],
-      options1: options1,
-      options2: options2,
-      options3: options3,
-      options4: options4,
-      options5: options5,
-      supplierOptions4: [
-        { id: "0", name: "0%" },
-        { id: "1", name: "1%" },
-        { id: "3", name: "3%" },
-        { id: "6", name: "6%" },
-        { id: "9", name: "9%" },
-        { id: "13", name: "13%" },
-      ],
-      supplierOptions6: [
-        { id: "0", name: "供应商1" },
-        { id: "1", name: "供应商1" },
-      ],
-
-      ruleForm: {
-        id: this.id,
-        catid: [],
-        good_name: "",
-        unit: "",
-        supplier: "",
-        brandid: "",
-        image: [],
-        spec: "",
-        table: "",
-      },
-
+      tableData: [{ id: 1, s1: "1", s2: "-", s3: "-", s4: "-", s5: "0" }],
       rules: {
-        supplier: [
+        a1: [
+          {
+            required: true,
+            message: "证书费应为合法数字",
+            trigger: "blur",
+          },
+        ],
+        a2: [
           {
             required: true,
-            message: "供应商联系人",
-            trigger: "change",
+            message: "包装费应为合法数字",
+            trigger: "blur",
           },
         ],
-        image: [
+        a3: [
           {
             required: true,
-            message: "商品主图",
-            trigger: "change",
+            message: "成本工艺费应为合法数字",
+            trigger: "blur",
           },
         ],
-        catid: [
+        a4: [
           {
             required: true,
-            message: "商品分类",
-            trigger: "change",
+            message: "加标费应为合法数字",
+            trigger: "blur",
           },
         ],
-        brandid: [
+        a5: [
           {
             required: true,
-            message: "商品品牌",
-            trigger: "change",
+            message: "打样应为合法数字",
+            trigger: "blur",
           },
         ],
-        good_name: [
+        a6: [
           {
             required: true,
-            message: "请输入商品名称",
+            message: "开模费应为合法数字",
             trigger: "blur",
           },
+        ],
+        a7: [
           {
-            min: 2,
-            max: 50,
-            message: "长度在 2 到 50 个字符",
+            required: true,
+            message: "调样费应为合法数字",
             trigger: "blur",
           },
         ],
-        unit: [
+        a8: [
           {
             required: true,
-            message: "请输入商品单位",
+            message: "市场价应为合法数字",
             trigger: "blur",
           },
+        ],
+        a9: [
           {
-            min: 1,
-            max: 10,
-            message: "长度在 1 到 10 个字符",
+            required: true,
+            message: "含税成本裸价应为合法数字",
             trigger: "blur",
           },
         ],
@@ -317,6 +314,7 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
+      this.resetFormData();
       this.rulesThis = this.rules;
       await this.resetForm();
       this.loading = false;
@@ -324,6 +322,14 @@ export default {
     handleClick(row) {
       console.log(row);
     },
+    refreshEdit(e) {
+      console.log(e);
+    },
+    openEdit(type, sitem) {
+      this.sitem = sitem;
+      this.modelId = type;
+      this.showModel = true;
+    },
     async initData() {
       this.loading = true;
       let res = await asyncRequest.detail({ id: this.id });
@@ -338,46 +344,24 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          // if (data) {
-          //   this.ruleForm = {
-          //     id: this.id,
-          //     catid: data.good_cat.split(","),
-          //     good_name: data.good_name,
-          //     unit: data.good_unit,
-          //     supplier: data.supplier,
-          //     brandid: data.brand_id,
-          //     image: data.galley.split(","),
-          //   };
-          //   this.oldcatid = this.ruleForm.catid;
-          //   // await this.specByCat(false);
-          // } else {
-          this.ruleForm = {
-            id: this.id,
-            catid: ["1", "2", "3"],
-            good_name:
-              "2018春秋新款V领修身丝绒西装女 双排扣复古极简中长款工装外套",
-            unit: "件",
-            supplier: "8",
-            brandid: "3",
-            supplier3: "0",
-            image: [
-              "http://cum.sit.wanyuhengtong.com/20210425/1edfa0da4eee9b24d1f35d52b6a0ec0a.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/cc70a4c06c83d9d8ac27ae35b118a23f.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/a5e05dc1c5c75030bcc95f1da1d2d9cb.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/9d505e7632891459a29f2fafe28d6705.jpg",
-              "http://cum.sit.wanyuhengtong.com/20210425/714914d7545184e99e240b3affeada07.jpg",
-            ],
-            // };
-          };
-
-          // this.ruleForm = {
-          //   spec: "",
-          //   table: "",
-          // };
+          this.resetFormData();
         }
       });
     },
-
+    resetFormData() {
+      this.ruleForm = {
+        a1: "",
+        a2: "",
+        a3: "",
+        a4: "",
+        a5: "",
+        a6: "",
+        a7: "",
+        a8: "",
+        a9: "",
+        b1: [],
+      };
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
@@ -463,326 +447,9 @@ export default {
         }
       });
     },
-    // groupChange($event, index, item) {
-    //   this.$set(this.mock, index, item);
-    //   this.actionSpecList();
-    // },
-    // actionSpecList() {
-    //   // this.leftS = "0px";
-    //   this.left.header = [];
-    //   this.left.middle = [];
-    //   this.left.specList = [];
-    //   console.log(this.mock);
-    //   console.log(this.right.specList);
-    //   this.mock.forEach((v1) => {
-    //     if (
-    //       v1.change &&
-    //       v1.change.length > 0 &&
-    //       v1.child &&
-    //       v1.child.length > 0
-    //     ) {
-    //       this.left.header.push({
-    //         spec_id: v1.spec_id,
-    //         spec_name: v1.spec_name,
-    //       });
-    //       let arr = [];
-    //       let changeList = v1.change;
-    //       changeList.forEach((v2) => {
-    //         let index = v1.child.findIndex((v3) => v2 === v3.id);
-    //         if (index !== -1) {
-    //           let x = {
-    //             spec_id: v1.spec_id,
-    //             spec_name: v1.spec_name,
-    //             id: v1.child[index].id,
-    //             spec_value: v1.child[index].spec_value,
-    //           };
-    //           arr.push(x);
-    //         }
-    //       });
-    //       this.left.middle.push(arr);
-    //     }
-    //   });
-    //   let lang = this.left.header.length;
-    //   this.leftS = lang * 70 + "px";
-    //   if (this.left.middle.length > 1) {
-    //     this.left.specList = this.doExchange(this.left.middle);
-    //   } else if (this.left.middle.length === 0) {
-    //     this.left.specList = [];
-    //   } else {
-    //     let list1 = [];
-    //     this.left.middle.forEach((v1) => {
-    //       if (v1) {
-    //         v1.forEach((v2) => {
-    //           let list2 = [];
-    //           list2.push(v2);
-    //           list1.push(list2);
-    //         });
-    //       }
-    //     });
-    //     this.left.specList = list1;
-    //   }
-    //   this.right.header = [];
-    //   for (let i = 0; i < this.ladderNum; i++) {
-    //     this.right.header.push(this.headLadder);
-    //   }
-    //   this.right.specList = [];
-    //   this.left.specList.forEach((v1) => {
-    //     let arr = [];
-    //     let model = {
-    //       specid: [],
-    //       limit: [],
-    //     };
-    //     v1.forEach((v2) => {
-    //       model.specid.push(v2.id);
-    //     });
-    //     for (let i = 0; i < this.ladderNum; i++) {
-    //       let bodyLadder = {
-    //         num: 0,
-    //         price: 0,
-    //       };
-    //       model.limit.push(bodyLadder);
-    //     }
-    //     arr.push(model);
-    //     this.right.specList.push(arr);
-    //   });
-    //   console.log(this.right.specList);
-    // },
-
-    // closeLadder(index) {
-    //   console.log(index);
-    // },
-    // async handleChange(type) {
-    //   if (this.ruleForm.catid !== this.oldcatid && this.oldcatid.length === 0) {
-    //     await this.specByCat();
-
-    //     if (this.step === 0 && !type) {
-    //       this.step = 1;
-    //     }
-    //   } else if (
-    //     this.ruleForm.catid !== this.oldcatid &&
-    //     this.oldcatid.length > 0
-    //   ) {
-    //     await this.$confirm(
-    //       "分类修改会影响该商品规格与价格!",
-    //       "确定要修改?",
-    //       {
-    //         confirmButtonText: "确定",
-    //         cancelButtonText: "取消",
-    //         type: "warning",
-    //       }
-    //     )
-    //       .then(async () => {
-    //         await this.specByCat();
-    //         if (this.step === 0) {
-    //           this.step = 1;
-    //         }
-    //       })
-    //       .catch(() => {
-    //         this.ruleForm.catid = this.oldcatid;
-    //       });
-    //   } else {
-    //     if (this.step === 0 && !type) {
-    //       this.step = 1;
-    //     }
-    //   }
-    // },
-    // //  商品种类ID换取规格值
-    // async specByCat(type) {
-    //   console.log("准备拉取!");
-    //   this.mock = [];
-    //   this.$set(this.mock);
-    //   let list = this.ruleForm.catid;
-    //   let res = await asyncRequest.specByCat({ catid: list[list.length - 1] });
-    //   if (res.code === 0) {
-    //     this.dealWitHInitMock(res.data, type);
-    //     this.oldcatid = list;
-    //   } else if (res.code !== 101 && res.code !== 102) {
-    //     this.ruleForm.catid = this.oldcatid;
-    //   }
-    // },
-    // //  规格属性值新建
-    // async specinfoadd(id, value) {
-    //   console.log(id, value);
-    //   let list = this.ruleForm.catid;
-    //   let model = {
-    //     catid: list[list.length - 1],
-    //     specid: id,
-    //     spec_value: value,
-    //   };
-    //   let res = await asyncRequest.specinfoadd(model);
-    //   if (res.code === 0) {
-    //     await this.specByCat(true);
-    //   }
-    // },
-    // dealWitHInitMock(list, type) {
-    //   console.log(list, type);
-    //   if (!type) {
-    //     this.mock = [];
-    //     console.log("12345678");
-    //     console.log(this.mock);
-
-    //     this.left.header = [];
-    //     this.left.specList = [];
-    //     this.right.header = [];
-    //     this.right.specList = [];
-    //     list.map((v1) => {
-    //       v1.value = "";
-    //       v1.change = [];
-    //       return v1;
-    //     });
-    //     this.mock = list;
-    //     console.log(this.mock);
-    //     this.mock.forEach((v3, i) => {
-    //       this.$set(this.mock, i, v3);
-    //     });
-    //   } else {
-    //     let arr = JSON.parse(JSON.stringify(this.mock));
-    //     list.map((v1) => {
-    //       v1.value = "";
-    //       let index = arr.findIndex((v2) => v2.spec_id === v1.spec_id);
-    //       if (index !== -1) {
-    //         v1.change = arr[index].change;
-    //       }
-    //       return v1;
-    //     });
-    //     this.mock = list;
-    //     this.mock.forEach((v3, i) => {
-    //       this.$set(this.mock, i, v3);
-    //     });
-    //   }
-    // },
-    // async getAllbrandid() {
-    //   const res = await asyncRequest.brandAll({});
-    //   if (res.code === 0 && res.data) {
-    //     this.brandidOptions = res.data;
-    //   }
-    // },
-    // async getAllCat() {
-    //   const res = await asyncRequest.catAll({});
-    //   if (res.code === 0 && res.data) {
-    //     let list = res.data;
-    //     list.map((v1) => {
-    //       v1.value = v1.id;
-    //       v1.label = v1.cat_name;
-    //       if (v1.child && v1.child.length > 0) {
-    //         v1.child.map((v2) => {
-    //           v2.value = v2.id;
-    //           v2.label = v2.cat_name;
-    //           if (v2.child && v2.child.length > 0) {
-    //             v2.child.map((v3) => {
-    //               v3.value = v3.id;
-    //               v3.label = v3.cat_name;
-    //               return v3;
-    //             });
-    //             v2.children = v2.child;
-    //           }
-    //           return v2;
-    //         });
-    //         v1.children = v1.child;
-    //       }
-
-    //       return v1;
-    //     });
-    //     this.catOptions = list;
-    //   }
-    // },
-    // async getAllSupplier() {
-    //   const res = await asyncRequest.supplierAll({});
-    //   if (res.code === 0 && res.data) {
-    //     let list = res.data;
-    //     this.supplierOptions = list;
-    //   }
-    // },
-    //图片上传失败
-    UploadErrorEvent() {
-      this.$message.error("图片上传失败!");
-      this.$refs.ruleForm.validateField("image");
-    },
-    closeImg(index) {
-      this.ruleForm.image.splice(index, 1);
-      this.$refs.ruleForm.validateField("image");
-    },
-    //图片上传成功
-    UploadSuccessEvent(data) {
-      console.log(data);
-      this.ruleForm.image.push(data.url);
-      this.$message.success("图片上传成功!");
-      this.$refs.ruleForm.validateField("image");
-    },
-    //判断图片规格
-    beforeAvatarUpload(file) {
-      console.log(file);
-      let isJPG = false;
-      if (
-        file.type === "image/jpg" ||
-        file.type === "image/png" ||
-        file.type === "image/bmp" ||
-        file.type === "image/jpeg" ||
-        file.type === "image/gif"
-      ) {
-        isJPG = true;
-      }
-      const isLt2M = file.size / 1024 / 1024 < 1;
-      if (!isJPG) {
-        this.$message.error("图片格式不正确!");
-      }
-      if (!isLt2M) {
-        this.$message.error("图片大小不能超过 1MB!");
-      }
-      return isJPG && isLt2M;
-    },
-    doExchange(arr) {
-      let len = arr.length;
-      // 当数组大于等于2个的时候
-      if (len >= 2) {
-        // 第一个数组的长度
-        let len1 = arr[0].length;
-        // 第二个数组的长度
-        let len2 = arr[1].length;
-        // 2个数组产生的组合数
-        let lenBoth = len1 * len2;
-        //  申明一个新数组
-        let items = new Array(lenBoth);
-        // 申明新数组的索引
-        let index = 0;
-        for (let i = 0; i < len1; i++) {
-          for (let j = 0; j < len2; j++) {
-            if (arr[0][i] instanceof Array) {
-              items[index] = arr[0][i].concat(arr[1][j]);
-            } else {
-              items[index] = [arr[0][i]].concat(arr[1][j]);
-            }
-            index++;
-          }
-        }
-        let newArr = new Array(len - 1);
-        for (let i = 2; i < arr.length; i++) {
-          newArr[i - 1] = arr[i];
-        }
-        newArr[0] = items;
-        return this.doExchange(newArr);
-      } else {
-        return arr[0];
-      }
-    },
   },
-  watch: {},
 };
 </script>
    <style lang="scss" scoped>
-.goodsCostAdd {
-  .goodsCostAdd-title {
-    border-top: 1px solid #ebeef5;
-    span {
-      height: 50px;
-      line-height: 50px;
-      font-family: "微软雅黑", sans-serif;
-      font-weight: 400;
-      font-style: normal;
-      font-size: 16fpx;
-      text-align: left;
-    }
-  }
-}
 </style>
    

+ 293 - 0
src/views/goodStore/goodsCost/components/costFormAddEdit.vue

@@ -0,0 +1,293 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="18vh"
+    width="500px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'small'"
+            :rules="rulesThis"
+            label-width="80px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="起订量" prop="s1">
+              <el-input
+                placeholder="起订量"
+                v-model="ruleForm.s1"
+                type="number"
+                :min="0"
+                :max="9999999999"
+                :step="0"
+              />
+            </el-form-item>
+            <el-form-item label="成本裸价" prop="s2">
+              <el-input
+                placeholder="成本裸价"
+                v-model="ruleForm.s2"
+                type="number"
+                :min="0"
+                :max="9999999999"
+                :step="2"
+              >
+                <template slot="append">元</template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="成本合计" prop="s2">
+              <el-input
+                placeholder="成本合计"
+                v-model="ruleForm.s2"
+                type="number"
+                :min="0"
+                :max="9999999999"
+                :step="2"
+              >
+                <template slot="append">元</template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="其中运费" prop="s2">
+              <el-input
+                placeholder="其中运费"
+                v-model="ruleForm.s2"
+                type="number"
+                :min="0"
+                :max="9999999999"
+                :step="2"
+              >
+                <template slot="append">元</template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="使用状态" prop="s5">
+              <el-select
+                v-model="ruleForm.s5"
+                style="width: 100%"
+                placeholder="使用状态"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right; padding-top: 18px">
+          <el-button
+            v-if="id !== 'edit'"
+            :size="'small'"
+            type="primary"
+            @click="submitForm"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false" :size="'small'">{{
+            id == "edit" ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/goodStore/brand";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "brand",
+  props: ["showModel", "id", "sitem"],
+  mixins: [resToken],
+  data() {
+    return {
+      loading: false,
+      title: "",
+      showModelThis: this.showModel,
+      options: [
+        { value: "1", label: "启用" },
+        { value: "0", label: "禁用" },
+      ],
+      ruleForm: {},
+      rulesThis: this.rules,
+      rules: {
+        s1: [
+          { required: true, message: "起订量应为合法数字", trigger: "blur" },
+        ],
+        s2: [
+          { required: true, message: "成本裸价应为合法数字", trigger: "blur" },
+        ],
+        s3: [
+          { required: true, message: "成本合计应为合法数字", trigger: "blur" },
+        ],
+        s4: [
+          { required: true, message: "其中运费应为合法数字", trigger: "blur" },
+        ],
+        s5: [
+          { required: true, message: "请选择使用状态", trigger: "change" },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.resetFormData();
+      if (this.id === "add") {
+        this.title = "添加成本阶梯";
+
+        this.rulesThis = this.rules;
+      } else if (this.id === "005") {
+        this.title = "修改成本阶梯";
+        this.rulesThis = this.rules;
+      } else {
+        this.title = "成本阶梯详情";
+        this.rulesThis = {};
+      }
+      await this.resetForm();
+      this.loading = false;
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.resetFormData();
+        }
+      });
+    },
+    resetFormData() {
+      const { id, s1, s2, s3, s4, s5 } = this.sitem;
+      this.ruleForm = {
+        id: id || "",
+        s1: s1 || "",
+        s2: s2 || "",
+        s3: s3 || "",
+        s4: s4 || "",
+        s5: s5 || "0",
+      };
+    },
+    s1searchChange(e) {
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.s1 = code;
+      } else {
+        this.ruleForm.s1 = "";
+      }
+      this.$refs.ruleForm.validateField("s1");
+      this.getlist();
+    },
+    async getlist() {
+      const { s1 } = this.ruleForm;
+      const { code, data, message } = await asyncRequest.list({
+        s1: s1,
+      });
+      if (code === 0) {
+        this.options = data;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = {};
+          if (this.id === "003") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    async submitForm1() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = {};
+          if (this.id === "003") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.brand {
+}
+</style>

+ 267 - 116
src/views/goodStore/goodsCost/components/packForm.vue

@@ -21,17 +21,29 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="包装清单" prop="a1">
-              <el-input placeholder="包装清单" v-model="ruleForm.a1" />
+              <el-input
+                placeholder="包装清单"
+                v-model="ruleForm.a1"
+                maxlength="250"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="包装方式" prop="a2">
-              <el-input placeholder="包装方式" v-model="ruleForm.a2" />
+              <el-input
+                placeholder="包装方式"
+                v-model="ruleForm.a2"
+                maxlength="250"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="装箱规格" prop="a3">
-              <el-input placeholder="装箱规格" v-model="ruleForm.a3" />
+              <el-input
+                placeholder="装箱规格"
+                v-model="ruleForm.a3"
+                maxlength="250"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -50,7 +62,11 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="装箱尺寸" prop="a5">
-              <el-input placeholder="装箱尺寸" v-model="ruleForm.a5" />
+              <el-input
+                placeholder="装箱尺寸"
+                v-model="ruleForm.a5"
+                maxlength="250"
+              />
             </el-form-item>
           </el-col>
 
@@ -100,24 +116,26 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="发货地" prop="b2">
-              <el-input-number
-                v-model="ruleForm.b2"
-                style="width: 100%"
-                @change="handleChange"
-                :min="0"
-                :max="10"
-              ></el-input-number>
+              <select-area
+                :placeholder="'发货地'"
+                :value="ruleForm.b2"
+                :is-detail="id !== 'add'"
+                :disabled="isDetail"
+                :size="'mini'"
+                @selectChange="selectAreab2"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="产地" prop="b3">
-              <el-input-number
-                v-model="ruleForm.b3"
-                style="width: 100%"
-                @change="handleChange"
-                :min="0"
-                :max="10"
-              ></el-input-number>
+              <select-area
+                :placeholder="'产地'"
+                :value="ruleForm.b3"
+                :size="'mini'"
+                :is-detail="id !== 'add'"
+                :disabled="isDetail"
+                @selectChange="selectAreab3"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -175,7 +193,7 @@
         </ul></el-col
       >
       <el-col :span="23" class="dmain">
-        <el-row>
+        <el-row style="padding: 0 0 20px 0">
           <el-col :span="8">
             <el-form-item label="缩略图" prop="c1" class="activity-upload">
               <div class="btnupload" style="position: relative">
@@ -184,73 +202,67 @@
                 <file-upload
                   class="Upload"
                   :disabled="id == '007'"
-                  :accept="'.jpg,.png,.bmp,.jpeg'"
+                  :accept="'.jpg,.png,.jpeg'"
                   :multiple="true"
                   :uploadcondition="beforeAvatarUpload"
-                  @UploadErrorEvent="UploadErrorEvent"
-                  @UploadSuccessEvent="UploadSuccessEvent"
+                  @UploadErrorEvent="UploadErrorEventc1"
+                  @UploadSuccessEvent="UploadSuccessEventc1"
                 ></file-upload>
               </div>
               <div class="txt-tips fl">
-                <p>大小:小于1M</p>
-                <p>类型:</p>
-                <p>jpg.png.bmp.jpeg</p>
+                <p>尺寸比例:</p>
+                <p>1:1</p>
               </div>
             </el-form-item>
-            <el-form-item
-              label="详情主图"
-              prop="supplier3"
-              class="activity-upload"
-            >
+            <el-form-item label="详情主图" prop="c2" class="activity-upload">
               <div class="btnupload" style="position: relative">
                 <img v-if="ruleForm.c2" :src="ruleForm.c2" class="avatar" />
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <file-upload
                   class="Upload"
                   :disabled="id == '007'"
-                  :accept="'.jpg,.png,.bmp,.jpeg'"
+                  :accept="'.jpg,.png,.jpeg'"
                   :multiple="true"
                   :uploadcondition="beforeAvatarUpload"
-                  @UploadErrorEvent="UploadErrorEvent"
-                  @UploadSuccessEvent="UploadSuccessEvent"
+                  @UploadErrorEvent="UploadErrorEventc2"
+                  @UploadSuccessEvent="UploadSuccessEventc2"
                 ></file-upload>
               </div>
-              <div class="txt-tips fl">
-                <p>大小:小于1M</p>
-                <p>类型:</p>
-                <p>jpg.png.bmp.jpeg</p>
-              </div>
             </el-form-item>
+                 <div style="font-size: 12px; color: #606266">
+            <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
+            <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
+          </div>
           </el-col>
           <el-col :span="16">
-            <el-form-item label="详情介绍图" prop="c3" class="activity-upload">
+            <el-form-item label="详情介绍图" prop="c3">
               <div class="c3-div">
-                <ul>
-                  <li v-for="(img, iindex) in ruleForm.c3" :key="img + iindex">
+                <ul v-if="ruleForm.c3" class="clear">
+                  <li class="img-show-li" v-viewer v-for="(img, iindex) in ruleForm.c3" :key="img + iindex">
                     <img :src="img" alt="" />
+                    <i class="el-icon-close" @click="closeImg(iindex)"></i>
+                  </li>
+                  <li class="img-upload-li" v-if="ruleForm.c3.length < 10">
+                    <div class="activity-upload">
+                      <div class="btnupload" style="position: relative">
+                        <i class="el-icon-plus avatar-uploader-icon"></i>
+                        <file-upload
+                          class="Upload"
+                          :disabled="id == '007'"
+                          :accept="'.jpg,.png,.jpeg'"
+                          :multiple="true"
+                          :uploadcondition="beforeAvatarUpload"
+                          @UploadErrorEvent="UploadErrorEventc3"
+                          @UploadSuccessEvent="UploadSuccessEventc3"
+                        ></file-upload>
+                      </div>
+                    </div>
                   </li>
                 </ul>
-                <div class="btnupload" style="position: relative">
-                  <img v-if="ruleForm.c3" :src="ruleForm.c3" class="avatar" />
-                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-                  <file-upload
-                    class="Upload"
-                    :disabled="id == '007'"
-                    :accept="'.jpg,.png,.bmp,.jpeg'"
-                    :multiple="true"
-                    :uploadcondition="beforeAvatarUpload"
-                    @UploadErrorEvent="UploadErrorEvent"
-                    @UploadSuccessEvent="UploadSuccessEvent"
-                  ></file-upload>
-                </div>
-              </div>
-              <div class="txt-tips fl">
-                <p>大小:小于1M</p>
-                <p>类型:</p>
-                <p>jpg.png.bmp.jpeg</p>
               </div>
             </el-form-item>
           </el-col>
+     
         </el-row>
       </el-col>
     </el-row>
@@ -286,62 +298,109 @@ export default {
       options6: options6,
       ruleForm: {},
       rules: {
-        supplier: [
+        a1: [
           {
             required: true,
-            message: "供应商联系人",
-            trigger: "change",
+            message: "请输入包装清单",
+            trigger: "blur",
           },
         ],
-        image: [
+        a2: [
           {
             required: true,
-            message: "商品主图",
+            message: "请输入包装方式",
+            trigger: "blur",
+          },
+        ],
+
+        a3: [
+          {
+            required: true,
+            message: "请输入装箱规格",
+            trigger: "blur",
+          },
+        ],
+        a4: [
+          {
+            required: true,
+            message: "请输入装箱重量",
+            trigger: "blur",
+          },
+        ],
+        a5: [
+          {
+            required: true,
+            message: "请输入装箱尺寸",
+            trigger: "blur",
+          },
+        ],
+        b1: [
+          {
+            required: true,
+            message: "请选择供货区域",
             trigger: "change",
           },
         ],
-        catid: [
+        b2: [
           {
+            type: "array",
             required: true,
-            message: "商品分类",
+            message: "请选择发货地",
             trigger: "change",
           },
         ],
-        brandid: [
+        b3: [
           {
+            type: "array",
             required: true,
-            message: "商品品牌",
+            message: "请选择产地",
             trigger: "change",
           },
         ],
-        good_name: [
+        b4: [
           {
             required: true,
-            message: "请输入商品名称",
+            message: "请输入物流时间",
             trigger: "blur",
           },
+        ],
+        b5: [
           {
-            min: 2,
-            max: 50,
-            message: "长度在 2 到 50 个字符",
+            required: true,
+            message: "请输入供货周期",
             trigger: "blur",
           },
         ],
-        unit: [
+        b6: [
           {
             required: true,
-            message: "请输入商品单位",
+            message: "请输入调样周期",
             trigger: "blur",
           },
+        ],
+        c1: [
           {
-            min: 1,
-            max: 10,
-            message: "长度在 1 到 10 个字符",
-            trigger: "blur",
+            required: true,
+            message: "商品主图",
+            trigger: "change",
+          },
+        ],
+        c2: [
+          {
+            required: true,
+            message: "商品分类",
+            trigger: "change",
+          },
+        ],
+        c3: [
+          {
+            type: "array",
+            required: true,
+            message: "商品品牌",
+            trigger: "change",
           },
         ],
       },
-      ruleForm: {},
     };
   },
   mounted() {
@@ -350,6 +409,7 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
+      this.resetFormData();
       this.rulesThis = this.rules;
       await this.resetForm();
       this.loading = false;
@@ -371,28 +431,39 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-
-          this.ruleForm = {
-            a1: "",
-            a2: "",
-            a3: "",
-            a4: "",
-            a5: "",
-            a6: "",
-            b1: "",
-            b2: "",
-            b3: "",
-            b4: "",
-            b5: "",
-            b6: "",
-            c1: "",
-            c2: "",
-            c3: "",
-          };
+          this.resetFormData();
         }
       });
     },
-
+    resetFormData() {
+      this.ruleForm = {
+        a1: "",
+        a2: "",
+        a3: "",
+        a4: "",
+        a5: "",
+        a6: "",
+        b1: "",
+        b2: [],
+        b3: [],
+        b4: "",
+        b5: "",
+        b6: "",
+        c1: "",
+        c2: "",
+        c3: [],
+      };
+    },
+    //仓库省市区
+    selectAreab2(e) {
+      this.ruleForm.b2 = e;
+      this.$refs.ruleForm.validateField("b2");
+    },
+    //仓库省市区
+    selectAreab3(e) {
+      this.ruleForm.b3 = e;
+      this.$refs.ruleForm.validateField("b3");
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
@@ -479,32 +550,68 @@ export default {
       });
     },
 
-    //图片上传失败
-    UploadErrorEvent() {
-      this.$message.error("图片上传失败!");
-      this.$refs.ruleForm.validateField("image");
-    },
     closeImg(index) {
-      this.ruleForm.image.splice(index, 1);
-      this.$refs.ruleForm.validateField("image");
+      this.ruleForm.c3.splice(index, 1);
+      this.$refs.ruleForm.validateField("c3");
+    },
+    //图片上传成功
+    async UploadSuccessEventc1(data) {
+      await this.UploadSuccessEvent(1, data);
     },
     //图片上传成功
-    UploadSuccessEvent(data) {
-      console.log(data);
-      this.ruleForm.image.push(data.url);
-      this.$message.success("图片上传成功!");
-      this.$refs.ruleForm.validateField("image");
+    async UploadSuccessEventc2(data) {
+      await this.UploadSuccessEvent(2, data);
+    },
+    //图片上传成功
+    async UploadSuccessEventc3(data) {
+      await this.UploadSuccessEvent(3, data);
+    },
+    //图片上传成功
+    async UploadSuccessEvent(type, data) {
+      const { url } = data;
+      if (url === "noToken") {
+        await this.logout();
+      } else {
+        if (type === 1) {
+          this.ruleForm.c1 = url;
+          this.$refs.ruleForm.validateField("c1");
+        } else if (type === 2) {
+          this.ruleForm.c2 = url;
+          this.$refs.ruleForm.validateField("c2");
+        } else {
+          this.ruleForm.c3.push(url);
+          this.$refs.ruleForm.validateField("c3");
+        }
+        this.$message.success("图片上传成功!");
+      }
+    },
+    //图片上传失败
+    UploadErrorEventc1(res) {
+      this.imgUploadError(1, res);
+    },
+    //图片上传失败
+    UploadErrorEventc2(res) {
+      this.imgUploadError(2, res);
+    },
+    //图片上传失败
+    UploadErrorEventc3(res) {
+      this.imgUploadError(3, res);
+    },
+    imgUploadError(type, res) {
+      if (res !== "break") {
+        this.$message.error("图片上传失败!");
+        this.$refs.ruleForm.validateField(
+          type === 1 ? "c1" : type === 2 ? "c2" : "c3"
+        );
+      }
     },
     //判断图片规格
     beforeAvatarUpload(file) {
-      console.log(file);
       let isJPG = false;
       if (
         file.type === "image/jpg" ||
         file.type === "image/png" ||
-        file.type === "image/bmp" ||
-        file.type === "image/jpeg" ||
-        file.type === "image/gif"
+        file.type === "image/jpeg"
       ) {
         isJPG = true;
       }
@@ -518,11 +625,55 @@ export default {
       return isJPG && isLt2M;
     },
   },
-  watch: {},
 };
 </script>
    <style lang="scss" scoped>
 .goodsCostAdd {
+  .c3-div {
+    ul {
+      float: left;
+      width: 100%;
+
+      li {
+        float: left;
+        width: 102px;
+        height: 102px;
+        overflow: hidden;
+        margin: 0 10px 10px 0;
+        border: 1px solid rgb(220, 223, 230);
+        position: relative;
+        &.img-upload-li {
+          border: 0;
+        }
+        &.img-show-li {
+          img {
+            display: inline-block;
+            width: 100%;
+          }
+          i {
+            position: absolute;
+            width: 20px;
+            height: 20px;
+            font-size: 13px;
+            text-align: center;
+            line-height: 20px;
+            top: 0;
+            right: 0;
+            z-index: 2;
+            color: rgb(220, 223, 230);
+          }
+          &:hover {
+            i {
+              color: #63cbe7;
+              &:hover {
+                cursor: pointer;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
 }
 </style>
    

+ 1 - 1
src/views/parameter/finance/addEdit.vue

@@ -348,7 +348,7 @@ export default {
   .activity-upload {
     .btnupload {
       float: left;
-      border: 1px solid #cccccc;
+      border: 1px solid rgb(220, 223, 230);
       box-sizing: border-box;
       width: 135px;
       height: 135px;