Prechádzať zdrojové kódy

国内发货单修改

lichao 3 rokov pred
rodič
commit
3b2d99f30c

+ 20 - 9
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -1245,8 +1245,7 @@ export default {
       this.removeRepeat()
     },
     //修改提交触发
-    editCustomer(isBack = false) {
-      console.log(this.form)
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           //商品信息
@@ -1267,6 +1266,23 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '发货') {
+              this.$nextTick(() => {
+                this.form.deliveryItemsList = this.contactsData
+                this.form.deliveryFeesList = this.advantageProjectData
+                this.form.deliveryFilesList = this.bankOfDepositData
+                if (typeof this.form.corpsTypeId == 'object') {
+                  this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+                }
+                this.pageLoading = true
+                sendOutGoods(this.form).then(res => {
+                  this.$message.success('发货成功')
+                  this.queryData(res.data.data.id)
+                }).finally(() => {
+                  this.pageLoading = false
+                })
+              })
+            }
           }).catch(() => {
             this.saveLoading = false
           })
@@ -1306,11 +1322,6 @@ export default {
           if (this.contactsData.length == 0) {
             return this.$message.error('商品信息为空')
           }
-          // for (let item in this.contactsData) {
-          //   if (!this.contactsData[item].id) {
-          //     return this.$message.error('有商品未保存,请先保存')
-          //   }
-          // }
           if (contrastObj(this.form, this.oldForm) ||
             contrastList(this.contactsData, this.oldGoodsList) ||
             contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1320,8 +1331,8 @@ export default {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
-            }).then(() => {
-              this.editCustomer(false)
+            }).then(async () => {
+              await this.editCustomer(false, '发货')
             }).catch(() => {
               this.$message.info('已取消')
             })

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

@@ -329,7 +329,6 @@ export default {
     onLoad(page, params) {
       if (this.search.businessDate.length > 0) {
         params = {
-          ...this.search,
           ...params,
           businessStartDate: this.search.businessDate[0]+ " " + "00:00:00",
           businessEndDate: this.search.businessDate[1]+ " " + "23:59:59",

+ 33 - 25
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -19,10 +19,15 @@
           class="el-button--small-yh"
           :disabled="detailData.seeDisabled || !this.form.id"
           type="warning"
-          @click="applyPayment"
+          @click="applyPayment('申请')"
         >
           申请货款
         </el-button>
+        <el-button type="warning"
+                   size="small"
+                   class="el-button--small-yh "
+                   @click.stop="applyPayment('收费')">退款
+        </el-button>
         <el-button
           size="small"
           class="el-button--small-yh"
@@ -30,6 +35,8 @@
           @click="copyOrder"
           :disabled="detailData.seeDisabled || !this.form.id"
         >
+
+
           复制新单
         </el-button>
         <el-button
@@ -823,7 +830,6 @@ export default {
       }, [])
     },
     getShipmentC() {
-      console.log(this.$store.getters.domTakeStatus)
       if (this.$store.getters.domTakeStatus) {
         this.$alert("收货单存在,请保存发货单再进行操作", "温馨提示", {
           confirmButtonText: "确定",
@@ -848,31 +854,15 @@ export default {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
-        }).then(() => {
-          this.editCustomer(false)
+        }).then(async () => {
+          await this.editCustomer(false, '收货')
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消'
           });
-          // this.selection.forEach(item => {
-          //   lsit.push(item.id)
-          // })
-          // // lsit.push(this.selection[item].id)
-          // let data = {
-          //   id: this.form.id,
-          //   orderItemIds: lsit
-          // }
-          // generateShipment(data).then(res => {
-          //   this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
-          //   this.$router.push({
-          //     path: "/businessManagement/receipt/index",
-          //     query: {form: JSON.stringify(res.data.data)},
-          //   });
-          // })
         })
       } else {
-        // lsit.push(this.selection[item].id)
         this.selection.forEach(item => {
           lsit.push(item.id)
         })
@@ -1232,7 +1222,7 @@ export default {
       this.removeRepeat()
     },
     //修改提交触发
-    editCustomer(isBack = false) {
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           for (let item in this.contactsData) {
@@ -1260,13 +1250,31 @@ export default {
             } else {
               this.queryData(res.data.data)
             }
+            if (type == '收货') {
+              let lsit = []
+              this.selection.forEach(item => {
+                lsit.push(item.id)
+              })
+              let data = {
+                id: this.form.id,
+                orderItemIds: lsit
+              }
+              generateShipment(data).then(res => {
+                this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
+                this.$router.push({
+                  path: "/businessManagement/receipt/index",
+                  query: {form: JSON.stringify(res.data.data)},
+                });
+              })
+            }
           })
         } else {
           return false;
         }
       });
     },
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       //采购明细提单号 list
       this.billData = {
         srcOrderno:this.form.srcOrderNo,
@@ -1279,12 +1287,12 @@ export default {
         taxRate: '0',
         accDate: this.form.businesDate,
       }
-      if(type){ //申请货款
+      if(bool){ //申请货款
         this.billData.srcId = -1
       }
     },
     //申请货款
-    applyPayment(){
+    applyPayment(type){
       // if (contrastObj(this.form, this.oldForm) ||
       //   contrastList(this.contactsData, this.oldGoodsList) ||
       //   contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1298,7 +1306,7 @@ export default {
       //     this.editCustomer();
       //   })
       // }else{
-        this.beforeBillData(true);
+        this.beforeBillData(true,type);
         this.applyPaymentDialog = true;
       // }
 

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

@@ -303,7 +303,6 @@ export default {
     onLoad(page, params) {
       if (this.search.requiredArrivalDate.length > 0) {
         params = {
-          ...this.search,
           ...params,
           requiredArrivalStartDate: this.search.requiredArrivalDate[0]+ " " + "00:00:00",
           requiredArrivalEndDate: this.search.requiredArrivalDate[1]+ " " + "23:59:59",

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

@@ -28,7 +28,7 @@
           @click="sendInGoods"
           size="small"
           v-if="form.deliveryStatus == '录入'"
-          :disabled="detailData.seeDisabled"
+          :disabled="detailData.seeDisabled || !this.form.id"
         >确认收货</el-button>
         <el-button
           class="el-button--small-yh"
@@ -1220,8 +1220,8 @@ export default {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
-            }).then(() => {
-              this.editCustomer(false)
+            }).then(async () => {
+              await this.editCustomer(false, '收货')
             }).catch(() => {
               this.$message.info('已取消')
             })
@@ -1270,7 +1270,7 @@ export default {
       });
     },
     //修改提交触发
-    editCustomer(isBack = false) {
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           this.form.deliveryAmount = 0
@@ -1300,6 +1300,23 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '收货') {
+              this.$nextTick(() => {
+                this.form.deliveryItemsList = this.contactsData
+                this.form.deliveryFeesList = this.advantageProjectData
+                this.form.deliveryFilesList = this.bankOfDepositData
+                if (typeof this.form.corpsTypeId == 'object') {
+                  this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+                }
+                this.pageLoading = true
+                sendInGoods(this.form).then(res => {
+                  this.$message.success('收货成功')
+                  this.queryData(res.data.data.id)
+                }).finally(() => {
+                  this.pageLoading = false
+                })
+              })
+            }
           })
         }
       });

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

@@ -332,7 +332,6 @@ export default {
     onLoad(page, params) {
       if (this.search.businessDate.length > 0) {
         params = {
-          ...this.search,
           ...params,
           businessStartDate: this.search.businessDate[0]+ " " + "00:00:00",
           businessEndDate: this.search.businessDate[1]+ " " + "23:59:59",

+ 2 - 0
src/views/businessManagement/salesOrder/configuration/mainList.json

@@ -20,6 +20,8 @@
   "searchIcon": true,
   "searchIndex": 2,
   "searchSpan": 8,
+  "expand": true,
+  "expandWidth": 38,
   "summaryText": "合计",
   "sumColumnList": [
     {

+ 47 - 37
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -19,10 +19,17 @@
           type="warning"
           :disabled="detailData.seeDisabled"
           size="small"
-          @click="applySettlement"
+          @click="applySettlement('收费')"
         >生成账单</el-button>
         <el-button
           class="el-button--small-yh"
+          type="warning"
+          :disabled="detailData.seeDisabled"
+          size="small"
+          @click="applySettlement('申请')"
+        >退款</el-button>
+        <el-button
+          class="el-button--small-yh"
           type="primary"
           :disabled="detailData.seeDisabled"
           size="small"
@@ -1383,21 +1390,10 @@ export default {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
-        }).then(() => {
-          this.editCustomer(false)
+        }).then(async () => {
+          await this.editCustomer(false, '采购')
         }).catch(() => {
           this.$message.info('已取消')
-          // this.$confirm("是否生成采购单?", {
-          //   confirmButtonText: "确定",
-          //   cancelButtonText: "取消",
-          //   type: "warning"
-          // }).then(() => {
-          //   saveSell(this.form.id).then(res => {
-          //     if (res.data.code == 200) {
-          //       this.$message.success("生成成功");
-          //     }
-          //   });
-          // });
         })
       } else {
         this.$confirm("是否生成采购单?", {
@@ -1536,7 +1532,7 @@ export default {
       }
     },
     //生成发货单
-    generateShipmentD() {
+    async generateShipmentD() {
       let lsit = []
       if (contrastObj(this.form, this.oldForm) ||
         contrastList(this.contactsData, this.oldGoodsList) ||
@@ -1548,29 +1544,14 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
-          this.editCustomer(false)
+          this.editCustomer(false, '发货')
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消'
           });
-          // this.selection.forEach(item => {
-          //   lsit.push(item.id)
-          // })
-          // let data = {
-          //   id: this.form.id,
-          //   orderItemIds: lsit
-          // }
-          // generateShipment(data).then(res => {
-          //   this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
-          //   this.$router.push({
-          //     path: "/businessManagement/deliveryNotice/index",
-          //     query: {form: JSON.stringify(res.data.data)},
-          //   });
-          // })
         })
       } else {
-        // lsit.push(this.selection[item].id)
         this.selection.forEach(item => {
           lsit.push(item.id)
         })
@@ -1588,7 +1569,7 @@ export default {
       }
     },
     // 生成结算
-    applySettlement() {
+    applySettlement(type) {
       if (contrastObj(this.form, this.oldForm) ||
         contrastList(this.contactsData, this.oldGoodsList) ||
         contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1603,12 +1584,13 @@ export default {
         }).catch(() => {
         })
       } else {
-        this.beforeBillData(true)
+        this.beforeBillData(true,type)
         this.applySettlementDialog = true;
       }
     },
     //生成账单 拿到主表信息
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       this.billData = {
         srcOrderno:this.form.orgOrderNo,
         itemType:"销售",
@@ -1620,7 +1602,7 @@ export default {
         taxRate: '0',
         accDate: this.form.businesDate,
       }
-      if(type){ //申请货款
+      if(bool){ //申请货款
         this.billData.srcId = -1
       }
     },
@@ -2104,7 +2086,7 @@ export default {
       done();
     },
     //修改提交触发
-    editCustomer(isBack = false) {
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           for (let item in this.contactsData) {
@@ -2116,7 +2098,6 @@ export default {
           if (this.form.packageRemarks) {
             packFee = this.advantageProjectData.findIndex(item => item.feeName == '包装费')
           }
-          console.log(packFee)
           if (packFee == -1) {
             return this.$message.error('费用明细未有包装费')
           }
@@ -2151,6 +2132,35 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '发货') {
+              let lsit = []
+              this.selection.forEach(item => {
+                lsit.push(item.id)
+              })
+              let data = {
+                id: this.form.id,
+                orderItemIds: lsit
+              }
+              generateShipment(data).then(res => {
+                this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
+                this.$router.push({
+                  path: "/businessManagement/deliveryNotice/index",
+                  query: {form: JSON.stringify(res.data.data)},
+                });
+              })
+            } else if (type == '采购') {
+              this.$confirm("是否生成采购单?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }).then(() => {
+                saveSell(this.form.id).then(res => {
+                  if (res.data.code == 200) {
+                    this.$message.success("生成成功");
+                  }
+                });
+              });
+            }
           }).finally(() => {
             this.saveLoading = false
           })

+ 46 - 8
src/views/businessManagement/salesOrder/index.vue

@@ -24,8 +24,25 @@
                  @tree-load="treeLoad"
                  :cell-style="tableRowClassName"
                  :table-loading="loading"
+                 @expand-change="expandChange"
       >
-        <template slot-scope="scope" slot="orgOrderNo">
+        <template slot-scope="scope" slot="expand">
+          <el-table :data="scope.row.insideList" v-loading="scope.row.loading">
+            <el-table-column  label="产品分类" prop="priceCategory" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="价格类别" prop="priceType" align="center" show-overflow-tooltip width="180"></el-table-column>
+            <el-table-column  label="商品名称" prop="cname" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="编码" prop="code" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="规格型号" prop="typeno" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="供应商" prop="corpId" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="订货数量" prop="orderQuantity" align="center" show-overflow-tooltip width="180"></el-table-column>
+            <el-table-column  label="发货数量" prop="actualQuantity" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="库存" prop="storageQuantity" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="采购价格" prop="purchaseAmount" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="最新单价" prop="price" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="金额" prop="amount" align="center" show-overflow-tooltip width="200"></el-table-column>
+          </el-table>
+        </template>
+        <template slot-scope="scope" slot="orderNo">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
         </template>
         <template slot="corpIdSearch">
@@ -169,9 +186,9 @@ export default {
   },
   methods: {
     tableRowClassName({row, column, rowIndex, columnIndex}) {
-      if (row.orderStatus == '录入' && columnIndex == 21){
+      if (row.orderStatus == '录入' && columnIndex == 19){
         return {
-          background: '#eceb3c'
+          background: '#eceb3c',
         }
       } else if (row.orderStatus == '成交') {
         return 'success-row'
@@ -306,8 +323,8 @@ export default {
         this.$delete(params,'requiredDeliveryDate')
       }
       if (params.requiredArrivalDate) {
-        params.arrivalStartDate = params.requiredArrivalDate[0]+ " " + "00:00:00"
-        params.arrivalEndDate = params.requiredArrivalDate[1]+ " " + "23:59:59"
+        params.arrivalDateStart = params.requiredArrivalDate[0]+ " " + "00:00:00"
+        params.arrivalDateEnd = params.requiredArrivalDate[1]+ " " + "23:59:59"
         this.$delete(params,'requiredArrivalDate')
       }
       if (params.actualDeliveryDate) {
@@ -342,10 +359,22 @@ export default {
       this.page.currentPage = 1;
       this.onLoad(this.page,this.search);
     },
+    // 表格展开触发
+    expandChange(row, index) {
+      if (row.loading) {
+        setTimeout(() => {
+          row.loading = false
+        }, 2000)
+      }
+    },
     onLoad(page, params) {
       if (this.search.businesDate && this.search.businesDate.length > 0) {
+        // delete this.search.createTime
+        // delete this.search.actualDeliveryDate
+        // delete this.search.requiredDeliveryDate
+        // delete this.search.requiredArrivalDate
         params = {
-          ...this.search,
+          // ...this.search,
           ...params,
           orderStartDate: this.search.businesDate[0]+ " " + "00:00:00",
           orderEndDate: this.search.businesDate[1]+ " " + "23:59:59",
@@ -361,6 +390,10 @@ export default {
       this.loading = true;
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records
+        this.dataList.forEach(item => {
+          this.$set(item,'insideList',[])
+          this.$set(item,'loading', true)
+        })
         this.page.total = res.data.data.total
       }).finally(() => {
         this.loading = false;
@@ -376,12 +409,17 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.isShow = true;
-      // console.log(this.search)
-      // this.onLoad(this.page, this.search)
+      // this.searchChange(this.search)
     },
   }
 }
 </script>
 
 <style scoped>
+/deep/ .el-table__expanded-cell .el-table__header-wrapper .cell {
+  font-size: 8px !important;
+}
+/deep/ .el-table__body-wrapper .cell {
+  font-size: 8px;
+}
 </style>