Explorar o código

采销订单补录修复

xiaodai2022 %!s(int64=2) %!d(string=hai) anos
pai
achega
9059227b3b

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/0.js


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

@@ -241,6 +241,7 @@
                     :precision="2"
                     :min="0"
                     :step="0.01"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>
@@ -254,8 +255,8 @@
                     placeholder="采购单价"
                     :precision="2"
                     :min="0"
-                    :max="100"
                     :step="0.01"
+                    @change="number_change($event, 1)"
                   />
                 </el-form-item>
               </el-col>
@@ -271,6 +272,7 @@
                     :min="0"
                     :max="100"
                     :step="0.01"
+                    @change="number_change($event, 2)"
                   />
                 </el-form-item>
               </el-col>
@@ -327,7 +329,7 @@
 <script>
 import asyncRequest from "@/apis/service/netOrderEntry/netOrderEnter";
 import companyHelper from "@/mixins/companyHelper";
-import { accMul, isPhone, isMobile } from "@/utils/validate";
+import { accMul, accDiv, accSub, isPhone, isMobile } from "@/utils/validate";
 import resToken from "@/mixins/resToken";
 
 const defaultData = {
@@ -396,14 +398,14 @@ export default {
             trigger: "blur",
           },
         ],
-        addr_code: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择收货省市区",
-            trigger: "blur",
-          },
-        ],
+        // addr_code: [
+        //   {
+        //     type: "array",
+        //     required: true,
+        //     message: "请选择收货省市区",
+        //     trigger: "blur",
+        //   },
+        // ],
         platform_id: [
           {
             required: true,
@@ -585,6 +587,27 @@ export default {
       this.ruleForm.addr_code = e;
       this.$refs.ruleForm.validateField("addr_code");
     },
+    number_change(e, type) {
+      console.log(1111);
+      const { cgdPrice, goodPrice, cgd_tax } = this.ruleForm;
+      let tax = 0,
+        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");
+        console.log(type, tax);
+      }
+      if (type === 2) {
+        // cgd_price = (100 - cgd_tax) * goodPrice;
+        cgd_price = accMul(accDiv(100, cgd_tax), goodPrice);
+        this.ruleForm.cgdPrice = cgd_price;
+        this.$refs.ruleForm.validateField("cgdPrice");
+        console.log(type, cgd_tax);
+      }
+    },
     handleClose() {
       this.showModelThis = false;
       this.companyName = "";
@@ -594,7 +617,7 @@ export default {
     },
     async initForm() {
       this.loading = true;
-      await this.getAccounts();
+      // await this.getAccounts();
 
       if (this.id === "003") {
         this.title = "添加销售订单信息";
@@ -700,16 +723,16 @@ 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 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_id = id ? [id] : [];

+ 43 - 29
src/views/netOrderEntry/netOrderEnter/index.vue

@@ -24,16 +24,17 @@
       <template #table-header="{}">
         <div style="width: 100%">
           <el-row style="padding: 0 0 10px 80px">
-            <period-date-picker
-              :type="1"
-              :width="'135px'"
-              :size="searchSize"
-              :start="parmValue.start"
-              :end="parmValue.end"
-              @timeReturned="handleTime"
-            />
-
-            <el-col :span="4" style="width: 373px; margin-left: 15px">
+            <el-col :span="4" style="width: 293px">
+              <period-date-picker
+                :type="1"
+                :width="'135px'"
+                :size="searchSize"
+                :start="parmValue.start"
+                :end="parmValue.end"
+                @timeReturned="handleTime"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 380px; padding: 0 0 0 10px">
               <el-input
                 size="mini"
                 v-model="value"
@@ -74,25 +75,19 @@
                 >重置</el-button
               >
             </el-col>
-            <!-- v-if="powers.includes('003') && !isSupertube" -->
-            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-              <el-button type="primary" :size="searchSize" @click="openModal({}, '003')"
+            <el-col
+              :span="3"
+              class="fr"
+              style="width: 66px; padding: 0 0 0 10px"
+              v-if="powers.includes('003') && !isSupertube"
+            >
+              <el-button type="success" :size="searchSize" @click="openModal({}, '003')"
                 >添加</el-button
               >
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="6" style="margin-right: 15px">
-              <search-customer
-                size="mini"
-                :value="parmValue.customer_code"
-                :names="customerName"
-                @searchChange="handleCustomerChange"
-                placeholder="购买方公司"
-              />
-            </el-col>
-
-            <el-col :span="3" style="margin-left: 10px">
+            <el-col :span="3" style="width: 181px">
               <el-input
                 v-model="parmValue.lower_price"
                 size="mini"
@@ -105,7 +100,7 @@
               />
             </el-col>
 
-            <el-col :span="3" style="margin-left: 10px">
+            <el-col :span="3" style="width: 192px; padding: 0 0 0 10px">
               <el-input
                 v-model="parmValue.upper_price"
                 size="mini"
@@ -117,15 +112,34 @@
                 "
               />
             </el-col>
+            <el-col :span="6" style="width: 373px; padding: 0 0 0 10px">
+              <search-customer
+                size="mini"
+                :value="parmValue.customer_code"
+                :names="customerName"
+                @searchChange="handleCustomerChange"
+                placeholder="购买方公司"
+              />
+            </el-col>
 
             <!-- <el-col :span="3" class="fr" style="width: 116px; padding: 0 0 0 10px">
-              <el-button type="primary" :size="searchSize" @click="downloadTemplate">
+              <el-button
+                class="fr"
+                type="primary"
+                :size="searchSize"
+                @click="downloadTemplate"
+              >
                 下载导入模板
               </el-button>
             </el-col>
-            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-              <el-button type="primary" :size="searchSize" @click="() => templateModalVisible = true">
-                导入
+            <el-col :span="3" class="fr" style="width: 116px; padding: 0 0 0 10px">
+              <el-button
+                type="primary"
+                class="fr"
+                :size="searchSize"
+                @click="() => (templateModalVisible = true)"
+              >
+                导入订单数据
               </el-button>
             </el-col> -->
           </el-row>

+ 3 - 2
src/views/netOrderEntry/netOrderEnter/template.js

@@ -12,9 +12,10 @@ const mapTemplateToTable = {
   '单位': 'goodUnit',
   '税率': 'tax',
   '数量': 'goodNum',
-  '单价': 'goodPrice',
+  '销售单价': 'goodPrice',
+  '采购单价': 'cgdPrice',
   '采购毛利率': 'cgd_tax',
-  '货款总额': 'good_total',
+  '销售总额': 'good_total',
   '收货人': 'contactor',
   '联系电话': 'mobile',
   '收货地址': 'addr',

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio