瀏覽代碼

feat: 修改家用工程押金管理模块

aXin-0810 2 年之前
父節點
當前提交
5bba38517a

+ 1 - 1
src/views/deposit_home/components/deposit-apply-deduction.vue

@@ -169,7 +169,7 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     }
   }
 }

+ 15 - 6
src/views/deposit_home/components/deposit-apply-surrender.vue

@@ -433,6 +433,16 @@ import { downloadFiles, downloadPdf } from '@/utils/util'
 import { getFileUrl } from '@/api/common'
 
 export default {
+  props: {
+    depositManageId: {
+      type: [String, Number],
+      default: null
+    },
+    refEnginRecordNo: {
+      type: [String, Number],
+      default: null
+    }
+  },
   components: {
     imageUpload
   },
@@ -476,7 +486,7 @@ export default {
   },
   methods: {
     geDetail() {
-      geDetail({ id: this.$parent.depositManageId }).then(res => {
+      geDetail({ id: this.depositManageId }).then(res => {
         const arr = []
         res.data.items.forEach(item => {
           if (Number(item.qty) > 0) {
@@ -510,7 +520,7 @@ export default {
       })
     },
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     handleSvse() {
       const arr = []
@@ -551,9 +561,8 @@ export default {
       }).then(res => {
         this.$successMsg('申请成功')
         this.$emit('updateList')
-        this.$parent.showPage = 1
-        this.$parent.deduction = ''
-        this.$parent?.getList()
+        this.$emit('setShowPage', 1)
+        this.deduction = ''
       })
     },
     delFile(index) {
@@ -565,7 +574,7 @@ export default {
     },
     // 批量下载
     async batchDownloadFn() {
-      downloadFiles('deposit-manage/downZip', { parentId: this.$parent.depositManageId })
+      downloadFiles('deposit-manage/downZip', { parentId: this.depositManageId })
     },
     // 下载
     downLoadFn(v, fileName) {

+ 17 - 7
src/views/deposit_home/components/deposit_list-detail.vue

@@ -828,6 +828,16 @@ import { downloadFiles, downloadPdf } from '@/utils/util'
 import { getFileUrl } from '@/api/common'
 
 export default {
+  props: {
+    depositManageId: {
+      type: [String, Number],
+      default: null
+    },
+    refEnginRecordNo: {
+      type: [String, Number],
+      default: null
+    }
+  },
   data() {
     return {
       isDis: true,
@@ -871,7 +881,7 @@ export default {
   methods: {
     getDetail() {
       if (this.engineering == '工程押金信息') {
-        geDetail({ id: this.$parent.depositManageId }).then(res => {
+        geDetail({ id: this.depositManageId }).then(res => {
           if (res.data.dataList.length == 0) {
             this.isDis = true
           } else {
@@ -893,7 +903,7 @@ export default {
         })
       } else if (this.engineering == '工程订单信息') {
         geOrderInfo({
-          refEnginRecordNo: this.$parent.refEnginRecordNo,
+          refEnginRecordNo: this.refEnginRecordNo,
           examineStatus: 'OK'
         }).then(res => {
           this.dataList = res.data
@@ -903,7 +913,7 @@ export default {
           pageSize: -1,
           pageNum: 1,
           type: 3,
-          refEnginRecordNo: this.$parent.refEnginRecordNo
+          refEnginRecordNo: this.refEnginRecordNo
         }).then(res => {
           this.goodsList = res.data.records
         })
@@ -911,7 +921,7 @@ export default {
         getListProject({
           pageSize: -1,
           pageNum: 1,
-          refEnginRecordNo: this.$parent.refEnginRecordNo
+          refEnginRecordNo: this.refEnginRecordNo
         }).then(res => {
           this.projectList = res.data.records
         })
@@ -919,7 +929,7 @@ export default {
     },
     // 批量下载
     async batchDownloadFn() {
-      downloadFiles('deposit-manage/downZip', { parentId: this.$parent.depositManageId })
+      downloadFiles('deposit-manage/downZip', { parentId: this.depositManageId })
     },
     // 下载
     downLoadFn(v, fileName) {
@@ -957,7 +967,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     handleRadio(e) {
       this.getDetail()
@@ -966,7 +976,7 @@ export default {
       this.details.isRefundDeposit = this.details.isRefundDeposit == true
       editInfo(this.details).then(res => {
         this.$successMsg('编辑成功')
-        this.$parent.showPage = 1
+        this.$emit('setShowPage', 1)
       })
     },
     handleReset() {

+ 19 - 9
src/views/deposit_home/components/deposit_replenish.vue

@@ -862,6 +862,16 @@ import { getFileUrl } from '@/api/common'
 import imageUpload from '@/components/Common/image-upload.vue'
 
 export default {
+  props: {
+    depositManageId: {
+      type: [String, Number],
+      default: null
+    },
+    refEnginRecordNo: {
+      type: [String, Number],
+      default: null
+    }
+  },
   components: {
     imageUpload
   },
@@ -910,7 +920,7 @@ export default {
   methods: {
     getDetail() {
       if (this.engineering == '工程押金信息') {
-        geDetail({ id: this.$parent.depositManageId }).then(res => {
+        geDetail({ id: this.depositManageId }).then(res => {
           if (res.data.dataList.length == 0) {
             this.isDis = true
           } else {
@@ -932,7 +942,7 @@ export default {
         })
       } else if (this.engineering == '工程订单信息') {
         geOrderInfo({
-          refEnginRecordNo: this.$parent.refEnginRecordNo,
+          refEnginRecordNo: this.refEnginRecordNo,
           examineStatus: 'OK'
         }).then(res => {
           this.dataList = res.data
@@ -942,7 +952,7 @@ export default {
           pageSize: -1,
           pageNum: 1,
           type: 3,
-          refEnginRecordNo: this.$parent.refEnginRecordNo
+          refEnginRecordNo: this.refEnginRecordNo
         }).then(res => {
           this.goodsList = res.data.records
         })
@@ -950,7 +960,7 @@ export default {
         getListProject({
           pageSize: -1,
           pageNum: 1,
-          refEnginRecordNo: this.$parent.refEnginRecordNo
+          refEnginRecordNo: this.refEnginRecordNo
         }).then(res => {
           this.projectList = res.data.records
         })
@@ -958,7 +968,7 @@ export default {
     },
     // 批量下载
     async batchDownloadFn() {
-      downloadFiles('deposit-manage/downZip', { parentId: this.$parent.depositManageId })
+      downloadFiles('deposit-manage/downZip', { parentId: this.depositManageId })
     },
     // 下载
     downLoadFn(v, fileName) {
@@ -1005,7 +1015,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     handleRadio(e) {
       this.getDetail()
@@ -1014,7 +1024,8 @@ export default {
       this.details.isRefundDeposit = this.details.isRefundDeposit == true
       editInfo(this.details).then(res => {
         this.$successMsg('编辑成功')
-        this.$parent.showPage = 1
+
+        this.$emit('setShowPage', 1)
       })
     },
     handleReset() {
@@ -1056,8 +1067,7 @@ export default {
       }).then(res => {
         this.$emit('updateList')
         this.$successMsg('已提交')
-        this.$parent.showPage = 1
-        this.$parent?.getList()
+        this.$emit('setShowPage', 1)
       })
     }
   }

+ 1 - 1
src/views/deposit_home/components/nodeduct_list-detail.vue

@@ -248,7 +248,7 @@
 export default {
   methods: {
     goBack() {
-      this.$parent.showExamine = true
+      this.$emit('setShowPage', true)
     }
   }
 }

+ 1 - 1
src/views/deposit_home/components/refund_list-detail.vue

@@ -1269,7 +1269,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showSurrender = 0
+      this.$emit('setShowPage', 0)
     }
   }
 }

+ 1 - 1
src/views/deposit_home/components/refund_reexamine.vue

@@ -1074,7 +1074,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showSurrender = 0
+      this.$emit('setShowPage', 0)
     }
   }
 }

+ 1 - 1
src/views/deposit_home/components/refund_replenish.vue

@@ -1313,7 +1313,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showSurrender = 0
+      this.$emit('setShowPage', 0)
     },
     resetClick() {
       this.detailList.amendName = ''

+ 47 - 5
src/views/deposit_home/deposit_list.vue

@@ -14,16 +14,56 @@
     >
     </template-page>
     <div class="app-container" v-if="showPage == 2">
-      <DepositListDetail @updateList="updateList" />
+      <DepositListDetail
+        @updateList="updateList"
+        :depositManageId="depositManageId"
+        :refEnginRecordNo="refEnginRecordNo"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-else-if="showPage == 3">
-      <DepositApplyDeduction @updateList="updateList" />
+      <DepositApplyDeduction
+        @updateList="updateList"
+        :depositManageId="depositManageId"
+        :refEnginRecordNo="refEnginRecordNo"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-else-if="showPage == 4">
-      <DepositApplySurrender @updateList="updateList" />
+      <DepositApplySurrender
+        @updateList="updateList"
+        :depositManageId="depositManageId"
+        :refEnginRecordNo="refEnginRecordNo"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-else-if="showPage == 5">
-      <deposit_replenish @updateList="updateList" />
+      <deposit_replenish
+        @updateList="updateList"
+        :depositManageId="depositManageId"
+        :refEnginRecordNo="refEnginRecordNo"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
   </div>
 </template>
@@ -151,7 +191,9 @@ export default {
       tableEvents: {
         'selection-change': this.selectionChange
       },
-      recordSelected: []
+      recordSelected: [],
+      depositManageId: '',
+      refEnginRecordNo: ''
     }
   },
   computed: {

+ 8 - 1
src/views/deposit_home/nodeduct_list.vue

@@ -160,7 +160,14 @@
         </div>
       </div>
     </div>
-    <NodeductListDetail v-else />
+    <NodeductListDetail
+      v-else
+      @setShowPage="
+        val => {
+          showExamine = val
+        }
+      "
+    />
   </div>
 </template>
 

+ 30 - 3
src/views/deposit_home/refund_list.vue

@@ -13,13 +13,40 @@
     >
     </template-page>
     <div class="app-container" v-if="showSurrender == 1">
-      <refund-list-detail :detail-id="detailId" @updateList="updateList" />
+      <refund-list-detail
+        :detail-id="detailId"
+        @updateList="updateList"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showSurrender = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-else-if="showSurrender == 2">
-      <refund-replenish :detail-id="detailId" @updateList="updateList" />
+      <refund-replenish
+        :detail-id="detailId"
+        @updateList="updateList"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showSurrender = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-else-if="showSurrender == 3">
-      <refund-reexamine :detail-id="detailId" @updateList="updateList" />
+      <refund-reexamine
+        :detail-id="detailId"
+        @updateList="updateList"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showSurrender = val
+          }
+        "
+      />
     </div>
     <examine-dialog :is-show.sync="isShowExamineDialog" :examine-form.sync="examineForm" />
   </div>