Procházet zdrojové kódy

返利单增加编辑功能

chen před 3 roky
rodič
revize
7f78a97bf2

+ 1 - 1
src/api/finance/credit_list.js

@@ -52,7 +52,7 @@ export function getCreditRecordList(params) {
 // 经销商钱包列表
 export function getWalletCustomerList(params) {
     return request({
-      url: '/wallet/customer/list',
+      url: '/wallet/customer/list/page',
       method: 'get',
       params
     })

+ 8 - 0
src/api/finance/rebate_list.js

@@ -46,4 +46,12 @@ export function getRebateOrderAck(data) {
     method: 'post',
     data
   })
+}
+// 编辑
+export function getRebateOrderUpdate(data) {
+  return request({
+    url: '/rebate/order/update',
+    method: 'post',
+    data
+  })
 }

+ 4 - 1
src/views/finance/change_apply.vue

@@ -242,6 +242,9 @@ export default {
 
     // //返利类型数据
     async changeCustomerFn(v, index) {
+      if (v.customerId == "") {
+        return;
+      }
       console.log(v, index, 123456789);
       v.name = "";
       let res = await getWalletCustomerList({
@@ -347,4 +350,4 @@ export default {
 .dateStyle {
   width: 100%;
 }
-</style>
+</style>

+ 572 - 0
src/views/finance/components/rebate_list-edit.vue

@@ -0,0 +1,572 @@
+<template>
+  <div>
+    <div class="sty">
+      <el-page-header @back="goBack" content="销售返利单"> </el-page-header>
+    </div>
+    <el-divider></el-divider>
+    <!-- 表头 -->
+    <div>
+      <el-form
+        ref="searchForm"
+        :rules="rules"
+        :model="searchForm"
+        label-width="100px"
+        size="small"
+        label-position="left"
+      >
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="返利日期" prop="theTime">
+              <el-date-picker
+                class="selectStyle"
+                v-model="searchForm.theTime"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fl">
+        <el-button type="primary" size="small" @click="addFn">保存</el-button>
+      </div>
+      <div class="fr" v-if="state == 'SAVE'">
+        <el-button type="primary" size="small" @click="addRowFn"
+          >添加行</el-button
+        >
+        <el-button type="primary" size="small" @click="delRowFn"
+          >删除行</el-button
+        >
+      </div>
+    </div>
+    <!-- 列表 -->
+    <div v-if="this.state != 'SAVE'" class="mymain-container">
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          :row-class-name="rouClassNameFn"
+          @row-click="onRowClick"
+        >
+          <el-table-column
+            align="center"
+            label="序号"
+            type="index"
+            width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商编码"
+            prop="customerNumber"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商名称"
+            prop="customerName"
+            min-width="200"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利类型"
+            prop="walletName"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利总金额"
+            prop="amount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="暂扣返利"
+            prop="withholdAmount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文件流水号"
+            prop="policyFileNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文号"
+            prop="policyDocNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策年份"
+            prop="policyYear"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策月份"
+            prop="policyMonth"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策归属部门"
+            prop="policyOrg"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户区域"
+            prop="customerArea"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户属性"
+            prop="customerAttr"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="建立实际归属客户"
+            prop="rewardActualCustomers"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark1"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark2"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <!-- 列表 -->
+    <div v-if="this.state == 'SAVE'" class="mymain-container">
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          :row-class-name="rouClassNameFn"
+          @row-click="onRowClick"
+        >
+          <el-table-column
+            align="center"
+            label="序号"
+            type="index"
+            width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商编码"
+            prop="customerNumber"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input disabled v-model="scope.row.customerNumber"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商名称"
+            prop="customerName"
+            min-width="200"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                @change="changeCustomerFn($event, scope.$index, scope.row)"
+                v-model="scope.row.customerId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in customerData"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利类型"
+            prop="customerWalletId"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-if="state2"
+                v-model="scope.row.customerWalletId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in scope.row.walletList"
+                  :key="item.customerWalletId"
+                  :label="item.name"
+                  :value="item.customerWalletId"
+                >
+                </el-option>
+              </el-select>
+              <el-select
+                v-else
+                v-model="scope.row.walletName"
+                placeholder="请选择"
+              >
+                <el-option :label="scope.row.walletName" value=""> </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利总金额"
+            prop="amount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.amount"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="暂扣返利"
+            prop="withholdAmount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.withholdAmount"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文件流水号"
+            prop="policyFileNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyFileNo"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文号"
+            prop="policyDocNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyDocNo"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策年份"
+            prop="policyYear"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyYear"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策月份"
+            prop="policyMonth"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyMonth"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策归属部门"
+            prop="policyOrg"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyOrg"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户区域"
+            prop="customerArea"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerArea"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户属性"
+            prop="customerAttr"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerAttr"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="建立实际归属客户"
+            prop="rewardActualCustomers"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.rewardActualCustomers"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark1"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark2"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getRebateOrderDetail,
+  getRebateOrderUpdate,
+} from "@/api/finance/rebate_list";
+import {
+  getCustomerList,
+  getWalletCustomerList,
+} from "@/api/finance/rebate_form";
+export default {
+  props: {
+    detailId: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      state: "", //单据状态
+      state2: false, //状态
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      searchForm: {
+        theTime: "",
+        remark: "",
+      },
+      customerData: [],
+      rules: {
+        theTime: [
+          {
+            required: true,
+            message: "请选择返利日期",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getDataList();
+    this.getCustomerData();
+  },
+  methods: {
+    goBack() {
+      this.$parent.showPage = 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;
+      //   this.searchForm.createTime = res.data.createTime;
+      this.searchForm.remark = res.data.remark;
+      this.dataList = res.data.items;
+      this.state = res.data.examineStatus;
+    },
+    //保存
+    async addFn() {
+      await this.$refs.searchForm.validate();
+
+      if (this.state2) {
+        this.dataList.forEach((v) => {
+          const arr = v.walletList.filter(
+            (i) => i.customerWalletId == v.customerWalletId
+          );
+
+          v.walletName = arr[0].name;
+
+          delete v.walletList;
+        });
+      }
+
+      console.log(this.dataList);
+      await getRebateOrderUpdate({
+        ...this.searchForm,
+        items: this.dataList,
+        id: this.detailId,
+      });
+      this.$emit("updateList");
+
+      this.$message.success("保存成功");
+      this.$parent.showPage = 1;
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v, index, value) {
+      this.state2 = true;
+
+      value.customerWalletId = "";
+      const res = await getWalletCustomerList({
+        customerId: v,
+        type: "REBATE",
+      });
+      const res2 = this.customerData.filter((i) => i.id == v);
+
+      this.$set(this.dataList[index], "customerNumber", res2[0].number);
+      this.$set(this.dataList[index], "customerName", res2[0].name);
+      this.$set(this.dataList[index], "walletList", res.data);
+    },
+    //获取经销商数据
+    async getCustomerData() {
+      const res = await getCustomerList({ pageSize: -1, pageNum: 1 });
+      this.customerData = res.data.records;
+    },
+    rouClassNameFn({ row, rowIndex }) {
+      //把每一行的索引放进row
+      row.index = rowIndex;
+    },
+    onRowClick(row, event, column) {
+      this.delIndex = row.index;
+    },
+    //删除行
+    delRowFn() {
+      this.dataList.splice(this.delIndex, 1);
+    },
+    //添加行
+    addRowFn() {
+      this.dataList.push({
+        customerNumber: "",
+        customerName: "",
+        customerWalletId: "",
+        amount: null,
+        withholdAmount: null,
+        policyFileNo: "",
+        policyDocNo: "",
+        policyYear: "",
+        policyMonth: "",
+        policyOrg: "",
+        customerArea: "",
+        customerAttr: "",
+        rewardActualCustomers: "",
+        remark1: "",
+        remark2: "",
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
+</style>

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

@@ -246,7 +246,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       searchForm: {
         rebateOrderId: "",
         theTime: "",
@@ -276,6 +276,7 @@ export default {
       });
       this.$emit("updateList");
       this.$message.success("审核成功");
+      this.$parent.showPage = 1;
     },
     //获取详情数据
     async getDataList() {

+ 10 - 8
src/views/finance/components/rebate_list-review.vue

@@ -306,9 +306,9 @@
             min-width="160"
             show-overflow-tooltip
           >
-            <!-- <template slot-scope="scope">
+            <template slot-scope="scope">
               <el-input v-model="scope.row.allowanceCode"></el-input>
-            </template> -->
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -317,9 +317,9 @@
             min-width="160"
             show-overflow-tooltip
           >
-            <!-- <template slot-scope="scope">
+            <template slot-scope="scope">
               <el-input v-model="scope.row.allowanceAccount"></el-input>
-            </template> -->
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -376,13 +376,13 @@
           <div class="label">操作</div>
           <div class="value">
             <el-radio v-model="examineStatus" label="OK">复核通过</el-radio>
-            <el-radio v-model="examineStatus" label="FALL">取消复核</el-radio>
+            <el-radio v-model="examineStatus" label="FAIL">取消复核</el-radio>
           </div>
         </el-col>
         <el-col :span="24" class="item">
-          <div class="label">复核状态</div>
+          <div class="label">复核说明</div>
           <div class="value">
-            <el-input v-model="examineRemark" placeholder=""></el-input>
+            <el-input v-model="examineRemark" placeholder="复核说明"></el-input>
           </div>
         </el-col>
       </el-row>
@@ -409,7 +409,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       searchForm: {
         rebateOrderId: "",
         theTime: "",
@@ -444,7 +444,9 @@ export default {
         examineStatus: this.examineStatus,
         items: this.selectArr,
       });
+      this.$emit("updateList");
       this.$message.success("复核成功");
+      this.$parent.showPage = 1;
     },
     //获取详情数据
     async getDataList() {

+ 2 - 1
src/views/finance/components/receivable_list-add.vue

@@ -332,6 +332,7 @@ export default {
         v.customerNumber = res[0].number;
         let res2 = v.walletList.filter((j) => j.mainId == v.walletId);
         v.customerWalletId = res2[0].customerWalletId;
+        v.walletId = res2[0].walletRebateId;
       });
       console.log(this.dataList);
       await getFinanceOtherReceAdd({
@@ -386,4 +387,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 4 - 5
src/views/finance/components/receivable_list-approval.vue

@@ -168,7 +168,7 @@
           <el-table-column
             align="center"
             label="现金钱包"
-            prop=""
+            prop="customerWalletName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -268,7 +268,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       dataList: [],
       listLoading: false, // 列表加载loading
       searchForm: {
@@ -318,7 +318,7 @@ export default {
         totalAmount: res.data.totalAmount,
         create: res.data.create,
         createTime: res.data.createTime,
-        examineStatus: res.data.examineStatus,
+        examineStatus: res.data.examineStatus == "WAIT" ? "待审核" : "",
         remark: res.data.remark,
       };
       this.dataList = res.data.items;
@@ -330,5 +330,4 @@ export default {
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 2 - 3
src/views/finance/components/receivable_list-detail.vue

@@ -150,7 +150,7 @@
           <el-table-column
             align="center"
             label="现金钱包"
-            prop=""
+            prop="customerWalletName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -285,5 +285,4 @@ export default {
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 24 - 10
src/views/finance/credit_list.vue

@@ -123,7 +123,7 @@
             </el-table-column>
           </el-table>
         </div>
-        <!-- 分页
+        <!-- 分页 -->
         <div class="fr">
           <el-pagination
             @size-change="handleSizeChange"
@@ -135,7 +135,7 @@
             :total="listTotal"
           >
           </el-pagination>
-        </div> -->
+        </div>
       </div>
     </div>
     <CreditListDetail :recordsListId="recordsListId" v-else />
@@ -202,9 +202,9 @@ export default {
   },
   data() {
     return {
-      // currentPage: 1, // 当前页码
-      // pageSize: 10, // 每页数量
-      // listTotal: 0, // 列表总数
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
         customerId: "",
@@ -246,7 +246,11 @@ export default {
     };
   },
   created() {
-    this.getDataList({ type: "COMMONLY" });
+    this.getDataList({
+      type: "COMMONLY",
+      pageSize: this.pageSize,
+      pageNum: this.currentPage,
+    });
     this.getCustomerData({ pageSize: -1, pageNum: 1 });
   },
   methods: {
@@ -280,7 +284,12 @@ export default {
     },
     //搜索
     searchFn() {
-      this.getDataList({ ...this.searchForm, type: "COMMONLY" });
+      this.getDataList({
+        ...this.searchForm,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: "COMMONLY",
+      });
     },
     // 更改每页数量
     handleSizeChange(val) {
@@ -297,14 +306,19 @@ export default {
     async getDataList(data) {
       const res = await getWalletCustomerList(data);
       console.log(res);
-      this.dataList = res.data;
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
     },
 
     //确定
     async addDataFn() {
       await this.$refs.addForm.validate();
       await getCreditListEdit({ ...this.addForm, ...this.data });
-      this.getDataList({ type: "COMMONLY" });
+      this.getDataList({
+        type: "COMMONLY",
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+      });
       this.$message.success("设置成功");
       this.dialogForm = false;
     },
@@ -327,4 +341,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 30 - 7
src/views/finance/rebate_form.vue

@@ -6,6 +6,7 @@
     <div>
       <el-form
         ref="searchForm"
+        :rules="rules"
         :model="searchForm"
         label-width="100px"
         size="small"
@@ -18,7 +19,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="返利日期" prop="">
+            <el-form-item label="返利日期" prop="theTime">
               <el-date-picker
                 class="selectStyle"
                 v-model="searchForm.theTime"
@@ -31,7 +32,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="">
+            <el-form-item label="备注" prop="remark">
               <el-input
                 v-model="searchForm.remark"
                 placeholder="请输入"
@@ -41,12 +42,13 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
               <el-input
+                disabled
                 v-model="searchForm.createBy"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <!-- <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
               <el-date-picker
                 class="selectStyle"
@@ -58,7 +60,7 @@
               >
               </el-date-picker>
             </el-form-item>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
     </div>
@@ -306,6 +308,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 import {
   getCustomerList,
   getWalletCustomerList,
@@ -321,15 +324,28 @@ export default {
       customerData: [],
       searchForm: {
         theTime: "",
-        createTime: "",
+
         remark: "",
         createBy: "",
       },
       delIndex: null,
+      rules: {
+        theTime: [
+          {
+            required: true,
+            message: "请选择返利日期",
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapGetters(["name"]),
+  },
   created() {
     this.getCustomerData();
+    this.searchForm.createBy = this.name;
   },
   methods: {
     //重置
@@ -363,8 +379,13 @@ export default {
     },
     //新增
     async addFn() {
-      console.log(this.searchForm);
+      await this.$refs.searchForm.validate();
       this.dataList.forEach((v) => {
+        const arr = v.walletList.filter(
+          (i) => i.customerWalletId == v.customerWalletId
+        );
+
+        v.walletName = arr[0].name;
         delete v.walletList;
       });
       console.log(this.dataList);
@@ -380,9 +401,11 @@ export default {
         type: "REBATE",
       });
       const res2 = this.customerData.filter((i) => i.id == v);
+      console.log(res2, 8888);
 
       this.$set(this.dataList[index], "customerNumber", res2[0].number);
       this.$set(this.dataList[index], "customerName", res2[0].name);
+
       this.$set(this.dataList[index], "walletList", res.data);
     },
     //获取经销商数据
@@ -418,4 +441,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 28 - 4
src/views/finance/rebate_list.vue

@@ -105,7 +105,7 @@
                 <el-tag v-show="scope.row.examineStatus == 'OK'"
                   >复核通过</el-tag
                 >
-                <el-tag v-show="scope.row.examineStatus == 'FALL'"
+                <el-tag v-show="scope.row.examineStatus == 'FAIL'"
                   >不通过</el-tag
                 >
                 <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
@@ -345,6 +345,12 @@
                 <el-button
                   type="text"
                   class="textColor"
+                  @click="editFn(scope.row.rebateOrderId)"
+                  >编辑</el-button
+                >
+                <el-button
+                  type="text"
+                  class="textColor"
                   v-show="scope.row.examineStatus == 'SAVE' && !isCustomer"
                   @click="applyFn(scope.row.rebateOrderId)"
                   >申请</el-button
@@ -390,7 +396,7 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  v-if="isCustomer"
+                  v-if="isCustomer && scope.row.examineStatus == 'OK_ONE'"
                   @click="confirmFn(scope.row.rebateOrderId)"
                   >确认</el-button
                 >
@@ -419,11 +425,21 @@
       :detailId="detailId"
       v-else-if="showPage == 3"
     />
-    <RebateListReview :detailId="detailId" v-else-if="showPage == 4" />
+    <RebateListReview
+      @updateList="updateList"
+      :detailId="detailId"
+      v-else-if="showPage == 4"
+    />
     <!-- 详情 -->
     <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
     <!-- 确定 -->
     <RebateListConfirm :detailId="detailId" v-else-if="showPage == 6" />
+    <!-- 编辑 -->
+    <RebateListEdit
+      @updateList="updateList"
+      :detailId="detailId"
+      v-else-if="showPage == 7"
+    />
   </div>
 </template>
 
@@ -437,6 +453,8 @@ import RebateListExamine from "./components/rebate_list-examine.vue";
 import RebateListReview from "./components/rebate_list-review.vue";
 import RebateListDetail from "./components/rebate_list-detail";
 import RebateListConfirm from "./components/rebate_list-confirm";
+import RebateListEdit from "./components/rebate_list-edit.vue";
+
 export default {
   components: {
     RebateListDetail,
@@ -444,6 +462,7 @@ export default {
     RebateListExamine,
     RebateListReview,
     RebateListConfirm,
+    RebateListEdit,
   },
   data() {
     return {
@@ -545,6 +564,11 @@ export default {
       this.detailId = id;
       this.showPage = 5;
     },
+    //编辑
+    editFn(id) {
+      this.detailId = id;
+      this.showPage = 7;
+    },
   },
 };
 </script>
@@ -552,4 +576,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 90 - 14
src/views/finance/standbook_list.vue

@@ -469,12 +469,50 @@ export default {
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = 1;
-      this.getDataList({ pageNum: 1, pageSize: this.pageSize });
+      // this.getDataList({
+      //   type: this.bill,
+      //   pageNum: this.currentPage,
+      //   pageSize: this.pageSize,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
     // 更改当前页
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.getDataList({ pageNum: val, pageSize: 10 });
+      // this.getDataList({
+      //   type: this.bill,
+      //   pageNum: this.currentPage,
+      //   pageSize: this.pageSize,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
     //获取品类
     async getDataDict() {
@@ -495,13 +533,32 @@ export default {
       //   (v) => v.walletRebateId == this.searchForm.walletRebateId
       // );
       // console.log(res);
-      this.getDataList({
-        ...this.searchForm,
-        mainId: this.mainId,
-        type: this.bill,
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-      });
+      // this.getDataList({
+      //   ...this.searchForm,
+      //   mainId: this.mainId,
+      //   type: this.bill,
+      //   pageSize: this.pageSize,
+      //   pageNum: this.currentPage,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
 
     //钱包数据
@@ -515,11 +572,30 @@ export default {
     //切换列表
     checkFn(v) {
       this.resetFn();
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: v,
-      });
+      // this.getDataList({
+      //   pageSize: 10,
+      //   pageNum: 1,
+      //   type: v,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: 10,
+          pageNum: 1,
+          type: v,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: 10,
+          pageNum: 1,
+          type: v,
+        });
+      }
       this.getWalletList();
     },
     //