Переглянути джерело

feat:更换商品选择组件,限制不能选择有赞和bbc平台

snow 1 рік тому
батько
коміт
1eb0715820

+ 22 - 10
src/components/good-online-platform-modal/main.vue

@@ -148,6 +148,7 @@
 <script>
 import asyncRequest from '@/apis/components/search-good-online-modal'
 import asyncYZRequest from '@/apis/service/youzan/othgoodsOnline'
+import asyncBBCRequest from '@/apis/service/bbc'
 import resToken from '@/mixins/resToken'
 import mixinPage from '@/mixins/elPaginationHandle'
 import { mapGetters } from 'vuex'
@@ -298,19 +299,30 @@ export default {
       model.good_name = this.select === '1' ? this.sinput : '' // 商品名称
       model.plat_code = this.select === '3' ? this.sinput : ''
       model.skucode = this.select === '4' ? this.sinput : ''
-      // model.platform_code =
-      //   model.platform_code.length > 0
-      //     ? model.platform_code[model.platform_code.length - 1]
-      //     : "";
 
-      const apis = this.platform_type + '' === '1' ? asyncYZRequest : asyncRequest
 
-      const status = this.platform_type + '' === '1' ? '6' : '3'
+      // const apis = this.platform_type + '' === '1' ? asyncYZRequest : asyncRequest
+
+      
+      let api;
+      let status;
+      switch (this.platform_type) {
+        case '1': // 有赞
+          api = asyncYZRequest;
+          status = '6'
+          break;
+        case '2': // bbc
+          api = asyncBBCRequest
+          status = '3'
+          break;
+        default: // 无对接
+          api = asyncRequest
+          status = '3'
+          break;
+      }
+
+      const res = await api.list({ ...model, exam_status: status })
 
-      const res = await apis.list({
-        ...model,
-        exam_status: status
-      })
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list
         this.tableData.map((e) => {

+ 16 - 1
src/views/sellOut/businessFiling/components/createBusinessForm.vue

@@ -262,6 +262,7 @@
                 is_combind="0"
                 :active="true"
                 :show-model="showModel"
+                :platform_type="platformType"
                 @resultList="resultList"
                 @cancel="showModel = false"
               />
@@ -298,7 +299,7 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/businessFiling";
 import showVoucherModel from "@/components/show-voucher-model";
-import searchGoodOnlineModal from "@/components/search-good-online-modal";
+import searchGoodOnlineModal from "@/components/good-online-platform-modal";
 import inAddrModel from "@/components/in-addr-model";
 import { addColumns } from "./ShowDataTableColumns";
 import companyHelper from "@/mixins/companyHelper";
@@ -350,6 +351,7 @@ export default {
           return time.getTime() < Date.now() - 1000 * 60 * 60 * 24;
         }
       },
+      platformType:"",
       ruleForm: {
         order_type: "1",
         supplierNo: "", //销售方编码
@@ -624,10 +626,22 @@ export default {
         this.$message.warning("请选择销售方公司!");
         return;
       }
+      
       if (platform_id === "") {
         this.$message.warning("请选择所属平台!");
         return;
       }
+
+      if(this.platformType === "1"){
+        this.$message.warning("不能选择有赞平台")
+        return
+      }
+
+      if(this.platformType === "2"){
+        this.$message.warning("不能选择bbc平台")
+        return
+      }
+
       this.addshowModel = {
         company_id: supplierNo,
         platform_code: platform_id
@@ -657,6 +671,7 @@ export default {
       const { id, code, label } = e;
       this.ruleForm.platform_id = id || "";
       this.$refs.ruleForm.validateField("platform_id");
+      this.platformType = e.platform_type;
       this.ruleForm.good_code = "";
       this.goods_sitem = {};
     },

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

@@ -162,7 +162,7 @@ export default {
   },
   methods:{
     async initialData(){
-      const response = await asyncRequest.detail({id:this.id})
+      const response = await asyncRequest.detail({ id: this.id})
       if(response.code !== 0) return;
       this.sitem = response.data;
       this.sitem.wait_num = response.data.good_num - response.data.transfer_num;

+ 21 - 2
src/views/sellOut/salesOrder/components/addForm.vue

@@ -25,6 +25,7 @@
                 />
               </el-form-item>
             </el-col>
+
             <el-col :span="12">
               <el-form-item label="企业客户" prop="customer_code">
                 <search-customer
@@ -38,6 +39,7 @@
                 />
               </el-form-item>
             </el-col>
+
             <el-col :span="6">
               <el-form-item label="所属平台" prop="platform_id">
                 <search-terrace
@@ -51,11 +53,13 @@
                 />
               </el-form-item>
             </el-col>
+            
             <el-col :span="6">
               <el-form-item label="平台订单号" prop="platform_order">
                 <el-input v-model="ruleForm.platform_order" placeholder="如:PO号" maxlength="100" />
               </el-form-item>
             </el-col>
+
             <el-col :span="6">
               <el-form-item label="回款时间" prop="paytime">
                 <el-date-picker
@@ -355,6 +359,7 @@
                 :sitem="addshowModel"
                 :active="true"
                 :show-model="showModel"
+                :platform_type="platformType"
                 @resultList="resultList"
                 @cancel="showModel = false"
               />
@@ -596,7 +601,7 @@ import {
   isAddr
 } from "@/utils/validate";
 import showVoucherModel from "@/components/show-voucher-model";
-import searchGoodOnlineModal from "@/components/search-good-online-modal";
+import searchGoodOnlineModal from "@/components/good-online-platform-modal";
 import inAddrModel from "@/components/in-addr-model";
 import { addColumns } from "./ShowDataTableColumns";
 import companyHelper from "@/mixins/companyHelper";
@@ -690,7 +695,8 @@ export default {
       }
     };
     return {
-        isCombindChild: true,
+      platformType:"",
+      isCombindChild: true,
       ShowDataTableColumns: addColumns,
       AddrAddEditModalIndex: -1,
       AddrAddEditModalSitem: {},
@@ -1195,6 +1201,18 @@ export default {
         this.$message.warning("请选择所属平台!");
         return;
       }
+
+      if(this.platformType === "1"){
+        this.$message.warning("不能选择有赞平台")
+        return
+      }
+
+      if(this.platformType === "2"){
+        this.$message.warning("不能选择bbc平台")
+        return
+      }
+
+
       this.addshowModel = {
         company_id: supplierNo,
         platform_code: platform_id
@@ -1225,6 +1243,7 @@ export default {
       this.ruleForm.platform_id = id || "";
       this.$refs.ruleForm.validateField("platform_id");
       this.ruleForm.good_code = "";
+      this.platformType = e.platform_type;
       this.goods_sitem = {};
     },
     openHouseModal(index) {

+ 3 - 3
src/views/sellOut/zixunOrder/components/transferGoodModal.vue

@@ -144,7 +144,7 @@
                     </el-form-item>
                   </el-col>
                   <el-col :span="18">
-                    <el-form-item label="凭证文件" prop="proof_url" label-width="85px">
+                    <el-form-item label="比价凭证" prop="proof_url" label-width="85px">
                       <ul class="shangchuan-ul">
                         <li v-if="ruleForm.proof_type + '' === '1'" class="shiping">
                           <div v-if="video_url" class="clearfix">
@@ -219,7 +219,7 @@
                         </li>
                         <li v-if="ruleForm.proof_type + '' === '3'" class="qita">
                           <div v-if="other_url" class="clearfix">
-                            <a :href="other_url" download="凭证文件">点击下载</a>
+                            <a :href="other_url" download="比价凭证">点击下载</a>
 
                             <el-link
                               :underline="false"
@@ -492,7 +492,7 @@ export default {
         proof_url: [
           {
             required: true,
-            message: "请上传凭证文件",
+            message: "请上传比价凭证",
             trigger: "blur,change"
           }
         ]