戴艳蓉 3 years ago
parent
commit
9f4dd212b4

+ 2 - 14
src/apis/service/sellOut/zixunOrder/index.js

@@ -10,9 +10,6 @@ export default {
   status: (data, params) => http(api + "consultbar", data, "post", params),
   // 分页查询 反馈列表
   feedList: (data, params) => http(api + "consultbidlist", data, "post", params),
-
-
-
   // 添加
   add: (data, params) => http(api + "consultcreate", data, "post", params),
   // 分页查询项目列表
@@ -26,16 +23,7 @@ export default {
   pdetail: (data, params) => http(api + "projectinfo", data, "post", params),
   // 议价单创建
   bargain_add: (data, params) => http(api + "consultbaradd", data, "post", params),
-
-  // 异常原因接口
-  reasonList: (data, params) => http(api + "resultlist", data, "post", params),
-  // 物流反馈
-  afterFeed: (data, params) => http(api + "afterfeed", data, "post", params),
-  // 企业客户反馈
-  aftergys: (data, params) => http(api + "aftergys", data, "post", params),
-  // 售后快递录入
-  afterPost: (data, params) => http(api + "afterpost ", data, "post", params),
-  //售后获取仓库list
-  afterwsm: (data, params) => http(api + "afterwsm ", data, "post", params),
+  // 咨询单选定商品
+  bidscheck: (data, params) => http(api + "bidscheck", data, "post", params),
 
 };

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

@@ -68,6 +68,8 @@ const btnList = [
   { code: "066", name: "招标任务停止" },
   { code: "067", name: "招标任务启动" },
   { code: "068", name: "发起议价" },
+  { code: "069", name: "选定商品" },
+  { code: "070", name: "非项目咨询单下单" },
 
 ];
 export default btnList;

+ 1 - 1
src/views/sellOut/bargainList/columns.js

@@ -313,7 +313,7 @@ const listCol = [
     width: "160"
   },
   {
-    prop: "bargainNo",
+    prop: "bidsNo",
     label: "采返商品编号",
     width: "160"
   },

+ 9 - 3
src/views/sellOut/zixunOrder/columns.js

@@ -433,11 +433,17 @@ const feedbackListCol = [
     label: "反馈商品编号",
     width: "160"
   },
+  {
+    prop: " origin_price",
+    label: "议价前销售单价",
+    "width": "110"
+  },
   {
     prop: "sale_price",
-    label: "销售单价",
-    "width": "100"
+    label: "议价后销售单价",
+    "width": "110"
   },
+
   {
     prop: "good_img",
     label: "图片",
@@ -490,7 +496,7 @@ const feedbackListCol = [
     fixed: "right",
     _noset_: true,
     _slot_: "operation",
-    width: 50,
+    width: 80,
   },
 ]
 

+ 889 - 0
src/views/sellOut/zixunOrder/components/buyGoodModal.vue

@@ -0,0 +1,889 @@
+<template>
+  <el-dialog
+    :title="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 :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            label-width="95px"
+            class="demo-ruleForm"
+          >
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="商品分类" prop="goods_class">
+                  search-sort
+                  999
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="商品名称" prop="good_code">
+                  <el-input
+                    v-model="ruleForm.good_name"
+                    readonly
+                    @focus="hand"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="企业客户" prop="customer_code">
+                  <search-customer
+                    :value="ruleForm.customer_code"
+                    @searchChange="customer_code_change"
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="24">
+                <search-stock-good-modal
+                  :once="true"
+                  :cat_id="cat_id"
+                  :show-model="showGoodsModel"
+                  @cancel="showGoodsModel = false"
+                  @searchChange="addGoodsRes"
+                />
+                <!-- <search-stock-good-modal
+                  :show-model="showGoodsModel"
+                  :code="stock_code"
+                  @cancel="showGoodsModel = false"
+                  @searchChange="addGoodsRes"
+                /> -->
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="padding: 0 0 20px 0">
+          <el-form :model="stockForm" ref="stockForm" :size="'mini'">
+            <el-table
+              :data="stockForm.good_stock"
+              border
+              :size="'mini'"
+              style="width: 100%"
+              row-key="key"
+            >
+              <el-table-column
+                prop="wsm_supplierNo"
+                label="发货公司编号"
+                width="145"
+              />
+
+              <el-table-column
+                show-overflow-tooltip
+                prop="wsm_supplier"
+                label="发货公司名称"
+                min-width="145"
+              />
+              <el-table-column
+                prop="wsm_code"
+                label="发货仓库编码"
+                width="180"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                prop="wsm_name"
+                label="发货仓库名称"
+                min-width="180"
+              />
+              <el-table-column
+                prop="usable_stock"
+                label="商品可用库存"
+                width="120"
+              />
+
+              <el-table-column prop="num" label="下单数量" width="150">
+                <template slot-scope="scope">
+                  <el-form-item
+                    :prop="'good_stock.' + scope.$index + '.' + 'num'"
+                    :rules="{}"
+                    :size="'mini'"
+                    style="margin-bottom: 0"
+                  >
+                    <el-input
+                      v-model="scope.row.num"
+                      :disabled="!scope.row.edit"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="original_price"
+                label="销售价"
+                width="110"
+              />
+
+              <el-table-column fixed="right" width="80" label="操作">
+                <template slot-scope="scope">
+                  <el-tooltip
+                    effect="dark"
+                    content="编辑"
+                    v-if="!scope.row.edit"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-edit tb-icon"
+                      @click="editRow(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="checkStockRow(scope.$index)"
+                    ></i>
+                  </el-tooltip>
+
+                  <el-tooltip effect="dark" content="删除" placement="top">
+                    <i
+                      class="el-icon-delete tb-icon"
+                      @click="deleteRow(scope.$index, stockForm.good_stock)"
+                    ></i>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form>
+        </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-form :model="addrForm" ref="addrForm" :size="'mini'">
+            <el-table
+              :data="addrForm.order_addr"
+              border
+              :size="'mini'"
+              style="width: 100%"
+              row-key="key"
+            >
+              <el-table-column
+                prop="receipt_quantity"
+                label="收货总数"
+                min-width="125"
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    :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>
+                </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' }"
+                  >
+                    <!-- type="datetime"
+                      style="width: 100%"
+                      value-format="yyyy-MM-dd HH:mm:ss" -->
+                    <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"
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    :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>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="mobile"
+                label="收货联系电话"
+                min-width="130"
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    :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>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="addr_code"
+                label="收货省市区"
+                min-width="230"
+              >
+                <template slot-scope="scope">
+                  <el-form-item
+                    :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>
+                </template>
+              </el-table-column>
+              <el-table-column prop="addr" label="详细地址" min-width="170">
+                <template slot-scope="scope">
+                  <el-form-item
+                    :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>
+                </template>
+              </el-table-column>
+
+              <el-table-column fixed="right" width="80">
+                <template slot="header" slot-scope="scope">
+                  <span>操作</span>
+
+                  <el-tooltip
+                    class="fr"
+                    style="margin: 3px 0 0 0"
+                    effect="dark"
+                    content="添加"
+                    placement="top"
+                  >
+                    <i
+                      class="el-icon-circle-plus-outline tb-icon"
+                      style="color: #63cbe7"
+                      @click="openHouseModal(-1)"
+                    ></i>
+                  </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-col :span="24" style="text-align: right">
+          <el-button :size="'mini'" type="primary" @click="submitForm"
+            >保 存
+          </el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+   <script>
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/zxOrder/detail";
+import searchStockGoodModal from "@/components/search-stock-good-modal";
+import { isnumber, isMobile } from "@/utils/validate";
+import inAddrModel from "@/components/in-addr-model";
+export default {
+  name: "allot",
+  props: ["showModel", "id"],
+  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,
+      title: "新建销售订单",
+      showModelThis: this.showModel,
+      showGoodsModel: false,
+      stock_code: "",
+      cat_id: "",
+      ruleForm: {
+        goods_class: [],
+        good_name: "",
+        good_code: "", // 商品选择
+        customer_code: [], // 企业客户选择
+      },
+      rulesThis: this.rules,
+      rules: {
+        goods_class: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择商品分类",
+            trigger: "change",
+          },
+        ],
+        good_code: [
+          {
+            required: true,
+            message: "请选择商品",
+            trigger: "blur",
+          },
+        ],
+        customer_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择企业客户",
+            trigger: "change",
+          },
+        ],
+      },
+      addrForm: {
+        order_addr: [], //收货地址
+      },
+      addrRules: {
+        arrive_time: [
+          {
+            required: true,
+            message: "最晚收货日期不能为空",
+            trigger: "change",
+          },
+        ],
+        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",
+          },
+        ],
+      },
+      stockForm: {
+        good_stock: [], //出货仓库
+      },
+      loading: false,
+      id: "",
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.rulesThis = this.rules;
+        this.resetForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+      this.showModelThis = false;
+    },
+    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);
+    },
+    async getstock(code) {
+      this.loading = true;
+      let model = {
+        wsm_code: "",
+        page: 1,
+        size: 100,
+        type_code: code,
+        good_code: "",
+        good_name: "",
+        supplierNo: "",
+        stock_low: "",
+        stock_up: "",
+        warn_low: "",
+        warn_up: "",
+        stock_max: "1",
+      };
+      const res = await asyncRequest.getGoodStock(model);
+      if (res && res.code === 0 && res.data) {
+        this.stockForm = {
+          good_stock: [], //出货仓库
+        };
+        const { list } = res.data;
+        list.forEach((v) => {
+          let model = {
+            num: v.usable_stock,
+            usable_stock: v.usable_stock,
+            wsm_name: v.wsm_name,
+            wsm_supplier: v.wsm_supplier,
+            wsm_supplierNo: v.wsm_supplierNo,
+            wsm_code: v.wsm_code,
+            original_price: v.original_price,
+            edit: false,
+          };
+          this.stockForm.good_stock.push(model);
+        });
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+      this.loading = false;
+    },
+
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+    async resetForm() {
+      // 重置
+      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();
+
+          this.stockForm = {
+            good_stock: [], //出货仓库
+          };
+        }
+        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");
+      if (this.ruleForm.good_code !== "" && this.id === "add") {
+        await this.getstock(this.ruleForm.good_code);
+      } else {
+        this.stockForm = {
+          good_stock: [], //出货仓库
+        };
+      }
+    },
+    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);
+
+          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>
+
+   
+   <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>

+ 101 - 8
src/views/sellOut/zixunOrder/components/feedbackList.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="zixunOrder pagePadding">
+    <!-- <div>{{powers}}---{{is_project}}</div> -->
     <ex-table
       v-loading="loading"
       :table="table"
@@ -37,7 +38,10 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '0' ? 'warning' : ''"
+          :type="
+            (statusOptions.find((item) => item.id == scope.row.status) || {})
+              .type || ''
+          "
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -53,6 +57,7 @@
       </template>
 
       <template #operation="{ scope }">
+        <!-- 状态 -->
         <!-- <el-tooltip
             v-if="powers.some((item) => item == '007')"
             effect="dark"
@@ -74,7 +79,11 @@
             powers &&
             powers.length > 0 &&
             powers.some((item) => item == '068') &&
-            !is_project
+            is_project === '0' &&
+            (scope.row === '0' ||
+              scope.row.status === '1' ||
+              scope.row.status === '2' ||
+              scope.row.status === '5')
           "
           effect="dark"
           content="发起议价流程"
@@ -85,6 +94,43 @@
             @click="wantBargaining(scope.row)"
           ></i>
         </el-tooltip>
+        <el-tooltip
+          v-if="
+            powers &&
+            powers.length > 0 &&
+            powers.some((item) => item == '069') &&
+            is_project === '0' &&
+            (scope.row === '0' ||
+              scope.row.status === '1' ||
+              scope.row.status === '2' ||
+              scope.row.status === '5')
+          "
+          effect="dark"
+          content="选择该商品"
+          placement="top"
+        >
+          <i
+            class="el-icon-s-check tb-icon"
+            @click="change_goods(scope.row.bidNo)"
+          ></i>
+        </el-tooltip>
+        <el-tooltip
+          v-if="
+            powers &&
+            powers.length > 0 &&
+            powers.some((item) => item == '070') &&
+            is_project === '0' &&
+            scope.row.status === '6'
+          "
+          effect="dark"
+          content="下单"
+          placement="top"
+        >
+          <i
+            class="el-icon-shopping-cart-2 tb-icon"
+            @click="buy_goods(scope.row)"
+          ></i>
+        </el-tooltip>
       </template>
     </ex-table>
     <add-edit-bargain
@@ -93,6 +139,12 @@
       @cancel="wantBmodel = false"
       @refresh="(wantBmodel = false), searchList()"
     />
+    <buy-good-modal
+      :showModel="bayGoodShowModel"
+      :sitem="bayGoodItem"
+      @cancel="bayGoodShowModel = false"
+      @refresh="(bayGoodShowModel = false), searchList()"
+    />
   </div>
 </template>
    <script>
@@ -102,6 +154,7 @@ import asyncRequest from "@/apis/service/sellOut/zixunOrder";
 import { feedbackListCol } from "../columns";
 import { mapGetters } from "vuex";
 import addEditBargain from "./addEditBargain";
+import buyGoodModal from "./buyGoodModal";
 
 export default {
   name: "zixunOrder",
@@ -109,6 +162,7 @@ export default {
   props: ["id", "newTime", "sitem"],
   components: {
     addEditBargain,
+    buyGoodModal,
   },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -130,6 +184,8 @@ export default {
       wantBsitem: "",
       select: "1",
       s_input: "",
+      bayGoodShowModel: false,
+      bayGoodItem: {},
       is_project: false,
       customerCode: [], //客户公司code
       options: [
@@ -137,7 +193,7 @@ export default {
         { id: "1", label: "招标进行中" },
         { id: "2", label: "招标已结束" },
         { id: "3", label: "等待议价结果" },
-        { id: "4", label: "待选择商品" },
+        { id: "4", label: "已选商品待下单" },
         { id: "5", label: "已成功转单" },
         { id: "6", label: "已取消转单" },
         { id: "7", label: "招标已暂停" },
@@ -150,11 +206,14 @@ export default {
       sitem: null,
       // 状态
       statusOptions: [
-        { id: "0", label: "待审核" },
-        { id: "1", label: "待物流反馈" },
-        { id: "3", label: "待退货" },
-        { id: "4", label: "已退货" },
-        { id: "5", label: "待客户验收" },
+        { id: "0", label: "采返已结束", type: "info" },
+        { id: "1", label: "采返已结束", type: "info" },
+        { id: "2", label: "采返已结束", type: "info" },
+        { id: "3", label: "等待议价结果", type: "warning" },
+        { id: "4", label: "等待议价结果", type: "warning" },
+        { id: "5", label: "议价已结束", type: "" },
+        { id: "6", label: "已选择该商品", type: "success" },
+        // 0待提交1待任务结束 2 待咨询确认 3议价待财务定价4 待主管确认5 待咨询确认定价6 咨询确认
       ],
       loading: true,
       showModel: false,
@@ -290,6 +349,35 @@ export default {
       this.loading = false;
     },
 
+    async change_goods(bidNo) {
+      await this.$confirm("确定要选择该商品下单?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            bidNo: bidNo,
+          };
+          const res = await asyncRequest.bidscheck(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "选择商品成功!",
+              message: "",
+            });
+            this.$emit("resGoodOk");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
     async statusConfirm(id, status) {
       let str = status === "1" ? "禁用" : "启用";
       await this.$confirm("确定要改为" + str + "?", {
@@ -321,6 +409,11 @@ export default {
           console.log("取消");
         });
     },
+    buy_goods(row) {
+      this.bayGoodItem = JSON.parse(JSON.stringify(row));
+      this.bayGoodShowModel=true;
+      // console.log(row);
+    },
     // 时间选择事件
     async handleTime(e) {
       if (e.startTime !== "") {

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

@@ -82,6 +82,7 @@
             :newTime="newTime"
             :sitem="sitem"
             :id="queryId"
+            @resGoodOk="initForm()"
           />
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="3" v-if="queryType == 'view'">
@@ -151,7 +152,7 @@ export default {
         { id: "1", label: "招标进行中" },
         { id: "2", label: "招标已结束" },
         { id: "3", label: "等待议价结果" },
-        { id: "4", label: "待选择商品" },
+        { id: "4", label: "已选商品待下单" },
         { id: "5", label: "已成功转单" },
         { id: "6", label: "已取消转单" },
         { id: "7", label: "招标已暂停" },

+ 1 - 25
src/views/sellOut/zixunOrder/index.vue

@@ -163,30 +163,6 @@
             "
           ></el-tag>
         </template>
-        <!-- 费用承担方 -->
-        <template #post_own="{ scope }">
-          <el-tag
-            :size="tablebtnSize"
-            :type="scope.row.status == '0' ? 'warning' : ''"
-            v-text="
-              (
-                post_ownOptions.find((item) => item.id == scope.row.post_own) ||
-                {}
-              ).label || '--'
-            "
-          ></el-tag>
-        </template>
-        <!-- 期望意愿 -->
-        <template #except_code="{ scope }">
-          <el-tag
-            :size="tablebtnSize"
-            :type="scope.row.status == '0' ? 'warning' : ''"
-            v-text="
-              (options.find((item) => item.id == scope.row.except_code) || {})
-                .label || '--'
-            "
-          ></el-tag>
-        </template>
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
@@ -246,7 +222,7 @@ export default {
         { id: "1", label: "招标进行中" },
         { id: "2", label: "招标已结束" },
         { id: "3", label: "等待议价结果" },
-        { id: "4", label: "待选择商品" },
+        { id: "4", label: "已选商品待下单" },
         { id: "5", label: "已成功转单" },
         { id: "6", label: "已取消转单" },
         { id: "7", label: "招标已暂停" },