Browse Source

feat: 销售返利单/返利互转列表页面

aXin-0810 2 years ago
parent
commit
7d8975daaf

+ 0 - 2
src/views/finance/change_list.vue

@@ -11,9 +11,7 @@
   >
     <Popu v-if="showPage !== 1">
       <ChangeListDetail v-if="showPage == 2" @refresh="refreshFn" :detailList="detailList" />
-
       <ChangeListExamine v-if="showPage == 3" @refresh="refreshFn" :detailList="detailList" />
-
       <ChangeListReview v-if="showPage == 4" @refresh="refreshFn" :detailList="detailList" />
     </Popu>
   </template-page>

+ 1 - 2
src/views/finance/components/rebate_list-apply.vue

@@ -375,12 +375,11 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
       let res = await getRebateOrderDetail({ id: this.detailId })
-      console.log(res, 11111)
       this.searchForm.rebateOrderId = res.data.id
       this.searchForm.theTime = res.data.theTime
       this.searchForm.createBy = res.data.createBy

+ 52 - 19
src/views/finance/components/rebate_list-confirm.vue

@@ -38,15 +38,23 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="审批人" prop="">
-              <el-input v-if="this.searchForm.secondExamineBy != null" disabled v-model="searchForm.secondExamineBy"
-                placeholder=""></el-input>
+              <el-input
+                v-if="this.searchForm.secondExamineBy != null"
+                disabled
+                v-model="searchForm.secondExamineBy"
+                placeholder=""
+              ></el-input>
               <el-input v-else disabled v-model="searchForm.examineBy" placeholder=""></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="审批日期" prop="">
-              <el-input v-if="this.searchForm.secondExamineTime != null" disabled v-model="searchForm.secondExamineTime"
-                placeholder=""></el-input>
+              <el-input
+                v-if="this.searchForm.secondExamineTime != null"
+                disabled
+                v-model="searchForm.secondExamineTime"
+                placeholder=""
+              ></el-input>
               <el-input v-else disabled v-model="searchForm.examineTime" placeholder=""></el-input>
             </el-form-item>
           </el-col>
@@ -56,11 +64,23 @@
     <!-- 列表 -->
     <div class="mymain-container">
       <div class="table">
-        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit
-          highlight-current-row stripe>
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
           <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
-          <el-table-column align="left" label="返利类型" prop="walletName" min-width="160"
-            show-overflow-tooltip></el-table-column>
+          <el-table-column
+            align="left"
+            label="返利类型"
+            prop="walletName"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
           <el-table-column align="right" label="总返利金额" prop="amount" min-width="160" show-overflow-tooltip>
             <!-- <template slot-scope="scope">
 
@@ -68,8 +88,13 @@
           </el-table-column>
           <el-table-column align="right" label="返利金额" prop="" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input style="width: 100%" class="mountclass" :disabled="show" type="number"
-                v-model="scope.row.rebateAmount"></el-input>
+              <el-input
+                style="width: 100%"
+                class="mountclass"
+                :disabled="show"
+                type="number"
+                v-model="scope.row.rebateAmount"
+              ></el-input>
             </template>
           </el-table-column>
           <!--          <el-table-column align="right" label="折让金额" prop="" min-width="160" show-overflow-tooltip>-->
@@ -90,10 +115,20 @@
           <!--            min-width="160"-->
           <!--            show-overflow-tooltip-->
           <!--          ></el-table-column>-->
-          <el-table-column align="left" label="备注1" prop="remark1" min-width="160"
-            show-overflow-tooltip></el-table-column>
-          <el-table-column align="left" label="备注2" prop="remark2" min-width="160"
-            show-overflow-tooltip></el-table-column>
+          <el-table-column
+            align="left"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="left"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
         </el-table>
       </div>
     </div>
@@ -135,13 +170,11 @@ export default {
     }
   },
   computed: {
-    
     isCustomer() {
       return this.$store.getters.customerId && this.$store.getters.customerNumber
     },
     show() {
       if (this.isShow && this.examineStatus == 'OK_ONE') {
-        
         this.state = 1
         if (this.isCustomer) {
           return true
@@ -149,7 +182,7 @@ export default {
         return false
       } else if (!this.isShow) {
         this.state = 2
-        console.log(33);
+        console.log(33)
         return false
       } else if (this.isShow && (this.examineStatus == 'OK' || this.examineStatus == 'FAIL')) {
         return true
@@ -229,7 +262,7 @@ export default {
       }
 
       this.$emit('updateList')
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
@@ -255,7 +288,7 @@ export default {
       }
     },
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     }
   }
 }

+ 1 - 2
src/views/finance/components/rebate_list-detail.vue

@@ -228,12 +228,11 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
       let res = await getRebateOrderDetail({ id: this.detailId })
-      console.log(res, 11111)
       this.searchForm.rebateOrderId = res.data.id
       this.searchForm.theTime = res.data.theTime
       this.searchForm.createBy = res.data.createBy

+ 8 - 8
src/views/finance/components/rebate_list-edit.vue

@@ -275,7 +275,7 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
@@ -286,14 +286,14 @@ export default {
       //   this.searchForm.createTime = res.data.createTime;
       this.searchForm.remark = res.data.remark
       this.state = res.data.examineStatus
-      res.data.items.map(async(k)=>{
+      res.data.items.map(async k => {
         const wallet = await getWalletCustomerList({
-        customerId: k.customerId,
-        type: 'REBATE'
+          customerId: k.customerId,
+          type: 'REBATE'
+        })
+        this.$set(k, 'walletList', wallet.data)
       })
-      this.$set(k, 'walletList', wallet.data)
-    })
-        this.dataList = res.data.items
+      this.dataList = res.data.items
       // this.$set(this.dataList, 'walletList', wallet.data)
     },
     //保存
@@ -317,7 +317,7 @@ export default {
       this.$emit('updateList')
 
       this.$message.success('保存成功')
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //选择经销商名称事件
     async changeCustomerFn(v, index, value) {

+ 2 - 2
src/views/finance/components/rebate_list-examine.vue

@@ -240,7 +240,7 @@ export default {
       })
       this.$emit('updateList')
       this.$message.success('审核成功')
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
@@ -255,7 +255,7 @@ export default {
     },
 
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     }
   }
 }

+ 2 - 2
src/views/finance/components/rebate_list-review.vue

@@ -414,7 +414,7 @@ export default {
       })
       this.$emit('updateList')
       this.$message.success('复核成功')
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     },
     //获取详情数据
     async getDataList() {
@@ -438,7 +438,7 @@ export default {
       this.dataList2 = this.trueOKList
     },
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     }
   }
 }

+ 55 - 10
src/views/finance/rebate_list.vue

@@ -14,22 +14,71 @@
     >
     </template-page>
     <div class="app-container" v-if="showPage == 2">
-      <RebateListApply :detailId="detailId" />
+      <RebateListApply
+        :detailId="detailId"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-if="showPage == 3">
-      <RebateListExamine @updateList="updateList" :detailId="detailId" />
+      <RebateListExamine
+        :detailId="detailId"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-if="showPage == 4">
-      <RebateListReview @updateList="updateList" :detailId="detailId" />
+      <RebateListReview
+        :detailId="detailId"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-if="showPage == 5">
-      <RebateListDetail :detailId="detailId" />
+      <RebateListDetail
+        :detailId="detailId"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-if="showPage == 6">
-      <RebateListConfirm @updateList="updateList" :detailId="detailId" :isShow="isShow" />
+      <RebateListConfirm
+        :detailId="detailId"
+        :isShow="isShow"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <div class="app-container" v-if="showPage == 7">
-      <RebateListEdit @updateList="updateList" :detailId="detailId" />
+      <RebateListEdit
+        :detailId="detailId"
+        @setShowPage="
+          val => {
+            $refs.pageRef.refreshList()
+            showPage = val
+          }
+        "
+      />
     </div>
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
   </div>
@@ -393,10 +442,6 @@ export default {
       this.$message.success('删除成功')
       this.deleList = []
     },
-    //更新列表数据
-    updateList() {
-      this.$refs.pageRef.refreshList()
-    },
     //获取列表数据
     async getDataList() {
       this.$refs.pageRef.refreshList()