snow 2 лет назад
Родитель
Сommit
51811a13ae

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/0.js


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

@@ -3,7 +3,7 @@ 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/#/test-good-share?id=',
@@ -21,7 +21,7 @@ module.exports = {
   // 结算平台url
   // settlementPlatformUrl: 'http://127.0.0.1:8848',
   // 结算平台url
-  settlementPlatformUrl: 'http://fin.caixiao365.com/',
+  settlementPlatformUrl: 'http://webcx.test241.wanyuhengtong.com/',
   // token加密key
   secretKey: 'key123',
   loginTitle: '',

+ 87 - 28
src/views/netOrderEntry/netOrderEnter/addEdit.vue

@@ -229,34 +229,37 @@
                   />
                 </el-form-item>
               </el-col>
-
               <el-col :span="6">
-                <el-form-item label="销售单价" prop="goodPrice">
+                <el-form-item label="销售总额" prop="sale_total">
+                  <!-- <el-input v-model="ruleForm.sale_total" placeholder="销售总额">
+                    <template #append>元</template>
+                  </el-input> -->
                   <el-input-number
-                    v-model="ruleForm.goodPrice"
+                    v-model="ruleForm.sale_total"
                     :disabled="id !== '003'"
                     style="width: 100%"
                     controls-position="right"
-                    placeholder="单价"
+                    placeholder="销售总额"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 1)"
+                    @change="number_change_total($event, 'sale_total')"
                   />
                 </el-form-item>
               </el-col>
+
               <el-col :span="6">
-                <el-form-item label="采购单价" prop="cgdPrice">
+                <el-form-item label="采购总额" prop="cgd_total">
                   <el-input-number
-                    v-model="ruleForm.cgdPrice"
+                    v-model="ruleForm.cgd_total"
+                    :disabled="id !== '003'"
                     style="width: 100%"
-                    :disabled="id === '007'"
                     controls-position="right"
-                    placeholder="采购单价"
+                    placeholder="采购总额"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 1)"
+                    @change="number_change_total($event, 'cgd_total')"
                   />
                 </el-form-item>
               </el-col>
@@ -304,11 +307,35 @@
                   />
                 </el-form-item>
               </el-col>
+
               <el-col :span="6">
-                <el-form-item label="销售总额" prop="good_total">
-                  <el-input v-model="ruleForm.good_total" placeholder="销售总额" disabled>
-                    <template #append>元</template>
-                  </el-input>
+                <el-form-item label="销售单价" prop="goodPrice">
+                  <el-input-number
+                    v-model="ruleForm.goodPrice"
+                    :disabled="id !== '003'"
+                    style="width: 100%"
+                    controls-position="right"
+                    placeholder="单价"
+                    :precision="2"
+                    :min="0"
+                    :step="0.01"
+                    @change="number_change($event, 1)"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="采购单价" prop="cgdPrice">
+                  <el-input-number
+                    v-model="ruleForm.cgdPrice"
+                    style="width: 100%"
+                    :disabled="id === '007'"
+                    controls-position="right"
+                    placeholder="采购单价"
+                    :precision="2"
+                    :min="0"
+                    :step="0.01"
+                    @change="number_change($event, 1)"
+                  />
                 </el-form-item>
               </el-col>
 
@@ -349,6 +376,7 @@ import resToken from '@/mixins/resToken'
 
 const defaultData = {
   addr_code: [],
+  cgd_total: '',
   cgdPrice: '',
   // buyerid: "",
   // buyer_name: "",
@@ -367,7 +395,7 @@ const defaultData = {
   goodName: '',
   goodNum: '',
   goodPrice: '',
-  good_total: '',
+  sale_total: '',
   goodUnit: '',
   tax: ''
 }
@@ -458,10 +486,10 @@ export default {
             trigger: 'blur'
           }
         ],
-        good_total: [
+        sale_total: [
           {
             required: true,
-            message: '请输入货款总金额',
+            message: '请输入销售总额',
             trigger: 'blur'
           }
         ],
@@ -558,6 +586,13 @@ export default {
             message: '请输入数量',
             trigger: 'blur'
           }
+        ],
+        cgd_total: [
+          {
+            required: true,
+            message: '请输入采购总额',
+            trigger: 'blur'
+          }
         ]
       }
     }
@@ -566,6 +601,10 @@ export default {
     totalWatchSource() {
       const { goodNum, goodPrice } = this.ruleForm
       return { goodNum, goodPrice }
+    },
+    cgdTotalWatchSource() {
+      const { goodNum, cgdPrice } = this.ruleForm
+      return { goodNum, cgdPrice }
     }
   },
   watch: {
@@ -583,11 +622,22 @@ export default {
     totalWatchSource: {
       handler({ goodPrice, goodNum }) {
         if (goodPrice === 0 || goodNum === 0) {
-          this.ruleForm.good_total = 0
+          this.ruleForm.sale_total = 0
           return
         }
 
-        this.ruleForm.good_total = accMul(goodPrice, goodNum)
+        this.ruleForm.sale_total = accMul(goodPrice, goodNum)
+      },
+      deep: true
+    },
+    cgdTotalWatchSource: {
+      handler({ cgdPrice, goodNum }) {
+        if (cgdPrice === 0 || goodNum === 0) {
+          this.ruleForm.cgd_total = 0
+          return
+        }
+
+        this.ruleForm.cgd_total = accMul(cgdPrice, goodNum)
       },
       deep: true
     }
@@ -613,15 +663,17 @@ export default {
         tax = accMul(accSub(1, accDiv(cgdPrice, goodPrice)), 100)
         this.ruleForm.cgd_tax = tax
         this.$refs.ruleForm.validateField('cgd_tax')
-        console.log(type, tax)
       }
       if (type === 2) {
         // cgd_price = ((100 - cgd_tax) / 100) * goodPrice;
-        cgd_price = accMul(accDiv(accSub(100, cgd_tax), 100), goodPrice)
+        cgd_price = accMul(accDiv(accSub(100, cgd_tax), 100), goodPrice) || 0
         this.ruleForm.cgdPrice = cgd_price
         this.$refs.ruleForm.validateField('cgdPrice')
-        console.log(type, cgd_tax)
       }
+
+      // if (this.ruleForm.cgdPrice && this.ruleForm.goodPrice) {
+      //   this.ruleForm['cgd_tax'] = accMul(accDiv(this.ruleForm.cgdPrice, this.ruleForm.goodPrice), 100) || 0
+      // }
     },
     handleClose() {
       this.showModelThis = false
@@ -669,7 +721,6 @@ export default {
       this.$refs.ruleForm.validateField('tax')
     },
     unitsearchChange(e) {
-      console.log(e)
       const { id, code, label } = e
       this.ruleForm.goodUnit = code ? [code] : []
       this.$refs.ruleForm.validateField('goodUnit')
@@ -683,16 +734,26 @@ export default {
         }
       })
 
-      console.log(this.id)
-
       if (this.id === '003') {
         this.ruleForm.companyNo = this.currentCompany
-        console.log(this.ruleForm.companyNo)
         return
       }
 
       if (this.id !== '003') this.getDetail()
     },
+    number_change_total(current, prop) {
+      const isCgdTotal = prop === 'cgd_total'
+      const { goodNum } = this.ruleForm
+      this.ruleForm[isCgdTotal ? 'cgdPrice' : 'goodPrice'] = accDiv(current, goodNum)
+      this.ruleForm[prop] = current
+
+      let tax = 0
+      tax = accMul(accSub(1, accDiv(this.ruleForm.cgd_total, this.ruleForm.sale_total)), 100)
+      this.ruleForm.cgd_tax = tax
+      // if (this.ruleForm.cgd_total && this.ruleForm.sale_total) {
+      //   this.ruleForm['cgd_tax'] = accMul(accDiv(this.ruleForm.cgd_total, this.ruleForm.sale_total), 100) || 0
+      // }
+    },
     async getDetail() {
       this.detailLoading = true
       const { orderCode } = this.sitem
@@ -723,8 +784,6 @@ export default {
         goodUnit: goodUnit ? [goodUnit] : ''
       }
 
-      console.log(this.ruleForm)
-
       this.cat_id_name = cat_id.map(({ name }) => name).join('_')
       this.unit_name = unitName
 

+ 186 - 103
src/views/netOrderEntry/prestoreRecordingOrders/addEdit.vue

@@ -31,14 +31,14 @@
 
             <el-row>
               <el-col :span="12">
-                <el-form-item label="商品分类" prop="cat_info">
+                <el-form-item label="商品分类" prop="cat_id">
                   <company-sort
-                    :value="ruleForm.cat_info"
+                    :value="ruleForm.cat_id"
                     :placeholder="'商品分类'"
                     :disabled="id !== '003'"
                     :size="'mini'"
                     :company-no="ruleForm.companyNo"
-                    :names="cat_info_name"
+                    :names="cat_id_name"
                     :is-detail="type !== 'add'"
                     @searchChange="goods_class_change"
                   />
@@ -94,13 +94,13 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="购买方公司" label-width="100px" prop="customerNo">
+                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
                   <search-customer
                     size="mini"
-                    :names="customerName"
+                    :names="khName"
                     :disabled="id !== '003'"
                     :is-detail="type !== 'add'"
-                    :value="ruleForm.customerNo"
+                    :value="ruleForm.khNo"
                     placeholder="购买方公司"
                     @searchChange="handleCustomerChange"
                   />
@@ -203,9 +203,9 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="商品名称" prop="good_name">
+                <el-form-item label="商品名称" prop="goodName">
                   <el-input
-                    v-model="ruleForm.good_name"
+                    v-model="ruleForm.goodName"
                     placeholder="商品名称"
                     maxlength="50"
                     :disabled="id !== '003'"
@@ -216,9 +216,9 @@
 
             <el-row>
               <el-col :span="6">
-                <el-form-item label="数量" prop="good_num" label-width="60px">
+                <el-form-item label="数量" prop="goodNum" label-width="60px">
                   <el-input-number
-                    v-model="ruleForm.good_num"
+                    v-model="ruleForm.goodNum"
                     :disabled="id !== '003'"
                     style="width: 100%"
                     controls-position="right"
@@ -229,40 +229,43 @@
                   />
                 </el-form-item>
               </el-col>
-
               <el-col :span="6">
-                <el-form-item label="销售单价" prop="sale_price">
+                <el-form-item label="销售总额" prop="sale_total">
+                  <!-- <el-input v-model="ruleForm.sale_total" placeholder="销售总额">
+                    <template #append>元</template>
+                  </el-input> -->
                   <el-input-number
-                    v-model="ruleForm.sale_price"
+                    v-model="ruleForm.sale_total"
                     :disabled="id !== '003'"
                     style="width: 100%"
                     controls-position="right"
-                    placeholder="单价"
+                    placeholder="销售总额"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 1)"
+                    @change="number_change_total($event, 'sale_total')"
                   />
                 </el-form-item>
               </el-col>
+
               <el-col :span="6">
-                <el-form-item label="采购单价" prop="cgd_price">
+                <el-form-item label="采购总额" prop="cgd_total">
                   <el-input-number
-                    v-model="ruleForm.cgd_price"
+                    v-model="ruleForm.cgd_total"
+                    :disabled="id !== '003'"
                     style="width: 100%"
-                    :disabled="id === '007'"
                     controls-position="right"
-                    placeholder="采购单价"
+                    placeholder="采购总额"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 1)"
+                    @change="number_change_total($event, 'cgd_total')"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="6">
                 <el-form-item label="采购毛利率" label-width="100px" prop="cgd_tax">
-                  <el-input-number
+                  <!-- <el-input-number
                     v-model="ruleForm.cgd_tax"
                     style="width: 100%"
                     :disabled="id === '007'"
@@ -273,29 +276,66 @@
                     :max="100"
                     :step="0.01"
                     @change="number_change($event, 2)"
+                  /> -->
+                  <digital-input
+                    :values="ruleForm.cgd_tax"
+                    :placeholder="'采购毛利率'"
+                    :min="0"
+                    :max="100"
+                    :disabled="id === '007'"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'%'"
+                    @reschange="number_change($event, 2)"
                   />
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row>
               <el-col :span="6">
-                <el-form-item label="单位" prop="good_unit" label-width="60px">
+                <el-form-item label="单位" prop="goodUnit" label-width="60px">
                   <search-unit
+                    :value="ruleForm.goodUnit"
                     disabled
-                    :value="ruleForm.good_unit"
                     :size="'mini'"
-                    :is-detail="true"
+                    :is-detail="type !== 'add'"
                     :names="unit_name"
-                    :placeholder="'good_unit'"
+                    :placeholder="'单位'"
                     @searchChange="unitsearchChange"
                   />
                 </el-form-item>
               </el-col>
+
               <el-col :span="6">
-                <el-form-item label="销售总额" prop="good_total">
-                  <el-input v-model="ruleForm.good_total" placeholder="销售总额" disabled>
-                    <template #append>元</template>
-                  </el-input>
+                <el-form-item label="销售单价" prop="goodPrice">
+                  <el-input-number
+                    v-model="ruleForm.goodPrice"
+                    :disabled="id !== '003'"
+                    style="width: 100%"
+                    controls-position="right"
+                    placeholder="单价"
+                    :precision="2"
+                    :min="0"
+                    :step="0.01"
+                    @change="number_change($event, 1)"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="采购单价" prop="cgdPrice">
+                  <el-input-number
+                    v-model="ruleForm.cgdPrice"
+                    style="width: 100%"
+                    :disabled="id === '007'"
+                    controls-position="right"
+                    placeholder="采购单价"
+                    :precision="2"
+                    :min="0"
+                    :step="0.01"
+                    @change="number_change($event, 1)"
+                  />
                 </el-form-item>
               </el-col>
 
@@ -329,33 +369,34 @@
   </el-dialog>
 </template>
 <script>
-import asyncRequest from '@/apis/service/netOrderEntry/prestoreRecordingOrders'
+import asyncRequest from '@/apis/service/netOrderEntry/netOrderEnter'
 import companyHelper from '@/mixins/companyHelper'
 import { accMul, accDiv, accSub, isPhone, isMobile } from '@/utils/validate'
 import resToken from '@/mixins/resToken'
 
 const defaultData = {
   addr_code: [],
-  cgd_price: '',
+  cgd_total: '',
+  cgdPrice: '',
   // buyerid: "",
   // buyer_name: "",
   platform_id: '',
   cgd_tax: '',
   workCode: '',
   poCode: '',
-  customerNo: '',
+  khNo: '',
   companyNo: '',
   contactor: '',
   mobile: '',
   addr: '',
   sendtime: '',
   supplierNo: '',
-  cat_info: '',
-  good_name: '',
-  good_num: '',
-  sale_price: '',
-  good_total: '',
-  good_unit: '',
+  cat_id: '',
+  goodName: '',
+  goodNum: '',
+  goodPrice: '',
+  sale_total: '',
+  goodUnit: '',
   tax: ''
 }
 
@@ -380,9 +421,9 @@ export default {
       loading: false,
       detailLoading: false,
       title: '添加销售订单信息',
-      customerName: '',
+      khName: '',
       accounts: [],
-      cat_info_name: '',
+      cat_id_name: '',
       showModelThis: this.showModel,
       pickerOptions: {
         disabledDate: (time) => time.getTime() > new Date()
@@ -393,10 +434,10 @@ export default {
       ruleForm: { ...defaultData },
       rulesThis: this.rules,
       rules: {
-        good_unit: [
+        goodUnit: [
           {
             required: true,
-            message: '请选择good_unit',
+            message: '请选择单位',
             trigger: 'blur'
           }
         ],
@@ -423,7 +464,7 @@ export default {
             trigger: 'blur'
           }
         ],
-        cat_info: [
+        cat_id: [
           {
             required: true,
             message: '请选择商品分类',
@@ -445,7 +486,7 @@ export default {
             trigger: 'blur'
           }
         ],
-        good_total: [
+        sale_total: [
           {
             required: true,
             message: '请输入货款总金额',
@@ -466,7 +507,7 @@ export default {
             trigger: 'blur'
           }
         ],
-        customerNo: [
+        khNo: [
           {
             type: 'array',
             required: true,
@@ -518,41 +559,52 @@ export default {
           }
         ],
 
-        good_name: [
+        goodName: [
           {
             required: true,
             message: '请输入商品名称',
             trigger: 'blur'
           }
         ],
-        sale_price: [
+        goodPrice: [
           {
             required: true,
             message: '请输入销售单价',
             trigger: 'blur'
           }
         ],
-        cgd_price: [
+        cgdPrice: [
           {
             required: true,
             message: '请选择采购单价',
             trigger: 'blur'
           }
         ],
-        good_num: [
+        goodNum: [
           {
             required: true,
             message: '请输入数量',
             trigger: 'blur'
           }
+        ],
+        cgd_total: [
+          {
+            required: true,
+            message: '请输入采购总额',
+            trigger: 'blur'
+          }
         ]
       }
     }
   },
   computed: {
     totalWatchSource() {
-      const { good_num, sale_price } = this.ruleForm
-      return { good_num, sale_price }
+      const { goodNum, goodPrice } = this.ruleForm
+      return { goodNum, goodPrice }
+    },
+    cgdTotalWatchSource() {
+      const { goodNum, cgdPrice } = this.ruleForm
+      return { goodNum, cgdPrice }
     }
   },
   watch: {
@@ -568,13 +620,24 @@ export default {
       }
     },
     totalWatchSource: {
-      handler({ sale_price, good_num }) {
-        if (sale_price === 0 || good_num === 0) {
-          this.ruleForm.good_total = 0
+      handler({ goodPrice, goodNum }) {
+        if (goodPrice === 0 || goodNum === 0) {
+          this.ruleForm.sale_total = 0
           return
         }
 
-        this.ruleForm.good_total = accMul(sale_price, good_num)
+        this.ruleForm.sale_total = accMul(goodPrice, goodNum)
+      },
+      deep: true
+    },
+    cgdTotalWatchSource: {
+      handler({ cgdPrice, goodNum }) {
+        if (cgdPrice === 0 || goodNum === 0) {
+          this.ruleForm.cgd_total = 0
+          return
+        }
+
+        this.ruleForm.cgd_total = accMul(cgdPrice, goodNum)
       },
       deep: true
     }
@@ -590,30 +653,32 @@ export default {
       this.$refs.ruleForm.validateField('addr_code')
     },
     number_change(e, type) {
-      console.log(1111)
-      const { cgd_price, sale_price, cgd_tax } = this.ruleForm
+      this.ruleForm.cgd_tax = e
+      const { cgdPrice, goodPrice, cgd_tax } = this.ruleForm
       let tax = 0
-      let cgd_price1 = 0
+      let cgd_price = 0
 
       if (type === 1) {
-        // tax = (1 - cgd_price / sale_price)*100
-        tax = accMul(accSub(1, accDiv(cgd_price, sale_price)), 100)
+        // tax = (1 - cgdPrice / goodPrice)*100
+        tax = accMul(accSub(1, accDiv(cgdPrice, goodPrice)), 100)
         this.ruleForm.cgd_tax = tax
         this.$refs.ruleForm.validateField('cgd_tax')
-        console.log(type, tax)
       }
       if (type === 2) {
-        // cgd_price = (100 - cgd_tax) * sale_price;
-        cgd_price1 = accMul(accDiv(100, cgd_tax), sale_price)
-        this.ruleForm.cgd_price = cgd_price1
-        this.$refs.ruleForm.validateField('cgd_price')
-        console.log(type, cgd_tax)
+        // cgd_price = ((100 - cgd_tax) / 100) * goodPrice;
+        cgd_price = accMul(accDiv(accSub(100, cgd_tax), 100), goodPrice) || 0
+        this.ruleForm.cgdPrice = cgd_price
+        this.$refs.ruleForm.validateField('cgdPrice')
       }
+
+      // if (this.ruleForm.cgdPrice && this.ruleForm.goodPrice) {
+      //   this.ruleForm['cgd_tax'] = accMul(accDiv(this.ruleForm.cgdPrice, this.ruleForm.goodPrice), 100) || 0
+      // }
     },
     handleClose() {
       this.showModelThis = false
       this.companyName = ''
-      this.customerName = ''
+      this.khName = ''
       this.supplierName = ''
       this.ruleForm = { ...defaultData }
     },
@@ -628,7 +693,7 @@ export default {
         this.title = '修改销售订单信息'
         this.rulesThis = this.rules
       } else {
-        this.title = '订单预存录单详情'
+        this.title = '销售订单信息详情'
         this.rulesThis = {}
       }
       await this.resetForm()
@@ -640,26 +705,25 @@ export default {
       this.$refs.ruleForm.validateField('companyNo')
     },
     handleCustomerChange(e) {
-      this.ruleForm.customerNo = e.code ? [e.code] : ''
-      this.$refs.ruleForm.validateField('customerNo')
+      this.ruleForm.khNo = e.code ? [e.code] : ''
+      this.$refs.ruleForm.validateField('khNo')
     },
     handleSupplierChange(e) {
       this.ruleForm.supplierNo = e.code ? [e.code] : ''
       this.$refs.ruleForm.validateField('supplierNo')
     },
     handleGoodClassChange(e) {
-      this.ruleForm.cat_info = e
-      this.$refs.ruleForm.validateField('cat_info')
+      this.ruleForm.cat_id = e
+      this.$refs.ruleForm.validateField('cat_id')
     },
     handleTaxChange(e) {
       this.ruleForm.tax = e
       this.$refs.ruleForm.validateField('tax')
     },
     unitsearchChange(e) {
-      console.log(e)
       const { id, code, label } = e
-      this.ruleForm.good_unit = code ? [code] : []
-      this.$refs.ruleForm.validateField('good_unit')
+      this.ruleForm.goodUnit = code ? [code] : []
+      this.$refs.ruleForm.validateField('goodUnit')
     },
     async resetForm() {
       // 重置
@@ -677,45 +741,54 @@ export default {
 
       if (this.id !== '003') this.getDetail()
     },
+    number_change_total(current, prop) {
+      const isCgdTotal = prop === 'cgd_total'
+      const { goodNum } = this.ruleForm
+      this.ruleForm[isCgdTotal ? 'cgdPrice' : 'goodPrice'] = accDiv(current, goodNum)
+      this.ruleForm[prop] = current
+
+      let tax = 0
+      tax = accMul(accSub(1, accDiv(this.ruleForm.cgd_total, this.ruleForm.sale_total)), 100)
+      this.ruleForm.cgd_tax = tax
+      // if (this.ruleForm.cgd_total && this.ruleForm.sale_total) {
+      //   this.ruleForm['cgd_tax'] = accMul(accDiv(this.ruleForm.cgd_total, this.ruleForm.sale_total), 100) || 0
+      // }
+    },
     async getDetail() {
       this.detailLoading = true
-      const { interNo } = this.sitem
-      const { data } = await asyncRequest.detail({ interNo })
+      const { orderCode } = this.sitem
+      const { data } = await asyncRequest.detail({ orderCode })
 
       const {
-        cat_info,
+        cat_id,
         buyerid,
-        customerNo,
+        khNo,
         supplierNo,
-        supplierName,
-        customerName,
-        good_unit,
-        good_tax,
+        supplierNanme,
+        khName,
+        goodUnit,
+        tax,
         addr_code,
-        unit_name,
+        unitName,
         ...rest
       } = data
 
-      console.log(data)
-
       this.ruleForm = {
         ...rest,
         buyerid: buyerid ? [buyerid] : [],
         addr_code: addr_code ? addr_code.split(',') : [],
-        cat_info: cat_info ? [cat_info[cat_info.length - 1]] : [],
+        cat_id: cat_id ? [cat_id[cat_id.length - 1]] : [],
         supplierNo: supplierNo ? [supplierNo] : [],
-        customerNo: customerNo ? [customerNo] : [],
-        tax: good_tax ? Number(good_tax).toFixed(0) + '%' : '',
-        good_unit: good_unit ? [good_unit] : ''
+        khNo: khNo ? [khNo] : [],
+        tax: tax ? tax + '%' : '',
+        goodUnit: goodUnit ? [goodUnit] : ''
       }
 
-      this.cat_info_name = cat_info.map(({ name }) => name).join('_')
-      this.unit_name = unit_name
-
-      this.customerName = customerName
-      this.supplierName = supplierName
+      this.cat_id_name = cat_id.map(({ name }) => name).join('_')
+      this.unit_name = unitName
 
-      console.log(this.supplierName)
+      this.khName = khName
+      this.supplierName = supplierNanme
       this.detailLoading = false
     },
     platform_codesearchChange(e) {
@@ -724,10 +797,20 @@ export default {
       this.pay_name = pay_name || ''
       this.$refs.ruleForm.validateField('platform_id')
     },
+    // async getAccounts() {
+    //   const res = await asyncRequest.accountall(this.dataForm);
+    //   if (res && res.code === 0 && res.data) {
+    //     this.accounts = res.data;
+    //   } else if (res && res.code >= 100 && res.code <= 104) {
+    //     await this.logout();
+    //   } else {
+    //     this.$message.warning(res.message);
+    //   }
+    // },
     async goods_class_change(e) {
       const { id } = e
-      this.ruleForm.cat_info = id ? [id] : []
-      this.$refs.ruleForm.validateField('cat_info')
+      this.ruleForm.cat_id = id ? [id] : []
+      this.$refs.ruleForm.validateField('cat_id')
     },
     async submitForm() {
       await this.$refs.ruleForm.validate(async(valid) => {
@@ -739,15 +822,15 @@ export default {
           this.loading = true
           const model = JSON.parse(JSON.stringify(this.ruleForm))
           model.supplierNo = model.supplierNo[0]
-          model.customerNo = model.customerNo[0]
+          model.khNo = model.khNo[0]
           model.buyerid = Array.isArray(model.buyerid) ? model.buyerid[0] : model.buyerid
-          model.cat_info = model.cat_info ? model.cat_info[model.cat_info.length - 1] : ''
+          model.cat_id = model.cat_id ? model.cat_id[model.cat_id.length - 1] : ''
           model.addr_code = model.addr_code.join(',')
           model.tax = model.tax.split('%')[0]
           model.pay_name = this.pay_name
-          model.good_unit = Array.isArray(model.good_unit)
-            ? model.good_unit[0]
-            : model.good_unit
+          model.goodUnit = Array.isArray(model.goodUnit)
+            ? model.goodUnit[0]
+            : model.goodUnit
 
           let res = {}
           if (this.id === '003') {

+ 2 - 1
src/views/netOrderEntry/prestoreRecordingOrders/importTemplateModal.vue

@@ -76,6 +76,7 @@ export default {
         const field = header[index]
         const importField = importHeader[index]
         if (field !== importField) {
+          console.log(field, importField)
           isHeaderOk = false
           break
         }
@@ -295,9 +296,9 @@ export default {
       templateItems.forEach(templateItem => {
         const tableItem = this.mapTemplateItemToTableItem(templateItem)
         Object.keys(tableItem).forEach(field => {
+          console.log(field, tableItem[field])
           let target = ''
           if (field === PROPERTYS.SEND_TIME) {
-            console.log(tableItem[PROPERTYS.SEND_TIME])
             target = this.validateDateField(tableItem[PROPERTYS.SEND_TIME])
               ? tableItem[PROPERTYS.SEND_TIME]
               : this.formatDate2(tableItem[PROPERTYS.SEND_TIME])

+ 27 - 13
src/views/netOrderEntry/prestoreRecordingOrders/template.js

@@ -11,9 +11,10 @@ const mapTemplateToTable = {
   '商品名称': 'good_name',
   '销售单价': 'sale_price',
   '数量': 'good_num',
-  '销售总额': 'good_total',
+  '销售总额': 'sale_total',
   '税率': 'good_tax',
   '采购单价': 'cgd_price',
+  '采购总额': 'cgd_total',
   '采购毛利率': 'cgd_tax',
   'PO编号': 'poCode',
   '收货人': 'contactor',
@@ -46,13 +47,14 @@ export const PROPERTYS = {
   GOOD_PRICE: getTableProperty('销售单价'),
   TAX: getTableProperty('税率'),
   CGD_PRICE: getTableProperty('采购单价'),
-  CGD_TAX: getTableProperty('采购毛利率'),
-  GOOD_TOTAL: getTableProperty('销售总额'),
+  CGD_TAX: getTableProperty('采购毛利率'),
+  SALE_TOTAL: getTableProperty('销售总额'),
   CONTACTOR: getTableProperty('收货人'),
   MOBILE: getTableProperty('联系电话'),
   ADDR: getTableProperty('联系地址'),
   SEND_TIME: getTableProperty('发货时间'),
   PO_CODE: getTableProperty('PO编号'),
+  CGD_TOTAL: getTableProperty('采购总额'),
   WORK_CODE: getTableProperty('单据号')
 }
 
@@ -71,7 +73,8 @@ export const template = [
     '数量': '100',
     '销售总额': '3200',
     '税率': '13',
-    '采购单价': '30.08',
+    '采购单价': '30.00',
+    '采购总额': '3000',
     '采购毛利率': '6',
     'PO编号': 'PO206020230400240002',
     '收货人': '张三',
@@ -155,7 +158,7 @@ export const columns = [
     required: true
   },
   {
-    prop: PROPERTYS.GOOD_TOTAL,
+    prop: PROPERTYS.SALE_TOTAL,
     label: '销售总额',
     'width': '150px'
   },
@@ -172,7 +175,13 @@ export const columns = [
     required: true
   },
   {
-    prop: PROPERTYS.CGD_TAX,
+    prop: PROPERTYS.CGD_TOTAL,
+    label: '采购总额',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: getTableProperty('采购毛利率'),
     label: '采购毛利率',
     'width': '150px'
   },
@@ -251,7 +260,9 @@ export const requsetFields = [
   PROPERTYS.COMPANY_NO,
   PROPERTYS.SUPPLIER_NO,
   PROPERTYS.CUSTOMER_NO,
-  PROPERTYS.CGD_TAX
+  PROPERTYS.CGD_TAX,
+  PROPERTYS.SALE_TOTAL,
+  PROPERTYS.CGD_TOTAL
 ]
 
 // 税率、数量、销售单价、采购单价
@@ -265,26 +276,29 @@ export const requiredFields = [
   PROPERTYS.GOOD_NAME,
   PROPERTYS.GOOD_UNIT,
   PROPERTYS.GOOD_NUM,
-  PROPERTYS.CGD_PRICE,
   PROPERTYS.CONTACTOR,
   PROPERTYS.SEND_TIME,
-  PROPERTYS.GOOD_PRICE,
   PROPERTYS.COMPANY_NO,
   PROPERTYS.SUPPLIER_NO,
-  PROPERTYS.CUSTOMER_NO
+  PROPERTYS.CUSTOMER_NO,
+  PROPERTYS.CGD_TOTAL,
+  PROPERTYS.SALE_TOTAL,
+  PROPERTYS.CGD_TAX
 ]
 
 export const numberFields = [
-  PROPERTYS.CGD_PRICE,
+  PROPERTYS.CGD_TOTAL,
+  PROPERTYS.SALE_TOTAL,
   PROPERTYS.GOOD_PRICE,
+  PROPERTYS.CGD_PRICE,
   PROPERTYS.CGD_TAX
 ]
 
 export const intNumberFields = [
   PROPERTYS.CATEGORY,
   PROPERTYS.GOOD_UNIT,
-  PROPERTYS.TAX,
-  PROPERTYS.GOOD_NUM
+  PROPERTYS.GOOD_NUM,
+  PROPERTYS.TAX
 ]
 
 export const helper = {

+ 1 - 1
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -163,7 +163,7 @@
             <el-collapse-item title="收货信息" name="2">
               <order-out-table :newTime="newTime" v-if="newTime !== ''" :sitem="sitem" />
             </el-collapse-item>
-            <el-collapse-item title="商品信息" name="3">
+            <el-collapse-item title="商品信息" name="3" v-if="sitem && String(sitem.order_source) !== '9'">
               <show-goods-data-table
                 :newTime="newTime"
                 v-if="newTime !== ''"

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

@@ -150,7 +150,7 @@
                 </template>
               </show-data-table>
             </el-collapse-item>
-            <el-collapse-item title="商品信息" name="2">
+            <el-collapse-item title="商品信息" name="2" v-if="sitem && String(sitem.order_source) !== '9'">
               <show-goods-data-table
                 :newTime="newTime"
                 v-if="newTime !== ''"

Некоторые файлы не были показаны из-за большого количества измененных файлов