xiaodai2022 2 years ago
parent
commit
ea7249cb27

+ 7 - 4
src/views/sellOut/sellOutOrder/detail.vue

@@ -310,6 +310,8 @@ export default {
       }
     },
     async initData(e) {
+      this.returnCode = "";
+      this.returnCode_type = "";
       let model = {
         outCode: this.code,
       };
@@ -319,10 +321,11 @@ export default {
         const { status, can, id, order_return } = this.sitem;
         this.status = status;
         this.did = id;
-
-        this.returnCode = order_return.returnCode;
-        this.returnCode_type = order_return.status;
-        await this.receive_initData(this.returnCode);
+        if (order_return) {
+          this.returnCode = order_return.returnCode;
+          this.returnCode_type = order_return.status;
+          await this.receive_initData(this.returnCode);
+        }
         this.getNewTime();
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();

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

@@ -524,6 +524,12 @@ const listCol = [
     _slot_: "status",
     width: "120px",
   },
+  {
+    prop: "is_project",
+    label: "咨询单类型",
+    _slot_: "is_project",
+    width: "110px",
+  },
 
   {
     prop: "khNo",

+ 100 - 29
src/views/sellOut/zixunOrder/components/addEditBargain.vue

@@ -5,7 +5,7 @@
     :center="true"
     align="left"
     top="10vh"
-    width="750px"
+    width="900px"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
     element-loading-text="拼命加载中"
@@ -20,42 +20,67 @@
         status-icon
         :size="'mini'"
         :rules="rulesThis"
-        label-width="80px"
+        label-width="75px"
         class="demo-ruleForm"
       >
         <el-row>
-          <el-col :span="24">
-            <el-form-item label="商品名称:">
-              <el-input v-model="sitem.good_name" disabled />
-            </el-form-item>
-          </el-col>
           <el-col :span="3">
-            <el-form-item label="图片:" style="margin: 0" label-width="44px">
+            <el-form-item label="图片" style="margin: 0" label-width="44px">
               <img
                 class="hover"
                 v-viewer
-                :src="sitem.good_img"
+                :src="show_sitem.good_img"
                 alt=""
-                v-if="sitem.good_img"
+                v-if="show_sitem && show_sitem.good_img"
                 style="width: 35px; height: 35px"
               />
             </el-form-item>
           </el-col>
           <el-col :span="4">
-            <el-form-item label="单位:" label-width="50px">
-              <el-input v-model="sitem.unit" disabled />
+            <el-form-item label="单位" label-width="50px">
+              <el-input v-if="show_sitem" v-model="show_sitem.unit" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="17">
+            <el-form-item label="商品名称">
+              <el-input
+                v-if="show_sitem"
+                v-model="show_sitem.good_name"
+                disabled
+              />
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item
+              label="议价原因"
+              prop="result_info_id"
+              label-width="88px"
+            >
+              <abnormal-cause
+                :value="ruleForm.result_info_id"
+                :placeholder="'议价原因'"
+                :type="'7'"
+                :disabled="false"
+                :size="'mini'"
+                @searchChange="select_change"
+              />
+            </el-form-item>
+          </el-col>
+
           <el-col :span="7">
-            <el-form-item label="当前售价:">
-              <el-input v-model="sitem.sale_price" disabled />
+            <el-form-item label="当前售价">
+              <el-input
+                v-if="show_sitem"
+                v-model="show_sitem.sale_price"
+                disabled
+              />
             </el-form-item>
           </el-col>
-          <el-col :span="10">
+          <el-col :span="9">
             <el-form-item
-              label="期望售价:"
+              label="期望售价"
               prop="bargain_price"
-              label-width="95px"
+              label-width="88px"
             >
               <digital-input
                 :values="ruleForm.bargain_price"
@@ -73,15 +98,25 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="16">
-            <el-form-item label="型号:" style="margin: 0">
-              <span v-for="(si, sii) in sitem.specinfo" :key="sii + 'spec'"
-                ><span v-if="sii !== 0">--</span>
-                <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
-              </span>
+          <el-col :span="18">
+            <el-form-item
+              label="议价备注:"
+              prop="bargain_remark"
+              label-width="88px"
+            >
+              <el-input
+                type="textarea"
+                :rows="2"
+                placeholder="议价备注"
+                v-model="ruleForm.bargain_remark"
+              >
+              </el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="8" style="text-align: right">
+          <el-col :span="6" style="text-align: right">
+            <el-button @click="showModelThis = false" :size="'mini'">{{
+              isDetail ? "关 闭" : "取 消"
+            }}</el-button>
             <el-button
               v-if="!isDetail"
               type="primary"
@@ -89,9 +124,6 @@
               @click="submitForm"
               >保 存
             </el-button>
-            <el-button @click="showModelThis = false" :size="'mini'">{{
-              isDetail ? "关 闭" : "取 消"
-            }}</el-button>
           </el-col>
         </el-row>
       </el-form>
@@ -128,10 +160,21 @@ export default {
       organizeList: [],
       showModelThis: this.showModel,
       ruleForm: {
+        result_info_id: "",
         bargain_price: "0",
+        result_info_id_name: "",
+        bargain_remark: "",
       },
+      show_sitem: null,
       rulesThis: this.rules,
       rules: {
+        result_info_id: [
+          {
+            required: true,
+            message: "请选择议价原因!",
+            trigger: "change",
+          },
+        ],
         bargain_price: [
           {
             required: true,
@@ -139,6 +182,13 @@ export default {
             trigger: "blur",
           },
         ],
+        bargain_remark: [
+          {
+            required: true,
+            message: "议价备注不能为空!",
+            trigger: "blur",
+          },
+        ],
       },
     };
   },
@@ -176,21 +226,40 @@ export default {
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
-        const { sale_price } = this.sitem;
+        this.show_sitem = JSON.parse(JSON.stringify(this.sitem));
+        const { sale_price, specinfo } = this.sitem;
+        if (specinfo && specinfo.length > 0) {
+          specinfo.forEach((a, ai) => {
+            this.show_sitem.good_name += `${ai === 0 ? "_" : "-"}${
+              a.spec_name
+            }[${a.spec_value_name}]`;
+          });
+        }
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
             bargain_price: sale_price || "0",
+            result_info_id: "",
+            bargain_remark: "",
+            result_info_id_name: "",
           };
         }
       });
     },
+    select_change(e) {
+      const { code, label } = e;
+      this.ruleForm.result_info_id = code || "";
+      this.ruleForm.result_info_id_name = label || "";
+      this.$refs.ruleForm.validateField("result_info_id");
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
-          const { bargain_price } = JSON.parse(JSON.stringify(this.ruleForm));
+          const { bargain_price, result_info_id, bargain_remark } = JSON.parse(
+            JSON.stringify(this.ruleForm)
+          );
           const { bidNo, sale_price } = this.sitem;
           if (sale_price * 100 === bargain_price * 100) {
             this.$message.warning("期望售价不能等于当前售价!");
@@ -200,6 +269,8 @@ export default {
           const model = {
             bidNo: bidNo,
             bargain_price: bargain_price, // 账号
+            result_info_id,
+            bargain_remark,
           };
           let res = await asyncRequest.bargain_add(model);
           this.loading = false;

+ 7 - 15
src/views/sellOut/zixunOrder/components/feedbackList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="zixunOrder pagePadding">
-    <div>{{ powers }}---{{ is_project }}</div>
+    <!-- <div>{{ powers }}---{{ is_project }}</div> -->
     <ex-table
       v-loading="loading"
       :table="table"
@@ -80,10 +80,10 @@
             powers.length > 0 &&
             powers.some((item) => item == '068') &&
             is_project === '0' &&
-            (scope.row === '0' ||
-              scope.row.status === '1' ||
-              scope.row.status === '2' ||
-              scope.row.status === '5')
+            (status === '2' ||
+              status === '7' ||
+              (status === '3' &&
+                (scope.row.status === '2' || scope.row.status === '5')))
           "
           effect="dark"
           content="发起议价流程"
@@ -100,10 +100,7 @@
             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') &&
+            scope.row.status !== '6' &&
             (status == '3' || status == '2' || status == '7')
           "
           effect="dark"
@@ -205,17 +202,12 @@ export default {
         { id: "0", label: "待发布竞标" },
         { id: "1", label: "招标进行中" },
         { id: "2", label: "招标已结束" },
-        { id: "3", label: "等待议价结果" },
+        { id: "3", label: "待选择商品" },
         { id: "4", label: "已选商品待下单" },
         { id: "5", label: "已成功转单" },
         { id: "6", label: "已取消转单" },
         { id: "7", label: "招标已暂停" },
       ],
-      post_ownOptions: [
-        { id: "1", label: "客户承担" },
-        { id: "2", label: "公司承担" },
-        { id: "3", label: "供应商承担" },
-      ],
       sitem: null,
       // 状态
       statusOptions: [

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

@@ -77,7 +77,7 @@
             @refresh="refresh"
           />
         </el-tab-pane>
-        <el-tab-pane label="咨询单反馈情况" name="2" v-if="queryType == 'view'">
+        <el-tab-pane label="反馈情况" name="2" v-if="queryType == 'view'">
           <feedback-list
             v-if="newTime !== ''"
             :newTime="newTime"

+ 15 - 2
src/views/sellOut/zixunOrder/index.vue

@@ -163,6 +163,20 @@
             "
           ></el-tag>
         </template>
+        <template #is_project="{ scope }">
+          <el-tag
+            :size="'mini'"
+            :type="scope.row.is_project === '1' ? '' : 'success'"
+            >{{
+              scope.row.is_project === "0"
+                ? "非项目咨询单"
+                : scope.row.is_project === "1"
+                ? "项目咨询单"
+                : "--"
+            }}</el-tag
+          >
+        </template>
+
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
@@ -191,7 +205,7 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import {statusList} from "@/assets/js/statusList";
+import { statusList } from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/sellOut/zixunOrder";
 import { listCol } from "./columns";
 import { mapGetters } from "vuex";
@@ -341,7 +355,6 @@ export default {
       this.loading = false;
     },
 
-   
     // 时间选择事件
     async handleTime(e) {
       if (e.startTime !== "") {

+ 1 - 0
src/views/serviceParam/unusualReason/addEdit.vue

@@ -100,6 +100,7 @@ export default {
         { id: "4", label: "采购退货" },
         { id: "5", label: "销售退换货" },
         { id: "6", label: "售后未收到货异常" },
+        { id: "7", label: "议价申请原因" },
       ],
 
       rules: {

+ 2 - 1
src/views/serviceParam/unusualReason/index.vue

@@ -182,7 +182,7 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import {statusList} from "@/assets/js/statusList";
+import { statusList } from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/serviceParam/unusualReason";
 import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
@@ -221,6 +221,7 @@ export default {
         { id: "4", label: "采购退货" },
         { id: "5", label: "销售退换货" },
         { id: "6", label: "售后未收到货异常" },
+        { id: "7", label: "议价申请原因" },
       ],
       statusList: statusList,
       loading: true,