Procházet zdrojové kódy

国内贸易修改

lichao před 3 roky
rodič
revize
b1102a7c3b

+ 5 - 3
src/views/businessManagement/deliveryNotice/configuration/mainList.json

@@ -58,7 +58,7 @@
             "search": true,
             "index": 4,
             "width":100,
-          "overHidden": true
+            "overHidden": true
         },{
             "label": "匹配订单号",
             "prop": "srcOrderNo",
@@ -99,7 +99,8 @@
             "prop": "businessDate",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
             "type": "date",
             "unlinkPanels": true,
@@ -110,7 +111,8 @@
             "prop": "createTime",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         }
     ]
 }

+ 40 - 24
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -274,6 +274,7 @@ import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/basicFeesDesc";
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 
 export default {
   name: "detailsPage",
@@ -680,16 +681,19 @@ export default {
             delete item.id
             delete item.pid
           })
+          this.form.deliveryStatus == '录入'
         }
       });
     },
     // 出库数量变化时调用
     actualQuantityChange(row) {
-      row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
-      this.contactsData.forEach(item => {
-        this.form.deliveryAmount += Number(item.deliveryAmount)
-        this.form.totalQuantity += Number(item.actualQuantity)
-      })
+      if (row.scale) {
+        row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+        this.contactsData.forEach(item => {
+          this.form.deliveryAmount += Number(item.deliveryAmount)
+          this.form.totalQuantity += Number(item.actualQuantity)
+        })
+      }
     },
     // 类别变换时触发
     warehouseTreeChange(id) {
@@ -731,6 +735,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //点击费用明细选择触发
@@ -755,6 +760,12 @@ export default {
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
+        selectGoodsNum({
+          goodsId: this.tableData[0].id,
+          typeno: this.tableData[0].specs
+        }).then(res => {
+          this.contactsData[this.choiceIndexT].storageQuantity =  res.data.data
+        })
       }
       this.dialogVisible = !this.dialogVisible
       this.commodityData = false
@@ -794,27 +805,32 @@ export default {
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
           console.log(this.tableData[item])
-          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$set(this.tableData[item], 'inventoryNumber', 0)
-          this.$set(this.tableData[item], 'actualQuantity', 0)
-          this.$set(this.tableData[item], 'inventoryAmount', 0)
-          this.$set(this.tableData[item], 'deliveryAmount', 0)
-          this.tableData[item].price = 0
-          this.tableData[item].amount = 0
-          this.tableData[item].sort = this.maxGoodsNum + 1
-          this.maxGoodsNum++
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          console.log(this.contactsData)
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          selectGoodsNum({
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }).then(res =>{
+            this.tableData[item].storageQuantity =  res.data.data
+            this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+            this.tableData[item].itemId = this.tableData[item].id
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            delete this.tableData[item].goodsTypeName
+            delete this.tableData[item].id
+            delete this.tableData[item].status
+            delete this.tableData[item].isDeleted
+            this.$set(this.tableData[item], 'inventoryNumber', 0)
+            this.$set(this.tableData[item], 'actualQuantity', 0)
+            this.$set(this.tableData[item], 'inventoryAmount', 0)
+            this.$set(this.tableData[item], 'deliveryAmount', 0)
+            this.tableData[item].price = 0
+            this.tableData[item].amount = 0
+            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.maxGoodsNum++
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            console.log(this.contactsData)
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          })
         }
       }
-      this.tableData = []
       this.dialogVisible = false
     },
     closeGoods() {

+ 36 - 0
src/views/businessManagement/deliveryNotice/index.vue

@@ -118,6 +118,42 @@ export default {
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(20), option);
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
+    }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   activated() {
     setTimeout(() => {

+ 4 - 2
src/views/businessManagement/purchaseOrder/configuration/mainList.json

@@ -83,7 +83,8 @@
             "valueFormat": "yyyy-MM-dd",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
           "label": "合同日期",
           "type": "date",
@@ -95,7 +96,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         }
     ]
 }

+ 8 - 2
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -671,7 +671,7 @@ export default {
         }
         this.configuration.dicData = this.form.corpsName
         let feesData = []
-        this.form.orderFeesList.forEach(item => {
+        this.advantageProjectData.forEach(item => {
           let a = {
             cname: item.corpName,
             id: item.corpId
@@ -772,7 +772,7 @@ export default {
         orderItemIds: lsit
       }
       generateShipment(data).then(res => {
-        console.log(res.data.data)
+        this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
         this.$router.push({
           path: "/businessManagement/receipt/index",
           query: {form: JSON.stringify(res.data.data)},
@@ -839,6 +839,12 @@ export default {
         this.contactsData[this.choiceIndexT].orderQuantity = 0
         this.contactsData[this.choiceIndexT].price = 0
         this.contactsData[this.choiceIndexT].amount = 0
+        selectGoodsNum({
+          goodsId: this.tableData[0].id,
+          typeno: this.tableData[0].specs
+        }).then(res => {
+          this.contactsData[this.choiceIndexT].storageQuantity =  res.data.data
+        })
       }
       this.dialogVisible = !this.dialogVisible
       this.commodityData = false

+ 37 - 0
src/views/businessManagement/purchaseOrder/index.vue

@@ -113,6 +113,43 @@ export default {
   async created() {
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(17), option);
+    console.log(this.option.column.length)
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
+    }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)

+ 6 - 3
src/views/businessManagement/receipt/configuration/mainList.json

@@ -101,7 +101,8 @@
             "prop": "businessDate",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
             "type": "date",
             "unlinkPanels": true,
@@ -112,7 +113,8 @@
             "prop": "createTime",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
           "label": "合同日期",
           "type": "date",
@@ -124,7 +126,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         }
     ]
 }

+ 48 - 21
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -275,7 +275,7 @@ import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree, customerList,getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
-import {revokeOutGoods} from "../../../api/basicData/deliveryNotice";
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 
 export default {
   name: "detailsPage",
@@ -587,6 +587,7 @@ export default {
       this.$set(this.form, 'totalQuantity', 0)
       this.$set(this.form, 'purchaseAmount', 0)
       this.contactsData.forEach(item => {
+        this.$set(item, "inventoryNumber", item.storageQuantity)
         this.$set(item, "srcId", item.id)
         this.$set(item, "deliveryAmount", item.amount)
         this.$set(item, "actualQuantity", (Number(item.purchaseQuantity) - Number(item.actualQuantity)))
@@ -595,6 +596,8 @@ export default {
         this.form.deliveryAmount += Number(item.deliveryAmount)
         this.form.totalQuantity += Number(item.actualQuantity)
         this.form.purchaseAmount += Number(item.deliveryAmount)
+        this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
+        this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
         delete item.id
         delete item.pid
       })
@@ -614,8 +617,8 @@ export default {
         this.bankOfDepositData = this.form.deliveryFilesList
         this.configuration.dicData = this.form.corpName
         this.contactsData.forEach(item => {
-          this.form.deliveryAmount += Number(item.deliveryAmount)
-          this.form.totalQuantity += Number(item.actualQuantity)
+          // this.form.deliveryAmount += Number(item.deliveryAmount)
+          // this.form.totalQuantity += Number(item.actualQuantity)
           // 入库金额和入库数量的比例
           this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
         })
@@ -676,6 +679,7 @@ export default {
             delete item.id
             delete item.pid
           })
+          form.deliveryStatus == '录入'
         }
       });
     },
@@ -684,7 +688,9 @@ export default {
     },
     // 入库数量变化时调用
     actualQuantityChange(row) {
-      row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+      if (row.scale) {
+        row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+      }
     },
     // 类别变换时触发
     warehouseTreeChange(id) {
@@ -726,6 +732,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //点击费用明细选择触发
@@ -750,6 +757,12 @@ export default {
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
+        selectGoodsNum({
+          goodsId: this.tableData[0].id,
+          typeno: this.tableData[0].specs
+        }).then(res => {
+          this.contactsData[this.choiceIndexT].storageQuantity =  res.data.data
+        })
       }
       this.dialogVisible = !this.dialogVisible
       this.commodityData = false
@@ -789,25 +802,29 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
-          this.$set(this.tableData[item], 'purchaseQuantity', 0)
-          this.$set(this.tableData[item], 'actualQuantity', 0)
-          this.$set(this.tableData[item], 'purchaseAmount', 0)
-          this.$set(this.tableData[item], 'deliveryAmount', 0)
-          this.tableData[item].sort = this.maxGoodsNum + 1
-          this.maxGoodsNum++
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          selectGoodsNum({
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }).then(res => {
+            this.tableData[item].storageQuantity =  res.data.data
+            this.tableData[item].itemId = this.tableData[item].id
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            delete this.tableData[item].goodsTypeName
+            delete this.tableData[item].id
+            delete this.tableData[item].status
+            delete this.tableData[item].isDeleted
+            this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+            this.$set(this.tableData[item], 'purchaseQuantity', 0)
+            this.$set(this.tableData[item], 'actualQuantity', 0)
+            this.$set(this.tableData[item], 'purchaseAmount', 0)
+            this.$set(this.tableData[item], 'deliveryAmount', 0)
+            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.maxGoodsNum++
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          })
         }
       }
-      this.tableData = []
       this.dialogVisible = false
     },
     closeGoods() {
@@ -1058,6 +1075,16 @@ export default {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.form.deliveryAmount = 0
+          this.form.totalQuantity = 0
+          this.form.purchaseAmount = 0
+          this.contactsData.forEach(item => {
+            this.form.deliveryAmount += Number(item.deliveryAmount)
+            this.form.totalQuantity += Number(item.actualQuantity)
+            this.form.purchaseAmount += Number(item.deliveryAmount)
+            this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
+            this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
+          })
           //商品信息
           this.form.deliveryItemsList = this.contactsData
           this.form.deliveryFeesList = this.advantageProjectData

+ 36 - 0
src/views/businessManagement/receipt/index.vue

@@ -91,6 +91,42 @@ export default {
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(23), option);
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
+    }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   activated() {
     setTimeout(() => {

+ 7 - 4
src/views/businessManagement/salesOrder/configuration/mainList.json

@@ -125,7 +125,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         },
         {
             "label": "要求发货日期",
@@ -138,7 +139,8 @@
             "width":100,
             "format": "yyyy-MM-dd",
             "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+            "overHidden": true,
+            "pickerOptions": {}
       },{
             "label": "要求到货日期",
             "type": "date",
@@ -150,14 +152,15 @@
             "width":100,
             "format": "yyyy-MM-dd",
             "valueFormat": "yyyy-MM-dd",
-        "overHidden": true
+            "overHidden": true,
+            "pickerOptions": {}
       },{
             "label": "公司户头",
             "prop": "banksAccountName",
             "search": true,
             "index": 8,
             "width":100,
-        "overHidden": true
+            "overHidden": true
         }
     ]
 }

+ 13 - 4
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -1082,9 +1082,12 @@ export default {
           })
         }
         let goodsNum = []
+        let purchaseAmount = 0
         this.contactsData.forEach(item => {
           goodsNum.push(item.sort)
+          purchaseAmount += Number(item.purchaseAmount)
         })
+        this.form.grossProfitRate = (((Number(this.form.grossProfit) - Number(purchaseAmount)) / Number(this.form.grossProfit)) * 100).toFixed()
         if (goodsNum.length == 0) {
           this.maxGoodsNum = 0;
         } else {
@@ -1093,6 +1096,7 @@ export default {
           })
         }
         if (isCopy) {
+          this.$set(this.form, 'orderStatus', '录入')
           delete this.form.id
           this.contactsData.forEach(item => {
             delete item.id
@@ -1184,7 +1188,7 @@ export default {
         orderItemIds: lsit
       }
       generateShipment(data).then(res => {
-        console.log(res.data.data)
+        this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
         this.$router.push({
           path: "/businessManagement/deliveryNotice/index",
           query: {form: JSON.stringify(res.data.data)},
@@ -1579,9 +1583,14 @@ export default {
             this.form.grossProfit += Number(item.amount)
           })
           // 计算毛利率
-          if (this.form.orderAmount) {
-            this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
-          }
+          // if (this.form.orderAmount) {
+          //   this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
+          // }
+          // 计算应收账款
+          this.$set(this.form, 'debitAmount', 0)
+          this.contactsData.forEach(item => {
+            this.form.debitAmount += Number(item.amount)
+          })
           //商品信息
           this.form.orderItemsList = this.contactsData
           this.form.orderFeesList = this.advantageProjectData

+ 37 - 2
src/views/businessManagement/salesOrder/index.vue

@@ -75,6 +75,7 @@
 import option from "./configuration/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/configuration"
 import detailPage from "./detailsPageEdit";
+import search from "../../../page/index/search";
 
 export default {
   name: "customerInformation",
@@ -112,11 +113,45 @@ export default {
   async created() {
     this.option = await this.getColumnData(this.getColumnName(14), option);
     if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
-      this.option.searchMenuSpan = 6;
-      this.option.searchMenuPosition = "center";
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
     }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   methods: {
+    // 获取日期
+    getDate() {},
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
       this.$confirm("确定将选择数据删除?", {