Browse Source

国内修改完善

lichao 3 years ago
parent
commit
d4e54fbbf2

+ 14 - 0
src/views/businessManagement/deliveryNotice/configuration/customerContact.json

@@ -117,6 +117,20 @@
         }
       ]
     },{
+      "label": "重量(kg)",
+      "prop": "invoiceWeight",
+      "index": 5,
+      "width":100,
+      "cell": true,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入包装要求",
+          "trigger": "blur"
+        }
+      ]
+    },{
       "label": "出库数量",
       "prop": "actualQuantity",
       "index": 6,

+ 1 - 0
src/views/businessManagement/inventoryAccount/index.vue

@@ -124,6 +124,7 @@ export default {
       window.console.log(column);
       this.excelBox = false;
       this.page.currentPage = 1;
+      this.$message.warning(res)
       this.onLoad(this.page);
       loading()
       done();

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

@@ -14,10 +14,15 @@
           @click="detailData.seeDisabled = false"
           type="primary"
         >编辑</el-button>
+        <el-button type="primary"
+                   size="small"
+                   :disabled="true"
+                   @click.stop="">请核
+        </el-button>
         <el-button
           size="small"
           class="el-button--small-yh"
-          :disabled="detailData.seeDisabled || !this.form.id"
+          :disabled="detailData.seeDisabled || !form.id"
           type="warning"
           @click="applyPayment('申请')"
         >
@@ -26,6 +31,7 @@
         <el-button type="info"
                    size="small"
                    @click="openApplicationDialog"
+                   :disabled="!form.id"
         >查看申请记录
         </el-button>
         <el-button type="warning"
@@ -40,8 +46,6 @@
           @click="copyOrder"
           :disabled="detailData.seeDisabled || !this.form.id"
         >
-
-
           复制新单
         </el-button>
         <el-button
@@ -637,7 +641,7 @@ export default {
             ]
           }, {
             label: '预估运费',
-            prop: 'oceanFreight',
+            prop: 'predictOceanFreight',
             type: 'number',
             rules: [
               {

+ 114 - 46
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -14,6 +14,11 @@
           @click="detailData.seeDisabled = false"
           type="primary"
         >编辑</el-button>
+        <el-button type="primary"
+                   size="small"
+                   :disabled="true"
+                   @click.stop="">请核
+        </el-button>
         <el-button
           class="el-button--small-yh"
           type="warning"
@@ -164,6 +169,7 @@
               @selection-change="productSelection"
               @row-del="rowDel"
               @saveColumn="saveColumn('goods')"
+              :summary-method="summaryMethod"
           >
             <template slot="corpId" slot-scope="{ row, index }">
               <customer-dialog
@@ -1070,7 +1076,7 @@ export default {
           {
             label: '发货地址',
             prop: 'shippingAddress',
-            disabled: true,
+            disabled: false,
             rules: [
               {
                 required: true,
@@ -1163,7 +1169,7 @@ export default {
             ]
           }, {
             label: '预估运费',
-            prop: 'oceanFreight',
+            prop: 'predictOceanFreight',
             type: 'number',
             rules: [
               {
@@ -1254,7 +1260,7 @@ export default {
     this.$set(this.form, 'orderStatus', '录入')
     this.$set(this.form, 'overPayment', 0)
     this.$set(this.form, 'orderAmount', 0)
-    this.$set(this.form, 'oceanFreight', 0)
+    this.$set(this.form, 'predictOceanFreight', 0)
     if (this.detailData.id) {
       this.queryData(this.detailData.id)
     }
@@ -1758,6 +1764,7 @@ export default {
             this.$set(this.tableData[item], 'orderQuantity', 0)
             this.$set(this.tableData[item], 'actualQuantity', 0)
             this.$set(this.tableData[item], 'purchaseAmount', '0')
+            this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight)
             getMarketPrice({code: this.tableData[item].code}).then(res => {
               if (res.data.data.length > 0) {
                 this.$set(this.tableData[item], 'price', res.data.data[0].salesPrice)
@@ -1873,64 +1880,87 @@ export default {
     //导入商品政策
     importPolicy() {
       let list = this.deepClone(this.policyData.concat(this.policyDataTwo))
+      let listLength = this.policyDataTwo.length
       // 买赠额外加一条
       let buyFree = []
       if (this.policyDataTwo.length > 0) {
         buyFree = this.deepClone(this.policyDataTwo)
       }
       for (let item in list) {
+        if (this.policyData.length > 0) {
+          if (!list[item].specialOffer) {
+            getMarketPrice({code: list[item].code}).then(response => {
+              if (response.data.data.length > 0) {
+                this.$set(list[item], 'price', response.data.data[0].salesPrice)
+              } else {
+                this.$set(list[item], 'price', '0')
+              }
+            })
+          } else {
+            this.$set(list[item], 'price', list[item].specialOffer)
+          }
+        } else {
+          if (!list[item].salesPrice) {
+            getMarketPrice({code: list[item].code}).then(response => {
+              if (response.data.data.length > 0) {
+                this.$set(list[item], 'price', response.data.data[0].salesPrice)
+              } else {
+                this.$set(list[item], 'price', '0')
+              }
+            })
+          } else {
+            this.$set(list[item], 'price', list[item].salesPrice)
+          }
+          this.$set(buyFree[item], 'price', '0')
+          this.$set(buyFree[item], 'orderQuantity',  list[item].salesVolume)
+          this.$set(buyFree[item], 'itemType',  list[item].typeno)
+        }
         selectGoodsNum({
           goodsId: list[item].itemId,
           itemType: list[item].typeno
         }).then(res => {
           this.$set(list[item], 'storageQuantity', res.data.data)
-          if (this.policyDataTwo.length > 0) {
+          if (listLength != 0) {
             this.$set(buyFree[item], 'storageQuantity', res.data.data)
           }
-        })
-        if (this.policyData.length > 0) {
-          this.$set(list[item], 'price', list[item].specialOffer)
-        } else {
-          this.$set(list[item], 'price', list[item].salesPrice)
-          this.$set(buyFree[item], 'price', '0')
-          this.$set(buyFree[item], 'orderQuantity',  list[item].salesVolume)
-          this.$set(buyFree[item], 'itemType',  list[item].typeno)
-        }
-        this.$set(list[item], 'itemType',  list[item].typeno)
-        this.$set(list[item], 'actualQuantity', 0)
-        this.$set(list[item], 'orderQuantity', 0)
-        this.$set(list[item], 'amount', 0)
-        this.$set(list[item], 'priceCategory', list[item].productCategory)
-        this.$set(list[item], 'priceType', this.policyForm.cname)
-        this.$set(list[item], 'cname', list[item].productCategory)
-        this.$set(list[item], 'sort', this.maxGoodsNum + 1)
-        this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
 
-        if (this.policyDataTwo.length > 0) {
-          this.$set(buyFree[item], 'actualQuantity', 0)
-          this.$set(buyFree[item], 'amount', 0)
-          this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
-          this.$set(buyFree[item], 'priceType', this.policyForm.cname)
-          this.$set(buyFree[item], 'cname', list[item].productCategory)
-          this.$set(buyFree[item], 'sort', this.maxGoodsNum + 2)
-          this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
+          this.$set(list[item], 'itemType',  list[item].typeno)
+          this.$set(list[item], 'actualQuantity', 0)
+          this.$set(list[item], 'orderQuantity', 0)
+          this.$set(list[item], 'amount', 0)
+          this.$set(list[item], 'priceCategory', list[item].productCategory)
+          this.$set(list[item], 'priceType', this.policyForm.cname)
+          this.$set(list[item], 'cname', list[item].productCategory)
+          this.$set(list[item], 'sort', this.maxGoodsNum + 1)
+          this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
+
+          if (listLength != 0) {
+            this.$set(buyFree[item], 'actualQuantity', 0)
+            this.$set(buyFree[item], 'orderQuantity', 0)
+            this.$set(buyFree[item], 'amount', 0)
+            this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
+            this.$set(buyFree[item], 'priceType', this.policyForm.cname)
+            this.$set(buyFree[item], 'cname', list[item].productCategory)
+            this.$set(buyFree[item], 'sort', this.maxGoodsNum + 2)
+            this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
+            this.maxGoodsNum++
+          }
+          delete list[item].id
+          delete list[item].pid
+          delete list[item].isDeleted
+          delete list[item].status
+          delete list[item].tenantId
+          delete list[item].updateTime
+          delete list[item].updateUser
+          delete list[item].updateUserName
           this.maxGoodsNum++
-        }
-        delete list[item].id
-        delete list[item].pid
-        delete list[item].isDeleted
-        delete list[item].status
-        delete list[item].tenantId
-        delete list[item].updateTime
-        delete list[item].updateUser
-        delete list[item].updateUserName
-        this.maxGoodsNum++
-        this.$refs.crudContact.rowCellAdd(list[item]);
-        // this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
-        if (this.policyDataTwo.length > 0) {
-          this.$refs.crudContact.rowCellAdd(buyFree[item]);
-        }
-        // this.$refs.crudContact.rowCell(buyFree[item], this.contactsData.length - 1)
+          this.$refs.crudContact.rowCellAdd(list[item]);
+          // this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
+          if (listLength != 0) {
+            this.$refs.crudContact.rowCellAdd(buyFree[item]);
+          }
+          // this.$refs.crudContact.rowCell(buyFree[item], this.contactsData.length - 1)
+        })
       }
       this.policyDialog = false
     },
@@ -2311,6 +2341,44 @@ export default {
         this.$set(this.form, 'accountBank', null)
       }
     },
+    // 合计计算
+    summaryMethod({ columns, data }) {
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((item, index) => {
+          sums[0] = '合计'
+          if (
+            item.property == "amount" ||
+            item.property == "orderQuantity" ||
+            item.property == "actualQuantity"
+          ) {
+            let amountSum = 0;
+            let orderQuantitySum = 0;
+            let actualQuantitySum = 0;
+            if (this.selection.length > 0) {
+              this.selection.forEach(e => {
+                amountSum = _.add(amountSum, Number(e.amount));
+                orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
+                actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
+              })
+            };
+            // 订货数量合计
+            if (item.property == "orderQuantity") {
+              sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(2) : "0.00";
+            }
+            // 发货数量合计
+            if (item.property == "actualQuantity") {
+              sums[index] = actualQuantitySum ? actualQuantitySum.toFixed(2) : "0.00";
+            }
+            // 金额合计
+            if (item.property == "amount") {
+              sums[index] = amountSum ? amountSum.toFixed(2) : "0.00";
+            }
+          }
+        })
+      }
+      return sums;
+    },
   }
 }
 </script>

+ 3 - 3
src/views/businessManagement/salesOrder/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <basic-container
-      v-if="isShow">
+      v-show="isShow">
       <avue-crud :option="option"
                  :data="dataList"
                  ref="crud"
@@ -91,7 +91,7 @@
       ref="detail"
       @goBack="goBack"
       :detailData="detailData"
-      v-else
+      v-if="!isShow"
     ></detail-page>
   </div>
 </template>
@@ -337,6 +337,7 @@ export default {
         params.createTimeEnd = params.createTime[1]+ " " + "23:59:59"
         this.$delete(params,'createTime')
       }
+      console.log(this.search)
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done()
@@ -412,7 +413,6 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.isShow = true;
-      // this.searchChange(this.search)
     },
   }
 }