Browse Source

采购功能修改

戴艳蓉 3 years ago
parent
commit
e07d446e79
46 changed files with 1523 additions and 89 deletions
  1. 0 0
      dist/index.html
  2. 0 0
      dist/static/css/app.7750cd29.css
  3. 0 0
      dist/static/css/app.7750cd29.css.gz
  4. 0 0
      dist/static/css/chunk-11160440.8bd48c8b.css
  5. 0 0
      dist/static/css/chunk-1cb5ff52.fff5dd6a.css
  6. 0 0
      dist/static/css/chunk-27491dc0.68d53367.css
  7. 0 0
      dist/static/css/chunk-303f3557.5cecacfb.css
  8. 0 0
      dist/static/css/chunk-34b4f843.5b78ccd1.css
  9. BIN
      dist/static/css/chunk-34b4f843.5b78ccd1.css.gz
  10. 0 0
      dist/static/css/chunk-99ddbe98.82402d24.css
  11. 0 0
      dist/static/css/chunk-b498323c.da93a073.css
  12. 0 0
      dist/static/css/chunk-e4b6aab2.0b5623b7.css
  13. BIN
      dist/static/css/chunk-e4b6aab2.0b5623b7.css.gz
  14. 0 0
      dist/static/js/app.a144e2b1.js
  15. BIN
      dist/static/js/app.a144e2b1.js.gz
  16. 0 0
      dist/static/js/app.ceb80774.js
  17. BIN
      dist/static/js/app.ceb80774.js.gz
  18. 0 0
      dist/static/js/chunk-032352f5.c5b756f2.js
  19. 0 0
      dist/static/js/chunk-0faec682.c6691e33.js
  20. 0 0
      dist/static/js/chunk-11160440.eb61f70e.js
  21. 6 0
      dist/static/js/chunk-1cb5ff52.07e8248f.js
  22. BIN
      dist/static/js/chunk-1cb5ff52.07e8248f.js.gz
  23. 0 0
      dist/static/js/chunk-27491dc0.25c8243d.js
  24. 0 0
      dist/static/js/chunk-303f3557.0bd8fa29.js
  25. 0 0
      dist/static/js/chunk-34b4f843.4f12a870.js
  26. BIN
      dist/static/js/chunk-34b4f843.4f12a870.js.gz
  27. 0 0
      dist/static/js/chunk-39320d98.ab480761.js
  28. 0 0
      dist/static/js/chunk-55ab42fe.211e4715.js
  29. BIN
      dist/static/js/chunk-55ab42fe.211e4715.js.gz
  30. 0 0
      dist/static/js/chunk-59eb59c9.9468315e.js
  31. BIN
      dist/static/js/chunk-59eb59c9.9468315e.js.gz
  32. 0 0
      dist/static/js/chunk-7b1f2dbe.6b2c9f42.js
  33. 0 0
      dist/static/js/chunk-99ddbe98.5de347ae.js
  34. 0 0
      dist/static/js/chunk-b498323c.14c1f29e.js
  35. 0 0
      dist/static/js/chunk-e4b6aab2.49bda91d.js
  36. BIN
      dist/static/js/chunk-e4b6aab2.49bda91d.js.gz
  37. 17 0
      src/apis/service/network/orderEntry/index.js
  38. 137 0
      src/components/global/search-select/index.vue
  39. 68 4
      src/utils/validate.js
  40. 98 12
      src/views/InvoiceSales/invoiceApply/addview.vue
  41. 686 0
      src/views/network/orderEntry/addEdit.vue
  42. 391 0
      src/views/network/orderEntry/index.vue
  43. 0 0
      src/views/network/orderEntry/网络订单录入
  44. 83 45
      src/views/purchase/orderRecord/components/addView.vue
  45. 21 20
      src/views/purchase/orderRecord/index.vue
  46. 16 8
      src/views/search/standBook/index.vue

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/app.427dbc27.css → dist/static/css/app.7750cd29.css


+ 0 - 0
dist/static/css/app.427dbc27.css.gz → dist/static/css/app.7750cd29.css.gz


+ 0 - 0
dist/static/css/chunk-0faec682.8bd48c8b.css → dist/static/css/chunk-11160440.8bd48c8b.css


+ 0 - 0
dist/static/css/chunk-59eb59c9.fff5dd6a.css → dist/static/css/chunk-1cb5ff52.fff5dd6a.css


+ 0 - 0
dist/static/css/chunk-7b1f2dbe.68d53367.css → dist/static/css/chunk-27491dc0.68d53367.css


+ 0 - 0
dist/static/css/chunk-39320d98.5cecacfb.css → dist/static/css/chunk-303f3557.5cecacfb.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-34b4f843.5b78ccd1.css


BIN
dist/static/css/chunk-34b4f843.5b78ccd1.css.gz


+ 0 - 0
dist/static/css/chunk-032352f5.82402d24.css → dist/static/css/chunk-99ddbe98.82402d24.css


+ 0 - 0
dist/static/css/chunk-55ab42fe.da93a073.css → dist/static/css/chunk-b498323c.da93a073.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-e4b6aab2.0b5623b7.css


BIN
dist/static/css/chunk-e4b6aab2.0b5623b7.css.gz


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


BIN
dist/static/js/app.a144e2b1.js.gz


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


BIN
dist/static/js/app.ceb80774.js.gz


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


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


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


File diff suppressed because it is too large
+ 6 - 0
dist/static/js/chunk-1cb5ff52.07e8248f.js


BIN
dist/static/js/chunk-1cb5ff52.07e8248f.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-27491dc0.25c8243d.js


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-34b4f843.4f12a870.js


BIN
dist/static/js/chunk-34b4f843.4f12a870.js.gz


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-55ab42fe.211e4715.js


BIN
dist/static/js/chunk-55ab42fe.211e4715.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-59eb59c9.9468315e.js


BIN
dist/static/js/chunk-59eb59c9.9468315e.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-7b1f2dbe.6b2c9f42.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-99ddbe98.5de347ae.js


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


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


BIN
dist/static/js/chunk-e4b6aab2.49bda91d.js.gz


+ 17 - 0
src/apis/service/network/orderEntry/index.js

@@ -0,0 +1,17 @@
+// 业务参数
+import http from '@/apis/axios'
+const api = 'Admin/'
+export default {
+  // 分页查询
+  list1: (data, params) => http(api + "customerlist", data, "post", params),
+  // 列表
+  list2: (data, params) => http(api + 'companylist', data, 'post', params),
+  // 分页查询
+  list3: (data, params) => http(api + "supplierlist", data, "post", params),
+  // 查出全部税率
+  list4: (data, params) => http(api + "ratelist", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "supplierlist", data, "post", params),
+  // 网络部订单录入接口
+  add: (data, params) => http(api + "interadd", data, "post", params),
+}

+ 137 - 0
src/components/global/search-select/index.vue

@@ -0,0 +1,137 @@
+<template>
+  <el-select
+    v-model="code"
+    multiple
+    filterable
+    remote
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size"
+    style="width: 100%"
+    :placeholder="placeholder"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="item in activeOptions"
+      :key="item.code"
+      :label="item.name"
+      :value="item.code"
+    />
+  </el-select>
+</template>
+<script>
+import asyncRequest from "@/apis/service/network/orderEntry";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "search-select",
+  props: [
+    "code",
+    "placeholder",
+    "size",
+    "type",
+    "isDetail",
+    "disabled",
+    "names",
+  ],
+  mixins: [resToken],
+  data() {
+    return {
+      activeOptions: [],
+      code: [],
+      selectLoading: false,
+      searchName: "",
+    };
+  },
+  watch: {
+    names: function (val) {
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  created() {
+    this.activeOptions = [];
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      this.selectLoading = false;
+    },
+    async selectChange() {
+      this.$emit("end", this.code);
+    },
+    async remoteMethod(query) {
+      this.selectLoading = true;
+      if (query !== "") {
+        this.activeOptions = [];
+        let formValue = {
+          page: 1,
+          size: 50,
+          name: query,
+          company: query,
+        };
+
+        let res = {};
+        if (this.type === "1") {
+          delete formValue["name"];
+          res = await asyncRequest.list1(formValue);
+        } else if (this.type === "2") {
+          delete formValue["company"];
+          res = await asyncRequest.list2(formValue);
+        } else if (this.type === "3") {
+          delete formValue["company"];
+          res = await asyncRequest.list3(formValue);
+        } else {
+          res = await asyncRequest.list4({});
+        }
+        if (res && res.code === 0 && res.data) {
+          this.activeOptions;
+          let list = [];
+          if (this.type === "4") {
+            list = res.data;
+          } else {
+            list = res.data.list;
+          }
+          list.forEach((v1) => {
+            let item = {
+              code:
+                this.type === "1"
+                  ? v1.companyNo || ""
+                  : this.type === "2"
+                  ? v1.companyNo || ""
+                  : this.type === "3"
+                  ? v1.code || ""
+                  : v1.id || "",
+              name:
+                this.type === "1"
+                  ? v1.companyName || ""
+                  : this.type === "2"
+                  ? v1.company_name || ""
+                  : this.type === "3"
+                  ? v1.name || ""
+                  : v1.rate+"%" || "",
+            };
+            this.activeOptions.push(item);
+          });
+        } else if (res && res.code >= 100 && res.code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(res.message);
+        }
+      } else {
+        this.activeOptions = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.search-select {
+}
+</style>

+ 68 - 4
src/utils/validate.js

@@ -113,7 +113,7 @@ export function isPhone(s) {
 }
 
 /**
- * 固定电话(支持分机)
+ * 固定电话(支持分机) 原始
  * @param {*} s
  */
 export function isExtension(s) {
@@ -129,12 +129,74 @@ export function isExtension(s) {
   return type
   ///0\d{2,3}-\d{7,8}(-\d{1,6})?/.test(s)
 }
+
+//区-座-分 
+export function isqzf(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 3) {
+    type = setqj(arr[0]) && setzj(arr[1]) && setfj(arr[2])
+  } else {
+    type = false
+  }
+  console.log('console区-座-分 ' + type);
+  return type
+}
+// //区-座 
+export function isqz(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 2) {
+    type = setqj(arr[0]) && setzj(arr[1])
+  } else {
+    type = false
+  }
+  console.log('console区-座 ' + type);
+  return type
+}
+//座-分 
+export function iszf(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 2) {
+    type = setzj(arr[0]) && setfj(arr[1])
+  } else {
+    type = false
+  }
+  console.log('console座-分' + type);
+  return type
+}
+
+//座
+export function isz(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 1) {
+    type = setzj(arr[0])
+  } else {
+    type = false
+  }
+  console.log('console座' + type);
+  return type
+}
+
+function setqj(s) {
+  return /0\d{2,3}?$/.test(s) && (s.length == 3 || s.length == 4)
+}
+function setzj(s) {
+  return /\d{7,8}$/.test(s) && (s.length == 7 || s.length == 8)
+}
+function setfj(s) {
+  return /\d{1,6}$/.test(s) && (s.length > 0 && s.length < 7)
+}
+//原始计算
 function setF(arr) {
   let type1 = true, type2 = true, type3 = true
-  type1 = /0\d{2,3}?$/.test(arr[0])
-  type2 = arr[1].length === 7 || arr[1].length === 8 ? /\d{7,8}$/.test(arr[1]) : false;
+  type1 = setqj(arr[0])
+  ///0\d{2,3}?$/.test()
+  type2 = arr[1].length === 7 || arr[1].length === 8 ? setzj(arr[1]) : false;
   if (arr.length === 3) {
-    type3 = arr[2].length === 0 || arr[2].length > 6 ? false : /\d{1,6}$/.test(arr[2])
+    type3 = arr[2].length === 0 || arr[2].length > 6 ? false : setfj(arr[2])
   }
   console.log(type1, type2, type3);
   if (arr.length === 2) {
@@ -145,6 +207,8 @@ function setF(arr) {
 
 }
 
+
+
 // (^(\d{11})$|^((\d{3}-)?\d{8}(-\d{1,4})?)$|^((\d{4}-)?\d{7}(-\d{1,4})?)$|^(\d{7,8})$)
 /**
  * 纳税人识别号

+ 98 - 12
src/views/InvoiceSales/invoiceApply/addview.vue

@@ -4,7 +4,6 @@
       <el-form
         ref="ruleForm1"
         :model="ruleForm1"
-        status-icon
         :rules="rulesThis"
         label-width="110px"
         class="demo-ruleForm"
@@ -132,10 +131,23 @@
               <el-form-item label="联系电话" prop="invoice_mobile">
                 <el-input
                   :disabled="disableds"
-                  placeholder="XXXX-XXXXXXXX-XXX"
+                  placeholder="请输入联系电话"
                   v-model="ruleForm1.invoice_mobile"
                 >
-                </el-input
+                  <el-select
+                    v-model="schange"
+                    slot="prepend"
+                    style="width: 100px"
+                    placeholder="请选择"
+                    @change="selectChangeMobile"
+                  >
+                    <el-option
+                      v-for="item in soptins"
+                      :key="item.code + 'indexs'"
+                      :label="item.name"
+                      :value="item.code"
+                    ></el-option>
+                  </el-select> </el-input
               ></el-form-item>
             </el-col>
           </el-col>
@@ -186,7 +198,7 @@
             >
               <el-select
                 v-model="ruleForm1.inv_out"
-                 :disabled="disableds"
+                :disabled="disableds"
                 placeholder="请选择销售方开票信息"
                 style="width: 100%"
               >
@@ -375,7 +387,6 @@
             >
               <template slot-scope="scope">
                 <el-tooltip
-                   
                   effect="dark"
                   v-if="isDetail === '003' || isDetail === '005'"
                   content="编辑"
@@ -388,7 +399,6 @@
                   ></i>
                 </el-tooltip>
                 <el-tooltip
-                   
                   effect="dark"
                   content="删除"
                   v-if="isDetail === '003'"
@@ -618,7 +628,6 @@
             >
               <template>
                 <el-tooltip
-                   
                   effect="dark"
                   content="删除"
                   v-if="isDetail === '003'"
@@ -688,7 +697,7 @@ import orderChangeDialog from "@/components/changeDialog/order";
 import capitalChangeDialog from "@/components/changeDialog/capital";
 import resToken from "@/mixins/resToken";
 import goodChangeDialog from "./goodChangeDialog.vue";
-import { isLicense, isExtension } from "@/utils/validate";
+import { isLicense, isqzf, isqz, iszf, isz, isMobile } from "@/utils/validate";
 export default {
   name: "invoiceApply",
   props: ["showModel", "id", "isDetail", "newTime", "invNo", "status"],
@@ -713,10 +722,43 @@ export default {
 
     const validatemobile = (rule, value, callback) => {
       if (value !== "") {
-        if (isExtension(value)) {
-          callback();
+        // 区-固-分
+        if (this.schange === "1") {
+          if (isqzf(value)) {
+            callback();
+          } else {
+            callback(
+              new Error("规则为区号[0+2~3位]-固定电话[7~8位]-分机号[1~6位]!")
+            );
+          }
+          //区-固
+        } else if (this.schange === "2") {
+          if (isqz(value)) {
+            callback();
+          } else {
+            callback(new Error("规则为区号[0+2~3位]-固定电话[7~8位]!"));
+          }
+          //固-分
+        } else if (this.schange === "3") {
+          if (iszf(value)) {
+            callback();
+          } else {
+            callback(new Error("规则为固定电话[7~8位]-分机号[1~6位]!"));
+          }
+          //固
+        } else if (this.schange === "4") {
+          if (isz(value)) {
+            callback();
+          } else {
+            callback(new Error("规则为固定电话[7~8位]!"));
+          }
+          //手机号
         } else {
-          callback(new Error("联系电话格式不正确!"));
+          if (!isMobile(value)) {
+            callback(new Error("手机号格式不正确!"));
+          } else {
+            callback();
+          }
         }
       } else {
         callback(new Error("请输入联系电话!"));
@@ -741,6 +783,29 @@ export default {
       selectLoading2: false,
       loading: false,
       title: "添加发票申请",
+      schange: "1",
+      soptins: [
+        {
+          code: "1",
+          name: "区-固-分",
+        },
+        {
+          code: "2",
+          name: "区-固",
+        },
+        {
+          code: "3",
+          name: "固-分",
+        },
+        {
+          code: "4",
+          name: "固",
+        },
+        {
+          code: "5",
+          name: "手机号",
+        },
+      ],
       invioceType: [
         {
           id: "1",
@@ -887,6 +952,9 @@ export default {
         this.tableData[this.activeIndex].unit = unit;
       }
     },
+    selectChangeMobile() {
+      this.$refs.ruleForm1.validateField("invoice_mobile");
+    },
     invAddChange() {
       if (this.ruleForm1.inv_add === "1") {
         this.ruleForm1.invoice_title = "";
@@ -1016,6 +1084,8 @@ export default {
                 ? this.activeOptions2[index][k] + ""
                 : "";
             }
+            console.log(this.ruleForm1);
+            this.setTypeM(this.ruleForm1.invoice_mobile);
             this.validateFormField();
           }
         } else {
@@ -1075,6 +1145,7 @@ export default {
           } else {
             this.ruleForm1[k] = data[k] ? data[k] + "" : "";
           }
+          this.setTypeM(this.ruleForm1.invoice_mobile);
           this.validateFormField();
         }
         this.activeOptions2 = [data];
@@ -1209,7 +1280,8 @@ export default {
         this.activeOptions = [customer];
         this.remark = remark;
         this.exam_remark = exam_remark;
-        console.log(this.ruleForm1);
+        this.setTypeM(invoice_mobile);
+        // console.log(this.ruleForm1);
         if (!this.disableds) {
           this.changetype(this.ruleForm1.type);
         }
@@ -1247,6 +1319,20 @@ export default {
         }
       }
     },
+    setTypeM(mobile) {
+      if (isMobile(mobile)) {
+        this.schange = "5";
+      } else if (isqzf(mobile)) {
+        this.schange = "1";
+      } else if (isqz(mobile)) {
+        this.schange = "2";
+      } else if (iszf(mobile)) {
+        this.schange = "3";
+      } else {
+        this.schange = "4";
+      }
+      console.log(this.schange);
+    },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {

+ 686 - 0
src/views/network/orderEntry/addEdit.vue

@@ -0,0 +1,686 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="1040px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="closeModel"
+  >
+    <el-card style="margin-top: -20px">
+      <el-form
+        ref="ruleForm"
+        :model="ruleForm"
+        status-icon
+        :rules="rulesThis"
+        size="mini"
+        label-width="93px"
+        class="demo-ruleForm"
+      >
+        <el-row :gutter="10">
+          <el-col :span="24" style="padding: 0 0 10px 0; margin-top: -5px">
+            <el-divider><el-tag size="mini">确认单信息</el-tag></el-divider>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="创建人" prop="sale_name">
+              <el-input
+                v-model.trim="ruleForm.sale_name"
+                placeholder="请输入创建人"
+                :disabled="isDetail"
+                maxlength="200"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="部门" prop="department">
+              <el-input
+                v-model.trim="ruleForm.department"
+                placeholder="请输入部门"
+                disabled
+                maxlength="200"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="确认单类型" prop="qrdType">
+              <el-input
+                v-model.trim="ruleForm.qrdType"
+                placeholder="请输入确认单类型"
+                disabled
+                maxlength="200"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="采购毛利率" prop="cgd_tax">
+              <el-input-number
+                style="width: 100%"
+                v-model="ruleForm.cgd_tax"
+                controls-position="right"
+                placeholder="请输入采购毛利率"
+                :disabled="isDetail"
+                :min="0"
+                :precision="2"
+                @change="numBlur"
+                step-strictly
+                :step="0.01"
+                :max="100"
+              ></el-input-number> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="单据号" prop="a5">
+              <el-input
+                v-model.trim="ruleForm.a5"
+                placeholder="请输入单据号"
+                :disabled="isDetail"
+                maxlength="200"
+              />
+            </el-form-item> </el-col
+          ><el-col :span="12">
+            <el-form-item label="PO编号" prop="poNo">
+              <el-input
+                v-model.trim="ruleForm.poNo"
+                placeholder="请输入PO编号"
+                :disabled="isDetail"
+                maxlength="200"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="购买方公司" prop="khNo">
+              <search-select
+                :code="ruleForm.khNo"
+                :placeholder="'请选择购买方公司'"
+                @end="searchChange1"
+                :names="searchName1"
+                :is-detail="id !== 'add'"
+                :type="'1'"
+                :size="'mini'"
+                :disabled="isDetail"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="销售方公司" prop="companyNo">
+              <search-select
+                :code="ruleForm.companyNo"
+                :placeholder="'请选择销售方公司'"
+                @end="searchChange2"
+                :names="searchName2"
+                :type="'2'"
+                :size="'mini'"
+                :is-detail="id !== 'add'"
+                :disabled="isDetail"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" style="padding: 0 0 10px 0; margin-top: -5px">
+            <el-divider><el-tag size="mini">收货信息</el-tag></el-divider>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="收货人" prop="contactor">
+              <el-input
+                v-model.trim="ruleForm.contactor"
+                placeholder="请输入收货人"
+                maxlength="200"
+                :disabled="isDetail"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="联系电话" prop="mobile">
+              <el-input
+                v-model.trim="ruleForm.mobile"
+                placeholder="请输入联系电话"
+                maxlength="200"
+                :disabled="isDetail"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="联系地址" prop="addr">
+              <el-input
+                v-model.trim="ruleForm.addr"
+                placeholder="请输入联系地址"
+                maxlength="200"
+                :disabled="isDetail"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="发货时间" prop="sendtime">
+              <el-date-picker
+                v-model="ruleForm.sendtime"
+                :editable="false"
+                :clearable="true"
+                :size="'mini'"
+                :picker-options="pickerOptions"
+                placeholder="请选择发货时间"
+                style="width: 100%; margin: 0"
+                type="datetime"
+                :disabled="isDetail"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" style="padding: 0 0 10px 0; margin-top: -5px">
+            <el-divider><el-tag size="mini">商品信息</el-tag></el-divider>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="供应商公司" prop="supplierNo">
+              <search-select
+                :code="ruleForm.supplierNo"
+                :placeholder="'请选择供应商公司'"
+                @end="searchChange3"
+                :type="'3'"
+                :size="'mini'"
+                :names="searchName3"
+                :disabled="isDetail"
+                :is-detail="id !== 'add'"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="商品名称" prop="goodName">
+              <el-input
+                v-model.trim="ruleForm.goodName"
+                placeholder="请输入商品名称"
+                maxlength="200"
+                :disabled="isDetail"
+              /> </el-form-item
+          ></el-col>
+
+          <el-col :span="6">
+            <el-form-item label="数量" prop="goodNum">
+              <el-input-number
+                style="width: 100%"
+                v-model="ruleForm.goodNum"
+                controls-position="right"
+                placeholder="请输入数量"
+                :disabled="isDetail"
+                :min="0"
+                :precision="0"
+                @change="numBlur"
+                step-strictly
+                :step="1"
+                :max="9999999"
+              ></el-input-number> </el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="单价" label-width="55px" prop="goodPice">
+              <el-input-number
+                v-model="ruleForm.goodPice"
+                controls-position="right"
+                placeholder="请输入单价"
+                style="width: 100%"
+                :disabled="isDetail"
+                :min="0"
+                :precision="2"
+                @change="numBlur"
+                step-strictly
+                :step="0.01"
+                :max="9999999"
+              ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="货款总额" prop="good_total">
+              <el-input
+                v-model.number="ruleForm.good_total"
+                placeholder="请输入货款总额"
+                disabled
+                ><template slot="append">元</template></el-input
+              >
+            </el-form-item></el-col
+          >
+          <el-col :span="6">
+            <el-form-item label="税率" prop="tax">
+              <search-select
+                :code="ruleForm.tax"
+                :placeholder="'请选择税率'"
+                @end="searchChange4"
+                :type="'4'"
+                :size="'mini'"
+                :names="searchName4"
+                :disabled="isDetail"
+                :is-detail="id !== 'add'"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-row>
+        <el-col :span="24" style="text-align: right">
+          <el-button v-if="!isDetail" type="primary" @click="submitForm"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/parameter/finance";
+import resToken from "@/mixins/resToken";
+import { isMobile, isPhone } from "@/utils/validate";
+export default {
+  name: "Account",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    const validatemobile = (rule, value, callback) => {
+      if (value !== "") {
+        if (isPhone(value) || isMobile(value)) {
+          callback();
+        } else {
+          callback(new Error("联系电话格式不正确!"));
+        }
+      } else {
+        callback(new Error("请输入联系电话!"));
+      }
+    };
+
+    return {
+      searchName1: "",
+      searchName2: "",
+      searchName3: "",
+      searchName4: "",
+      company_img: "",
+      bm: "",
+      roleList: [],
+      loading: false,
+      title: "添加确认单信息",
+      showModelThis: this.showModel,
+      ruleForm: {},
+      rulesThis: this.rules,
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() > new Date().valueOf();
+        },
+      },
+      //  validator: validateLicense,
+      rules: {
+        sale_name: [
+          {
+            required: true,
+            message: "请输入创建人",
+            trigger: "blur",
+          },
+        ],
+        department: [
+          {
+            required: true,
+            message: "请输入部门",
+            trigger: "blur",
+          },
+        ],
+        cgd_tax: [
+          {
+            required: true,
+            message: "请输入采购毛利率",
+            trigger: "blur",
+          },
+        ],
+        supplierNo: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择供应商公司",
+            trigger: "change",
+          },
+        ],
+        qrdType: [
+          {
+            required: true,
+            message: "请输入订单类型",
+            trigger: "blur",
+          },
+        ],
+        good_total: [
+          {
+            required: true,
+            message: "请输入货款总金额",
+            trigger: "blur",
+          },
+        ],
+        a5: [
+          {
+            required: true,
+            message: "请输入单据号",
+            trigger: "blur",
+          },
+        ],
+        poNo: [
+          {
+            required: true,
+            message: "请输入PO编号",
+            trigger: "blur",
+          },
+        ],
+        khNo: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择购买方公司",
+            trigger: "change",
+          },
+        ],
+        tax: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择税率",
+            trigger: "change",
+          },
+        ],
+        companyNo: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择销售方公司",
+            trigger: "change",
+          },
+        ],
+        contactor: [
+          {
+            required: true,
+            message: "请输入收货人",
+            trigger: "blur",
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
+        addr: [
+          {
+            required: true,
+            message: "请输入联系地址",
+            trigger: "blur",
+          },
+        ],
+
+        sendtime: [
+          {
+            required: true,
+            message: "请输入发货时间",
+            trigger: "change",
+          },
+        ],
+
+        goodName: [
+          {
+            required: true,
+            message: "请输入商品名称",
+            trigger: "blur",
+          },
+        ],
+        goodPice: [
+          {
+            required: true,
+            message: "请输入单价",
+            trigger: "blur",
+          },
+        ],
+        goodNum: [
+          {
+            required: true,
+            message: "请输入数量",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+    },
+    searchChange1(e) {
+      this.ruleForm.khNo = JSON.parse(JSON.stringify(e));
+      this.$refs.ruleForm.validateField("khNo");
+      console.log(this.ruleForm.khNo);
+    },
+    searchChange2(e) {
+      this.ruleForm.companyNo = JSON.parse(JSON.stringify(e));
+      this.$refs.ruleForm.validateField("companyNo");
+    },
+    searchChange3(e) {
+      this.ruleForm.supplierNo = JSON.parse(JSON.stringify(e));
+      this.$refs.ruleForm.validateField("supplierNo");
+    },
+    searchChange4(e) {
+      this.ruleForm.tax = JSON.parse(JSON.stringify(e));
+      this.$refs.ruleForm.validateField("tax");
+    },
+    async initForm() {
+      this.setform();
+      this.searchName1 = "";
+      this.searchName2 = "";
+      this.searchName3 = "";
+      this.searchName4 = "";
+      this.loading = true;
+      if (this.id === "add") {
+        this.title = "添加确认单信息";
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.title = "确认单信息详情";
+          this.rulesThis = {};
+        } else {
+          this.title = "修改确认单信息";
+          this.rulesThis = this.rules;
+        }
+        await this.resetForm();
+        await this.initData();
+      }
+      this.loading = false;
+    },
+    async initData() {
+      //KH202104272612 泰康人寿云南分公司玉溪中支
+      //CMP20210608140627719  北京万宇恒通国际科贸有限公司
+      //GYS-20210416-0316 北京顺捷玖芊科技有限公司
+
+      this.searchName1 = "泰康人寿云南分公司玉溪中支";
+      this.searchName2 = "北京万宇恒通国际科贸有限公司";
+      this.searchName3 = "北京顺捷玖芊科技有限公司";
+      this.searchName4 = "13";
+      this.ruleForm = {
+        khNo: ["KH202104272612"],
+        companyNo: ["CMP20210608140627719"],
+        supplierNo: ["GYS-20210416-0316"],
+        sale_name: "张三",
+        department: "网络部",
+        qrdType: "客服确认单",
+        good_total: 0,
+        a5: "xxxxxx",
+        poNo: "yyyyyy",
+        contactor: "李四",
+        mobile: "17744520491",
+        addr: "北京市东城区",
+        sendtime: "",
+        goodName: "网络部",
+        goodPice: 0,
+        goodNum: 0,
+        cgd_tax: 0,
+        tax: [],
+      };
+      // const res = await asyncRequest.detail({ companyNo: this.id });
+      // if (res && res.code === 0) {
+      //   // this.ruleForm = res.data;
+
+      //   // this.ruleForm.companyNo = this.id;
+      // } else if (res && res.code >= 100 && res.code <= 104) {
+      //   await this.logout();
+      // } else {
+      //   this.$message.warning(res.message);
+      // }
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.setform();
+        }
+      });
+    },
+    setform() {
+      this.ruleForm = {
+        khNo: [],
+        companyNo: [],
+        supplierNo: [],
+        sale_name: "张三",
+        department: "网络部",
+        qrdType: "客服确认单",
+        good_total: 0,
+        a5: "xxxxxx",
+        poNo: "yyyyyy",
+        contactor: "李四",
+        mobile: "17744520491",
+        addr: "北京市东城区",
+        sendtime: "",
+        goodName: "网络部",
+        goodPice: 0,
+        goodNum: 0,
+        cgd_tax: 0,
+        tax: [],
+      };
+    },
+    numBlur() {
+      this.ruleForm.good_total = this.setNum(
+        this.ruleForm.goodPice * 1 * (this.ruleForm.goodNum * 1)
+      );
+    },
+    setNum(s) {
+      return s ? parseFloat(s + "").toFixed(2) : "0";
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          const obj = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = {};
+          if (this.id === "add") {
+            delete obj["id"];
+            res = await asyncRequest.add(obj);
+          } else {
+            res = await asyncRequest.update(obj);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.finance {
+  .activity-upload {
+    .btnupload {
+      float: left;
+      border: 1px solid #cccccc;
+      box-sizing: border-box;
+      width: 135px;
+      height: 135px;
+      line-height: 135px;
+      text-align: center;
+    }
+    .Upload {
+      width: 135px;
+      height: 135px;
+      line-height: 135px;
+      text-align: center;
+      position: absolute;
+      line-height: 0px;
+      top: 0;
+      left: 0;
+      line-height: 135px;
+    }
+    .fileUp {
+      vertical-align: top;
+    }
+    .avatar {
+      width: 135px;
+      height: 135px;
+      line-height: 135px;
+      text-align: center;
+    }
+    .avatar-uploader .el-upload:hover {
+      border-color: #409eff;
+    }
+    .avatar-uploader-icon {
+      font-size: 28px;
+      color: #8c939d;
+      width: 50px;
+      height: 50px;
+      line-height: 50px;
+      text-align: center;
+    }
+    .avatar {
+      width: 100%;
+      height: 100%;
+      display: block;
+    }
+    .txt-tips {
+      display: inline-block;
+      font-size: 13px;
+      color: #606266;
+      padding: 18px 0 0 18px;
+      p {
+        margin: 0;
+        line-height: 30px;
+      }
+    }
+    .avatar-uploader .el-upload {
+      border: 1px dashed #d9d9d9;
+      border-radius: 6px;
+      cursor: pointer;
+      position: relative;
+      overflow: hidden;
+    }
+  }
+}
+</style>

+ 391 - 0
src/views/network/orderEntry/index.vue

@@ -0,0 +1,391 @@
+<template>
+  <div class="orderEntry pagePadding">
+    <ex-table
+      v-loading="loading"
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+      :table="table"
+      :data="tableData"
+      :columns="columns"
+      :page="pageInfo"
+      :size="size"
+      @page-curr-change="handlePageChange"
+      @page-size-change="handleSizeChange"
+      @screen-reset="
+        pageInfo.curr = 1;
+        searchList();
+      "
+      @screen-submit="
+        pageInfo.curr = 1;
+        searchList();
+      "
+    >
+      <template #table-header="{}">
+        <div style="width: 100%">
+          <el-row :gutter="10">
+            <el-col :span="24" style="padding: 0 0 10px 80px">
+              <el-col :span="6" style="width: 306px; padding: 0 0 0 0">
+                <period-date-picker
+                  :start="parmValue.starttime"
+                  :end="parmValue.endtime"
+                  :type="1"
+                  :width="'140px'"
+                  :size="searchSize"
+                  @timeReturned="timeReturned($event)"
+                ></period-date-picker>
+              </el-col>
+              <el-col :span="8" style="width: 360px">
+                <el-input
+                  :size="searchSize"
+                  v-model="input"
+                  placeholder="关键字"
+                >
+                  <el-select
+                    style="width: 115px"
+                    v-model="select"
+                    slot="prepend"
+                    placeholder="请选择"
+                  >
+                    <el-option label="确认单编号" value="1"></el-option>
+                    <el-option label="确认单业务员" value="2"></el-option>
+                    <el-option label="采购单编号" value="3"></el-option>
+                    <el-option label="采购单业务员" value="4"></el-option>
+                  </el-select>
+                </el-input>
+              </el-col>
+              <el-col :span="3" style="width: 195px; float: right">
+                <el-button
+                  v-if="powers.some((item) => item == '002')"
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+                <el-button
+                  v-if="powers.some((item) => item == '003')"
+                  :size="searchSize"
+                  type="success"
+                  style="float: right; margin: 0"
+                  @click="openModal('add', false)"
+                >
+                  添加
+                </el-button>
+              </el-col>
+            </el-col>
+            <el-col :span="24" style="padding: 0">
+              <el-col :span="8" style="width: 470px">
+                <search-select
+                  :code="parmValue.a1"
+                  :placeholder="'确认单购买方公司名称'"
+                  @end="searchChange1"
+                  :type="'1'"
+                  :size="searchSize"
+                />
+              </el-col>
+              <el-col :span="8" style="width: 470px">
+                <search-select
+                  :code="parmValue.a2"
+                  :placeholder="'采购单供应商名称'"
+                  @end="searchChange2"
+                  :type="'2'"
+                  :size="searchSize"
+                />
+              </el-col>
+            </el-col>
+          </el-row>
+        </div>
+      </template>
+      <template #status="{ scope }">
+        <el-tag
+          :type="scope.row.status == '0' ? 'warning' : ''"
+          :size="size"
+          v-text="
+            (statusOptions.find((item) => item.id == scope.row.status) || {})
+              .label || '--'
+          "
+        ></el-tag>
+      </template>
+      <template #operation="{ scope }">
+        <!-- v-if="powers.some((item) => item == '007')" -->
+        <el-tooltip effect="dark" content="详情" placement="top">
+          <i
+            class="el-icon-view tb-icon"
+            @click="openModal(scope.row.id, true)"
+          ></i>
+        </el-tooltip>
+        <!-- v-if="powers.some((item) => item == '007')" -->
+        <el-tooltip effect="dark" content="修改" placement="top">
+          <i
+            class="el-icon-edit tb-icon"
+            @click="openModal(scope.row.companyNo, false)"
+          ></i>
+        </el-tooltip>
+
+        <el-tooltip effect="dark" content="作废" placement="top">
+          <i
+            class="el-icon-video-pause tb-icon"
+            @click="statusConfirm(scope.row.companyNo, scope.row.status)"
+          ></i>
+        </el-tooltip>
+      </template>
+    </ex-table>
+    <no-auth v-else></no-auth>
+    <!-- 弹窗 新增/修改 -->
+    <add-edit
+      :id="modelId"
+      :show-model="showModel"
+      :is-detail="isDetail"
+      :contector="contector"
+      :name="name"
+      @refresh="searchList"
+      @cancel="showModel = false"
+    />
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/network/orderEntry";
+import ExTable from "@/components/ExTableNew.vue";
+import mixinPage from "@/mixins/elPaginationHandle";
+import addEdit from "./addEdit";
+import PeriodDatePicker from "@/components/PeriodDatePicker";
+import { mapGetters } from "vuex";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "orderEntry",
+  components: {
+    ExTable,
+    addEdit,
+    PeriodDatePicker,
+  },
+  mixins: [mixinPage, resToken],
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "orderEntry"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+
+  data() {
+    return {
+      select: "1",
+      input: "",
+      isDetail: false,
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      pickerOptions: {
+        // disabledDate是一个函数,参数是当前选中的日期值,这个函数需要返回一个Boolean值,
+        disabledDate(time) {
+          let date = new Date().valueOf();
+          const one = 1000 * 60 * 60 * 24;
+          date = parseInt(date / one) * one;
+          return time.getTime() <= date;
+        },
+      },
+      showModel: false,
+      loading: false,
+      modelId: 0,
+      parmValue: {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: [
+        {
+          prop: "companyNo",
+          label: "信息编号",
+          "min-width": "190px",
+        },
+        // {
+        //   prop: "company_name",
+        //   label: "单位名称",
+        // },
+        // {
+        //   prop: "company_license",
+        //   label: "纳税人识别号",
+        //   width: "190px",
+        // },
+        // {
+        //   prop: "bank_name",
+        //   label: "银行名称",
+        // },
+        // {
+        //   prop: "bankNo",
+        //   label: "银行卡号",
+        // },
+        // {
+        //   prop: "status",
+        //   label: "状态",
+        //   width: "90px",
+        //   _slot_: "status",
+        // },
+        // {
+        //   prop: "contector",
+        //   label: "联系人",
+        // },
+
+        // {
+        //   prop: "mobile",
+        //   label: "联系电话",
+        // },
+        // {
+        //   prop: "company_address",
+        //   label: "地址",
+        // },
+        // {
+        //   prop: "addtime",
+        //   label: "创建时间",
+        //   width: "160px",
+        //   sortable: true,
+        // },
+        {
+          prop: "",
+          label: "操作",
+          width: "120px",
+          fixed: "right",
+          _noset_: true,
+          _slot_: "operation",
+        },
+      ],
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+  methods: {
+    async searchList() {
+      this.loading = true;
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+    async searchChange1(e) {
+      this.parmValue.a1 = JSON.parse(JSON.stringify(e));
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async searchChange2(e) {
+      this.parmValue.a2 = JSON.parse(JSON.stringify(e));
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async timeReturned(e) {
+      if (e.startTime !== "") {
+        this.parmValue.starttime = e.startTime;
+      } else {
+        this.parmValue.starttime = "";
+      }
+
+      if (e.endTime !== "") {
+        this.parmValue.endtime = e.endTime;
+      } else {
+        this.parmValue.endtime = "";
+      }
+      if (this.parmValue.starttime !== "" && this.parmValue.endtime !== "") {
+        this.parmValue.page = 1;
+        await this.searchList();
+      }
+    },
+    openModal(id, isDetail) {
+      this.showModel = true;
+      this.modelId = id;
+      this.isDetail = isDetail;
+    },
+    async statusConfirm(id, status) {
+      await this.$confirm(`确定要改为${status === "1" ? "禁用" : "启用"}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            companyNo: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.loading = false;
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.orderEntry {
+  background: rgba(242, 242, 242, 1);
+  min-height: 100%;
+  width: 100%;
+  height: 100%;
+  // background-color: $bg;
+  overflow: hidden;
+
+  // position: absolute;
+  z-index: 2;
+  background: #fff;
+  .change {
+    .title {
+      border-width: 0px;
+      width: 100%;
+      height: 100px;
+      // display: flex;
+      font-weight: 400;
+      font-style: normal;
+      font-size: 22px;
+      text-align: left;
+      padding: 0;
+      padding: 60px 0 0 100px;
+      width: 100%;
+      box-sizing: border-box;
+    }
+  }
+}
+</style>

+ 0 - 0
src/views/network/orderEntry/网络订单录入


+ 83 - 45
src/views/purchase/orderRecord/components/addView.vue

@@ -96,12 +96,12 @@
                       step-strictly
                       class="fl"
                       controls-position="right"
-                      style="width: 120px"
+                      style="width: 210px"
                       v-model="v.num"
-                      :precision="0"
-                      :step="1"
+                      :precision="2"
+                      :step="0.01"
                       :min="0"
-                      :max="100"
+                      :max="99999999"
                     ></el-input-number>
                   </div>
                 </li>
@@ -112,11 +112,11 @@
                 <li class="fl" style="margin: 0 0 10px 0">
                   <el-input
                     class="fl"
-                    style="width: 145px"
+                    style="width: 193px"
                     disabled
                     v-model="scaleTotal"
                   >
-                    <template slot="append">%</template>
+                    <template slot="append"></template>
                   </el-input>
                 </li>
               </ul>
@@ -211,15 +211,14 @@
                 max-height="320"
                 style="width: 100%"
               >
-                    <el-table-column
-                    prop="cgdNO"
-                    label="采购单编号"
-                    width="135"
-                     fixed="left"
-                    show-overflow-tooltip
-                  />
+                <el-table-column
+                  prop="cgdNO"
+                  label="采购单编号"
+                  width="135"
+                  fixed="left"
+                  show-overflow-tooltip
+                />
                 <el-table-column label="采购单信息" align="center">
-            
                   <el-table-column
                     prop="purchasePrice"
                     label="货款"
@@ -436,7 +435,7 @@
                   prop="taxPoint1"
                   label="新税率"
                   fixed="right"
-                    width="60"
+                  width="60"
                   show-overflow-tooltip
                 />
                 <el-table-column
@@ -559,10 +558,10 @@ export default {
         inv_rate: "",
         scale: [
           {
-            num: 50,
+            num: 0,
           },
           {
-            num: 50,
+            num: 0,
           },
         ],
         goodList: [],
@@ -672,10 +671,16 @@ export default {
       if (index !== -1) {
         key = this.ratelist[index].rateName;
       }
-      this.ruleForm.goodList.forEach((v2, i2) => {
-        v2.taxPoint1 = key;
-        this.$set(this.ruleForm.goodList, i2, v2);
-      });
+      if (
+        this.ruleForm &&
+        this.ruleForm.goodList &&
+        this.ruleForm.goodList.length > 0
+      ) {
+        this.ruleForm.goodList.forEach((v2, i2) => {
+          v2.taxPoint1 = key;
+          this.$set(this.ruleForm.goodList, i2, v2);
+        });
+      }
     },
     selectChange(val) {
       if (val) {
@@ -726,7 +731,7 @@ export default {
       this.ruleForm.scale.forEach((v1) => {
         str += v1.num;
       });
-      this.scaleTotal = str;
+      this.scaleTotal = parseFloat(parseFloat(str + "").toFixed(2));
       //.toFixed(2);
     },
     async goodsReshList(e) {
@@ -876,27 +881,40 @@ export default {
     async initData() {
       const res = await asyncRequest.detail({ sid: this.id });
       if (res && res.code === 0) {
-        const data = res.data;
+        const {
+          name,
+          contector,
+          pay_method,
+          list,
+          inv_rate,
+          return_img,
+          supplierNo,
+          pay_rate,
+        } = res.data;
+        let reastr = pay_rate;
+        let reaList = reastr.split(",");
+        let lista = [];
+        reaList.forEach((v1) => {
+          v1 = v1.replace(/\[/g, "");
+          v1 = v1.replace(/\]/g, "");
+          let item = {
+            num: parseFloat(v1),
+          };
+          lista.push(item);
+        });
         this.ruleForm = {
           id: this.id,
-          name: [data.name + "-----" + data.contector],
+          name: [name + "-----" + contector],
           account: [
-            data.pay_method === "1" || data.pay_method === "2" ? "X" : "Y",
-            data.pay_method,
-          ],
-          scale: [
-            {
-              num: 50,
-            },
-            {
-              num: 50,
-            },
+            pay_method === "1" || pay_method === "2" ? "X" : "Y",
+            pay_method,
           ],
-          goodList: data.list,
-          inv_rate: data.inv_rate,
-          return_img: Array.isArray(data.return_img) ? data.return_img : [],
+          scale: lista,
+          goodList: list,
+          inv_rate: inv_rate,
+          return_img: Array.isArray(return_img) ? return_img : [],
         };
-        this.supplierNo = [data.supplierNo];
+        this.supplierNo = [supplierNo];
         this.handleChange(this.ruleForm.account);
         this.formatGoodList();
         this.inv_rateChange();
@@ -919,7 +937,7 @@ export default {
             name: [],
             scale: [
               {
-                num: 50,
+                num: 0,
               },
             ],
             goodList: [],
@@ -934,7 +952,7 @@ export default {
         this.show = true;
         if (this.ruleForm.scale.length === 1) {
           this.ruleForm.scale.push({
-            num: 100 - this.ruleForm.scale[0].num,
+            num: 0,
           });
         }
         this.scaleChange();
@@ -947,18 +965,38 @@ export default {
       console.log(index);
       this.ruleForm.goodList.splice(index, 1);
     },
+    setNum(s) {
+      return s ? parseFloat(s + "").toFixed(2) : "-";
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
+          let listTotal = 0;
+          this.ruleForm.goodList.forEach((v1) => {
+            console.log(v1.purchasePrice);
+            console.log(v1.purchasePrice * 1);
+            listTotal += v1.purchasePrice * 1;
+            listTotal =
+              listTotal === 0 ? 0 : parseFloat(this.setNum(listTotal));
+          });
+          console.log(this.scaleTotal, listTotal);
+          // console.log(listTotal);
           const obj = JSON.parse(JSON.stringify(this.ruleForm));
           if (obj.account[obj.account.length - 1] !== "2") {
-            this.scaleTotal = 100;
-            obj.scale = [{ num: 100 }];
+            this.scaleTotal = listTotal;
+            obj.scale = [{ num: listTotal }];
           }
-          if (this.scaleTotal !== 100) {
-            this.$message.error("自定义比例和必须为100%!");
+          if (
+            obj.account[obj.account.length - 1] === "2" &&
+            this.scaleTotal !== listTotal
+          ) {
+            this.$message.warning("自定义金额比例总数与货款总数不一致!");
             return;
           }
+          // if (this.scaleTotal !== 100) {
+          //   this.$message.error("自定义比例和必须为100%!");
+          //   return;
+          // }
 
           let isok = true;
           obj.scale.forEach((v1) => {
@@ -966,7 +1004,7 @@ export default {
               isok = false;
             }
           });
-          if (!isok) {
+          if (!isok && obj.account[obj.account.length - 1] === "2") {
             this.$message.error("自定义比例不能出现0!");
             return;
           }

+ 21 - 20
src/views/purchase/orderRecord/index.vue

@@ -714,47 +714,48 @@ export default {
         {
           prop: "total_fee",
           label: "总货款",
-          sortable: true,
+          // sortable: true,
           width: "110px",
         },
         {
           prop: "pay_fee",
           label: "已付款金额",
-          sortable: true,
+          // sortable: true,
           width: "110px",
         },
         {
           prop: "wait_fee",
           label: "待付款金额",
-          sortable: true,
+          // sortable: true,
           width: "110px",
         },
         {
-          prop: "ainv_fee",
+          prop: "inv_fee",
           label: "已回票金额",
-          sortable: true,
-          width: "110px",
-        },
-        {
-          prop: "winv_fee",
-          label: "待回票金额",
-          sortable: true,
+          // sortable: true,
           width: "110px",
         },
+        // {
+        //   prop: "winv_fee",
+        //   label: "待回票金额",
+        //   sortable: true,
+        //   width: "110px",
+        // },
         {
           prop: "dpay_fee",
           label: "申请金额",
-          sortable: true,
+          // sortable: true,
           width: "100px",
         },
         {
           prop: "pay_stages",
           label: "当期期数",
+           width: "70px",
         },
-        {
-          prop: "pay_rate",
-          label: "支付比率",
-        },
+        // {
+        //   prop: "pay_rate",
+        //   label: "支付比率",
+        // },
 
         {
           prop: "pay_status",
@@ -771,7 +772,7 @@ export default {
         {
           prop: "addtime",
           label: "申请时间",
-          sortable: true,
+          // sortable: true,
           width: "140px",
         },
 
@@ -779,7 +780,7 @@ export default {
           prop: "",
           label: "操作",
           fixed: "right",
-          _noset_: true,
+          // _noset_: true,
           width: "96px",
           _slot_: "operation",
         },
@@ -1012,8 +1013,8 @@ export default {
           v1.pay_fee = parseFloat(v1.pay_fee + "").toFixed(2);
           v1.wait_fee = parseFloat(v1.wait_fee + "").toFixed(2);
           v1.dpay_fee = parseFloat(v1.dpay_fee + "").toFixed(2);
-          v1.ainv_fee = parseFloat(v1.ainv_fee + "").toFixed(2);
-          v1.winv_fee = parseFloat(v1.winv_fee + "").toFixed(2);
+          v1.inv_fee = parseFloat(v1.inv_fee + "").toFixed(2);
+          // v1.winv_fee = parseFloat(v1.winv_fee + "").toFixed(2);
           v1.dtype = this.setDtype(v1.dstatus);
           v1.ptype = this.setPtype(v1.pay_status);
           v1.delType = this.setDeltype(v1.dstatus, v1.pay_status);

+ 16 - 8
src/views/search/standBook/index.vue

@@ -22,7 +22,7 @@
           </el-select>
         </el-col>
         <el-col :span="6" style="width: 292px">
-            <period-date-picker
+          <period-date-picker
             :start="parmValue.start"
             :end="parmValue.end"
             :type="2"
@@ -97,6 +97,10 @@ export default {
   data() {
     return {
       options: [
+        {
+          value: "6",
+          label: "应收台账",
+        },
         {
           value: "1",
           label: "确认单台账",
@@ -119,31 +123,33 @@ export default {
           label: "退货台账",
         },
       ],
-      value: "1",
+      value: "6",
 
       loading: false,
 
       fileUrl: urlConfig.baseURL + "Admin/",
       parmValue: {
-        start:"",
-        end:"",
+        start: "",
+        end: "",
       },
       // 表格 - 数据
       tableData: [],
     };
   },
-  mounted() {},
+  mounted() {
+    this.restSearch();
+  },
   methods: {
     restSearch() {
       // console.log("123456789");
-      this.value = "1";
+      this.value = "6";
       this.parmValue = {
         starttime: "",
         endtime: "",
       };
     },
 
-     async timeReturned(e) {
+    async timeReturned(e) {
       if (e.startTime !== "") {
         this.parmValue.start = e.startTime;
       } else {
@@ -176,8 +182,10 @@ export default {
           url = "downreportcgdtz";
         } else if (this.value === "4") {
           url = "downreportcgd";
-        } else {
+        } else if (this.value === "5") {
           url = "downreportthtz";
+        } else {
+          url = "downreportcwtz";
         }
         this.loading = true;
 

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