Browse Source

Merge branch 'v3.0' into company

snow 1 year ago
parent
commit
8697d46693

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-libs.js


+ 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: '',

+ 11 - 3
src/layout/components/Navbar.vue

@@ -37,18 +37,21 @@
           @click="onSwitchCompanyMode"
         />
       </el-tooltip>
-      <!-- <el-tooltip
+
+      <el-tooltip
         v-if="device !== 'mobile'"
         placement="bottom"
         content="登录工单管理系统"
       >
         <p
+          class="username"
           style="font-size:14px;color:#5a5e66;font-weight:500;line-height:54px;margin:0px 5px;cursor:pointer"
-          @click="openSettlementSystem(GDurl)"
+          @click="openAlert"
         >
           工单
         </p>
-      </el-tooltip> -->
+      </el-tooltip>
+
       <el-tooltip
         v-if="device !== 'mobile'"
         placement="bottom"
@@ -287,6 +290,11 @@ export default {
       const chunks = username.split('')
       return chunks[0] + chunks[1] + '...'
     },
+    openAlert() {
+      this.$alert('正在开发中', '提示', {
+        type: 'warning'
+      })
+    },
     openSettlementSystem: function(url) {
       // 加密token
       const encJson = CryptoJS.AES.encrypt(

+ 38 - 37
src/views/netOrderEntry/netOrderEnter/addEdit-c.vue

@@ -22,8 +22,8 @@
             status-icon
             :rules="rulesThis"
             label-width="80px"
-            class="demo-ruleForm"
             label-position="left"
+            class="demo-ruleForm"
             size="mini"
           >
             <el-divider>
@@ -32,15 +32,16 @@
 
             <el-row>
               <el-col :span="12">
-                <el-form-item label="销售方公司" label-width="100px" prop="companyNo">
-                  <search-work-company
+                <el-form-item label="销售方公司:" label-width="100px" prop="companyNo">
+                  <p style="font-size:14px;color:#606266;font-weight:700">{{ getCompanyWithCode(ruleForm.companyNo).name }}</p>
+                  <!-- <search-work-company
                     disabled
                     :value="ruleForm.companyNo"
                     :names="''"
                     :size="'mini'"
                     :placeholder="'销售方公司'"
                     @searchChange="handleCompanyChange"
-                  />
+                  /> -->
                 </el-form-item>
               </el-col>
 
@@ -58,22 +59,21 @@
                 </el-form-item>
               </el-col>
 
-              <el-col :span="12">
-                <el-form-item label="所属平台" prop="platform_id" label-width="100px" align="left">
-                  <search-terrace
-                    :value="ruleForm.platform_id"
-                    :disabled="id !== '003'"
-                    :size="'mini'"
-                    :is-detail="falsse"
-                    :is_show="'0'"
-                    :placeholder="'所属平台'"
-                    @searchChange="platform_codesearchChange"
+              <!-- <el-col :span="7">
+                <el-form-item label="采购员" prop="buyerid">
+                  <search-account
+                    size="mini"
+                    placeholder="采购员"
+                    level="2"
+                    :value="ruleForm.buyerid"
+                    :names="ruleForm.buyer_name"
+                    :is-detail="true"
+                    @searchChange="handleHandoverName"
                   />
                 </el-form-item>
-              </el-col>
-
+              </el-col> -->
               <el-col :span="12">
-                <el-form-item label="商品分类" prop="cat_id" label-width="100px">
+                <el-form-item label="商品分类" prop="cat_id">
                   <company-sort
                     :value="ruleForm.cat_id"
                     :placeholder="'商品分类'"
@@ -86,24 +86,26 @@
                   />
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="7">
-                <el-form-item label="采购员" prop="buyerid">
-                  <search-account
-                    size="mini"
-                    placeholder="采购员"
-                    level="2"
-                    :value="ruleForm.buyerid"
-                    :names="ruleForm.buyer_name"
-                    :is-detail="true"
-                    @searchChange="handleHandoverName"
+
+              <el-col :span="12">
+                <el-form-item label="所属平台" prop="platform_id">
+                  <search-terrace
+                    :value="ruleForm.platform_id"
+                    :disabled="id !== '003'"
+                    :size="'mini'"
+                    :is-detail="falsse"
+                    :is_show="'0'"
+                    :placeholder="'所属平台'"
+                    @searchChange="platform_codesearchChange"
                   />
                 </el-form-item>
-              </el-col> -->
+              </el-col>
+
               <el-col :span="12">
-                <el-form-item label="平台订单号" prop="poCode" label-width="100px">
+                <el-form-item label="平台订单编号" prop="poCode" label-width="110px">
                   <el-input
                     v-model="ruleForm.poCode"
-                    placeholder="如:PO编号"
+                    placeholder="平台订单编号"
                     maxlength="50"
                     :disabled="id === '007'"
                   />
@@ -111,19 +113,18 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item prop="workCode" label-width="100px">
+                <el-form-item label="其他单号" prop="workCode">
                   <template #label>
-                    <p style="padding-left:10px">其他单号</p>
+                    <p style="margin-left:10px">其他单号</p>
                   </template>
                   <el-input
                     v-model="ruleForm.workCode"
                     :disabled="id === '007'"
                     maxlength="50"
-                    placeholder="如:业管单号"
+                    placeholder="其他单号"
                   />
                 </el-form-item>
               </el-col>
-
             </el-row>
 
             <el-divider>
@@ -183,10 +184,10 @@
             </el-divider>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="供应商公司" label-width="100px" prop="supplierNo">
+                <el-form-item label="供应商" label-width="100px" prop="supplierNo">
                   <search-supplier
                     size="mini"
-                    placeholder="供应商公司"
+                    placeholder="供应商"
                     :value="ruleForm.supplierNo"
                     :names="supplierName"
                     :disabled="id === '007'"
@@ -496,7 +497,7 @@ export default {
         poCode: [
           {
             required: true,
-            message: '请输入平台订单号',
+            message: '请输入PO编号',
             trigger: 'blur'
           }
         ],

+ 50 - 44
src/views/netOrderEntry/netOrderEnter/addEdit.vue

@@ -22,6 +22,7 @@
             status-icon
             :rules="rulesThis"
             label-width="80px"
+            label-position="left"
             class="demo-ruleForm"
             size="mini"
           >
@@ -31,19 +32,33 @@
 
             <el-row>
               <el-col :span="12">
-                <el-form-item label="商品分类" prop="cat_id">
-                  <company-sort
-                    :value="ruleForm.cat_id"
-                    :placeholder="'商品分类'"
-                    :disabled="id !== '003'"
+                <el-form-item label="销售方公司:" label-width="100px" prop="companyNo">
+                  <p style="font-size:14px;color:#606266;font-weight:700">{{ getCompanyWithCode(ruleForm.companyNo).name }}</p>
+                  <!-- <search-work-company
+                    disabled
+                    :value="ruleForm.companyNo"
+                    :names="''"
                     :size="'mini'"
-                    :company-no="ruleForm.companyNo"
-                    :names="cat_id_name"
+                    :placeholder="'销售方公司'"
+                    @searchChange="handleCompanyChange"
+                  /> -->
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
+                  <search-customer
+                    size="mini"
+                    :names="khName"
+                    :disabled="id !== '003'"
                     :is-detail="type !== 'add'"
-                    @searchChange="goods_class_change"
+                    :value="ruleForm.khNo"
+                    placeholder="购买方公司"
+                    @searchChange="handleCustomerChange"
                   />
                 </el-form-item>
               </el-col>
+
               <!-- <el-col :span="7">
                 <el-form-item label="采购员" prop="buyerid">
                   <search-account
@@ -57,6 +72,20 @@
                   />
                 </el-form-item>
               </el-col> -->
+              <el-col :span="12">
+                <el-form-item label="商品分类" prop="cat_id">
+                  <company-sort
+                    :value="ruleForm.cat_id"
+                    :placeholder="'商品分类'"
+                    :disabled="id !== '003'"
+                    :size="'mini'"
+                    :company-no="ruleForm.companyNo"
+                    :names="cat_id_name"
+                    :is-detail="type !== 'add'"
+                    @searchChange="goods_class_change"
+                  />
+                </el-form-item>
+              </el-col>
 
               <el-col :span="12">
                 <el-form-item label="所属平台" prop="platform_id">
@@ -71,22 +100,12 @@
                   />
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="单据号" prop="workCode">
-                  <el-input
-                    v-model="ruleForm.workCode"
-                    :disabled="id === '007'"
-                    maxlength="50"
-                    placeholder="单据号"
-                  />
-                </el-form-item>
-              </el-col>
 
               <el-col :span="12">
-                <el-form-item label="PO编号" prop="poCode">
+                <el-form-item label="平台订单编号" prop="poCode" label-width="110px">
                   <el-input
                     v-model="ruleForm.poCode"
-                    placeholder="PO编号"
+                    placeholder="平台订单编号"
                     maxlength="50"
                     :disabled="id === '007'"
                   />
@@ -94,28 +113,15 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
-                  <search-customer
-                    size="mini"
-                    :names="khName"
-                    :disabled="id !== '003'"
-                    :is-detail="type !== 'add'"
-                    :value="ruleForm.khNo"
-                    placeholder="购买方公司"
-                    @searchChange="handleCustomerChange"
-                  />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
-                <el-form-item label="销售方公司" label-width="100px" prop="companyNo">
-                  <search-work-company
-                    disabled
-                    :value="ruleForm.companyNo"
-                    :names="''"
-                    :size="'mini'"
-                    :placeholder="'销售方公司'"
-                    @searchChange="handleCompanyChange"
+                <el-form-item label="其他单号" prop="workCode">
+                  <template #label>
+                    <p style="margin-left:10px">其他单号</p>
+                  </template>
+                  <el-input
+                    v-model="ruleForm.workCode"
+                    :disabled="id === '007'"
+                    maxlength="50"
+                    placeholder="其他单号"
                   />
                 </el-form-item>
               </el-col>
@@ -178,10 +184,10 @@
             </el-divider>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="供应商公司" label-width="100px" prop="supplierNo">
+                <el-form-item label="供应商" label-width="100px" prop="supplierNo">
                   <search-supplier
                     size="mini"
-                    placeholder="供应商公司"
+                    placeholder="供应商"
                     :value="ruleForm.supplierNo"
                     :names="supplierName"
                     :disabled="id === '007'"

+ 150 - 84
src/views/netOrderEntry/netOrderEnter/detail-modal.vue

@@ -22,6 +22,7 @@
             status-icon
             :rules="rulesThis"
             label-width="80px"
+            label-position="left"
             class="demo-ruleForm"
             size="mini"
           >
@@ -31,19 +32,33 @@
 
             <el-row>
               <el-col :span="12">
-                <el-form-item label="商品分类" prop="cat_id">
-                  <company-sort
-                    :value="ruleForm.cat_id"
-                    :placeholder="'商品分类'"
-                    :disabled="id !== '003'"
+                <el-form-item label="销售方公司:" label-width="100px" prop="companyNo">
+                  <p style="font-size:14px;color:#606266;font-weight:700">{{ getCompanyWithCode(ruleForm.companyNo).name }}</p>
+                  <!-- <search-work-company
+                    disabled
+                    :value="ruleForm.companyNo"
+                    :names="''"
                     :size="'mini'"
-                    :company-no="ruleForm.companyNo"
-                    :names="cat_id_name"
+                    :placeholder="'销售方公司'"
+                    @searchChange="handleCompanyChange"
+                  /> -->
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
+                  <search-customer
+                    size="mini"
+                    :names="khName"
+                    :disabled="id !== '003'"
                     :is-detail="type !== 'add'"
-                    @searchChange="goods_class_change"
+                    :value="ruleForm.khNo"
+                    placeholder="购买方公司"
+                    @searchChange="handleCustomerChange"
                   />
                 </el-form-item>
               </el-col>
+
               <!-- <el-col :span="7">
                 <el-form-item label="采购员" prop="buyerid">
                   <search-account
@@ -57,6 +72,20 @@
                   />
                 </el-form-item>
               </el-col> -->
+              <el-col :span="12">
+                <el-form-item label="商品分类" prop="cat_id">
+                  <company-sort
+                    :value="ruleForm.cat_id"
+                    :placeholder="'商品分类'"
+                    :disabled="id !== '003'"
+                    :size="'mini'"
+                    :company-no="ruleForm.companyNo"
+                    :names="cat_id_name"
+                    :is-detail="type !== 'add'"
+                    @searchChange="goods_class_change"
+                  />
+                </el-form-item>
+              </el-col>
 
               <el-col :span="12">
                 <el-form-item label="所属平台" prop="platform_id">
@@ -71,41 +100,28 @@
                   />
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="单据号" prop="workCode">
-                  <el-input v-model="ruleForm.workCode" :disabled="id === '007'" maxlength="50" placeholder="单据号" />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
-                <el-form-item label="PO编号" prop="poCode">
-                  <el-input v-model="ruleForm.poCode" placeholder="PO编号" maxlength="50" :disabled="id === '007'" />
-                </el-form-item>
-              </el-col>
 
               <el-col :span="12">
-                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
-                  <search-customer
-                    size="mini"
-                    :names="khName"
-                    :disabled="id !== '003'"
-                    :is-detail="type !== 'add'"
-                    :value="ruleForm.khNo"
-                    placeholder="购买方公司"
-                    @searchChange="handleCustomerChange"
+                <el-form-item label="平台订单编号" prop="poCode" label-width="110px">
+                  <el-input
+                    v-model="ruleForm.poCode"
+                    placeholder="平台订单编号"
+                    maxlength="50"
+                    :disabled="id === '007'"
                   />
                 </el-form-item>
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="销售方公司" label-width="100px" prop="companyNo">
-                  <search-work-company
-                    disabled
-                    :value="ruleForm.companyNo"
-                    :names="''"
-                    :size="'mini'"
-                    :placeholder="'销售方公司'"
-                    @searchChange="handleCompanyChange"
+                <el-form-item label="其他单号" prop="workCode">
+                  <template #label>
+                    <p style="margin-left:10px">其他单号</p>
+                  </template>
+                  <el-input
+                    v-model="ruleForm.workCode"
+                    :disabled="id === '007'"
+                    maxlength="50"
+                    placeholder="其他单号"
                   />
                 </el-form-item>
               </el-col>
@@ -117,13 +133,23 @@
             <el-row>
               <el-col :span="8">
                 <el-form-item label="收货人" prop="contactor">
-                  <el-input v-model="ruleForm.contactor" :disabled="id === '007'" placeholder="收货人" maxlength="30" />
+                  <el-input
+                    v-model="ruleForm.contactor"
+                    :disabled="id === '007'"
+                    placeholder="收货人"
+                    maxlength="30"
+                  />
                 </el-form-item>
               </el-col>
 
               <el-col :span="8">
                 <el-form-item label="联系电话" prop="mobile">
-                  <el-input v-model="ruleForm.mobile" :disabled="id === '007'" placeholder="联系电话" maxlength="11" />
+                  <el-input
+                    v-model="ruleForm.mobile"
+                    :disabled="id === '007'"
+                    placeholder="联系电话"
+                    maxlength="11"
+                  />
                 </el-form-item>
               </el-col>
 
@@ -143,7 +169,12 @@
 
               <el-col :span="24">
                 <el-form-item label="联系地址" prop="addr">
-                  <el-input v-model="ruleForm.addr" :disabled="id === '007'" maxlength="100" placeholder="联系地址" />
+                  <el-input
+                    v-model="ruleForm.addr"
+                    :disabled="id === '007'"
+                    maxlength="100"
+                    placeholder="联系地址"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -153,10 +184,10 @@
             </el-divider>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="供应商公司" label-width="100px" prop="supplierNo">
+                <el-form-item label="供应商" label-width="100px" prop="supplierNo">
                   <search-supplier
                     size="mini"
-                    placeholder="供应商公司"
+                    placeholder="供应商"
                     :value="ruleForm.supplierNo"
                     :names="supplierName"
                     :disabled="id === '007'"
@@ -167,7 +198,12 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="商品名称" prop="goodName">
-                  <el-input v-model="ruleForm.goodName" placeholder="商品名称" maxlength="50" :disabled="id !== '003'" />
+                  <el-input
+                    v-model="ruleForm.goodName"
+                    placeholder="商品名称"
+                    maxlength="50"
+                    :disabled="id !== '003'"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -194,7 +230,7 @@
                   </el-input> -->
                   <el-input-number
                     v-model="ruleForm.sale_total"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="销售总额"
@@ -210,7 +246,7 @@
                 <el-form-item label="采购总额" prop="cgd_total">
                   <el-input-number
                     v-model="ruleForm.cgd_total"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="采购总额"
@@ -240,13 +276,13 @@
                     :placeholder="'采购毛利率'"
                     :min="0"
                     :max="100"
-                    :disabled="id === '007'"
+                    :disabled="id === '007' || disabledField"
                     :position="'right'"
                     :precision="2"
                     :size="'mini'"
                     :controls="false"
                     :append="'%'"
-                    @reschange="number_change($event, 'cgd_tax')"
+                    @reschange="number_change($event, 2)"
                   />
                 </el-form-item>
               </el-col>
@@ -256,7 +292,7 @@
                 <el-form-item label="单位" prop="goodUnit" label-width="60px">
                   <search-unit
                     :value="ruleForm.goodUnit"
-                    disabled
+                    :disabled="type === 'view' || type === 'editCoin'"
                     :size="'mini'"
                     :is-detail="type !== 'add'"
                     :names="unit_name"
@@ -270,14 +306,14 @@
                 <el-form-item label="销售单价" prop="goodPrice">
                   <el-input-number
                     v-model="ruleForm.goodPrice"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="单价"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 'goodPrice')"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>
@@ -286,13 +322,13 @@
                   <el-input-number
                     v-model="ruleForm.cgdPrice"
                     style="width: 100%"
-                    :disabled="id === '007'"
+                    :disabled="id === '007' || disabledField"
                     controls-position="right"
                     placeholder="采购单价"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 'cgdPrice')"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>
@@ -313,7 +349,11 @@
           </el-form>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button v-if="id !== '007'" type="primary" @click="submitForm">保 存</el-button>
+          <el-button
+            v-if="id !== '007'"
+            type="primary"
+            @click="submitForm"
+          >保 存</el-button>
           <el-button @click="showModelThis = false">
             {{ id == "007" ? "关 闭" : "取 消" }}
           </el-button>
@@ -443,7 +483,7 @@ export default {
         sale_total: [
           {
             required: true,
-            message: '请输入货款总金额',
+            message: '请输入销售总额',
             trigger: 'blur'
           }
         ],
@@ -552,6 +592,10 @@ export default {
     }
   },
   computed: {
+    disabledField() {
+      const { goodNum } = this.ruleForm
+      return !goodNum || Number(goodNum) <= 0
+    },
     totalWatchSource() {
       const { goodNum, goodPrice } = this.ruleForm
       return { goodNum, goodPrice }
@@ -572,29 +616,29 @@ export default {
       if (!val) {
         this.$emit('cancel')
       }
+    },
+    totalWatchSource: {
+      handler({ goodPrice, goodNum }) {
+        if (goodPrice === 0 || goodNum === 0) {
+          this.ruleForm.sale_total = 0
+          return
+        }
+
+        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
     }
-    // totalWatchSource: {
-    //   handler({ goodPrice, goodNum }) {
-    //     if (goodPrice === 0 || goodNum === 0) {
-    //       this.ruleForm.sale_total = 0
-    //       return
-    //     }
-
-    //     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
-    // }
   },
   methods: {
     async handleHandoverName(e) {
@@ -607,7 +651,27 @@ export default {
       this.$refs.ruleForm.validateField('addr_code')
     },
     number_change(e, type) {
-      this.ruleForm[type] = e
+      this.ruleForm.cgd_tax = e
+      const { cgdPrice, goodPrice, cgd_tax } = this.ruleForm
+      let tax = 0
+      let cgd_price = 0
+
+      if (type === 1) {
+        // tax = (1 - cgdPrice / goodPrice)*100
+        tax = accMul(accSub(1, accDiv(cgdPrice, goodPrice)), 100)
+        this.ruleForm.cgd_tax = tax
+        this.$refs.ruleForm.validateField('cgd_tax')
+      }
+      if (type === 2) {
+        // 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
@@ -676,14 +740,14 @@ 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)
+      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
+      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
       // }
@@ -719,6 +783,7 @@ export default {
       }
 
       this.cat_id_name = cat_id.map(({ name }) => name).join('_')
+      console.log(this.cat_id_name)
       this.unit_name = unitName
 
       this.khName = khName
@@ -726,7 +791,7 @@ export default {
       this.detailLoading = false
     },
     platform_codesearchChange(e) {
-      const { id, pay_name } = e
+      const { id, label, pay_name } = e
       this.ruleForm.platform_id = id || ''
       this.pay_name = pay_name || ''
       this.$refs.ruleForm.validateField('platform_id')
@@ -799,5 +864,6 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.terrace {}
+.terrace {
+}
 </style>

+ 60 - 54
src/views/netOrderEntry/prestoreRecordingOrders/addEdit.vue

@@ -22,6 +22,7 @@
             status-icon
             :rules="rulesThis"
             label-width="80px"
+            label-position="left"
             class="demo-ruleForm"
             size="mini"
           >
@@ -31,19 +32,33 @@
 
             <el-row>
               <el-col :span="12">
-                <el-form-item label="商品分类" prop="cat_id">
-                  <company-sort
-                    :value="ruleForm.cat_id"
-                    :placeholder="'商品分类'"
-                    :disabled="id !== '003'"
+                <el-form-item label="销售方公司:" label-width="100px" prop="companyNo">
+                  <p style="font-size:14px;color:#606266;font-weight:700">{{ getCompanyWithCode(ruleForm.companyNo).name }}</p>
+                  <!-- <search-work-company
+                    disabled
+                    :value="ruleForm.companyNo"
+                    :names="''"
                     :size="'mini'"
-                    :company-no="ruleForm.companyNo"
-                    :names="cat_id_name"
+                    :placeholder="'销售方公司'"
+                    @searchChange="handleCompanyChange"
+                  /> -->
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
+                  <search-customer
+                    size="mini"
+                    :names="khName"
+                    :disabled="id !== '003'"
                     :is-detail="type !== 'add'"
-                    @searchChange="goods_class_change"
+                    :value="ruleForm.khNo"
+                    placeholder="购买方公司"
+                    @searchChange="handleCustomerChange"
                   />
                 </el-form-item>
               </el-col>
+
               <!-- <el-col :span="7">
                 <el-form-item label="采购员" prop="buyerid">
                   <search-account
@@ -57,6 +72,20 @@
                   />
                 </el-form-item>
               </el-col> -->
+              <el-col :span="12">
+                <el-form-item label="商品分类" prop="cat_id">
+                  <company-sort
+                    :value="ruleForm.cat_id"
+                    :placeholder="'商品分类'"
+                    :disabled="id !== '003'"
+                    :size="'mini'"
+                    :company-no="ruleForm.companyNo"
+                    :names="cat_id_name"
+                    :is-detail="type !== 'add'"
+                    @searchChange="goods_class_change"
+                  />
+                </el-form-item>
+              </el-col>
 
               <el-col :span="12">
                 <el-form-item label="所属平台" prop="platform_id">
@@ -64,29 +93,19 @@
                     :value="ruleForm.platform_id"
                     :disabled="id !== '003'"
                     :size="'mini'"
-                    :is-detail="false"
+                    :is-detail="falsse"
                     :is_show="'0'"
                     :placeholder="'所属平台'"
                     @searchChange="platform_codesearchChange"
                   />
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="单据号" prop="workCode">
-                  <el-input
-                    v-model="ruleForm.workCode"
-                    :disabled="id === '007'"
-                    maxlength="50"
-                    placeholder="单据号"
-                  />
-                </el-form-item>
-              </el-col>
 
               <el-col :span="12">
-                <el-form-item label="PO编号" prop="poCode">
+                <el-form-item label="平台订单编号" prop="poCode" label-width="110px">
                   <el-input
                     v-model="ruleForm.poCode"
-                    placeholder="PO编号"
+                    placeholder="平台订单编号"
                     maxlength="50"
                     :disabled="id === '007'"
                   />
@@ -94,28 +113,15 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="购买方公司" label-width="100px" prop="khNo">
-                  <search-customer
-                    size="mini"
-                    :names="khName"
-                    :disabled="id !== '003'"
-                    :is-detail="type !== 'add'"
-                    :value="ruleForm.khNo"
-                    placeholder="购买方公司"
-                    @searchChange="handleCustomerChange"
-                  />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
-                <el-form-item label="销售方公司" label-width="100px" prop="companyNo">
-                  <search-work-company
-                    disabled
-                    :value="ruleForm.companyNo"
-                    :names="''"
-                    :size="'mini'"
-                    :placeholder="'销售方公司'"
-                    @searchChange="handleCompanyChange"
+                <el-form-item label="其他单号" prop="workCode">
+                  <template #label>
+                    <p style="margin-left:10px">其他单号</p>
+                  </template>
+                  <el-input
+                    v-model="ruleForm.workCode"
+                    :disabled="id === '007'"
+                    maxlength="50"
+                    placeholder="其他单号"
                   />
                 </el-form-item>
               </el-col>
@@ -178,10 +184,10 @@
             </el-divider>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="供应商公司" label-width="100px" prop="supplierNo">
+                <el-form-item label="供应商" label-width="100px" prop="supplierNo">
                   <search-supplier
                     size="mini"
-                    placeholder="供应商公司"
+                    placeholder="供应商"
                     :value="ruleForm.supplierNo"
                     :names="supplierName"
                     :disabled="id === '007'"
@@ -224,7 +230,7 @@
                   </el-input> -->
                   <el-input-number
                     v-model="ruleForm.sale_total"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="销售总额"
@@ -240,7 +246,7 @@
                 <el-form-item label="采购总额" prop="cgd_total">
                   <el-input-number
                     v-model="ruleForm.cgd_total"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="采购总额"
@@ -270,13 +276,13 @@
                     :placeholder="'采购毛利率'"
                     :min="0"
                     :max="100"
-                    :disabled="id === '007'"
+                    :disabled="id === '007' || disabledField"
                     :position="'right'"
                     :precision="2"
                     :size="'mini'"
                     :controls="false"
                     :append="'%'"
-                    @reschange="number_change($event, 'cgd_tax')"
+                    @reschange="number_change($event, 2)"
                   />
                 </el-form-item>
               </el-col>
@@ -286,7 +292,7 @@
                 <el-form-item label="单位" prop="goodUnit" label-width="60px">
                   <search-unit
                     :value="ruleForm.goodUnit"
-                    disabled
+                    :disabled="type === 'view' || type === 'editCoin'"
                     :size="'mini'"
                     :is-detail="type !== 'add'"
                     :names="unit_name"
@@ -300,14 +306,14 @@
                 <el-form-item label="销售单价" prop="goodPrice">
                   <el-input-number
                     v-model="ruleForm.goodPrice"
-                    :disabled="id !== '003'"
+                    :disabled="id !== '003' || disabledField"
                     style="width: 100%"
                     controls-position="right"
                     placeholder="单价"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 'goodPrice')"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>
@@ -316,13 +322,13 @@
                   <el-input-number
                     v-model="ruleForm.cgdPrice"
                     style="width: 100%"
-                    :disabled="id === '007'"
+                    :disabled="id === '007' || disabledField"
                     controls-position="right"
                     placeholder="采购单价"
                     :precision="2"
                     :min="0"
                     :step="0.01"
-                    @change="number_change($event, 'cgdPrice')"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>

Some files were not shown because too many files changed in this diff