Bladeren bron

fix:报备单

snow 1 jaar geleden
bovenliggende
commit
aa7ed4ff71

+ 4 - 4
src/config/env.development.js

@@ -3,10 +3,10 @@ module.exports = {
   title: '采销平台',
   baseUrl: 'http://wx.wxhr.sit.futurelab.tv',
   api: {
-    baseApi: 'http://stock.api.caixiao365.com/'
+    baseApi: 'http://stocknew.test241.wanyuhengtong.com/'
     // baseApi: 'http://stockwm.test241.wanyuhengtong.com/'
   },
-  webUrl: 'http://project.web.caixiao365.com/#/good-share?id=',
+  webUrl: 'http://project.web.caixiao365.com/#/test-good-share?id=',
   fileURL: `https://api2.edu.futurelab.tv`,
   shareWebUrl: 'http://post.web.caixiao365.com/?prod=1&outCode=',
   // 分仓
@@ -21,9 +21,9 @@ module.exports = {
   // 结算平台url
   // settlementPlatformUrl: 'http://127.0.0.1:8848',
   // 结算平台url
-  settlementPlatformUrl: 'http://fin.caixiao365.com/',
+  settlementPlatformUrl: 'http://webcx.test241.wanyuhengtong.com/',
   // 工单管理系统url
-  GDUrl: 'http://http://bugweb.test241.wanyuhengtong.com/',
+  GDUrl: 'http://localhost:8080/',
   // token加密key
   secretKey: 'key123',
   loginTitle: '',

+ 4 - 1
src/views/sellOut/filing/cpns/baseDetail.vue

@@ -267,16 +267,19 @@ export default {
     },
     async initData() {
       this.loading = true
+
       const { code, message, data } = await asyncRequest.detail({
         id: this.queryId
       })
 
+      // return
       this.eaxmList = []
       this.loading = false
       if (code === 0) {
         this.sitem = JSON.parse(JSON.stringify(data))
         const { cat_info } = this.sitem
         let cat = ''
+
         if (cat_info && cat_info.length > 0) {
           cat_info.forEach((e, i) => {
             cat += i === 0 ? e.name : '_' + e.name
@@ -287,7 +290,7 @@ export default {
         this.status = status
 
         this.$emit('change-detail', data)
-        this.$emit('change-status', status)
+        // this.$emit('change-status', status)
         this.$emit('change-num', num)
         this.$emit('change-order-code', orderCode)
         this.getNewTime()

+ 12 - 11
src/views/sellOut/filing/cpns/exam-form.vue

@@ -22,7 +22,7 @@
         /></el-form-item>
       </el-col>
       <el-col :span="12"
-        ><el-form-item label="服务费" prop="service_charge">
+        ><el-form-item label="服务费" prop="service_charge" style="padding-bottom:1px">
           <digital-input
             :values="ruleForm.service_charge"
             :placeholder="'服务费'"
@@ -53,7 +53,7 @@
       </el-col>
 
       <el-col :span="12"
-        ><el-form-item label="服务费比例" prop="service_proportion">
+        ><el-form-item label="服务费比例" prop="service_proportion" style="padding-bottom:1px">
           <digital-input
             :values="ruleForm.service_proportion"
             :placeholder="'服务费比例'"
@@ -196,15 +196,12 @@ export default {
             platform_name,
           } = this.sitem;
 
-
-          console.log(this.sitem)
-
-          
           this.cgd_charge = cgd_charge;
           this.price = price;
           const service = status + "" === "0" ? expect_service : service_charge;
           const proportion =
             status + "" === "0" ? expect_service_proportion : service_proportion;
+
           this.is_determine_price = is_determine_price;
           this.ruleForm = {
             id: id,
@@ -225,21 +222,21 @@ export default {
       const { code, label } = e;
       this.ruleForm.companyCode = code ? [code] : [];
       this.ruleForm.companyName = label ? label : "";
-      this.$refs.ruleForm.validateField("companyCode");
+       this.$refs.ruleForm && this.$refs.ruleForm.validateField("companyCode");
     },
     platform_codesearchChange(e) {
-      console.log(e);
       const { id, label } = e;
       this.ruleForm.platform_id = id;
       this.ruleForm.platform_name = label ? label : "";
-      this.$refs.ruleForm.validateField("platform_id");
+       this.$refs.ruleForm && this.$refs.ruleForm.validateField("platform_id");
     },
     async number_change(e, key) {
+      console.log(e,key)
       if(Number(this.ruleForm[key]) === e) {
         return
       }     
       this.ruleForm[key] = e + "" || "0";
-      this.$refs.ruleForm.validateField(key);
+      this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
       await this.num(key);
     },
     async num(key) {
@@ -253,12 +250,14 @@ export default {
       } else {
         cgdAdd = this.cgd_charge * 1;
       }
+
       if (key === "service_charge") {
         serAdd = this.ruleForm.service_charge ?? "0" * 1;
       }
       if (key === "service_proportion") {
         rate = this.ruleForm.service_proportion ?? "0" * 1;
       }
+      
       if (is_sale && key === "service_charge") {
         if (qrdAdd <= serAdd) {
           this.$message.error("服务费不能大于等于销售单价!");
@@ -271,6 +270,7 @@ export default {
         rate = accMul(accSub(1, accDiv(cgdAdd, qrdAdd)), 100);
         await this.set_number_change("service_proportion", rate);
       }
+
       if (is_sale && key === "service_proportion") {
         if (rate === 100) {
           this.$message.error("服务费比例不能等于100!");
@@ -289,6 +289,7 @@ export default {
         await this.set_number_change("service_proportion", rate);
       }
 
+      return
       if (!is_sale && key === "service_proportion") {
         if (rate === 100) {
           this.$message.error("服务费比例不能等于100!");
@@ -304,7 +305,7 @@ export default {
     },
     async set_number_change(key, value) {
       this.ruleForm[key] = value + "" || "0";
-      this.$refs.ruleForm.validateField(key);
+       this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
     },
     async submitForm() {
       console.log(this.ruleForm)

+ 54 - 59
src/views/sellOut/filing/detail.vue

@@ -7,27 +7,24 @@
             <base-form :id="id" :type="type" />
           </el-collapse-item>
 
-          <template v-else>
-            <base-detail
-              ref="baseForm"
+          <base-detail
+            v-else
+            ref="baseForm"
+            :sitem="sitem"
+            @change-status="handleChangeStatus"
+            @change-num="handleChangeNum"
+            @change-order-code="handleChangeOrderCode"
+            @change-detail="(det) => {sitem = det;status = det.status}"
+          />
+
+          <el-collapse-item v-if="(status == '0' || status == '2') && !isSupertube" title="审批" name="2">
+            <exam-forms
+              v-if="newTime !== ''"
+              :new-time="newTime"
               :sitem="sitem"
-              @change-status="handleChangeStatus"
-              @change-num="handleChangeNum"
-              @change-order-code="handleChangeOrderCode"
-              @change-detail="(det) => (sitem = det)"
+              @searchChange="examFormSubmit($event, '')"
             />
-          </template>
-
-          <template v-if="(status == '0' || status == '2') && !isSupertube">
-            <el-collapse-item title="审批" name="2">
-              <exam-forms
-                v-if="newTime !== ''"
-                :new-time="newTime"
-                :sitem="sitem"
-                @searchChange="examFormSubmit($event, '')"
-              />
-            </el-collapse-item>
-          </template>
+          </el-collapse-item>
 
           <!-- <tempalte v-if="status === '2'">
             <el-collapse-item name="3" title="待转单">
@@ -35,11 +32,9 @@
             </el-collapse-item>
           </tempalte> -->
 
-          <template v-if="status === '3'">
-            <el-collapse-item name="4" title="发货单">
-              <shipment-request :order-code="orderCode" />
-            </el-collapse-item>
-          </template>
+          <el-collapse-item v-if="status === '3'" name="4" title="发货单">
+            <shipment-request :order-code="orderCode" />
+          </el-collapse-item>
         </el-collapse>
       </el-tab-pane>
     </el-tabs>
@@ -48,12 +43,12 @@
 
 <script>
 // import WaitTransferred from './cpns/wait-transferred.vue'
-import ShipmentRequest from "./cpns/shipment-request.vue";
-import baseDetail from "./cpns/baseDetail.vue";
-import BaseForm from "./cpns/baseForm.vue";
-import ExamForms from "./cpns/exam-form.vue";
-import asyncRequest from "@/apis/service/sellOut/filing";
-import { mapGetters } from "vuex";
+import ShipmentRequest from './cpns/shipment-request.vue'
+import baseDetail from './cpns/baseDetail.vue'
+import BaseForm from './cpns/baseForm.vue'
+import ExamForms from './cpns/exam-form.vue'
+import asyncRequest from '@/apis/service/sellOut/filing'
+import { mapGetters } from 'vuex'
 
 export default {
   components: {
@@ -61,64 +56,64 @@ export default {
     ExamForms,
     baseDetail,
     // WaitTransferred,
-    ShipmentRequest,
+    ShipmentRequest
   },
   data() {
     return {
       loading: false,
-      activeTabs: "1",
-      collapses: ["1", "2", "3", "4"],
-      status: "",
+      activeTabs: '1',
+      collapses: ['1', '2', '3', '4'],
+      status: '',
       sitem: {},
-      orderCode: "",
-      num: "0",
-    };
+      orderCode: '',
+      num: '0'
+    }
   },
   computed: {
-    ...mapGetters(["isSupertube"]),
+    ...mapGetters(['isSupertube']),
     title() {
-      return this.id && this.id !== "add" ? "报备单详情" : "新建报备单";
+      return this.id && this.id !== 'add' ? '报备单详情' : '新建报备单'
     },
     type() {
-      return this.id && this.id !== "add" ? "view" : "add";
+      return this.id && this.id !== 'add' ? 'view' : 'add'
     },
     id() {
-      return this.$route.query.id;
+      return this.$route.query.id
     },
     getNewTime() {
-      this.newTime = new Date().valueOf();
-    },
+      this.newTime = new Date().valueOf()
+    }
   },
   methods: {
     async examFormSubmit({ companyCode, ...rest } = {}) {
-      const { id } = this.$route.query;
-      this.loading = true;
+      const { id } = this.$route.query
+      this.loading = true
       await asyncRequest.status({
         ...rest,
         id,
-        companyCode: Array.isArray(companyCode) ? companyCode[0] : companyCode,
-      });
-      await this.$refs.baseForm.initData();
-      this.loading = false;
-      console.log(this.loading);
+        companyCode: Array.isArray(companyCode) ? companyCode[0] : companyCode
+      })
+      await this.$refs.baseForm.initData()
+      this.loading = false
+      console.log(this.loading)
       // this.handleRefresh()
     },
     handleChangeStatus(status) {
-      this.status = status;
+      this.status = status
     },
     handleChangeOrderCode(orderCode) {
-      this.orderCode = orderCode;
+      this.orderCode = orderCode
     },
     async handleRefresh() {
-      this.loading = true;
-      this.$refs.baseForm.initData();
-      this.loading = false;
+      this.loading = true
+      this.$refs.baseForm.initData()
+      this.loading = false
     },
     handleChangeNum(num) {
-      this.num = num;
-    },
-  },
-};
+      this.num = num
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>