Przeglądaj źródła

返利单部分功能及部分bug

chen 3 lat temu
rodzic
commit
807f3f4a9b

+ 33 - 0
src/api/finance/rebate_form.js

@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+// 经销商列表
+export function getCustomerList(params) {
+    return request({
+      url: '/customer/list',
+      method: 'get',
+      params
+    })
+  }
+// 经销商钱包列表
+export function getWalletCustomerList(params) {
+    return request({
+      url: '/wallet/customer/list',
+      method: 'get',
+      params
+    })
+  }
+// 新增
+export function getRebateOrderAdd(data) {
+    return request({
+      url: '/rebate/order/add',
+      method: 'post',
+      data
+    })
+  }
+// 提审
+export function getRebateOrderApply(data) {
+    return request({
+      url: '/rebate/order/apply',
+      method: 'post',
+      data
+    })
+  }

+ 12 - 6
src/views/basic_data/dealer/dealer_stock.vue

@@ -183,6 +183,7 @@
       >
         <el-form-item label="经销商名称" prop="customerId">
           <el-select
+            filterable
             class="selectStyle"
             v-model="addForm.customerId"
             placeholder="请选择"
@@ -201,6 +202,7 @@
             class="selectStyle"
             v-model="addForm.mainId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in categoryList"
@@ -216,6 +218,7 @@
             class="selectStyle"
             v-model="addForm.oneParentId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in oneList"
@@ -228,6 +231,7 @@
         </el-form-item>
         <el-form-item label="二级区域" prop="twoParentId">
           <el-select
+            filterable
             class="selectStyle"
             v-model="addForm.twoParentId"
             placeholder="请选择"
@@ -246,6 +250,7 @@
             class="selectStyle"
             v-model="addForm.threeParentId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in threeList"
@@ -261,6 +266,7 @@
             class="selectStyle"
             v-model="addForm.serviceId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="(item, i) in userList"
@@ -353,7 +359,7 @@ export default {
     this.getDealerDataList({ pageNum: -1, pageSize: 10 });
     this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
     this.getCategoryList();
-    this.getAdminWebsit(1);
+    this.getAdminWebsit(0);
   },
   computed: {},
   watch: {
@@ -373,7 +379,7 @@ export default {
       if (newValue) {
         let res = await getAdminUserList({
           pageNum: 1,
-          pageSize: 10,
+          pageSize: -1,
           isCustomer: 0,
           adminWebsitId: newValue,
         });
@@ -391,9 +397,9 @@ export default {
       console.log(res);
       this.addForm.customerId = res.data.customerId;
       this.addForm.mainId = res.data.mainId;
-      this.addForm.oneParentId = res.data.adminWebsitId2;
-      this.addForm.twoParentId = res.data.adminWebsitId3;
-      this.addForm.threeParentId = res.data.adminCompanyId;
+      this.addForm.oneParentId = res.data.adminWebsitId1;
+      this.addForm.twoParentId = res.data.adminWebsitId2;
+      this.addForm.threeParentId = res.data.adminWebsitId3;
       this.addForm.serviceId = res.data.serviceId;
 
       this.dialogForm = true;
@@ -530,7 +536,7 @@ export default {
     //获取列表数据
     async getList(data) {
       const res = await getDealerStockList(data);
-      console.log(res);
+
       this.dataList = res.data.records;
       this.listTotal = res.data.total;
     },

+ 28 - 7
src/views/basic_data/wallet/wallet_list.vue

@@ -20,16 +20,26 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="产品大类" prop="mainId">
-              <el-input
+              <el-select
+                class="selectStyle"
+                filterable
                 v-model="searchForm.mainId"
-                placeholder="请输入"
-              ></el-input>
+                placeholder="名称"
+              >
+                <el-option
+                  v-for="item in categoryList"
+                  :key="item.productCategoryNumber"
+                  :label="item.productCategoryName"
+                  :value="item.productCategoryNumber"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
-          <el-col :xs="24" :sm="12" :lg="12" class="tr">
+          <el-col :xs="24" :sm="24" :lg="12" class="tr">
             <el-form-item label="">
-              <el-button size="small">清空</el-button>
+              <el-button size="small" @click="clearFn">清空</el-button>
               <el-button size="small" type="primary" @click="searchFn"
                 >搜索</el-button
               >
@@ -116,7 +126,11 @@
           <el-input disabled v-model="addForm.number"></el-input>
         </el-form-item>
         <el-form-item label="对应产品大类" prop="customerId">
-          <el-select v-model="addForm.mainId" placeholder="名称">
+          <el-select
+            class="selectStyle"
+            v-model="addForm.mainId"
+            placeholder="名称"
+          >
             <el-option
               v-for="item in categoryList"
               :key="item.productCategoryNumber"
@@ -213,6 +227,10 @@ export default {
       // this.addForm.mainId = "";
       this.dialogForm = false;
     },
+    //清空
+    async clearFn() {
+      await this.$refs.searchForm.resetFields();
+    },
     //搜索
     searchFn() {
       this.getDataList({ ...this.searchForm });
@@ -247,5 +265,8 @@ export default {
 };
 </script>
 
-<style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 </style>

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

@@ -208,6 +208,7 @@ export default {
     },
     //返利类型数据
     async typeFn(row) {
+      console.log(row);
       let res = await getWalletCustomerList({
         customerId: row.customerId,
         type: "REBATE",

+ 3 - 3
src/views/finance/components/receivable_list-add.vue

@@ -319,7 +319,7 @@ export default {
         console.log(res);
         v.customerName = res[0].name;
         v.customerNumber = res[0].number;
-        let res2 = this.walletList.filter((j) => j.mainId == v.walletId);
+        let res2 = v.walletList.filter((j) => j.mainId == v.walletId);
         v.customerWalletId = res2[0].customerWalletId;
       });
       console.log(this.dataList);
@@ -335,14 +335,14 @@ export default {
     },
     //选择经销商名称事件
     async changeCustomerFn(v, index) {
-      console.log(v);
+      console.log(v, 322311);
       const res = await getFinanceCustomerList({
         customerId: v,
         type: "COMMONLY",
       });
       this.$set(this.dataList[index], "walletList", res.data);
       console.log(this.dataList, "kkk");
-      this.walletList = res.data;
+      // this.walletList = res.data;
     },
     //获取经销商数据
     async getCustomerList() {

+ 5 - 5
src/views/finance/credit_list.vue

@@ -138,7 +138,7 @@
             </el-table-column>
           </el-table>
         </div>
-        <!-- 分页 -->
+        <!-- 分页
         <div class="fr">
           <el-pagination
             @size-change="handleSizeChange"
@@ -150,7 +150,7 @@
             :total="listTotal"
           >
           </el-pagination>
-        </div>
+        </div> -->
       </div>
     </div>
     <CreditListDetail :recordsListId="recordsListId" v-else />
@@ -216,9 +216,9 @@ export default {
   },
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      // currentPage: 1, // 当前页码
+      // pageSize: 10, // 每页数量
+      // listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
         customerNumber: "",

+ 280 - 29
src/views/finance/rebate_form.vue

@@ -14,27 +14,49 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利单号" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input disabled placeholder=""></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <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="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.createBy"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-date-picker
+                class="selectStyle"
+                v-model="searchForm.createTime"
+                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-row>
@@ -68,65 +90,294 @@
           <el-table-column
             align="center"
             label="经销商编码"
-            prop=""
+            prop="customerNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <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=""
+            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
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.customerWalletId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in scope.row.walletList"
+                  :key="item.walletRebateId"
+                  :label="item.name"
+                  :value="item.walletRebateId"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="经销商简称"
-            prop=""
+            label="返利总金额"
+            prop="amount"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <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=""
+            label="暂扣返利"
+            prop="withholdAmount"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <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=""
+            label="政策文件流水号"
+            prop="policyFileNo"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyFileNo"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="暂扣返利"
-            prop=""
+            label="政策文号"
+            prop="policyDocNo"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyDocNo"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="备注"
-            prop=""
+            label="政策年份"
+            prop="policyYear"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <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>
     <br />
-    <el-button type="primary" size="small">保存</el-button>
-    <el-button type="primary" size="small">提交审批</el-button>
-    <el-button type="primary" size="small">重置</el-button>
+
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fl">
+        <el-button type="primary" size="small" @click="addFn">保存</el-button>
+        <el-button type="primary" size="small">提交审批</el-button>
+        <el-button type="primary" size="small">重置</el-button>
+      </div>
+      <div class="fr">
+        <el-button type="primary" size="small" @click="addRowFn"
+          >添加行</el-button
+        >
+        <el-button type="primary" size="small">删除行</el-button>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
-export default {};
+import {
+  getCustomerList,
+  getWalletCustomerList,
+  getRebateOrderAdd,
+  getRebateOrderApply,
+} from "@/api/finance/rebate_form";
+export default {
+  data() {
+    return {
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      customerData: [],
+      searchForm: {
+        theTime: "",
+        createTime: "",
+        remark: "",
+        createBy: "",
+      },
+    };
+  },
+  created() {
+    this.getCustomerData();
+  },
+  methods: {
+    //新增
+    async addFn() {
+      console.log(this.searchForm);
+      this.dataList.forEach((v) => {
+        delete v.walletList;
+      });
+      console.log(this.dataList);
+      await getRebateOrderAdd({ ...this.searchForm, items: this.dataList });
+      this.$message.success("保存成功");
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v, index, value) {
+      value.customerWalletId = "";
+      console.log(v, 322311);
+      const res = await getWalletCustomerList({
+        customerId: v,
+        type: "REBATE",
+      });
+      const res2 = this.customerData.filter((i) => i.id == v);
+      console.log(res2, 326556);
+
+      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;
+    },
+    //添加行
+    addRowFn() {
+      this.dataList.push({
+        customerNumber: "",
+        customerName: "",
+        customerWalletId: "",
+        amount: null,
+        withholdAmount: null,
+        policyFileNo: "",
+        policyDocNo: "",
+        policyYear: "",
+        policyMonth: "",
+        policyOrg: "",
+        customerArea: "",
+        customerAttr: "",
+        rewardActualCustomers: "",
+        remark1: "",
+        remark2: "",
+      });
+    },
+  },
+};
 </script>
 
-<style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 </style>

+ 6 - 5
src/views/finance/standbook_list.vue

@@ -4,8 +4,8 @@
     <el-divider></el-divider>
     <el-radio-group v-model="mainId" size="">
       <el-radio-button
-        v-for="v in dictList"
-        :key="v.sysDictId"
+        v-for="(v, i) in dictList"
+        :key="i"
         :label="v.dictCode"
         >{{ v.dictValue }}</el-radio-button
       >
@@ -34,8 +34,8 @@
                 placeholder="请选择"
               >
                 <el-option
-                  v-for="v in selectList"
-                  :key="v.walletRebateId"
+                  v-for="(v, i) in selectList"
+                  :key="i"
                   :label="v.name"
                   :value="v.walletRebateId"
                 >
@@ -389,7 +389,7 @@ export default {
         walletRebateId: "",
       }, //搜索表单
       listLoading: false, // 列表加载loading
-      mainId: "",
+      mainId: null,
       bill: "COMMONLY",
     };
   },
@@ -430,6 +430,7 @@ export default {
     },
     //查询
     searchFn() {
+      console.log(this.mainId);
       // console.log(this.searchForm);
       // const res = this.selectList.filter(
       //   (v) => v.walletRebateId == this.searchForm.walletRebateId