戴艳蓉 3 years ago
parent
commit
ed12ff2872

+ 11 - 11
src/apis/service/sellOut/zixunOrder/index.js

@@ -3,14 +3,15 @@ import http from "@/apis/axios";
 const api = "admin/";
 export default {
   // 添加
-  add: (data, params) => http(api + "aftercreate", data, "post", params),
+  add: (data, params) => http(api + "consultcreate", data, "post", params),
+  // 分页查询项目列表
+  plist: (data, params) => http(api + "projectlist", data, "post", params),
   // 删除
   delete: (data, params) => http(api + "delete", data, "post", params),
   // 分页查询
-  list: (data, params) => http(api + "afterlist", data, "post", params),
-  // 分页查询项目列表
-  plist: (data, params) => http(api + "projectlist", data, "post", params),
-  
+  list: (data, params) => http(api + "consultlists", data, "post", params),
+
+
   // 详情
   detail: (data, params) => http(api + "afterinfo", data, "post", params),
   // 更新
@@ -20,13 +21,12 @@ export default {
   // 异常原因接口
   reasonList: (data, params) => http(api + "resultlist", data, "post", params),
   // 物流反馈
-  afterFeed: (data, params) => http(api + "afterfeed", data, "post", params),  
+  afterFeed: (data, params) => http(api + "afterfeed", data, "post", params),
   // 企业客户反馈
-  aftergys: (data, params) => http(api + "aftergys", data, "post", params),  
- // 售后快递录入
-  afterPost : (data, params) => http(api + "afterpost ", data, "post", params),  
+  aftergys: (data, params) => http(api + "aftergys", data, "post", params),
+  // 售后快递录入
+  afterPost: (data, params) => http(api + "afterpost ", data, "post", params),
   //售后获取仓库list
-  afterwsm: (data, params) => http(api + "afterwsm ", data, "post", params),  
+  afterwsm: (data, params) => http(api + "afterwsm ", data, "post", params),
 
 };
-   

+ 8 - 0
src/views/sellOut/zixunOrder/columns.js

@@ -81,6 +81,14 @@ const rules = {
       trigger: "change",
     },
   ],
+  unit: [
+    {
+      type: "array",
+      required: false,
+      message: "请选择单位",
+      trigger: "change",
+    },
+  ],
   cat_id: [
     {
       type: "array",

+ 23 - 213
src/views/sellOut/zixunOrder/components/ShowDataTableColumns.js

@@ -2,34 +2,40 @@ export default [
   {
     prop: "brand_id",
     label: "品牌",
+    span: 4,
   },
 
   {
     prop: "model",
     label: "型号",
+    span: 4,
   },
   {
     prop: "color",
     label: "颜色",
+    span: 4,
   },
   {
     prop: "material",
     label: "材质",
+    span: 4,
   },
   {
     prop: "total_weight",
     label: "商品重量(g)",
+    span: 4,
   },
   {
     prop: "is_addrs",
     label: "是否多地",
     _slot_: "is_auth",
+    span: 4,
   },
   {
     prop: "is_custom",
     label: "是否定制",
     _slot_: "is_custom",
-    span: 8,
+    span: 4,
   },
 
 
@@ -40,241 +46,45 @@ export default [
     span: 8,
   },
   {
-    prop: "platform_name",
-    label: "上线平台",
+    prop: "config",
+    label: "配置要求",
     span: 8,
   },
   {
-    prop: "platform_name",
-    label: "平台商品编码",
+    prop: "specs_weight",
+    label: "金属克重",
     span: 8,
   },
   {
-    prop: "online_time",
-    label: "上线时间",
+    prop: "other_config",
+    label: "其他要求",
     span: 8,
   },
   {
-    prop: "cat",
-    label: "分类",
+    prop: "cost_desc",
+    label: "工艺说明",
     span: 8,
   },
   {
-    prop: "online_remark",
-    label: "上线备注",
+    prop: "use_desc",
+    label: "产品用途",
     span: 24,
   },
   {
-    prop: "brand_name",
-    label: "品牌",
-    span: 8,
-  },
-  {
-    prop: "unit",
-    label: "单位",
-    span: 8,
-  },
-
-  {
-    prop: "is_auth",
-    label: "供应商权限",
-    _slot_: "is_auth",
-    span: 8,
-  },
-  {
-    prop: "exclusive",
-    label: "专属类型",
-    // _slot_: "exclusive",
-    span: 8,
-  },
-  {
-    prop: "weight",
-    label: "商品总克重",
-    span: 8,
-  },
-  {
-    prop: "is_stock",
-    label: "是否库存品",
-    _slot_: "is_stock",
-    span: 8,
-  },
-  {
-    prop: "tax",
-    label: "税点",
-    span: 8,
-  },
-  {
-    prop: "good_type",
-    label: "是否定制",
-    _slot_: "good_type",
-    span: 8,
-  },
-
-  {
-    prop: "packing_list",
-    label: "包装清单",
-    span: 8,
-  },
-  {
-    prop: "packing_way",
-    label: "包装方式",
-    span: 8,
-  },
-  {
-    prop: "packing_spec",
-    label: "装箱规格",
-    span: 8,
-  },
-  {
-    prop: "packing_weight",
-    label: "装箱重量(g)",
-    span: 8,
-  },
-  {
-    prop: "packing_size",
-    label: "装箱尺寸",
-    span: 8,
-  },
-  {
-    prop: "good_bar",
-    label: "商品条形码",
-    span: 8,
-  },
-  {
-    prop: "supply_area",
-    label: "供货区域",
-    _slot_: "supply_area",
-    span: 8,
-  },
-  {
-    prop: "delivery_place_cn",
-    label: "发货地",
-    span: 8,
-  },
-  {
-    prop: "origin_place_cn",
-    label: "产地",
-    span: 8,
-  },
-  {
-    prop: "delivery_day",
-    label: "物流时间(天)",
-    span: 8,
-  },
-  {
-    prop: "lead_time",
-    label: "供货周期(天)",
-    span: 8,
-  },
-  {
-    prop: "sample_day",
-    label: "调样周期(天)",
-    span: 8,
-  },
-
-
-  {
-    prop: "cert_fee",
-    label: "证书费(元)",
-    span: 8,
-  },
-  {
-    prop: "packing_fee",
-    label: "包装费(元)",
-    span: 8,
-  },
-  {
-    prop: "cost_fee",
-    label: "成本工艺费(元)",
-    span: 8,
-  },
-
-  {
-    prop: "mark_fee",
-    label: "加标费(元)",
-    span: 8,
-  },
-  {
-    prop: "demo_fee",
-    label: "打样费(元)",
+    prop: "remark",
+    label: "商品备注",
     span: 8,
   },
   {
-    prop: "open_fee",
-    label: "开模费(元)",
+    prop: "metal_id",
+    label: "贵金属种类",
     span: 8,
   },
 
   {
-    prop: "sample_fee",
-    label: "调样费(元)",
-    span: 8,
-  },
-  {
-    prop: "market_price",
-    label: "市场价(元)",
-    span: 8,
-  },
-  {
-    prop: "nake_price",
-    label: "含税成本合计",
-    span: 8,
-  },
-  {
-    prop: "is_step",
-    label: "启用阶梯",
-    _slot_: "is_step",
-    span: 8,
-  },
-  {
-    prop: "exam_status",
-    label: "状态",
-    _slot_: "exam_status",
-    span: 8,
-  },
-  {
-    prop: "updatetime",
-    label: "更新时间",
+    prop: "gold_price",
+    label: "当前金价",
     span: 8,
   },
-  {
-    prop: "addtime",
-    label: "创建时间",
-    span: 8,
-  },
-
-
-  {
-    prop: "after_sales",
-    label: "售后说明",
-    span: 24,
-  },
-  {
-    prop: "good_remark",
-    label: "商品备注",
-    span: 24,
-  },
-
-  {
-    prop: "craft_desc",
-    label: "工艺说明",
-    span: 24,
-  },
-
-  {
-    prop: "nakelist",
-    label: "采购起订量",
-    _slot_: "nakelist",
-    span: 24,
-  },
-
-  {
-    prop: "ladderlist",
-    label: "销售起订量",
-    _slot_: "ladderlist",
-    span: 24,
-  },
-
-
 ]
 

+ 21 - 20
src/views/sellOut/zixunOrder/components/addEditForm.vue

@@ -557,31 +557,32 @@ export default {
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          const { anomalous_numbers } = this.ruleForm;
-
+          this.loading = true;
+          if (this.tableData.length === 0) {
+            this.$message.warning("至少提供一条商品要求!");
+            this.loading = false;
+            return;
+          }
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-
-          // console.log("调接口");
-          let _model = {
-            order_type: "1",
-            outCode: model.outCode,
-            errorCode: model.anomalous_reason, //异常原因
-            num: model.anomalous_numbers,
-            remark: model.anomalous_remark,
-            except_code: model.expect_wish,
-            img: model.anomalous_images.toString(),
-          };
-
-          console.log(_model);
-          const res = await asyncRequest.add(_model);
-
+          model.khNo = model.khNo.toString();
+          model.platform_code = model.platform_code.toString();
+          model.projectNo = model.projectNo.toString();
+          model.ladder = JSON.parse(JSON.stringify(this.tableData));
+          model.ladder.forEach((e) => {
+            e.brand_id = e.brand_id.toString();
+            e.unit = e.unit.toString();
+            e.cat_id = e.cat_id[e.cat_id.length - 1];
+            e.config = e.config.toString();
+          });
+          console.log(model);
+          const res = await asyncRequest.add(model);
+          this.loading = false;
           if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功!" : "修改成功!";
             this.$notify.success({
-              title,
+              title: "创建成功!",
               message: "",
             });
-            this.$emit("refresh", false);
+            this.$emit("refresh", true);
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();
           } else {

+ 74 - 45
src/views/sellOut/zixunOrder/components/addEditGoodModal.vue

@@ -142,6 +142,19 @@
                     minlength="100"
                   />
                 </el-form-item>
+                <el-col :span="8">
+                  <el-form-item label="单位" prop="unit">
+                    <search-unit
+                      :value="ruleForm.unit"
+                      :disabled="id == '007'"
+                      :size="'mini'"
+                      :isDetail="unit_name !== ''"
+                      :names="unit_name"
+                      :placeholder="'商品单位'"
+                      @searchChange="unitsearchChange"
+                    />
+                  </el-form-item>
+                </el-col>
                 <el-col :span="8">
                   <el-form-item label="型号" prop="model">
                     <el-input
@@ -206,23 +219,6 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-                <el-col :span="8">
-                  <el-form-item label="是否定制" prop="is_custom">
-                    <el-select
-                      v-model="ruleForm.is_custom"
-                      placeholder="是否定制"
-                      style="width: 100%"
-                    >
-                      <el-option
-                        v-for="item in is_custom_options"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                      >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-col>
               </el-col>
 
               <el-col :span="8" v-if="is_noble">
@@ -326,29 +322,48 @@
                 </el-form-item>
               </el-col>
               <el-col :span="24" style="text-align: right">
-                <el-col :span="8" v-if="is_noble">
-                  <el-form-item label="贵金属种类" prop="metal_id">
-                    <el-input
-                      v-model="ruleForm.metal_id"
-                      :disabled="id == '007'"
-                      placeholder="贵金属种类"
-                      minlength="20"
-                    />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8" v-if="is_noble">
-                  <el-form-item
-                    label="当前金价"
-                    prop="gold_price"
-                    style="margin: 0 0 0 0"
-                  >
-                    <el-input
-                      v-model="ruleForm.gold_price"
-                      disabled
-                      placeholder="当前金价"
-                      minlength="500"
-                    />
-                  </el-form-item>
+                <el-col :span="16">
+                  <el-col :span="8">
+                    <el-form-item label="是否定制" prop="is_custom">
+                      <el-select
+                        v-model="ruleForm.is_custom"
+                        placeholder="是否定制"
+                        style="width: 100%"
+                      >
+                        <el-option
+                          v-for="item in is_custom_options"
+                          :key="item.value"
+                          :label="item.label"
+                          :value="item.value"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="8" v-if="is_noble">
+                    <el-form-item label="贵金属种类" prop="metal_id">
+                      <el-input
+                        v-model="ruleForm.metal_id"
+                        :disabled="id == '007'"
+                        placeholder="贵金属种类"
+                        minlength="20"
+                      />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="8" v-if="is_noble">
+                    <el-form-item
+                      label="当前金价"
+                      prop="gold_price"
+                      style="margin: 0 0 0 0"
+                    >
+                      <el-input
+                        v-model="ruleForm.gold_price"
+                        disabled
+                        placeholder="当前金价"
+                        minlength="500"
+                      />
+                    </el-form-item>
+                  </el-col>
                 </el-col>
                 <el-button
                   v-if="id !== '007'"
@@ -369,7 +384,6 @@
   </el-dialog>
 </template>
 <script>
-import asyncRequest from "@/apis/service/goodStore/brand";
 import resToken from "@/mixins/resToken";
 import { rules } from "../columns";
 export default {
@@ -411,6 +425,7 @@ export default {
         num: "0",
         brand_id: [],
         cat_id: [],
+        unit: [],
         good_img: "",
         good_name: "",
         model: "",
@@ -429,6 +444,7 @@ export default {
         metal_id: "",
         gold_price: "",
       },
+      unit_name: "",
       rulesThis: this.rules,
       rules: rules,
     };
@@ -491,7 +507,10 @@ export default {
             remark,
             metal_id,
             gold_price,
+            unit,
+            unit_name,
           } = this.sitem;
+          this.unit_name = unit_name || "";
           this.ruleForm = {
             pgNo: pgNo || "",
             arrival_time: arrival_time || "",
@@ -505,9 +524,9 @@ export default {
             color: color || "",
             material: material || "",
             total_weight: total_weight || "0",
-            is_addrs: is_addrs || "",
-            is_custom: is_custom || "",
-            is_gold_price: is_gold_price || "",
+            is_addrs: is_addrs || "0",
+            is_custom: is_custom || "0",
+            is_gold_price: is_gold_price || "0",
             config: config ? [config] : [],
             specs_weight: specs_weight || "0.000",
             other_config: other_config || "",
@@ -516,11 +535,21 @@ export default {
             remark: remark || "",
             metal_id: metal_id || "",
             gold_price: gold_price || "",
+            unit: unit ? [unit] : [],
           };
         }
       });
     },
-
+    //单位选择
+    unitsearchChange(e) {
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.unit = [code];
+      } else {
+        this.ruleForm.unit = [];
+      }
+      this.$refs.ruleForm.validateField("unit");
+    },
     //预算单价
     budget_price_change(e) {
       this.ruleForm.budget_price = e + "";

+ 2 - 8
src/views/sellOut/zixunOrder/detail.vue

@@ -179,14 +179,8 @@ export default {
     handleClick(row) {
       console.log(row);
     },
-    async refresh(e) {
-      const { projectNo } = e;
-      let model = {
-        id: this.queryType === "add" ? projectNo : this.queryId,
-        type: "view",
-      };
-      this.routeReGoto("zixunOrderDetail", model);
-      await this.initForm();
+    async refresh() {
+      this.routeReGoto("zixunOrder", {});
     },
     async initData() {
       this.loading = true;