|
@@ -13,13 +13,7 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-form-item label="单据日期" prop="theTime">
|
|
|
- <el-date-picker
|
|
|
- disabled
|
|
|
- class="dateStyle"
|
|
|
- placeholder="系统自动生成"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- >
|
|
|
+ <el-date-picker disabled class="dateStyle" placeholder="系统自动生成" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -49,53 +43,28 @@
|
|
|
<!-- 列表 -->
|
|
|
<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="序号" type="index" align="left" width="100" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.$index == 0">{{ searchForm.customerNumber }}</div>
|
|
|
<div v-if="scope.$index == 1">{{ scope.row.customerNumber }}</div>
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.$index == 0">{{ searchForm.customerName }}</div>
|
|
|
- <el-select
|
|
|
- size="mini"
|
|
|
- class="dateStyle"
|
|
|
- @change="changeCustomerFn1($event, scope.$index, scope.row)"
|
|
|
- v-if="scope.$index == 1"
|
|
|
- filterable
|
|
|
- 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 size="mini" class='dateStyle' @change="changeCustomerFn1($event, scope.$index, scope.row)" v-if="scope.$index == 1" filterable 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="left" label="返利类型" prop="name" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select
|
|
|
- size="mini"
|
|
|
- filterable
|
|
|
- v-model="scope.row.name"
|
|
|
- placeholder="请选择"
|
|
|
- @click.native="changeCustomerFn(scope.row, scope.$index)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in scope.row.typeList"
|
|
|
- :key="item.customerWalletId"
|
|
|
- :label="item.name"
|
|
|
- :value="item.customerWalletId"
|
|
|
- >
|
|
|
+ <el-select size="mini" filterable v-model="scope.row.name" placeholder="请选择" @click.native="changeCustomerFn(scope.row, scope.$index)">
|
|
|
+ <el-option v-for="item in scope.row.typeList" :key="item.customerWalletId" :label="item.name" :value="item.customerWalletId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -108,13 +77,8 @@
|
|
|
<el-table-column align="left" label="折让金额" prop="" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.$index == 0"></div>
|
|
|
- <el-input
|
|
|
- v-if="scope.$index == 1"
|
|
|
- size="mini"
|
|
|
- type="number"
|
|
|
- @mousewheel.native.prevent
|
|
|
- v-model="scope.row.allowanceAmount"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-if="scope.$index == 1" size="mini" type="number" @mousewheel.native.prevent v-model="scope.row.allowanceAmount"></el-input>
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="备注" prop="" min-width="160" show-overflow-tooltip>
|
|
@@ -137,14 +101,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
+import { mapGetters } from "vuex";
|
|
|
import {
|
|
|
getUserInfo,
|
|
|
getWalletCustomerList,
|
|
|
getTransferAdd,
|
|
|
getTransferSubmit,
|
|
|
- getCustomerGroupList
|
|
|
-} from '@/api/finance/change_apply'
|
|
|
+ getCustomerGroupList,
|
|
|
+} from "@/api/finance/change_apply";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -152,29 +116,29 @@ export default {
|
|
|
listLoading: false, // 列表加载loading
|
|
|
dataList: [
|
|
|
{
|
|
|
- customerNumber: '',
|
|
|
- customerId: '',
|
|
|
- name: '',
|
|
|
- money: '',
|
|
|
- bz: ''
|
|
|
+ customerNumber: "",
|
|
|
+ customerId: "",
|
|
|
+ name: "",
|
|
|
+ money: "",
|
|
|
+ bz: "",
|
|
|
},
|
|
|
{
|
|
|
- customerNumber: '',
|
|
|
- customerId: '',
|
|
|
- name: '',
|
|
|
- money: '',
|
|
|
- bz: '',
|
|
|
- allowanceAmount: ''
|
|
|
- }
|
|
|
+ customerNumber: "",
|
|
|
+ customerId: "",
|
|
|
+ name: "",
|
|
|
+ money: "",
|
|
|
+ bz: "",
|
|
|
+ allowanceAmount: "",
|
|
|
+ },
|
|
|
],
|
|
|
searchForm: {
|
|
|
- customerId: '',
|
|
|
- customerName: '',
|
|
|
- nickName: '',
|
|
|
- customerNumber: ''
|
|
|
+ customerId: "",
|
|
|
+ customerName: "",
|
|
|
+ nickName: "",
|
|
|
+ customerNumber: "",
|
|
|
},
|
|
|
customerData: [], //经销商数据
|
|
|
- typeList: [] //返利类型数据
|
|
|
+ typeList: [], //返利类型数据
|
|
|
// rules: {
|
|
|
// theTime: [
|
|
|
// {
|
|
@@ -184,14 +148,14 @@ export default {
|
|
|
// },
|
|
|
// ],
|
|
|
// },
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['userid'])
|
|
|
+ ...mapGetters(["userid"]),
|
|
|
},
|
|
|
created() {
|
|
|
- this.getUserInfoFn()
|
|
|
- this.getCustomerData()
|
|
|
+ this.getUserInfoFn();
|
|
|
+ this.getCustomerData();
|
|
|
},
|
|
|
methods: {
|
|
|
//选择经销商名称事件
|
|
@@ -201,13 +165,13 @@ export default {
|
|
|
|
|
|
const res = await getWalletCustomerList({
|
|
|
customerId: v,
|
|
|
- type: 'REBATE'
|
|
|
- })
|
|
|
+ type: "REBATE",
|
|
|
+ });
|
|
|
// console.log(res, 7878);
|
|
|
- const res2 = this.customerData.filter(i => i.id == v)
|
|
|
+ const res2 = this.customerData.filter((i) => i.id == v);
|
|
|
// console.log(res2, 8888);
|
|
|
|
|
|
- this.$set(this.dataList[1], 'customerNumber', res2[0].number)
|
|
|
+ this.$set(this.dataList[1], "customerNumber", res2[0].number);
|
|
|
// this.$set(this.dataList[index], "customerName", res2[0].name);
|
|
|
|
|
|
// this.$set(this.dataList[index], "walletList", res.data);
|
|
@@ -227,28 +191,30 @@ export default {
|
|
|
// },
|
|
|
|
|
|
resetFn() {
|
|
|
- this.searchForm.theTime = null
|
|
|
- this.dataList.forEach(v => {
|
|
|
- v.money = ''
|
|
|
- v.bz = ''
|
|
|
- v.name = ''
|
|
|
- })
|
|
|
- this.dataList[1].customerId = ''
|
|
|
+ // this.searchForm.theTime = null;
|
|
|
+ this.dataList.forEach((v) => {
|
|
|
+ v.money = "";
|
|
|
+ v.bz = "";
|
|
|
+ v.name = "";
|
|
|
+ });
|
|
|
+ this.dataList[1].customerId = "";
|
|
|
+ this.dataList[1].customerNumber = "";
|
|
|
+ this.dataList[1].allowanceAmount = "";
|
|
|
},
|
|
|
|
|
|
// //返利类型数据
|
|
|
async changeCustomerFn(v, index) {
|
|
|
- if (v.customerId == '') {
|
|
|
- return
|
|
|
+ if (v.customerId == "") {
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- v.name = ''
|
|
|
+ v.name = "";
|
|
|
let res = await getWalletCustomerList({
|
|
|
customerId: v.customerId,
|
|
|
- type: 'REBATE'
|
|
|
- })
|
|
|
+ type: "REBATE",
|
|
|
+ });
|
|
|
|
|
|
- this.$set(this.dataList[index], 'typeList', res.data)
|
|
|
+ this.$set(this.dataList[index], "typeList", res.data);
|
|
|
|
|
|
// if (index == 1) {
|
|
|
// let aa = res.data.filter(
|
|
@@ -271,9 +237,9 @@ export default {
|
|
|
|
|
|
//查询同个集团的经销商数据
|
|
|
async getCustomerData() {
|
|
|
- const res = await getCustomerGroupList()
|
|
|
+ const res = await getCustomerGroupList();
|
|
|
// console.log(res, 123214);
|
|
|
- this.customerData = res.data
|
|
|
+ this.customerData = res.data;
|
|
|
},
|
|
|
|
|
|
//保存
|
|
@@ -284,40 +250,41 @@ export default {
|
|
|
// let receiverRemark;
|
|
|
// let amount;
|
|
|
|
|
|
- await this.$refs.searchForm.validate()
|
|
|
+ await this.$refs.searchForm.validate();
|
|
|
|
|
|
- let aaa = this.dataList.find(v => {
|
|
|
- if (v.money == '') {
|
|
|
- this.$message.error('请输入返利金额')
|
|
|
- return v
|
|
|
+ let aaa = this.dataList.find((v) => {
|
|
|
+ if (v.money == "") {
|
|
|
+ this.$message.error("请输入返利金额");
|
|
|
+ return v;
|
|
|
}
|
|
|
- if (v.customerId == '') {
|
|
|
- this.$message.error('请选择经销商')
|
|
|
- return v
|
|
|
+ if (v.customerId == "") {
|
|
|
+ this.$message.error("请选择经销商");
|
|
|
+ return v;
|
|
|
}
|
|
|
- if (v.name == '') {
|
|
|
- this.$message.error('请选择返利类型')
|
|
|
- return v
|
|
|
+ if (v.name == "") {
|
|
|
+ this.$message.error("请选择返利类型");
|
|
|
+ return v;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
if (aaa != undefined) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
if (this.dataList[0].money > 0) {
|
|
|
- this.$message.error('转出金额必须为负数')
|
|
|
- return
|
|
|
+ this.$message.error("转出金额必须为负数");
|
|
|
+ return;
|
|
|
}
|
|
|
if (this.dataList[1].money < 0 && this.dataList[1].allowanceAmount < 0) {
|
|
|
- this.$message.error('转入金额必须为正数')
|
|
|
- return
|
|
|
+ this.$message.error("转入金额必须为正数");
|
|
|
+ return;
|
|
|
}
|
|
|
if (
|
|
|
Number(-this.dataList[0].money) !=
|
|
|
- Number(this.dataList[1].money) + Number(this.dataList[1].allowanceAmount)
|
|
|
+ Number(this.dataList[1].money) +
|
|
|
+ Number(this.dataList[1].allowanceAmount)
|
|
|
) {
|
|
|
- this.$message.error('转入转出金额不等,请重新输入')
|
|
|
- return
|
|
|
+ this.$message.error("转入转出金额不等,请重新输入");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
// if (this.dataList[0].money > 0) {
|
|
@@ -341,21 +308,21 @@ export default {
|
|
|
receiverWalletRebateId: this.dataList[1].name,
|
|
|
allowanceAmount: this.dataList[1].allowanceAmount,
|
|
|
initiatorRemark: this.dataList[0].bz,
|
|
|
- receiverRemark: this.dataList[1].bz
|
|
|
- }
|
|
|
-
|
|
|
- await getTransferAdd(params)
|
|
|
+ receiverRemark: this.dataList[1].bz,
|
|
|
+ };
|
|
|
|
|
|
- this.$router.push('/finance/rebate/change_list')
|
|
|
- this.$message.success('申请成功')
|
|
|
+ await getTransferAdd(params);
|
|
|
+ this.resetFn();
|
|
|
+ this.$router.push("/finance/rebate/change_list");
|
|
|
+ this.$message.success("申请成功");
|
|
|
},
|
|
|
async getUserInfoFn() {
|
|
|
- const res = await getUserInfo({ adminUserId: this.userid })
|
|
|
- this.searchForm.customerNumber = res.data.customerNumber
|
|
|
- this.dataList[0].customerId = res.data.customerId
|
|
|
- this.searchForm.customerName = res.data.customerName
|
|
|
- this.searchForm.customerNumber = res.data.customerNumber
|
|
|
- this.searchForm.nickName = res.data.nickName
|
|
|
+ const res = await getUserInfo({ adminUserId: this.userid });
|
|
|
+ this.searchForm.customerNumber = res.data.customerNumber;
|
|
|
+ this.dataList[0].customerId = res.data.customerId;
|
|
|
+ this.searchForm.customerName = res.data.customerName;
|
|
|
+ this.searchForm.customerNumber = res.data.customerNumber;
|
|
|
+ this.searchForm.nickName = res.data.nickName;
|
|
|
// const res2 = await getWalletCustomerList({
|
|
|
// customerId: res.data.customerId,
|
|
|
// type: "REBATE",
|
|
@@ -367,9 +334,9 @@ export default {
|
|
|
// });
|
|
|
// this.dataList = res2.data;
|
|
|
// console.log(this.dataList);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|