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

Merge branch 'sit'

戴艳蓉 3 éve
szülő
commit
f53118e44c

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 119 - 0
dist/static/js/0.js


+ 6 - 0
src/apis/components/addr-add-edit-modal.js

@@ -0,0 +1,6 @@
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 区编码获取省市区汉字
+  addrall: (data, params) => http(api + "addrall", data, "post", params),
+};

+ 4 - 0
src/apis/service/sellOut/project/index.js

@@ -31,4 +31,8 @@ export default {
   project_make_plan: (data, params) => http(api + "plancreate", data, "post", params),
   // 查询方案列表
   get_project_plan: (data, params) => http(api + "projectplan", data, "post", params),
+  // 项目下单
+  project_place_order: (data, params) => http(api + "projectorder", data, "post", params),
+  // 区编码获取省市区汉字
+  addrall: (data, params) => http(api + "addrall", data, "post", params),
 };

+ 4 - 1
src/apis/service/sellOut/zixunOrder/index.js

@@ -25,5 +25,8 @@ export default {
   bargain_add: (data, params) => http(api + "consultbaradd", data, "post", params),
   // 咨询单选定商品
   bidscheck: (data, params) => http(api + "bidscheck", data, "post", params),
-
+  // 咨询商品下单
+  consultorder: (data, params) => http(api + "consultorder", data, "post", params),
+  // 区编码获取省市区汉字
+  addrall: (data, params) => http(api + "addrall", data, "post", params),
 };

+ 1 - 1
src/assets/js/btnList.js

@@ -60,7 +60,6 @@ const btnList = [
   { code: "059", name: "财务审核定价" },
   { code: "060", name: "设置毛利率" },
   { code: "061", name: "查看毛利率" },
-  //
   { code: "062", name: "添加线上商品" },
   { code: "063", name: "分享项目" },
   { code: "064", name: "制定项目方案" },
@@ -70,6 +69,7 @@ const btnList = [
   { code: "068", name: "发起议价" },
   { code: "069", name: "选定商品" },
   { code: "070", name: "非项目咨询单下单" },
+  { code: "071", name: "操作上线" },
 
 ];
 export default btnList;

+ 24 - 58
src/components/addr-add-edit-modal/index.vue

@@ -29,17 +29,6 @@
             placeholder="收货总数"
           />
         </el-form-item>
-        <el-form-item label="最晚收货日期" prop="arrive_time">
-          <el-date-picker
-            v-model="ruleForm.arrive_time"
-            type="date"
-            style="width: 100%"
-            placeholder="最晚收货日期"
-            value-format="yyyy-MM-dd"
-            :picker-options="pickerOptions"
-          >
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="收货联系人" prop="contactor">
           <el-input
             v-model="ruleForm.contactor"
@@ -93,6 +82,7 @@
 <script>
 import { isnumber, isMobile } from "@/utils/validate";
 import { province_list, city_list, county_list } from "@/assets/js/area-data";
+import asyncRequest from "@/apis/components/addr-add-edit-modal";
 export default {
   name: "AddrAddEditModal",
   props: ["showModel", "index", "sitem", "type"],
@@ -131,7 +121,6 @@ export default {
       },
       showModelThis: this.showModel,
       ruleForm: {
-        arrive_time: "",
         receipt_quantity: "",
         contactor: "",
         mobile: "",
@@ -141,13 +130,6 @@ export default {
       },
       rulesThis: this.rules,
       rules: {
-        arrive_time: [
-          {
-            required: true,
-            message: "最晚收货日期不能为空",
-            trigger: "change",
-          },
-        ],
         receipt_quantity: [
           {
             required: true,
@@ -227,7 +209,6 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           const {
-            arrive_time,
             receipt_quantity,
             contactor,
             mobile,
@@ -238,7 +219,6 @@ export default {
             id,
           } = this.sitem;
           this.ruleForm = {
-            arrive_time: arrive_time || "",
             receipt_quantity,
             contactor,
             mobile,
@@ -267,48 +247,34 @@ export default {
       });
     },
     //省市区选择
-    select_area_change(e) {
+    async select_area_change(e) {
       this.ruleForm.addr_code = e;
       this.$refs.ruleForm.validateField("addr_code");
 
-      if (e && e.length === 3) {
-        let item = this.get_name(e[0], e[1], e[2]);
-        this.ruleForm.addr_code_name = item.name;
-      } else {
-        this.ruleForm.addr_code_name = "";
-      }
-    },
-    get_name(code1, code2, code3) {
-       let name = "",
-        code = [];
-      if (code1 && code2 && code3) {
-        for (let x in province_list) {
-          if (code1 === x) {
-            code.push(x);
-            name += province_list[x];
-            break;
-          }
-        }
-        if (code.length === 1) {
-          for (let y in city_list) {
-            if (code2 === y) {
-              code.push(y);
-              name += "/" + city_list[y];
-              break;
-            }
-          }
-        }
-        if (code.length === 2) {
-          for (let z in county_list) {
-            if (code3 === z) {
-              code.push(z);
-              name += "/" + county_list[z];
-              break;
-            }
-          }
+      const { addr_code } = this.ruleForm;
+      if (addr_code && addr_code.length === 3) {
+        let arrCode = addr_code[addr_code.length - 1];
+        // console.log(model);
+        let { code, data, message } = await asyncRequest.addrall({
+          code: arrCode,
+        });
+        if (code === 0) {
+          const { province, city, area } = data;
+          let province_name = province && province.name ? province.name : "";
+          let city_name = city && city.name ? city.name : "";
+          let area_name = area && area.name ? area.name : "";
+          this.addrForm.addr_code_name =
+            province_name && city_name && area_name
+              ? `${province_name}/${city_name}/${area_name}`
+              : "";
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
         }
+      } else {
+        this.addrForm.addr_code_name = "";
       }
-      return { name: name, code: code };
     },
     get_code(name1, name2, name3) {
       let name = "",

+ 8 - 23
src/components/in-addr-model/index.vue

@@ -32,12 +32,7 @@
             show-overflow-tooltip
           />
 
-          <el-table-column
-            prop="arrive_time"
-            label="最晚收货日期"
-            width="100"
-            show-overflow-tooltip
-          />
+       
           <el-table-column prop="contactor" label="收件联系人"  show-overflow-tooltip width="85" />
 
           <el-table-column prop="mobile" label="收货联系电话"  show-overflow-tooltip width="100" />
@@ -142,13 +137,7 @@ export default {
         order_addr: [], //收货地址
       },
       rules: {
-        arrive_time: [
-          {
-            required: true,
-            message: "最晚收货日期不能为空",
-            trigger: "change",
-          },
-        ],
+    
         receipt_quantity: [
           {
             required: true,
@@ -230,7 +219,6 @@ export default {
         this.ruleForm.order_addr.push(JSON.parse(JSON.stringify(item)));
       } else {
         const {
-          arrive_time,
           receipt_quantity,
           contactor,
           mobile,
@@ -240,7 +228,6 @@ export default {
           id,
         } = JSON.parse(JSON.stringify(item));
         this.ruleForm.order_addr[index].receipt_quantity = receipt_quantity;
-        this.ruleForm.order_addr[index].arrive_time = arrive_time;
         this.ruleForm.order_addr[index].contactor = contactor;
         this.ruleForm.order_addr[index].mobile = mobile;
         this.ruleForm.order_addr[index].addr_code = addr_code;
@@ -268,7 +255,6 @@ export default {
       }
       let head = [
         "收货总数",
-        "最晚收货日期",
         "收货联系人",
         "收货联系电话",
         "收货省名称",
@@ -298,17 +284,15 @@ export default {
       this.ruleForm.order_addr = [];
       list.forEach((v1) => {
         let b = Object.values(v1);
-        let time = this.setTime((b[1] + "").replace(/^\s*|\s*$/g, ""));
-        let item = this.get_code(b[4], b[5], b[6]);
+        let item = this.get_code(b[3], b[4], b[5]);
         let model = {
           receipt_quantity: b[0] + "",
-          arrive_time: time + "",
-          contactor: b[2] + "",
-          mobile: b[3] + "",
-          in_addr: b[4] + "/" + b[5] + "/" + b[6],
+          contactor: b[1] + "",
+          mobile: b[2] + "",
+          in_addr: b[3] + "/" + b[4] + "/" + b[5],
           addr_code_name: item.name + "",
           addr_code: item.code,
-          addr: b[7] + "",
+          addr: b[6] + "",
           edit: false,
         };
         this.ruleForm.order_addr.push(model);
@@ -414,6 +398,7 @@ export default {
         this.loading = false;
         this.showModelThis = false;
         let list = JSON.parse(JSON.stringify(order_addr));
+        console.log(list);
         this.$emit("refresh", { list: list });
       }
     },

+ 1 - 1
src/views/goodStore/goodsCost/detail.vue

@@ -33,7 +33,7 @@
               name="1"
               v-if="
                 (status === '0' || status === '2' || status === '3') &&
-                queryType === 'view'
+                queryType === 'view'&&powers.some((item) => item == '036')
               "
             >
               <exam-form

+ 28 - 8
src/views/goodStore/goodsOnline/detail.vue

@@ -79,10 +79,10 @@
                       ).name || '--'
                     "
                   />
-                  <span v-if="sitem.good_type === '1'" style="padding:0 0 0 5px"
-                    >{{ sitem.moq }}起订/工期{{
-                      sitem.customized
-                    }}天</span
+                  <span
+                    v-if="sitem.good_type === '1'"
+                    style="padding: 0 0 0 5px"
+                    >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
                   >
                 </template>
                 <template slot="exclusive">
@@ -161,7 +161,11 @@
             <el-collapse-item
               title="产品部门审批"
               name="1"
-              v-if="status === '2'"
+              v-if="
+                status === '2' &&
+                queryType == 'view' &&
+                powers.some((item) => item == '056')
+              "
             >
               <online-exam-form
                 :newTime="newTime"
@@ -172,7 +176,15 @@
                 @searchChange="examForm"
               />
             </el-collapse-item>
-            <el-collapse-item title="财务定价" name="2" v-if="status === '3'">
+            <el-collapse-item
+              title="财务定价"
+              name="2"
+              v-if="
+                status === '3' &&
+                queryType == 'view' &&
+                powers.some((item) => item == '058')
+              "
+            >
               <fixed-price-form
                 :newTime="newTime"
                 :id="queryId"
@@ -186,7 +198,11 @@
             <el-collapse-item
               title="财务审核定价"
               name="3"
-              v-if="status === '4'"
+              v-if="
+                status === '4' &&
+                queryType == 'view' &&
+                powers.some((item) => item == '059')
+              "
             >
               <exam-form
                 :newTime="newTime"
@@ -200,7 +216,11 @@
             <el-collapse-item
               title="操作商品上线"
               name="4"
-              v-if="status === '5'"
+              v-if="
+                status === '5' &&
+                queryType == 'view' &&
+                powers.some((item) => item == '071')
+              "
             >
               <handle-online-form
                 :newTime="newTime"

+ 65 - 0
src/views/sellOut/project/components/ShowDataTableColumns.js

@@ -0,0 +1,65 @@
+
+
+const editColumns = [
+  {
+    prop: "infoNo",
+    label: "咨询单编号",
+    span: 6
+  },
+  {
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    span: 5
+  },
+
+  {
+    prop: "addtime",
+    label: "创建时间",
+    span: 6
+  },
+  {
+    prop: "departinfo",
+    label: "创建人",
+    _slot_: "departinfo",
+    span: 7
+  },
+]
+
+const ShowDataTableColumns = [
+  {
+    prop: "in_company",
+    label: "业务企业",
+  },
+  {
+    prop: "in_khname",
+    label: "客户企业",
+  },
+
+  {
+    prop: "in_platform_name",
+    label: "所属平台",
+    span: 8,
+  },
+
+  {
+    prop: "in_arrival_time",
+    label: "要求到货日期",
+    span: 6,
+  },
+  {
+    prop: "in_project_name",
+    label: "项目名称",
+    span: 10,
+  },
+]
+
+
+
+
+
+export {
+  editColumns, ShowDataTableColumns
+}
+
+

+ 761 - 0
src/views/sellOut/project/components/buyGoodModal.vue

@@ -0,0 +1,761 @@
+<template>
+  <el-dialog
+    :title="'项目下单'"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="1040px"
+    @close="showModelThis = false"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    append-to-body
+  >
+    <el-card style="margin-top: -20px">
+      <el-row>
+        <el-col :span="24">
+          <show-data-table
+            style="margin: 0; padding: 0"
+            :newTime="newTime"
+            v-if="newTime !== '' && sitem"
+            :sitem="sitem"
+            :columns="ShowDataTableColumns"
+          />
+        </el-col>
+        <el-col :span="24" style="padding: 10px 0 0 0">
+          <span>商品下单:</span>
+          <el-button-group :size="'mini'" class="fr" style="margin: 8px 0 0 0">
+            <el-button
+              class="fr"
+              type="primary"
+              :size="'mini'"
+              :disabled="index === 0"
+              v-if="total !== 0"
+              icon="el-icon-arrow-left"
+              @click="prev_goods()"
+            ></el-button>
+            <el-button
+              type="primary"
+              class="fr"
+              v-if="total !== 0"
+              :size="'mini'"
+              style="height: 29px"
+              >商品共{{ index + 1 }}/{{ total }}</el-button
+            >
+            <el-button
+              type="primary"
+              class="fr"
+              v-if="total !== 0"
+              @click="next_goods()"
+              :size="'mini'"
+              ><i class="el-icon-arrow-right el-icon--right" :size="'mini'"></i
+            ></el-button>
+          </el-button-group>
+        </el-col>
+        <el-col :span="24">
+          <el-table
+            :data="order_good"
+            border
+            :size="'mini'"
+            style="width: 100%"
+            row-key="key"
+          >
+            <el-table-column
+              prop="good_name"
+              label="图片"
+              width="50"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                <div
+                  v-if="scope.row.good_img"
+                  style="width: 20px; height: 20px"
+                  class="hover"
+                  v-viewer
+                >
+                  <img
+                    :src="scope.row.good_img"
+                    style="display: inline-block; width: 100%; height: 100%"
+                    alt=""
+                  />
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="good_name"
+              label="商品名称"
+              min-width="120"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              prop="model"
+              label="规格"
+              width="120"
+              show-overflow-tooltip
+            >
+            </el-table-column>
+            <el-table-column
+              prop="brand_name"
+              label="品牌"
+              width="110"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              prop="sale_price"
+              label="单价"
+              width="110"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              prop="num"
+              label="数量"
+              width="100"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              prop="sendtype"
+              label="发货方式"
+              width="150"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.sendtype"
+                  placeholder="发货方式"
+                  :size="'mini'"
+                  @change="sendtype_change($event, scope.$index)"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in options"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+        <el-col :span="24" v-if="sendtype === '1'" style="padding: 15px 0 0 0">
+          <el-form :model="addrForm" ref="addrForm" :size="'mini'">
+            <el-table
+              :data="addrForm.order_addr"
+              border
+              :size="'mini'"
+              style="width: 100%"
+              max-height="300px"
+              row-key="key"
+            >
+              <el-table-column type="index" width="80" show-overflow-tooltip />
+              <el-table-column
+                prop="receipt_quantity"
+                label="收货总数"
+                min-width="125"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    v-if="scope.row.edit"
+                    :prop="
+                      'order_addr.' + scope.$index + '.' + 'receipt_quantity'
+                    "
+                    :rules="addrRules.receipt_quantity"
+                    :size="'mini'"
+                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+                  >
+                    <el-input
+                      v-model="scope.row.receipt_quantity"
+                      :disabled="!scope.row.edit"
+                    />
+                  </el-form-item>
+                  <span v-if="!scope.row.edit">{{
+                    scope.row.receipt_quantity
+                  }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="contactor"
+                label="收件联系人"
+                min-width="110"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    v-if="scope.row.edit"
+                    :prop="'order_addr.' + scope.$index + '.' + 'contactor'"
+                    :rules="addrRules.contactor"
+                    :size="'mini'"
+                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+                  >
+                    <el-input
+                      v-model="scope.row.contactor"
+                      :disabled="!scope.row.edit"
+                    />
+                  </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.contactor }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="mobile"
+                label="收货联系电话"
+                min-width="130"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    v-if="scope.row.edit"
+                    :prop="'order_addr.' + scope.$index + '.' + 'mobile'"
+                    :rules="addrRules.mobile"
+                    :size="'mini'"
+                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+                  >
+                    <el-input
+                      v-model="scope.row.mobile"
+                      :disabled="!scope.row.edit"
+                    />
+                  </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.mobile }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="addr_code"
+                label="收货省市区"
+                min-width="230"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    v-if="scope.row.edit"
+                    :prop="'order_addr.' + scope.$index + '.' + 'addr_code'"
+                    :rules="addrRules.addr_code"
+                    :size="'mini'"
+                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+                  >
+                    <select-area
+                      :value="scope.row.addr_code"
+                      :disabled="!scope.row.edit"
+                      :size="'mini'"
+                      @selectChange="select_area_change($event, scope.$index)"
+                    />
+                  </el-form-item>
+                  <span v-if="!scope.row.edit">{{
+                    scope.row.addr_code_name
+                  }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="addr"
+                label="详细地址"
+                min-width="170"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    v-if="scope.row.edit"
+                    :prop="'order_addr.' + scope.$index + '.' + 'addr'"
+                    :rules="addrRules.addr"
+                    :size="'mini'"
+                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+                  >
+                    <el-input
+                      v-model="scope.row.addr"
+                      :disabled="!scope.row.edit"
+                    />
+                  </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.addr }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column fixed="right" width="94" show-overflow-tooltip>
+                <template slot="header" slot-scope="scope">
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 8px"
+                    effect="dark"
+                    content="手动添加地址"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-circle-plus-outline tb-icon"
+                      style="color: #63cbe7"
+                      @click="openHouseModal(-1)"
+                    ></i>
+                  </el-tooltip>
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 8px"
+                    effect="dark"
+                    content="导入收货地址"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-upload2 tb-icon"
+                      style="color: #63cbe7"
+                      @click="addrmodel = true"
+                    ></i>
+                  </el-tooltip>
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 0"
+                    effect="dark"
+                    content="下载收货地址模板"
+                    placement="top"
+                  >
+                    <a class="downloadAddr" href="./static/收货地址模板.xlsx">
+                      <i
+                        class="el-icon-download tb-icon"
+                        style="color: #63cbe7; margin: 0"
+                      ></i>
+                    </a>
+                  </el-tooltip>
+                </template>
+                <template slot-scope="scope">
+                  <el-tooltip
+                    effect="dark"
+                    content="编辑"
+                    v-if="!scope.row.edit"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-edit tb-icon"
+                      @click="openHouseModal(scope.$index)"
+                    ></i>
+                  </el-tooltip>
+
+                  <el-tooltip
+                    effect="dark"
+                    content="保存"
+                    v-if="scope.row.edit"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-circle-check tb-icon"
+                      @click="checkRow(scope.$index)"
+                    ></i>
+                  </el-tooltip>
+
+                  <el-tooltip effect="dark" content="删除" placement="top">
+                    <i
+                      class="el-icon-delete tb-icon"
+                      @click="deleteRow(scope.$index, addrForm.order_addr)"
+                    ></i>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form>
+        </el-col>
+        <el-col :span="24">
+          <in-addr-model
+            :show-model="addrmodel"
+            @cancel="addrmodel = false"
+            @refresh="addrRefresh"
+          />
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+   <script>
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/project";
+import searchStockGoodModal from "@/components/search-stock-good-modal";
+import { isnumber, isMobile } from "@/utils/validate";
+import inAddrModel from "@/components/in-addr-model";
+import { ShowDataTableColumns } from "./ShowDataTableColumns";
+export default {
+  name: "buyGoodModal",
+  props: ["showModel", "sitem"],
+  mixins: [resToken],
+  components: { searchStockGoodModal, inAddrModel },
+  data() {
+    const validatemobile = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("手机号不能为空!"));
+      } else {
+        if (!isMobile(value)) {
+          callback(new Error("手机号格式不正确!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    const validateWeight = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("收货总数不能为空!"));
+      } else {
+        if (!isnumber(value)) {
+          callback(new Error("收货总数仅支持整数!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      loading: false,
+      addrmodel: false,
+      showModelThis: this.showModel,
+      showGoodsModel: false,
+      ShowDataTableColumns: ShowDataTableColumns,
+      planNo: "",
+      arrtime: "",
+      project_list: [],
+      options: [
+        {
+          value: "1",
+          label: "直接发货",
+        },
+        {
+          value: "2",
+          label: "延时发货",
+        },
+      ],
+      index: 0,
+      total: 0,
+      order_good: [],
+      sendtype: "1",
+      addrForm: {
+        order_addr: [], //收货地址
+      },
+      addrRules: {
+        receipt_quantity: [
+          {
+            required: true,
+            validator: validateWeight,
+            trigger: "blur",
+          },
+        ],
+
+        contactor: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "联系人不能为空",
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
+
+        addr_code: [
+          {
+            type: "array",
+            required: true,
+            message: "收货省市区不能为空",
+            trigger: "change",
+          },
+        ],
+        addr: [
+          {
+            required: true,
+            message: "详细地址不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+
+      loading: false,
+      id: "",
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+      this.showModelThis = false;
+    },
+
+    async initForm() {
+      this.loading = true;
+      this.project_list = [];
+      console.log(this.sitem);
+      const { planNo, in_arrival_time, feedback } = this.sitem;
+      this.planNo = planNo || "";
+      this.arrtime = in_arrival_time || "";
+      let goods = JSON.parse(JSON.stringify(feedback));
+      if (goods && goods.length > 0) {
+        goods.forEach((e) => {
+          e.sendtype = "1";
+          let model = JSON.parse(JSON.stringify(e));
+          let item = {
+            order_good: [model],
+            order_addr: [],
+          };
+          this.project_list.push(item);
+        });
+      }
+      this.index = 0;
+      this.total = this.project_list.length;
+      await this.resetForm(this.index);
+      this.getNewTime();
+      this.loading = false;
+    },
+    addrRefresh(e) {
+      const { list } = e;
+      this.addrForm.order_addr.push(...list);
+    },
+    async prev_goods() {
+      this.index--;
+      await this.resetForm(this.index);
+    },
+    async next_goods() {
+      const { order_addr } = this.addrForm;
+      if (this.sendtype === "1" && order_addr && order_addr.length === 0) {
+        this.$message.warning("直接发货需要录入地址!");
+        return;
+      }
+      let isedit = false;
+      order_addr.forEach((e) => {
+        if (e.edit) {
+          isedit = true;
+        }
+      });
+      if (isedit) {
+        this.$message.warning("当前已有地址在编辑,请保存后再试!");
+        return;
+      }
+
+      console.log(this.sendtype);
+      this.project_list[this.index].order_good[0].sendtype = this.sendtype;
+      this.project_list[this.index].order_addr =
+        this.addrForm.order_addr.length === 0
+          ? []
+          : JSON.parse(JSON.stringify(this.addrForm.order_addr));
+      console.log(this.project_list[this.index].order_good[0].sendtype);
+      if (this.index + 1 === this.total) {
+        this.submitForm();
+      } else {
+        this.index++;
+
+        await this.resetForm(this.index);
+      }
+    },
+
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+    sendtype_change(e, index) {
+      this.order_good[index].sendtype = e;
+      this.sendtype = this.order_good[index].sendtype;
+    },
+
+    async resetForm(index) {
+      //重置
+      await this.$nextTick(() => {
+        if (this.$refs.addrForm) {
+          this.$refs.addrForm.resetFields();
+          this.$refs.addrForm.clearValidate();
+        }
+        let list1 = this.project_list[index].order_good;
+        this.order_good =
+          list1.length > 0 ? JSON.parse(JSON.stringify(list1)) : [];
+        let list2 = this.project_list[index].order_addr;
+        this.addrForm.order_addr =
+          list2.length > 0 ? JSON.parse(JSON.stringify(list2)) : [];
+        this.sendtype = this.order_good[0].sendtype;
+      });
+    },
+    openHouseModal(index) {
+      let findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
+      if (findex !== -1) {
+        this.$message.warning("当前已有地址在编辑,请保存后再试!");
+        return;
+      } else {
+        if (index === -1) {
+          this.addrForm.order_addr.push({
+            edit: true,
+            receipt_quantity: "",
+            contactor: "",
+            mobile: "",
+            addr_code: [],
+            addr: "",
+          });
+        } else {
+          this.addrForm.order_addr[index].edit = true;
+        }
+      }
+    },
+    //省市区选择
+    async select_area_change(e, index) {
+      this.addrForm.order_addr[index].addr_code = e;
+      const { addr_code } = this.addrForm.order_addr[index];
+      if (addr_code && addr_code.length === 3) {
+        let arrCode = addr_code[addr_code.length - 1];
+        // console.log(model);
+        let { code, data, message } = await asyncRequest.addrall({
+          code: arrCode,
+        });
+        if (code === 0) {
+          const { province, city, area } = data;
+          let province_name = province && province.name ? province.name : "";
+          let city_name = city && city.name ? city.name : "";
+          let area_name = area && area.name ? area.name : "";
+          this.addrForm.order_addr[index].addr_code_name =
+            province_name && city_name && area_name
+              ? `${province_name}/${city_name}/${area_name}`
+              : "";
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.addrForm.order_addr[index].addr_code_name = "";
+      }
+    },
+    //省市区保存某一行
+    checkRow(rowIndex) {
+      this.$refs.addrForm.validate((valid) => {
+        if (valid) {
+          this.addrForm.order_addr[rowIndex].edit = false;
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    // 省市区删除行操作
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+    async submitForm() {
+      this.loading = true;
+      let model = {
+        planNo: this.planNo,
+        arrtime: this.arrtime,
+        planinfo: [],
+      };
+      this.project_list.forEach((e) => {
+        const { order_good, order_addr } = e;
+        const { id, sendtype } = JSON.parse(JSON.stringify(order_good[0]));
+        let modelA = {
+          feedback_id: id || "",
+          sendtype: sendtype || "2",
+          addrlist: [],
+        };
+        order_addr.forEach((a) => {
+          let modelB = {
+            addr_code: a.addr_code.toString(),
+            contactor: a.contactor,
+            mobile: a.mobile,
+            addr: a.addr,
+            receipt_quantity: a.receipt_quantity,
+          };
+          modelA.addrlist.push(modelB);
+        });
+        model.planinfo.push(modelA);
+      });
+      let res = await asyncRequest.project_place_order(model);
+      this.loading = false;
+      if (res && res.code === 0) {
+        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);
+      }
+    },
+  },
+};
+</script>
+
+   
+   <style lang="scss" scoped>
+// .capitalClaim {
+.excelUploadBox {
+  position: relative;
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+  &:hover {
+    cursor: pointer;
+  }
+  .el-icon-receiving {
+    width: 100%;
+    text-align: center;
+    height: 50px;
+    display: block;
+    font-size: 32px;
+    line-height: 90px;
+    color: #d3d4d6;
+  }
+  .boxM {
+    width: 100%;
+    display: block;
+    text-align: center;
+    line-height: 65px;
+    height: 60px;
+    color: #909399;
+  }
+}
+.excelUpload {
+  top: 0;
+  left: 0;
+  position: absolute;
+  z-index: 2;
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+}
+.excelUploadRes {
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+  i {
+    width: 55px;
+    height: 120px;
+    line-height: 120px;
+    text-align: center;
+    font-size: 20px;
+    &.fl {
+      padding-left: 16px;
+    }
+    &.fr {
+      padding-right: 16px;
+      &:hover {
+        cursor: pointer;
+      }
+    }
+  }
+  span {
+    width: 386px;
+    line-height: 16px;
+    margin: 52px 0 0 0;
+    font-size: 16px;
+  }
+}
+// }
+</style>

+ 1 - 1
src/views/sellOut/project/components/columnsForm.js

@@ -3,7 +3,7 @@ export default [
     {
         prop: "pgNo",
         label: "要求编号",
-        width: '180px'
+        width: '155px'
     },
 
     {

+ 2 - 2
src/views/sellOut/project/components/grossForm.vue

@@ -143,11 +143,11 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          const { rate, projectNo, status } = this.sitem;
+          const { low_rate, projectNo, status } = this.sitem;
           this.status = status || "";
           this.ruleForm = {
             projectNo: projectNo || "",
-            rate: rate || "0",
+            rate: low_rate || "0",
           };
         }
       });

+ 0 - 664
src/views/sellOut/project/components/setPlan copy.vue

@@ -1,664 +0,0 @@
-<template>
-  <div class="project-setPlan" v-loading="loading">
-    <div class="project-setPlan-main">
-      <div class="project-setPlan-title">商品要求</div>
-      <div class="project-setPlan-ask-table">
-        <template v-if="ladder">
-          <el-table
-            :data="ladder"
-            :size="'mini'"
-            border
-            stripe
-            style="width: 100%"
-          >
-            <el-table-column label="要求编码" prop="pgNo" width="180px" />
-
-            <el-table-column prop="good_type" label="商品类型" width="80px">
-              <template slot-scope="scope">
-                <el-tag
-                  :size="'mini'"
-                  v-text="
-                    (
-                      statusOptions.find(
-                        (item) => item.value == scope.row.good_type
-                      ) || {}
-                    ).label || '--'
-                  "
-                ></el-tag
-              ></template>
-            </el-table-column>
-            <el-table-column prop="budget_price" label="预算单价" width="110" />
-            <el-table-column prop="num" label="购买数量" width="110" />
-            <el-table-column prop="cat_name" label="商品分类" />
-            <el-table-column prop="good_img" label="图片" width="50">
-              <template slot-scope="scope">
-                <div
-                  v-if="scope.row.good_img"
-                  style="width: 20px; height: 20px"
-                  class="hover"
-                  v-viewer
-                >
-                  <img
-                    :src="scope.row.good_img"
-                    style="display: inline-block; width: 100%; height: 100%"
-                    alt=""
-                  />
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column prop="good_name" label="商品名称" />
-          </el-table>
-        </template>
-      </div>
-      <div class="project-setPlan-title">客户意向商品</div>
-      <div class="project-setPlan-backGood-table">
-        <el-table
-          :data="tableData"
-          :size="'mini'"
-          border
-          stripe
-          ref="multipleTable"
-          style="width: 100%"
-          @selection-change="handleSelectionChange"
-        >
-          <el-table-column
-            type="selection"
-            width="40"
-            v-if="table_type === 'add'"
-          >
-          </el-table-column>
-          <el-table-column
-            prop="pgNo"
-            label="要求编码"
-            width="180px"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="sale_price"
-            label="销售单价"
-            width="110"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="num"
-            label="购买数量"
-            width="110"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="good_img"
-            label="图片"
-            width="50"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <div
-                v-if="scope.row.good_img"
-                style="width: 20px; height: 20px"
-                class="hover"
-                v-viewer
-              >
-                <img
-                  :src="scope.row.good_img"
-                  style="display: inline-block; width: 100%; height: 100%"
-                  alt=""
-                />
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="good_name"
-            label="商品名称"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="class_cat"
-            label="商品分类"
-            show-overflow-tooltip
-          />
-          <el-table-column prop="model" label="规格" show-overflow-tooltip />
-          <el-table-column
-            prop="expiry_day"
-            label="信息有效期"
-            width="85"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="work_day"
-            label="制作工期"
-            width="85"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            prop="delivery_day"
-            label="物流时间"
-            width="85"
-            show-overflow-tooltip
-          />
-        </el-table>
-      </div>
-      <div class="project-setPlan-title">
-        方案制定
-        <span v-if="plan_show && table_type === 'list'"
-          >方案总金额:{{ plan_show.sale_total }}元</span
-        >
-        <el-button-group
-          :size="'mini'"
-          class="fr"
-          v-if="table_type === 'list'"
-          style="margin: 8px 0 0 0"
-        >
-          <el-button
-            class="fr"
-            type="primary"
-            :size="'mini'"
-            :disabled="index === 0"
-            v-if="total !== 0"
-            icon="el-icon-arrow-left"
-            @click="index--, change_plan()"
-          ></el-button>
-          <el-button
-            type="primary"
-            class="fr"
-            v-if="total !== 0"
-            :size="'mini'"
-            style="height: 29px"
-            >方案共{{ index + 1 }}/{{ total }}</el-button
-          >
-          <el-button
-            type="primary"
-            class="fr"
-            :disabled="index + 1 === total"
-            v-if="total !== 0"
-            @click="index++, change_plan()"
-            :size="'mini'"
-            ><i class="el-icon-arrow-right el-icon--right" :size="'mini'"></i
-          ></el-button>
-          <el-button
-            type="primary"
-            class="fr"
-            v-if="
-              powers &&
-              powers.length > 0 &&
-              powers.some((item) => item == '064') &&
-              status == '3'
-            "
-            @click="add_plan"
-            icon="el-icon-circle-plus-outline"
-            :size="'mini'"
-            >添加方案
-          </el-button>
-        </el-button-group>
-        <el-button-group
-          :size="'mini'"
-          class="fr"
-          v-else-if="table_type === 'add'"
-          style="margin: 8px 0 0 0"
-        >
-          <el-button
-            class="fr"
-            type="primary"
-            :size="'mini'"
-            icon="el-icon-arrow-left"
-            @click="back_list"
-            >返回列表</el-button
-          >
-          <el-button type="primary" class="fr" @click="save_plan" :size="'mini'"
-            >保存方案<i class="el-icon-upload el-icon--right"></i>
-          </el-button>
-        </el-button-group>
-      </div>
-      <div class="project-setPlan-backGood-table" v-if="plan_show && tableList">
-        <div class="table-row">
-          <ul class="table-header">
-            <li v-for="head in headCol" :key="head.label">{{ head.label }}</li>
-          </ul>
-          <template v-if="tableList.length > 0">
-            {{ tableList[0] }}
-            <ul class="table-body" v-for="item in tableList" :key="item.planNo">
-              <li v-for="head in headCol" :key="head.prop + item.planNo">
-                <template v-if="head.prop === 'sale_price' && head._slot_">
-                  <digital-input
-                    v-if="table_type === 'add'"
-                    :values="item[head.prop]"
-                    :placeholder="'售价'"
-                    :min="0"
-                    :max="100000000000"
-                    :position="'right'"
-                    :precision="0"
-                    :size="'mini'"
-                    :controls="false"
-                    :append="''"
-                    @reschange="moq_num_change($event, 1)"
-                  />
-                </template>
-                <template v-if="head.prop === 'good_img' && head._slot_">
-                  <div
-                    v-if="item[head.prop]"
-                    style="width: 20px; height: 20px"
-                    class="hover"
-                    v-viewer
-                  >
-                    <img
-                      :src="item[head.prop]"
-                      style="display: inline-block; width: 100%; height: 100%"
-                      alt=""
-                    />
-                  </div>
-                </template>
-                <template v-else>
-                  <span>{{ item[head.prop] }}</span>
-                  <span v-if="head.unit">{{ head.unit }}</span>
-                </template>
-              </li>
-            </ul>
-          </template>
-          <div v-else class="table-no-data">暂无数据!</div>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-<script>
-import asyncRequest from "@/apis/service/sellOut/project";
-import resToken from "@/mixins/resToken";
-import columnsForm from "./columnsForm";
-export default {
-  name: "setPlan",
-  props: ["showModel", "sitem", "id", "type"],
-  mixins: [resToken],
-  computed: {
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "projectDetail"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  watch: {
-    // showModel: function (val) {
-    //   this.showModelThis = val;
-    //   if (val) {
-    //     this.initForm();
-    //   }
-    // },
-    // showModelThis(val) {
-    //   if (!val) {
-    //     this.$emit("cancel");
-    //   }
-    // },
-  },
-  data() {
-    return {
-      headCol: [
-        {
-          prop: "pgNo",
-          label: "要求编码",
-          _slot_: "status",
-        },
-        {
-          prop: "origin_price",
-          label: "系统售价单价",
-          unit: "元",
-        },
-        {
-          prop: "sale_price",
-          label: "当前销售单价",
-          _slot_: false,
-          unit: "元",
-        },
-        {
-          prop: "num",
-          label: "购买数量",
-        },
-        {
-          prop: "good_img",
-          label: "图片",
-          _slot_: true,
-        },
-        {
-          prop: "good_name",
-          label: "商品名称",
-        },
-        {
-          prop: "class_cat",
-          label: "商品分类",
-        },
-        {
-          prop: "model",
-          label: "规格",
-        },
-        {
-          prop: "expiry_day",
-          label: "信息有效期",
-          unit: "天",
-        },
-        {
-          prop: "work_day",
-          label: "制作工期",
-          unit: "天",
-        },
-        {
-          prop: "delivery_day",
-          label: "物流时间",
-          unit: "天",
-        },
-      ],
-      showModel: false,
-      searchItem: {},
-      loading: false,
-      allPlanList: [],
-      ladder: [],
-      tableList: [],
-      index: 0,
-      total: 0,
-      table_type: "list",
-      //   allList: [],
-      projectNo: "",
-      status: "",
-      statusOptions: [
-        { value: "1", label: "竞品" },
-        { value: "2", label: "竞聘" },
-      ],
-      table: {
-        stripe: true,
-        border: true,
-        // _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 列参数
-      columns: columnsForm,
-      tableData: [],
-      multipleSelection: [],
-      plan_show: {
-        sale_total: "0",
-        feedback: [],
-      },
-    };
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    //初始化整个组件
-    async initForm() {
-      // this.loading = true;
-      await this.initListData();
-      await this.back_list();
-      this.loading = false;
-    },
-    async resetFormData() {
-      this.pageInfo = {
-        size: 15,
-        curr: 1,
-        total: 0,
-      };
-      this.loading = true;
-      this.tableData = [];
-      await this.searchList();
-    },
-    async back_list() {
-      this.table_type = "list";
-      await this.get_plan("1");
-    },
-    add_plan() {
-      this.table_type = "add";
-      this.plan_show = {
-        sale_total: "0",
-        feedback: [],
-      };
-    },
-    moq_num_change(e, index) {
-      this.plan_show.feedback[index].sale_price = e + "";
-      this.$set(
-        this.plan_show.feedback[index],
-        index,
-        this.plan_show.feedback[index]
-      );
-    },
-    //初始化整个组件
-    async initListData() {
-      console.log(this.sitem);
-      const { projectNo, ladder, status } = this.sitem;
-      this.status = status;
-      this.projectNo = projectNo;
-      this.ladder =
-        ladder && ladder.length > 0 ? JSON.parse(JSON.stringify(ladder)) : [];
-      this.pageInfo = {
-        size: 100,
-        curr: 1,
-        total: 0,
-      };
-      this.tableData = [];
-      await this.searchList();
-    },
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
-
-      let list = JSON.parse(JSON.stringify(this.plan_show.feedback));
-      this.plan_show = {
-        sale_total: "0",
-        feedback: [],
-      };
-      this.multipleSelection.forEach((a, i) => {
-        let fi = list.findIndex((b) => a.id === b.id && b.pgNo === a.pgNo);
-        if (fi !== -1) {
-          this.plan_show.feedback.push(list[fi]);
-        } else {
-          this.plan_show.feedback.push(this.multipleSelection[i]);
-        }
-      });
-      this.plan_show.feedback.map((e) => {
-        e.sale_price = "0";
-        return e;
-      });
-    },
-
-    async searchList() {
-      const { size, curr } = this.pageInfo;
-      // this.loading = true;
-      let model = {
-        page: curr,
-        size: size,
-        zxNo: "",
-        infoNo: "",
-        bidNo: "",
-        status: "1",
-        pgNo: "",
-        projectNo: this.projectNo,
-      };
-      const { code, data } = await asyncRequest.back_good_list(model);
-      if (code === 0) {
-        const { list, count } = data;
-        this.tableData = list;
-        this.tableData.map((v) => {
-          v.class_cat = "";
-          if (v.can && v.can.length > 0) {
-            v.can.forEach((x, i) => {
-              v.class_cat += i === 0 ? x.name : "/" + x.name;
-            });
-          }
-          return v;
-        });
-        this.pageInfo.total = Number(count);
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.tableData = [];
-        this.pageInfo.total = 0;
-      }
-      // this.loading = false;
-    },
-    //保存方案
-    async save_plan() {
-      if (!this.loading) {
-        const { feedback } = this.plan_show;
-        console.log(feedback);
-        let list = feedback;
-        let isok = true;
-        list.forEach((a) => {
-          let findex = list.findIndex(
-            (b) => b.pgNo === a.pgNo && a.id !== b.id
-          );
-          if (findex !== -1) {
-            isok = false;
-          }
-        });
-        if (!isok) {
-          this.$message.warning("一种商品要求只能选择一种商品!");
-          return;
-        }
-        let isall = true;
-        this.ladder.forEach((a) => {
-          let to = 0;
-          list.forEach((b) => {
-            if (a.pgNo === b.pgNo) {
-              to++;
-            }
-          });
-          if (to !== 1) {
-            isall = false;
-          }
-        });
-        if (!isall) {
-          this.$message.warning("方案必须涵盖全部商品要求!");
-          return;
-        }
-        this.loading = true;
-        let model = {
-          feedback: [],
-          projectNo: this.projectNo,
-        };
-
-        list.forEach((e) => {
-          let si = {
-            feedid: e.id,
-            sale_price: e.sale_price,
-          };
-          model.feedback.push(si);
-        });
-        const { code, data, message } = await asyncRequest.project_make_plan(
-          model
-        );
-        if (code === 0) {
-          await this.back_list();
-        } else if (code >= 100 && code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(message);
-        }
-        this.loading = false;
-      }
-    },
-    //获取全部方案
-    async get_plan(type) {
-      let model = {
-        projectNo: this.projectNo,
-      };
-      const { code, data, message } = await asyncRequest.get_project_plan(
-        model
-      );
-      if (code === 0) {
-        this.allPlanList =
-          data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [];
-        this.total = this.allPlanList.length;
-
-        if (type) {
-          await this.change_plan("1");
-        }
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(message);
-      }
-    },
-    //切换当前展示的方案
-    async change_plan(type) {
-      this.table_type = "list";
-      this.plan_show = {
-        sale_total: "0",
-        feedback: [],
-      };
-      if (type) {
-        this.index = 0;
-      }
-      console.log(this.allPlanList[this.index]);
-      const { sale_total, feedback, planNo } = JSON.parse(
-        JSON.stringify(this.allPlanList[this.index])
-      );
-      this.plan_show = {
-        sale_total: sale_total,
-        feedback:
-          feedback && feedback.length > 0
-            ? JSON.parse(JSON.stringify(feedback))
-            : [],
-      };
-      // for (let i = 0; i < this.plan_show.feedback.length; i++) {
-      //   this.plan_show.feedback[i].planNo = planNo;
-      // }
-      this.tableList = JSON.parse(JSON.stringify(this.plan_show.feedback));
-      // for (let i = 0; i < this.plan_show.feedback.length; i++) {
-      //   this.$set(this.plan_show.feedback[i], i, this.plan_show.feedback[i]);
-      // }
-    },
-  },
-};
-</script>
-
-   <style lang="scss" scoped>
-.project-setPlan {
-  box-sizing: border-box;
-  width: 100%;
-
-  .project-setPlan-main {
-    padding: 2px 16px 16px 16px;
-    // background: #fefefe;
-    border-radius: 5px;
-    overflow: hidden;
-    border: 1px solid #f0f0f0;
-    margin: 0 0 16px 0;
-    .project-setPlan-title {
-      height: 48px;
-      line-height: 48px;
-      color: #676767;
-    }
-  }
-  .table-row {
-    width: 100%;
-    border-top: 1px solid #dfe6ec;
-    .table-header,
-    .table-body {
-      display: flex;
-      //
-      border-left: 1px solid #dfe6ec;
-      li {
-        width: 110px;
-        font-weight: 500;
-        font-size: 12px;
-        padding: 10px;
-        overflow: hidden;
-        box-sizing: border-box;
-        border-right: 1px solid #dfe6ec;
-        border-bottom: 1px solid #dfe6ec;
-        &:nth-child(1) {
-          width: 180px;
-        }
-      }
-    }
-    .table-header {
-      li {
-        color: #909399;
-      }
-    }
-    .table-body {
-      li {
-        color: #606266;
-      }
-    }
-  }
-}
-</style>

+ 110 - 33
src/views/sellOut/project/components/setPlan.vue

@@ -11,7 +11,7 @@
             stripe
             style="width: 100%"
           >
-            <el-table-column label="要求编码" prop="pgNo" width="180px" />
+            <el-table-column label="要求编码" prop="pgNo" width="155px" />
 
             <el-table-column prop="good_type" label="商品类型" width="80px">
               <template slot-scope="scope">
@@ -70,11 +70,11 @@
           <el-table-column
             prop="pgNo"
             label="要求编码"
-            width="180px"
+            width="155px"
             show-overflow-tooltip
           />
           <el-table-column
-            prop="sale_price"
+            prop="origin_price"
             label="销售单价"
             width="110"
             show-overflow-tooltip
@@ -126,21 +126,23 @@
           <el-table-column
             prop="work_day"
             label="制作工期"
-            width="85"
+            width="70"
             show-overflow-tooltip
           />
           <el-table-column
             prop="delivery_day"
             label="物流时间"
-            width="85"
+            width="70"
             show-overflow-tooltip
           />
         </el-table>
       </div>
       <div class="project-setPlan-title">
-        方案制定
+        项目方案
         <span v-if="total !== 0 && table_type === 'list'"
-          >方案总金额:{{ plan_show.sale_total }}元</span
+          >{{ plan_show.status === "1" ? "已选定" : "" }}方案总金额:{{
+            plan_show.sale_total
+          }}元</span
         >
         <el-button-group
           :size="'mini'"
@@ -148,6 +150,28 @@
           v-if="table_type === 'list'"
           style="margin: 8px 0 0 0"
         >
+          <el-button
+            type="primary"
+            class="fr"
+            v-if="
+              powers &&
+              powers.length > 0 &&
+              powers.some((item) => item == '064') &&
+              (status == '3' || status == '4')
+            "
+            @click="add_plan"
+            icon="el-icon-circle-plus-outline"
+            :size="'mini'"
+            >添加方案
+          </el-button>
+          <el-button
+            type="primary"
+            class="fr"
+            v-if="plan_show.status === '1'"
+            @click="place_order"
+            :size="'mini'"
+            >项目下单<i class="el-icon-shopping-cart-2 el-icon--right"></i>
+          </el-button>
           <el-button
             class="fr"
             type="primary"
@@ -174,20 +198,6 @@
             :size="'mini'"
             ><i class="el-icon-arrow-right el-icon--right" :size="'mini'"></i
           ></el-button>
-          <el-button
-            type="primary"
-            class="fr"
-            v-if="
-              powers &&
-              powers.length > 0 &&
-              powers.some((item) => item == '064') &&
-              (status == '3' || status == '4')
-            "
-            @click="add_plan"
-            icon="el-icon-circle-plus-outline"
-            :size="'mini'"
-            >添加方案
-          </el-button>
         </el-button-group>
         <el-button-group
           :size="'mini'"
@@ -220,7 +230,7 @@
           <el-table-column
             prop="pgNo"
             label="要求编码"
-            width="180px"
+            width="155px"
             show-overflow-tooltip
           />
           <el-table-column
@@ -241,24 +251,49 @@
                 v-if="table_type === 'add'"
                 :values="scope.row.new_sale_price"
                 :placeholder="'售价'"
-                :min="0"
+                :min="scope.row.origin_price"
                 :max="100000000000"
                 :position="'right'"
                 :precision="0"
                 :size="'mini'"
                 :controls="false"
                 :append="''"
-                @reschange="moq_num_change($event, scope.$index)"
+                @reschange="
+                  moq_num_change($event, scope.$index, 'new_sale_price')
+                "
               />
               <span v-else>{{ scope.row.sale_price }}元</span>
             </template>
           </el-table-column>
+          <el-table-column
+            prop="origin_num"
+            label="咨询数量"
+            width="110"
+            show-overflow-tooltip
+          />
           <el-table-column
             prop="num"
             label="购买数量"
             width="110"
             show-overflow-tooltip
-          />
+          >
+            <template slot-scope="scope">
+              <digital-input
+                v-if="table_type === 'add'"
+                :values="scope.row.origin_num"
+                :placeholder="'购买数量'"
+                :min="scope.row.origin_num"
+                :max="100000000000"
+                :position="'right'"
+                :precision="0"
+                :size="'mini'"
+                :controls="false"
+                :append="''"
+                @reschange="moq_num_change($event, scope.$index, 'num')"
+              />
+              <span v-else>{{ scope.row.num }}</span>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="good_img"
             label="图片"
@@ -300,17 +335,23 @@
           <el-table-column
             prop="work_day"
             label="制作工期"
-            width="85"
+            width="70"
             show-overflow-tooltip
           />
           <el-table-column
             prop="delivery_day"
             label="物流时间"
-            width="85"
+            width="70"
             show-overflow-tooltip
           />
         </el-table>
       </div>
+      <buy-good-modal
+        :showModel="bayGoodShowModel"
+        :sitem="bayGoodItem"
+        @cancel="bayGoodShowModel = false"
+        @refresh="(bayGoodShowModel = false), $emit('resGoodOk')"
+      />
     </div>
   </div>
 </template>
@@ -318,10 +359,14 @@
 import asyncRequest from "@/apis/service/sellOut/project";
 import resToken from "@/mixins/resToken";
 import columnsForm from "./columnsForm";
+import buyGoodModal from "./buyGoodModal";
 export default {
   name: "setPlan",
   props: ["showModel", "sitem", "id", "type"],
   mixins: [resToken],
+  components: {
+    buyGoodModal,
+  },
   computed: {
     powers() {
       let tran =
@@ -354,6 +399,8 @@ export default {
       searchItem: {},
       loading: false,
       allPlanList: [],
+      bayGoodItem: {},
+      bayGoodShowModel: false,
       ladder: [],
       index: 0,
       total: 0,
@@ -391,6 +438,20 @@ export default {
       await this.back_list();
       this.loading = false;
     },
+    //项目下单
+    place_order() {
+      const { company, khName, platform_name, arrtime, project_name } =
+        this.sitem;
+      this.bayGoodItem = JSON.parse(
+        JSON.stringify(this.allPlanList[this.index])
+      );
+      this.bayGoodItem.in_company = company;
+      this.bayGoodItem.in_khname = khName;
+      this.bayGoodItem.in_platform_name = platform_name;
+      this.bayGoodItem.in_arrival_time = arrtime;
+      this.bayGoodItem.in_project_name = project_name;
+      this.bayGoodShowModel = true;
+    },
     async resetFormData() {
       this.pageInfo = {
         size: 15,
@@ -406,14 +467,20 @@ export default {
       await this.get_plan("1");
     },
     add_plan() {
+      const { low_rate } = this.sitem;
+      let r = low_rate ? low_rate : "0";
+      if (r === 0) {
+        this.$message.warning("暂无项目毛利率,不能制定方案!");
+        return;
+      }
       this.table_type = "add";
       this.plan_show = {
         sale_total: "0",
         feedback: [],
       };
     },
-    moq_num_change(e, index) {
-      this.plan_show.feedback[index].new_sale_price = e + "";
+    moq_num_change(e, index, key) {
+      this.plan_show.feedback[index][key] = e + "";
       this.$set(
         this.plan_show.feedback[index],
         index,
@@ -437,7 +504,6 @@ export default {
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
-
       let list = JSON.parse(JSON.stringify(this.plan_show.feedback));
       this.plan_show = {
         sale_total: "0",
@@ -454,7 +520,9 @@ export default {
         }
       });
       this.plan_show.feedback.map((e) => {
-        e.new_sale_price = "0";
+        console.log(e.sale_price);
+        e.new_sale_price = e.sale_price;
+        e.origin_num = e.num;
         return e;
       });
     },
@@ -498,7 +566,6 @@ export default {
     async save_plan() {
       if (!this.loading) {
         const { feedback } = this.plan_show;
-        console.log(feedback);
         let list = feedback;
         let isok = true;
         list.forEach((a) => {
@@ -539,6 +606,7 @@ export default {
           let si = {
             feedid: e.id,
             sale_price: e.new_sale_price,
+            good_num: e.num,
           };
           model.feedback.push(si);
         });
@@ -580,16 +648,25 @@ export default {
       this.table_type = "list";
       this.plan_show = {
         sale_total: "0",
+        status: "0",
         feedback: [],
       };
       if (type) {
         this.index = 0;
       }
-      const { sale_total, feedback } = JSON.parse(
+      if (this.status === "4") {
+        this.allPlanList.forEach((a, ai) => {
+          if (a.status === "1") {
+            this.index = ai;
+          }
+        });
+      }
+      const { sale_total, feedback, status } = JSON.parse(
         JSON.stringify(this.allPlanList[this.index])
       );
       this.plan_show = {
         sale_total: sale_total,
+        status: status,
         feedback: JSON.parse(JSON.stringify(feedback)),
       };
       console.log(this.plan_show);

+ 30 - 52
src/views/sellOut/zixunOrder/components/ShowDataTableColumns.js

@@ -28,13 +28,15 @@ const editColumns = [
 
 const ShowDataTableColumns = [
   {
-    prop: "company",
+    prop: "in_company",
     label: "业务企业",
   },
   {
-    prop: "supplierName",
+    prop: "in_khname",
     label: "客户企业",
   },
+
+
   {
     prop: "good_name",
     label: "商品名称",
@@ -42,82 +44,58 @@ const ShowDataTableColumns = [
   },
 
   {
-    prop: "speclist",
+    prop: "specinfo",
     label: "规格",
-    _slot_: "speclist",
+    _slot_: "specinfo",
   },
-
- 
   {
-    prop: "cat",
+    prop: "can_name",
     label: "分类",
-    _slot_: "cat",
   },
   {
-    prop: "brand_name",
-    label: "品牌",
-    span: 8,
+    prop: "is_noble",
+    label: "贵金属信息",
+    _slot_: "is_noble",
   },
-
   {
-    prop: "tax",
-    label: "税点",
-    append: '%',
-    span: 4,
+    prop: "in_platform_name",
+    label: "所属平台",
+    span: 8,
   },
   {
-    prop: "good_type",
-    label: "是否定制",
-    _slot_: "good_type",
-    span: 4,
+    prop: "in_arrival_time",
+    label: "要求到货日期",
+    span: 8,
   },
   {
-    prop: "is_stock",
-    label: "是否库存品",
-    _slot_: "is_stock",
-    span: 4,
+    prop: "brand_name",
+    label: "品牌",
+    span: 8,
   },
   {
-    prop: "delivery_day",
-    label: "物流时间",
-    append: '',
+    prop: "tax",
+    label: "税点",
+    append: '%',
     span: 4,
   },
-  {
-    prop: "lead_time",
-    label: "供货周期",
-    append: '天',
-    span: 6,
-  },
-  {
-    prop: "sample_day",
-    label: "调样周期",
-    append: '天',
-    span: 6,
-  },
   {
     prop: "weight",
     label: "商品总克重",
     append: 'g',
     span: 8,
   },
-  {
-    prop: "exam_status",
-    label: "状态",
-    _slot_: "exam_status",
-    span: 8,
-  },
 
   {
-    prop: "good_remark",
-    label: "商品备注",
-    span: 24,
+    prop: "sale_price",
+    label: "销售单价",
+    append: '元',
+    span: 6,
   },
-
   {
-    prop: "craft_desc",
-    label: "工艺说明",
-    span: 24,
+    prop: "in_num",
+    label: "咨询数量",
+    _slot_: "in_num",
+    span: 6,
   },
 ]
 

+ 2 - 1
src/views/sellOut/zixunOrder/components/addEditBargain.vue

@@ -176,11 +176,12 @@ export default {
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
+        const { sale_price } = this.sitem;
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
-            bargain_price: "0",
+            bargain_price: sale_price || "0",
           };
         }
       });

+ 309 - 312
src/views/sellOut/zixunOrder/components/buyGoodModal.vue

@@ -15,7 +15,7 @@
     append-to-body
   >
     <el-card style="margin-top: -20px">
-      <el-row :gutter="10">
+      <el-row>
         <el-col :span="24">
           <show-data-table
             style="margin: 0; padding: 0"
@@ -35,46 +35,98 @@
               />
               <div>{{ sitem.good_name }}</div>
             </template>
-            <template slot="speclist">
-              <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
-                <span v-if="i !== 0">-</span><span>{{ si.spec_value }}</span>
-              </span>
-            </template>
             <template slot="specinfo">
               <span v-for="(si, sii) in sitem.specinfo" :key="si.specid + sii">
                 <span v-if="sii !== 0">--</span
                 ><span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span></span
               >
             </template>
-          </show-data-table> 
+            <template slot="is_noble">
+              <span v-if="sitem.is_noble">
+                {{ sitem.noble_weight }}g--{{ sitem.metal_name }}--{{
+                  sitem.is_diff === "1" ? "有" : "无"
+                }}工差--{{ sitem.config }}--{{ sitem.other_config }}</span
+              >
+              <span v-else>非贵金属商品</span>
+            </template>
+            <template slot="in_num">
+              <span>{{ sitem.in_num }}{{ sitem.unit }}</span>
+            </template>
+          </show-data-table>
         </el-col>
-
-        <!-- <el-col :span="24" style="padding: 0 0 22px 0">
-          <div style="height: 40px; margin: -10px 0 0 0" class="tr">
-            <download-addr />
-            <el-button
-              type="primary"
-              size="mini"
-              @click="addrmodel = true"
-              style="margin: 0 0 0 10px"
-              >导入收货地址</el-button
-            >
-          </div>
+        <el-col :span="24" style="padding: 18px 0 0 0">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            :size="'mini'"
+            label-width="90px"
+            class="demo-ruleForm"
+          >
+            <el-row>
+              <el-col :span="10">
+                <el-form-item label="购买数量" prop="good_num">
+                  <digital-input
+                    :values="ruleForm.good_num"
+                    :placeholder="'购买数量'"
+                    :min="0"
+                    :max="sitem.in_num"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :disabled="false"
+                    :append="sitem.unit"
+                    @reschange="num_change($event, 'good_num')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="10">
+                <el-form-item label="发货方式" prop="sendtype">
+                  <el-select
+                    v-model="ruleForm.sendtype"
+                    placeholder="发货方式"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4" style="text-align: right">
+                <el-button :size="'mini'" type="primary" @click="submitForm"
+                  >保 存
+                </el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="24" v-if="ruleForm.sendtype === '1'">
           <el-form :model="addrForm" ref="addrForm" :size="'mini'">
             <el-table
               :data="addrForm.order_addr"
               border
               :size="'mini'"
               style="width: 100%"
+              max-height="300px"
               row-key="key"
             >
+              <el-table-column type="index" width="80" show-overflow-tooltip />
               <el-table-column
                 prop="receipt_quantity"
                 label="收货总数"
                 min-width="125"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-form-item
+                    v-if="scope.row.edit"
                     :prop="
                       'order_addr.' + scope.$index + '.' + 'receipt_quantity'
                     "
@@ -87,40 +139,21 @@
                       :disabled="!scope.row.edit"
                     />
                   </el-form-item>
+                  <span v-if="!scope.row.edit">{{
+                    scope.row.receipt_quantity
+                  }}</span>
                 </template>
               </el-table-column>
 
-              <el-table-column
-                prop="arrive_time"
-                label="最晚收货日期"
-                width="150"
-              >
-                <template slot-scope="scope">
-                  <el-form-item
-                    :prop="'order_addr.' + scope.$index + '.' + 'arrive_time'"
-                    :rules="addrRules.arrive_time"
-                    :size="'mini'"
-                    :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
-                  >
-                    <el-date-picker
-                      :disabled="!scope.row.edit"
-                      v-model="scope.row.arrive_time"
-                      type="date"
-                      style="width: 100%"
-                      value-format="yyyy-MM-dd"
-                      :picker-options="pickerOptions"
-                    >
-                    </el-date-picker>
-                  </el-form-item>
-                </template>
-              </el-table-column>
               <el-table-column
                 prop="contactor"
                 label="收件联系人"
                 min-width="110"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-form-item
+                    v-if="scope.row.edit"
                     :prop="'order_addr.' + scope.$index + '.' + 'contactor'"
                     :rules="addrRules.contactor"
                     :size="'mini'"
@@ -131,6 +164,7 @@
                       :disabled="!scope.row.edit"
                     />
                   </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.contactor }}</span>
                 </template>
               </el-table-column>
 
@@ -138,9 +172,11 @@
                 prop="mobile"
                 label="收货联系电话"
                 min-width="130"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-form-item
+                    v-if="scope.row.edit"
                     :prop="'order_addr.' + scope.$index + '.' + 'mobile'"
                     :rules="addrRules.mobile"
                     :size="'mini'"
@@ -151,6 +187,7 @@
                       :disabled="!scope.row.edit"
                     />
                   </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.mobile }}</span>
                 </template>
               </el-table-column>
 
@@ -158,9 +195,11 @@
                 prop="addr_code"
                 label="收货省市区"
                 min-width="230"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-form-item
+                    v-if="scope.row.edit"
                     :prop="'order_addr.' + scope.$index + '.' + 'addr_code'"
                     :rules="addrRules.addr_code"
                     :size="'mini'"
@@ -173,11 +212,20 @@
                       @selectChange="select_area_change($event, scope.$index)"
                     />
                   </el-form-item>
+                  <span v-if="!scope.row.edit">{{
+                    scope.row.addr_code_name
+                  }}</span>
                 </template>
               </el-table-column>
-              <el-table-column prop="addr" label="详细地址" min-width="170">
+              <el-table-column
+                prop="addr"
+                label="详细地址"
+                min-width="170"
+                show-overflow-tooltip
+              >
                 <template slot-scope="scope">
                   <el-form-item
+                    v-if="scope.row.edit"
                     :prop="'order_addr.' + scope.$index + '.' + 'addr'"
                     :rules="addrRules.addr"
                     :size="'mini'"
@@ -188,18 +236,17 @@
                       :disabled="!scope.row.edit"
                     />
                   </el-form-item>
+                  <span v-if="!scope.row.edit">{{ scope.row.addr }}</span>
                 </template>
               </el-table-column>
 
-              <el-table-column fixed="right" width="80">
+              <el-table-column fixed="right" width="94" show-overflow-tooltip>
                 <template slot="header" slot-scope="scope">
-                  <span>操作</span>
-
                   <el-tooltip
                     class="fr"
-                    style="margin: 3px 0 0 0"
+                    style="margin: 3px 0 0 8px"
                     effect="dark"
-                    content="添加"
+                    content="手动添加地址"
                     placement="top"
                   >
                     <i
@@ -208,6 +255,33 @@
                       @click="openHouseModal(-1)"
                     ></i>
                   </el-tooltip>
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 8px"
+                    effect="dark"
+                    content="导入收货地址"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-upload2 tb-icon"
+                      style="color: #63cbe7"
+                      @click="addrmodel = true"
+                    ></i>
+                  </el-tooltip>
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 0"
+                    effect="dark"
+                    content="下载收货地址模板"
+                    placement="top"
+                  >
+                    <a class="downloadAddr" href="./static/收货地址模板.xlsx">
+                      <i
+                        class="el-icon-download tb-icon"
+                        style="color: #63cbe7; margin: 0"
+                      ></i>
+                    </a>
+                  </el-tooltip>
                 </template>
                 <template slot-scope="scope">
                   <el-tooltip
@@ -245,18 +319,12 @@
             </el-table>
           </el-form>
         </el-col>
-
         <el-col :span="24">
           <in-addr-model
             :show-model="addrmodel"
             @cancel="addrmodel = false"
             @refresh="addrRefresh"
           />
-        </el-col> -->
-        <el-col :span="24" style="text-align: right">
-          <el-button :size="'mini'" type="primary" @click="submitForm"
-            >保 存
-          </el-button>
         </el-col>
       </el-row>
     </el-card>
@@ -264,7 +332,7 @@
 </template>
    <script>
 import resToken from "@/mixins/resToken";
-// import asyncRequest from "@/apis/service/sellOut/zxOrder/detail";
+import asyncRequest from "@/apis/service/sellOut/zixunOrder";
 import searchStockGoodModal from "@/components/search-stock-good-modal";
 import { isnumber, isMobile } from "@/utils/validate";
 import inAddrModel from "@/components/in-addr-model";
@@ -303,36 +371,37 @@ export default {
       showModelThis: this.showModel,
       showGoodsModel: false,
       ShowDataTableColumns: ShowDataTableColumns,
+      options: [
+        {
+          value: "1",
+          label: "直接发货",
+        },
+        {
+          value: "2",
+          label: "延时发货",
+        },
+      ],
       stock_code: "",
       cat_id: "",
       ruleForm: {
-        goods_class: [],
-        good_name: "",
-        good_code: "", // 商品选择
-        customer_code: [], // 企业客户选择
+        bidNo: "", //咨询单反馈编号
+        good_num: "", //商品数量
+        sendtype: "1", // 发货方式
+        arrtime: "", // 到货时间
       },
       rulesThis: this.rules,
       rules: {
-        goods_class: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择商品分类",
-            trigger: "change",
-          },
-        ],
-        good_code: [
+        good_num: [
           {
             required: true,
-            message: "请选择商品",
+            message: "商品数量",
             trigger: "blur",
           },
         ],
-        customer_code: [
+        sendtype: [
           {
-            type: "array",
             required: true,
-            message: "请选择企业客户",
+            message: "请选择商品",
             trigger: "change",
           },
         ],
@@ -341,13 +410,6 @@ export default {
         order_addr: [], //收货地址
       },
       addrRules: {
-        arrive_time: [
-          {
-            required: true,
-            message: "最晚收货日期不能为空",
-            trigger: "change",
-          },
-        ],
         receipt_quantity: [
           {
             required: true,
@@ -411,249 +473,184 @@ export default {
       console.log("closeModel!!");
       this.showModelThis = false;
     },
+    num_change(e, key) {
+      this.ruleForm[key] = e + "";
+      this.$refs.ruleForm.validateField(key);
+    },
     async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
       console.log(this.sitem);
-      console.log(ShowDataTableColumns);
-      // this.loading = true;
-      // this.rulesThis = this.rules;
-      // await this.resetForm();
-      // this.loading = false;
+      const { can } = this.sitem;
+      this.sitem.can_name = "";
+      this.sitem.is_noble = false;
+      if (can && can.length > 0) {
+        can.forEach((a, ai) => {
+          this.sitem.is_noble = a.id === "6";
+          this.sitem.can_name += `${ai !== 0 ? "_" : ""}${a.name}`;
+        });
+      }
+      await this.resetForm();
+      this.getNewTime();
+      this.loading = false;
+    },
+    addrRefresh(e) {
+      const { list } = e;
+      this.addrForm.order_addr.push(...list);
     },
-    // hand() {
-    //   if (this.ruleForm.goods_class.length === 0) {
-    //     this.$message.warning("请选择商品分类!");
-    //     return;
-    //   }
-    //   this.showGoodsModel = true;
-    // },
-    // addrRefresh(e) {
-    //   const { list } = e;
-    //   this.addrForm.order_addr.push(...list);
-    // },
-
-    // goods_class_change(e) {
-    //   this.ruleForm.goods_class = e;
-    //   this.cat_id = e.length > 0 ? e[e.length - 1] : "";
-    //   this.$refs.ruleForm.validateField("goods_class");
-    //   this.ruleForm.good_code = "";
-    //   this.ruleForm.good_name = "";
-    //   this.$refs.ruleForm.validateField("good_code");
-    // },
-    // refresh(e) {
-    //   this.showModelThis = e;
-    //   this.$emit("refresh", true);
-    // },
 
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
     async resetForm() {
-      this.getNewTime();
-      // 重置
-      // await this.$nextTick(() => {
-      //   if (this.$refs.ruleForm) {
-      //     this.$refs.ruleForm.resetFields();
-      //     this.$refs.ruleForm.clearValidate();
-      //     this.cat_id = "";
-      //     this.ruleForm = {
-      //       goods_class: [],
-      //       good_code: "", // 商品选择
-      //       customer_code: [], // 企业客户选择
-      //     };
-      //   }
-      //   if (this.$refs.stockForm) {
-      //     this.$refs.stockForm.resetFields();
-      //     this.$refs.stockForm.clearValidate();
+      //重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { bidNo, in_num, in_arrival_time } = this.sitem;
+          this.ruleForm = {
+            bidNo: bidNo || "", //咨询单反馈编号
+            good_num: in_num || "0", //商品数量
+            sendtype: "1", // 发货方式
+            arrtime: in_arrival_time || "", // 到货时间
+          };
+        }
 
-      //     this.stockForm = {
-      //       good_stock: [], //出货仓库
-      //     };
-      //   }
-      //   if (this.$refs.addrForm) {
-      //     this.$refs.addrForm.resetFields();
-      //     this.$refs.addrForm.clearValidate();
-      //     this.addrForm = {
-      //       order_addr: [],
-      //     };
-      //   }
-      // });
+        if (this.$refs.addrForm) {
+          this.$refs.addrForm.resetFields();
+          this.$refs.addrForm.clearValidate();
+          this.addrForm = {
+            order_addr: [],
+          };
+        }
+      });
     },
-    // async addGoodsRes(e) {
-    //   if (e && e.length === 1) {
-    //     this.ruleForm.good_name = e[0].good_name;
-    //     this.ruleForm.good_code = e[0].type_code;
-    //   } else {
-    //     this.ruleForm.good_name = "";
-    //     this.ruleForm.good_code = "";
-    //   }
-    //   this.$refs.ruleForm.validateField("good_code");
-    // },
-    // editRow(index) {
-    //   let findex = this.stockForm.good_stock.findIndex((v) => v.edit === true);
-    //   if (findex !== -1) {
-    //     this.$message.warning("当前已有发货仓库信息在编辑,请保存后再试!");
-    //     return;
-    //   } else {
-    //     this.stockForm.good_stock[index].edit = true;
-    //   }
-    // },
-    // checkStockRow(index) {
-    //   let total = parseInt(this.stockForm.good_stock[index].usable_stock),
-    //     num = parseInt(this.stockForm.good_stock[index].num);
-    //   if (total === 0) {
-    //     this.$message.warning("该仓库已无该商品库存!不能销售!");
-    //     return;
-    //   } else {
-    //     if (num > total) {
-    //       this.$message.warning("销售数量不能大于可用库存!");
-    //       return;
-    //     } else {
-    //       this.stockForm.good_stock[index].edit = false;
-    //     }
-    //   }
-    // },
-    // customer_code_change(e) {
-    //   if (e && e.code) {
-    //     this.ruleForm.customer_code = [e.code];
-    //   } else {
-    //     this.ruleForm.customer_code = [];
-    //   }
-    //   this.$refs.ruleForm.validateField("customer_code");
-    // },
-    // openHouseModal(index) {
-    //   let findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
-    //   if (findex !== -1) {
-    //     this.$message.warning("当前已有地址在编辑,请保存后再试!");
-    //     return;
-    //   } else {
-    //     if (index === -1) {
-    //       this.addrForm.order_addr.push({
-    //         edit: true,
-    //         arrive_time: "",
-    //         receipt_quantity: "",
-    //         contactor: "",
-    //         mobile: "",
-    //         addr_code: [],
-    //         addr: "",
-    //       });
-    //     } else {
-    //       this.addrForm.order_addr[index].edit = true;
-    //     }
-    //   }
-    // },
-    // //省市区选择
-    // select_area_change(e, index) {
-    //   this.addrForm.order_addr[index].addr_code = e;
-    // },
-    // //省市区保存某一行
-    // checkRow(rowIndex) {
-    //   this.$refs.addrForm.validate((valid) => {
-    //     if (valid) {
-    //       this.addrForm.order_addr[rowIndex].edit = false;
-    //     } else {
-    //       console.log("error submit!!");
-    //       return false;
-    //     }
-    //   });
-    // },
-    // // 省市区删除行操作
-    // deleteRow(index, rows) {
-    //   rows.splice(index, 1);
-    // },
-    // async submitForm() {
-    //   await this.$refs.ruleForm.validate(async (valid) => {
-    //     if (valid) {
-    //       this.loading = true;
-    //       const { good_code, customer_code } = JSON.parse(
-    //         JSON.stringify(this.ruleForm)
-    //       );
-    //       const { good_stock } = JSON.parse(JSON.stringify(this.stockForm));
-    //       const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-    //       let model = {
-    //         good_code,
-    //         customer_code: customer_code.join(","), // 账号
-    //         order_addr: [],
-    //         good_stock: [],
-    //       };
-    //       let stockT = 0,
-    //         addrT = 0,
-    //         isStockOk = true,
-    //         isSEdit = false,
-    //         isAEdit = false;
-    //       good_stock.forEach((v1) => {
-    //         if (v1.edit) {
-    //           isSEdit = true;
-    //         }
-    //         if (parseInt(v1.usable_stock) < parseInt(v1.num)) {
-    //           isStockOk = false;
-    //         }
-    //         stockT += parseInt(v1.num);
-    //         let model1 = {
-    //           num: v1.num,
-    //           wsm_code: v1.wsm_code,
-    //         };
-    //         model.good_stock.push(model1);
-    //       });
-    //       order_addr.forEach((v2) => {
-    //         if (v2.edit) {
-    //           isAEdit = true;
-    //         }
-    //         addrT += parseInt(v2.receipt_quantity);
-    //         let model2 = {
-    //           contactor: v2.contactor,
-    //           mobile: v2.mobile,
-    //           arrive_time: v2.arrive_time,
-    //           addr: v2.addr,
-    //           receipt_quantity: v2.receipt_quantity,
-    //           addr_code: v2.addr_code,
-    //         };
-    //         model.order_addr.push(model2);
-    //       });
-    //       if (isSEdit) {
-    //         this.$message.warning("请保存仓库信息!");
-    //         this.loading = false;
-    //         return;
-    //       }
-    //       if (isAEdit) {
-    //         this.$message.warning("请保存地址信息!");
-    //         this.loading = false;
-    //         return;
-    //       }
-    //       if (!isStockOk) {
-    //         this.$message.warning("部分仓库销售数量已大于可用数量!");
-    //         this.loading = false;
-    //         return;
-    //       }
-    //       if (stockT !== addrT) {
-    //         this.$message.warning(
-    //           "库存出库总数量,与收货地址信息中的总数量不一致!"
-    //         );
-    //         this.loading = false;
-    //         return;
-    //       }
-
-    //       let res = await asyncRequest.add(model);
+    openHouseModal(index) {
+      let findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
+      if (findex !== -1) {
+        this.$message.warning("当前已有地址在编辑,请保存后再试!");
+        return;
+      } else {
+        if (index === -1) {
+          this.addrForm.order_addr.push({
+            edit: true,
+            receipt_quantity: "",
+            contactor: "",
+            mobile: "",
+            addr_code: [],
+            addr: "",
+          });
+        } else {
+          this.addrForm.order_addr[index].edit = true;
+        }
+      }
+    },
+    //省市区选择
+    async select_area_change(e, index) {
+      this.addrForm.order_addr[index].addr_code = e;
+      const { addr_code } = this.addrForm.order_addr[index];
+      if (addr_code && addr_code.length === 3) {
+        let arrCode = addr_code[addr_code.length - 1];
+        // console.log(model);
+        let { code, data, message } = await asyncRequest.addrall({
+          code: arrCode,
+        });
+        if (code === 0) {
+          const { province, city, area } = data;
+          let province_name = province && province.name ? province.name : "";
+          let city_name = city && city.name ? city.name : "";
+          let area_name = area && area.name ? area.name : "";
+          this.addrForm.order_addr[index].addr_code_name =
+            province_name && city_name && area_name
+              ? `${province_name}/${city_name}/${area_name}`
+              : "";
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.addrForm.order_addr[index].addr_code_name = "";
+      }
+    },
+    //省市区保存某一行
+    checkRow(rowIndex) {
+      this.$refs.addrForm.validate((valid) => {
+        if (valid) {
+          this.addrForm.order_addr[rowIndex].edit = false;
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    // 省市区删除行操作
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.order_addr = [];
+          const { sendtype, good_num } = model;
+          const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
+          if (sendtype === "2" && order_addr && order_addr.length === 0) {
+            this.$message.warning("至少上传一个地址信息!");
+            this.loading = false;
+            return;
+          }
+          let addrT = 0,
+            isAEdit = false;
+          order_addr.forEach((v2) => {
+            if (v2.edit) {
+              isAEdit = true;
+            }
+            addrT += parseInt(v2.receipt_quantity + "");
+            let model2 = {
+              addr_code: v2.addr_code.toString(),
+              contactor: v2.contactor,
+              mobile: v2.mobile,
+              addr: v2.addr,
+              receipt_quantity: v2.receipt_quantity,
+            };
+            model.order_addr.push(model2);
+          });
 
-    //       this.loading = false;
-    //       if (res && res.code === 0) {
-    //         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;
-    //     }
-    //   });
-    // },
+          if (isAEdit) {
+            this.$message.warning("请保存地址信息!");
+            this.loading = false;
+            return;
+          }
+          if (parseInt(good_num + "") !== addrT && sendtype === "2") {
+            this.$message.warning("收货总数量与购买不一致!");
+            this.loading = false;
+            return;
+          }
+          console.log(model);
+          let res = await asyncRequest.consultorder(model);
+          this.loading = false;
+          if (res && res.code === 0) {
+            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>

+ 17 - 58
src/views/sellOut/zixunOrder/components/feedbackList.vue

@@ -103,7 +103,9 @@
             (scope.row === '0' ||
               scope.row.status === '1' ||
               scope.row.status === '2' ||
-              scope.row.status === '5')
+              scope.row.status === '5') &&
+            status == '3'
+         
           "
           effect="dark"
           content="选择该商品"
@@ -120,7 +122,8 @@
             powers.length > 0 &&
             powers.some((item) => item == '070') &&
             is_project === '0' &&
-            scope.row.status === '6'
+            scope.row.status === '6' &&
+            status == '4'
           "
           effect="dark"
           content="下单"
@@ -143,7 +146,7 @@
       :showModel="bayGoodShowModel"
       :sitem="bayGoodItem"
       @cancel="bayGoodShowModel = false"
-      @refresh="(bayGoodShowModel = false), searchList()"
+      @refresh="(bayGoodShowModel = false), $emit('resGoodOk')"
     />
   </div>
 </template>
@@ -184,6 +187,7 @@ export default {
       wantBsitem: "",
       select: "1",
       s_input: "",
+      status: "",
       bayGoodShowModel: false,
       bayGoodItem: {},
       is_project: false,
@@ -243,61 +247,13 @@ export default {
       },
       // 表格 - 列参数
       columns: feedbackListCol,
-      serviceOptions: [
-        {
-          value: "0",
-          label: "待审核",
-        },
-        {
-          value: "1",
-          label: "待物流反馈",
-        },
-        {
-          value: "2",
-          label: "待退货",
-        },
-        {
-          value: "3",
-          label: "已退货",
-        },
-      ],
-      serviceValue: "", //售后申请处理状态
-      expectOptions: [
-        {
-          value: "1",
-          label: "退货",
-        },
-        {
-          value: "2",
-          label: "换货",
-        },
-        {
-          value: "3",
-          label: "改变售价",
-        },
-      ],
-      expectValue: "", //期望意愿
-      resultOptions: [
-        {
-          value: "ad",
-          label: "处理中",
-        },
-        {
-          value: "选项2",
-          label: "已同意",
-        },
-        {
-          value: "选项2",
-          label: "已驳回",
-        },
-      ],
-      resultValue: "", //处理结果
     };
   },
   mounted() {
     console.log(this.sitem);
-    const { is_project } = this.sitem;
+    const { is_project, status } = this.sitem;
     this.is_project = is_project;
+    this.status = status;
     this.searchList();
   },
 
@@ -410,12 +366,15 @@ export default {
         });
     },
     buy_goods(row) {
-      const {company,khname,platform_name}=this.sitem
+      const { company, khname, platform_name, arrival_time, num } = this.sitem;
       this.bayGoodItem = JSON.parse(JSON.stringify(row));
-      this.bayGoodItem.in_company=company
-      this.bayGoodItem.in_khname=khname
-      this.bayGoodItem.in_platform_name=platform_name
-      this.bayGoodShowModel=true;
+      this.bayGoodItem.in_company = company;
+      this.bayGoodItem.in_khname = khname;
+      this.bayGoodItem.in_platform_name = platform_name;
+      this.bayGoodItem.in_arrival_time = arrival_time;
+      this.bayGoodItem.in_num = num;
+      this.bayGoodShowModel = true;
+      
       // console.log(row);
     },
     // 时间选择事件

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott