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

+ 2 - 0
src/assets/js/btnList.js

@@ -51,5 +51,7 @@ const btnList = [
   { code: "050", name: "添加售后退货" },
   { code: "051", name: "添加未发货退货" },
   { code: "052", name: "客户验收" },
+  { code: "053", name: "修改成本信息" },
+  { code: "054", name: "修改基础信息" },
 ];
 export default btnList;

+ 17 - 13
src/components/globalComponents/search-tax/main.vue

@@ -12,8 +12,8 @@
     <el-option
       v-for="(item, index) in options"
       :key="item.rate + index + ''"
-      :label="item.rate + '%'"
-      :value="item.rate + '%'"
+      :label="item.rate"
+      :value="item.rate"
       :disabled="item.status === '0'"
     />
   </el-select>
@@ -71,23 +71,27 @@ export default {
   methods: {
     async selectChange(e) {
       // 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", {});
-      }
+      // let index = this.options.findIndex((v) => v.rate_cn === e);
+      // if (index !== -1) {
+      //   let model = {
+      //     id: this.options[index].rate_cn,
+      //     code: this.options[index].rate_cn,
+      //     label: this.options[index].rate,
+      //   };
+      //   this.$emit("searchChange", model);
+      // } else {
+        this.$emit("searchChange", e);
+      // }
     },
     async remoteMethod() {
       this.selectLoading = true;
       const { code, data, message } = await asyncRequest.list({});
       if (code === 0) {
+        // let list=data
         this.options = data;
+        this.options.forEach((i) => {
+          i.rate += "%";
+        });
       } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {

+ 3 - 2
src/styles/index.scss

@@ -243,8 +243,9 @@ aside {
 
 .clear::after,
 .clear::before {
-  content: "";
-  display: block;
+  // content: "";
+  // height: 0px;
+  // display: block;
   clear: both;
 }
 // .el-steps--simple {

+ 1 - 1
src/views/goodStore/goodsCost/columns.js

@@ -97,7 +97,7 @@ const listCol = [
     label: "操作",
     fixed: "right",
     _noset_: true,
-    width: "52px",
+    width: "150px",
     _slot_: "operation",
   },
 ]

+ 276 - 122
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -24,9 +24,9 @@
               <good-class
                 :value="ruleForm.cat_id"
                 @handleChange="goods_class_change"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
                 :placeholder="'商品分类'"
               />
             </el-form-item>
@@ -36,6 +36,7 @@
               <el-input
                 placeholder="商品名称"
                 maxlength="100"
+                :disabled="type === 'view'"
                 v-model="ruleForm.good_name"
               ></el-input>
             </el-form-item>
@@ -46,9 +47,9 @@
               <search-work-company
                 :value="ruleForm.company_id"
                 :placeholder="'业务公司'"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
                 @searchChange="company_idsearchChange"
               />
             </el-form-item>
@@ -58,9 +59,9 @@
               <search-supplier
                 :value="ruleForm.supplierNo"
                 :placeholder="'供应商'"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
                 @searchChange="supplierNosearchChange"
               />
             </el-form-item>
@@ -71,6 +72,7 @@
                 v-model="ruleForm.is_auth"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="销售权限"
               >
@@ -87,9 +89,10 @@
             <el-form-item label="商品品牌" prop="brandid">
               <search-brand
                 :value="ruleForm.brandid"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
+                :names="brand_name"
                 :placeholder="'商品品牌'"
                 @searchChange="brandidsearchChange"
               />
@@ -99,9 +102,10 @@
             <el-form-item label="商品单位" prop="unit">
               <search-unit
                 :value="ruleForm.unit"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
+                :names="unit_name"
                 :placeholder="'商品单位'"
                 @searchChange="unitsearchChange"
               />
@@ -113,6 +117,7 @@
                 v-model="ruleForm.is_exclusive"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="专属类型"
               >
@@ -131,6 +136,7 @@
               <el-input
                 placeholder="商品总重量"
                 v-model="ruleForm.weight"
+                :disabled="type === 'view'"
                 type="number"
                 :min="0"
                 :max="9999999999.99"
@@ -146,6 +152,7 @@
                 v-model="ruleForm.is_stock"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="是否库存品"
               >
@@ -162,9 +169,9 @@
             <el-form-item label="税点" prop="tax">
               <search-tax
                 :value="ruleForm.tax"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
                 :placeholder="'税点'"
                 @searchChange="taxsearchChange"
               />
@@ -175,6 +182,7 @@
               <el-input
                 placeholder="贵金属重量"
                 v-model="ruleForm.noble_weight"
+                :disabled="type === 'view'"
                 type="number"
                 :min="0"
                 :max="9999999999.99"
@@ -188,9 +196,9 @@
             <el-form-item label="贵金属种类" prop="noble_metal">
               <search-metal-kind
                 :value="ruleForm.noble_metal"
-                :disabled="false"
+                :disabled="type === 'view'"
                 :size="'mini'"
-                :isDetail="false"
+                :isDetail="type !== 'add'"
                 :placeholder="'贵金属种类'"
                 @searchChange="noble_metalsearchChange"
               />
@@ -202,6 +210,7 @@
                 v-model="ruleForm.is_gold_price"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="启用实时金价"
               >
@@ -220,6 +229,7 @@
               <el-input
                 type="textarea"
                 :rows="4"
+                :disabled="type === 'view'"
                 placeholder="售后说明"
                 v-model="ruleForm.after_sales"
               >
@@ -231,6 +241,7 @@
               <el-input
                 type="textarea"
                 :rows="4"
+                :disabled="type === 'view'"
                 placeholder="商品备注"
                 v-model="ruleForm.good_remark"
               >
@@ -241,6 +252,7 @@
             <el-form-item label="工艺说明" prop="craft_desc">
               <el-input
                 type="textarea"
+                :disabled="type === 'view'"
                 :rows="4"
                 placeholder="工艺说明"
                 v-model="ruleForm.craft_desc"
@@ -253,6 +265,7 @@
               <el-select
                 v-model="ruleForm.good_type"
                 filterable
+                :disabled="type === 'view'"
                 clearable
                 style="width: 100%"
                 placeholder="是否定制"
@@ -272,6 +285,7 @@
                 placeholder="定制起订量"
                 v-model="ruleForm.moq"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999"
                 :step="0"
@@ -283,6 +297,7 @@
               <el-input
                 placeholder="定制工期"
                 v-model="ruleForm.customized"
+                :disabled="type === 'view'"
                 type="number"
                 :min="0"
                 :max="9999999999"
@@ -363,6 +378,7 @@
             <el-form-item label="包装清单" prop="packing_list">
               <el-input
                 placeholder="包装清单"
+                :disabled="type === 'view'"
                 v-model="ruleForm.packing_list"
                 maxlength="250"
               />
@@ -372,6 +388,7 @@
             <el-form-item label="包装方式" prop="packing_way">
               <el-input
                 placeholder="包装方式"
+                :disabled="type === 'view'"
                 v-model="ruleForm.packing_way"
                 maxlength="250"
               />
@@ -381,6 +398,7 @@
             <el-form-item label="装箱规格" prop="packing_spec">
               <el-input
                 placeholder="装箱规格"
+                :disabled="type === 'view'"
                 v-model="ruleForm.packing_spec"
                 maxlength="250"
               />
@@ -390,6 +408,7 @@
             <el-form-item label="装箱重量" prop="packing_weight">
               <el-input
                 placeholder="装箱重量"
+                :disabled="type === 'view'"
                 v-model="ruleForm.packing_weight"
                 type="number"
                 :min="0"
@@ -404,6 +423,7 @@
             <el-form-item label="装箱尺寸" prop="packing_size">
               <el-input
                 placeholder="装箱尺寸"
+                :disabled="type === 'view'"
                 v-model="ruleForm.packing_size"
                 maxlength="250"
               />
@@ -414,6 +434,7 @@
             <el-form-item label="商品条形码" prop="good_bar">
               <el-input
                 placeholder="物流时间"
+                :disabled="type === 'view'"
                 v-model="ruleForm.good_bar"
                 type="number"
                 :min="0"
@@ -442,6 +463,7 @@
                 v-model="ruleForm.supply_area"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="供货区域"
               >
@@ -460,7 +482,7 @@
                 :placeholder="'发货地'"
                 :value="ruleForm.delivery_place"
                 :is-detail="id !== 'add'"
-                :disabled="isDetail"
+                :disabled="type === 'view'"
                 :size="'mini'"
                 @selectChange="selectAreadelivery_place"
               />
@@ -473,7 +495,7 @@
                 :value="ruleForm.origin_place"
                 :size="'mini'"
                 :is-detail="id !== 'add'"
-                :disabled="isDetail"
+                :disabled="type === 'view'"
                 @selectChange="selectAreaorigin_place"
               />
             </el-form-item>
@@ -485,6 +507,7 @@
                 v-model="ruleForm.delivery_day"
                 type="number"
                 :min="0"
+                :disabled="type === 'view'"
                 :max="9999999999"
                 :step="0"
               >
@@ -499,6 +522,7 @@
                 v-model="ruleForm.lead_time"
                 type="number"
                 :min="0"
+                :disabled="type === 'view'"
                 :max="9999999999"
                 :step="0"
               >
@@ -513,6 +537,7 @@
                 v-model="ruleForm.sample_day"
                 type="number"
                 :min="0"
+                :disabled="type === 'view'"
                 :max="9999999999"
                 :step="0"
               >
@@ -549,7 +574,7 @@
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <file-upload
                   class="Upload"
-                  :disabled="id == '007'"
+                  :disabled="type === 'view'"
                   :accept="'.jpg,.png,.jpeg'"
                   :multiple="true"
                   :uploadcondition="beforeAvatarUpload"
@@ -576,7 +601,7 @@
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                 <file-upload
                   class="Upload"
-                  :disabled="id == '007'"
+                 :disabled="type === 'view'"
                   :accept="'.jpg,.png,.jpeg'"
                   :multiple="true"
                   :uploadcondition="beforeAvatarUpload"
@@ -592,7 +617,7 @@
           </el-col>
           <el-col :span="16">
             <el-form-item label="详情介绍图" prop="good_info_img">
-              <div class="good_info_img-div">
+              <div class="good_info_img_div">
                 <ul v-if="ruleForm.good_info_img" class="clear">
                   <li
                     class="img-show-li"
@@ -600,19 +625,21 @@
                     v-for="(img, iindex) in ruleForm.good_info_img"
                     :key="img + iindex"
                   >
-                    <img :src="img" alt="" />
-                    <i class="el-icon-close" @click="closeImg(iindex)"></i>
+                    <div class="img-show-li-div">
+                      <img :src="img" class="img-show" alt="" />
+                      <i v-if="type !== 'view'" class="el-icon-close" @click="closeImg(iindex)"></i>
+                    </div>
                   </li>
                   <li
-                    class="img-upload-li"
-                    v-if="ruleForm.good_info_img.length < 10"
+                    class="img-show-li"
+                    v-if="ruleForm.good_info_img.length < 10&&type !== 'view'"
                   >
                     <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'"
+                          :disabled="type === 'view'"
                           :accept="'.jpg,.png,.jpeg'"
                           :multiple="true"
                           :uploadcondition="beforeAvatarUpload"
@@ -646,6 +673,7 @@
                 placeholder="证书费"
                 v-model="ruleForm.cert_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -660,6 +688,7 @@
                 placeholder="包装费"
                 v-model="ruleForm.packing_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -674,6 +703,7 @@
                 placeholder="成本工艺费"
                 v-model="ruleForm.cost_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -688,6 +718,7 @@
                 placeholder="加标费"
                 v-model="ruleForm.mark_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -702,6 +733,7 @@
                 placeholder="打样费"
                 v-model="ruleForm.demo_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -716,6 +748,7 @@
                 placeholder="开模费"
                 v-model="ruleForm.open_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -730,6 +763,7 @@
                 placeholder="调样费"
                 v-model="ruleForm.sample_fee"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -744,6 +778,7 @@
                 placeholder="市场价"
                 v-model="ruleForm.market_price"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -758,6 +793,7 @@
                 placeholder="含税成本合计"
                 v-model="ruleForm.nake_price"
                 type="number"
+                :disabled="type === 'view'"
                 :min="0"
                 :max="9999999999.99"
                 :step="2"
@@ -778,7 +814,7 @@
           <li>本</li>
         </ul></el-col
       >
-      <el-col :span="23" class="dmain" style="padding-left: 18px">
+      <el-col :span="23" class="dmain" >
         <el-row>
           <el-col :span="8">
             <el-form-item label="启用阶梯" prop="is_step">
@@ -786,6 +822,7 @@
                 v-model="ruleForm.is_step"
                 filterable
                 clearable
+                :disabled="type === 'view'"
                 style="width: 100%"
                 placeholder="启用阶梯"
               >
@@ -798,7 +835,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
+          <el-col :span="24" style="padding-left: 18px">
             <el-table
               :data="tableData1"
               :size="'mini'"
@@ -838,14 +875,6 @@
               </el-table-column>
             </el-table>
           </el-col>
-          <el-col :span="24" style="text-align: right">
-            <el-button v-if="id !== '007'" type="primary" @click="submitForm"
-              >保 存
-            </el-button>
-            <el-button @click="showModelThis = false">{{
-              id == "007" ? "关 闭" : "取 消"
-            }}</el-button>
-          </el-col>
         </el-row>
         <!-- 弹窗 新增/修改 -->
         <cost-form-add-edit
@@ -854,8 +883,22 @@
           :sitem="costsitem"
           @refresh="costrefreshEdit"
           @cancel="costshowModel = false"
-        /> </el-col
-    ></el-row>
+        />
+      </el-col>
+      <el-col
+        :span="24"
+        v-if="id !== '007'"
+        style="
+          text-align: right;
+          padding: 15px 0 15px 0;
+          border-top: 1px solid #dcdfe6;
+        "
+      >
+        <el-button :size="'mini'" type="primary" @click="submitForm"
+          >保 存
+        </el-button>
+      </el-col></el-row
+    >
   </el-form>
 </template>
    <script>
@@ -877,7 +920,7 @@ import {
 export default {
   name: "goodsCostAdd",
   mixins: [resToken],
-    props: ["showModel", "id", "sitem"],
+  props: ["showModel", "id", "type", "sitem"],
   components: {
     baseFormAddEdit,
     costFormAddEdit,
@@ -905,15 +948,16 @@ export default {
   },
   data() {
     return {
+      brand_name: "",
+      unit_name: "",
       costshowModel: false,
       costmodelIndex: "",
       costsitem: {},
       showModel: false,
       modelIndex: "",
       is_noble: false,
-      sitem: {},
       size: "small",
-
+      status: "",
       rulesThis: this.rules,
       activeName: "1",
       loading: false,
@@ -954,81 +998,6 @@ export default {
       this.costsitem = sitem;
       this.costshowModel = true;
     },
-    async initData() {
-      this.loading = true;
-      const { code, data, message } = await asyncRequest.detail({
-        id: this.id,
-      });
-      this.loading = false;
-      if (code === 0) {
-        await this.resetForm(data);
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(message);
-      }
-    },
-    async resetForm() {
-      // 重置
-      await this.$nextTick(async () => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.resetFormData();
-        }
-      });
-    },
-    resetFormData() {
-      this.ruleForm = {
-        cat_id: ["1", "53"],
-        brandid: [],
-        noble_weight: "",
-        weight: "111",
-        good_type: "0",
-        is_stock: "",
-        supplierNo: ["GYS-20210520-0001"],
-        company_id: "GSec37220215151111",
-        is_auth: "",
-        tax: "",
-        good_name: "2018春秋新款V领修身丝绒西装女 双排扣复古极简中长款工装外套",
-        unit: ["3"],
-        is_exclusive: "",
-        noble_metal: "",
-        is_gold_price: "",
-        moq: "",
-        customized: "",
-        after_sales: "",
-        craft_desc: "",
-        good_remark: "备注备注",
-        //包装发货/图片
-        packing_list: "",
-        packing_way: "",
-        packing_spec: "",
-        packing_weight: "",
-        packing_size: "",
-        good_bar: "",
-        supply_area: "",
-        delivery_place: [],
-        origin_place: [],
-        delivery_day: "",
-        lead_time: "",
-        sample_day: "",
-        good_thumb_img: "",
-        // good_img: "",
-        good_info_img: [],
-        //固定阶梯成本
-        cert_fee: "",
-        packing_fee: "",
-        cost_fee: "",
-        mark_fee: "",
-        demo_fee: "",
-        open_fee: "",
-        sample_fee: "",
-        market_price: "",
-        nake_price: "",
-      };
-    },
-
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
@@ -1134,6 +1103,158 @@ export default {
         return value1 - value2;
       };
     },
+
+    resetFormData() {
+      const {
+        id,
+        spuCode, //string	商品spuCode
+        // good_code, //string	无
+        good_name, //string	商品名称
+        // cat_id, //string	分类id
+        cat_info, //array 分类
+        brand_id, //string	品牌id
+        unit,
+        company_id, //	string	企业公司id
+        good_unit, //	string	商品单位
+        good_type, //string	是否定制 1是0否
+        moq, //string	起订量
+        is_exclusive, //	string	是否是专属
+        customized, //	string	定制工期
+        tax, //string	税率
+        supplierNo, //	string	供应商
+        is_auth, //string	是否有销售权限0 否1 是
+        auth_img, //	string	无
+        is_stock, //
+        after_sales, //	string	售后说明
+        craft_desc, //	string	工艺说明
+        good_remark, //	string	商品备注
+        weight, //	string	重量
+        packing_way, //	string	包装方式
+        packing_size, //	string	包装尺寸
+        packing_spec, //	string	包装规格
+        packing_list, //	string	包装清单
+        packing_weight, //	string	装箱重量
+        good_bar, //	string	条形码
+        supply_area, //	string	供货区域 1 全国2 除偏远地区
+        delivery_place, //	string	发货地区
+        origin_place, //	string	产地
+        delivery_day, //	string	物流天数
+        lead_time, //	string	供货周期
+        sample_day, //string	调样周期
+        sample_fee, //		string	调样费有
+        good_img, //	string	商品图片
+        good_thumb_img, //	string	商品说略图
+        good_info_img, //	string	商品详情图
+        cert_fee, //	string	证书费
+        packing_fee, //	string	打包费
+        cost_fee, //	string	工艺费
+        mark_fee, //	string	加标费
+        demo_fee, //	string	打样费
+        open_fee, //	string	开模费
+        noble_metal, //	string	金属类别
+        noble_weight, //	string	金属重量
+        is_gold_price, //	string	是否使用实时金价
+        market_price, //	string	市场价
+        nake_price, //	string	成本裸价
+        is_step, //	string	是否使用阶梯价
+        is_online, //	string	是否上线
+        status, //		string	状态
+        nakelist, //階梯成本
+        speclist, //商品规格
+        brand_name,
+      } = this.sitem;
+      let cat_id = [];
+      (cat_info || []).forEach((i) => {
+        cat_id.push(i.id);
+      });
+      this.tableData = [];
+      let list1 =
+        speclist && speclist.length > 0
+          ? JSON.parse(JSON.stringify(speclist))
+          : [];
+      list1.forEach((a) => {
+        let model = {
+          id: a.id,
+          is_del: a.is_del,
+          spec_id: a.spec_id,
+          spec_value: a.spec_name,
+          spec_value_value: a.spec_value,
+          spec_value_id: a.spec_value_id,
+          spuCode: a.spuCode,
+        };
+        this.tableData.push(model);
+      });
+      this.tableData1 = [];
+      let list2 =
+        nakelist && nakelist.length > 0
+          ? JSON.parse(JSON.stringify(nakelist))
+          : [];
+      this.tableData1 = list2;
+      this.status = status;
+      this.brand_name = brand_name;
+      this.unit_name = unit;
+      this.ruleForm = {
+        id: id || "",
+        spuCode: spuCode || "",
+        cat_id: cat_id || [],
+        brandid: brand_id ? [brand_id] : [],
+        noble_weight: noble_weight || "",
+        weight: weight || "",
+        good_type: good_type || "0",
+        is_stock: is_stock || "0",
+        supplierNo: supplierNo ? [supplierNo] : [],
+        company_id: "GSec37220215151111",
+        is_auth: is_auth || "",
+        tax: tax + "%" || "",
+        good_name: good_name || "",
+        unit: good_unit ? [good_unit] : [],
+        is_exclusive: is_exclusive || "",
+        noble_metal: noble_metal || "",
+        is_gold_price: is_gold_price || "",
+        moq: moq || "",
+        customized: customized || "",
+        after_sales: after_sales || "",
+        craft_desc: craft_desc || "",
+        good_remark: good_remark || "",
+        //包装发货/图片
+        packing_list: packing_list || "",
+        packing_way: packing_way || "",
+        packing_spec: packing_spec || "",
+        packing_weight: packing_weight || "",
+        packing_size: packing_size || "",
+        good_bar: good_bar || "",
+        supply_area: supply_area || "",
+        delivery_place: (delivery_place || "").split(","),
+        origin_place: (origin_place || "").split(","),
+        delivery_day: delivery_day || "",
+        lead_time: lead_time || "",
+        sample_day: sample_day || "",
+        good_thumb_img: good_thumb_img || "",
+        // good_img: "",
+        good_info_img: (good_info_img || "").split(","),
+        //固定阶梯成本
+        cert_fee: cert_fee || "",
+        packing_fee: packing_fee || "",
+        cost_fee: cost_fee || "",
+        mark_fee: mark_fee || "",
+        demo_fee: demo_fee || "",
+        open_fee: open_fee || "",
+        sample_fee: sample_fee || "",
+        market_price: market_price || "",
+        nake_price: nake_price || "",
+        is_step: is_step || "",
+      };
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(async () => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.resetFormData();
+        }
+      });
+    },
     //商品分类选择
     goods_class_change(e) {
       console.log(e);
@@ -1186,13 +1307,7 @@ export default {
     },
     //税点选择
     taxsearchChange(e) {
-      // console.log(e);
-      const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.tax = label;
-      } else {
-        this.ruleForm.tax = "";
-      }
+      this.ruleForm.tax = e;
       this.$refs.ruleForm.validateField("tax");
     },
     //单位选择
@@ -1308,7 +1423,46 @@ export default {
 };
 </script>
    <style lang="scss" scoped>
-.goodsCostAdd {
+.goodsCostDetail {
+  // position: relative;
+  .good_info_img_div {
+    ul {
+      width: 100%;
+      li {
+        float: left;
+        width: 107px;
+        height: 107px;
+        padding: 0 5px 0 0;
+        .img-show-li-div {
+          width: 102px;
+          height: 102px;
+          border: 1px solid #dfe4ed;
+          background: #dfe4ed;
+          position: relative;
+          img.img-show {
+            width: 100%;
+            height: 100%;
+            position: relative;
+            display: inline-block;
+          }
+          i.el-icon-close {
+            position: absolute;
+            z-index: 2;
+            top: 0;
+            right: 0;
+            color: #dfe4ed;
+          }
+          &:hover {
+            i.el-icon-close {
+              cursor: pointer;
+              color: #63cbe7;
+            }
+          }
+        }
+      }
+    }
+  }
+
   .goodsCostAdd-title {
     border-top: 1px solid #ebeef5;
     span {

+ 35 - 6
src/views/goodStore/goodsCost/detail.vue

@@ -6,12 +6,24 @@
     >
       <el-tabs v-model="activeTabs">
         <el-tab-pane label="新建商品" name="0" v-if="queryType === 'add'">
-          <base-form :type="queryType" :id="queryId" :newTime="newTime" />
+          <base-form
+            v-if="newTime !== ''"
+            :type="queryType"
+            :id="queryId"
+            :newTime="newTime"
+            :sitem="sitem"
+          />
         </el-tab-pane>
         <el-tab-pane label="商品详情" name="1" v-if="queryType !== 'add'">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
-            <el-collapse-item title="退货单详情" name="0">
-              <base-form :type="queryType" :id="queryId" :newTime="newTime" />
+            <el-collapse-item title="商品详情" name="0">
+              <base-form
+                v-if="newTime !== ''"
+                :type="queryType"
+                :id="queryId"
+                :newTime="newTime"
+                :sitem="sitem"
+              />
             </el-collapse-item>
             <el-collapse-item title="发起流程" name="1"> 555 </el-collapse-item>
             <el-collapse-item title="业务审核" name="2"> 444 </el-collapse-item>
@@ -69,6 +81,8 @@ export default {
       loading: false,
       queryType: "",
       queryId: "",
+      status: "",
+      sitem: null,
     };
   },
   mounted() {
@@ -81,6 +95,12 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
+      if (this.queryType === "add") {
+        this.sitem = {};
+        this.getNewTime();
+      } else {
+        await this.initData();
+      }
 
       this.loading = false;
     },
@@ -89,10 +109,19 @@ export default {
     },
     async initData() {
       this.loading = true;
-      let res = await asyncRequest.detail({ id: this.id });
+      const { code, message, data } = await asyncRequest.detail({
+        spuCode: this.queryId,
+      });
       this.loading = false;
-      if (res.code === 0) {
-        await this.resetForm(res.data);
+      if (code === 0) {
+        this.sitem = JSON.parse(JSON.stringify(data));
+        const { status } = this.sitem;
+        this.status = status;
+        this.getNewTime();
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
       }
     },
     getNewTime() {

+ 3 - 1
src/views/goodStore/goodsCost/index.vue

@@ -198,7 +198,9 @@
                 :size="searchSize"
                 type="success"
                 style="float: right"
-                @click="routeGoto('goodsCostAdd', { type: 'add' })"
+                @click="
+                  routeGoto('goodsCostDetail', { id: 'add', type: 'add' })
+                "
               >
                 添加
               </el-button>