|
@@ -9,6 +9,7 @@
|
|
|
<el-form
|
|
|
ref="searchForm"
|
|
|
:model="searchForm"
|
|
|
+ :rules="rulesSearchForm"
|
|
|
label-width="100px"
|
|
|
size="small"
|
|
|
label-position="left"
|
|
@@ -234,7 +235,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
- customerId: "",
|
|
|
+ customerId: null,
|
|
|
},
|
|
|
customerList: [],
|
|
|
listLoading: false, // 列表加载loading
|
|
@@ -244,6 +245,15 @@ export default {
|
|
|
rebateRate: null,
|
|
|
},
|
|
|
dialogForm: false,
|
|
|
+ rulesSearchForm: {
|
|
|
+ customerId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择经销商",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
rules: {
|
|
|
rebateRate: [
|
|
|
{
|
|
@@ -256,7 +266,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- console.log(this.$route.query.id, 11, this.customerId);
|
|
|
+ // console.log(this.$route.query.id, 11, this.customerId);
|
|
|
if (this.$route.query.id) {
|
|
|
this.getDataWallet({
|
|
|
customerId: this.$route.query.id,
|
|
@@ -289,16 +299,7 @@ export default {
|
|
|
},
|
|
|
//搜索
|
|
|
async searchFn() {
|
|
|
- // await this.$refs.searchForm.validate((valid, obj) => {
|
|
|
- // if (valid) {
|
|
|
- // console.log(valid, obj);
|
|
|
- // console.log(this.searchForm.customerId);
|
|
|
- // alert("submit!");
|
|
|
- // } else {
|
|
|
- // console.log("error submit!!");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // });
|
|
|
+ await this.$refs.searchForm.validate();
|
|
|
this.getDataWallet({
|
|
|
customerId: this.searchForm.customerId,
|
|
|
type: "COMMONLY",
|
|
@@ -338,7 +339,7 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
this.getDataRebate({
|
|
|
- customerId: this.customerId,
|
|
|
+ customerId: this.searchForm.customerId,
|
|
|
type: "REBATE",
|
|
|
});
|
|
|
}
|
|
@@ -351,13 +352,13 @@ export default {
|
|
|
this.addForm.rebateRate = v.rebateRate * 100;
|
|
|
this.dialogForm = true;
|
|
|
},
|
|
|
- //一键生成
|
|
|
- async generateFn() {
|
|
|
- await getfinanceInit({ customerId: this.customerId });
|
|
|
- this.getDataWallet();
|
|
|
- this.getDataRebate();
|
|
|
- this.$message.success("已生成");
|
|
|
- },
|
|
|
+ // //一键生成
|
|
|
+ // async generateFn() {
|
|
|
+ // await getfinanceInit({ customerId: this.customerId });
|
|
|
+ // this.getDataWallet();
|
|
|
+ // this.getDataRebate();
|
|
|
+ // this.$message.success("已生成");
|
|
|
+ // },
|
|
|
//
|
|
|
async getDataRebate(data) {
|
|
|
let res = await getWalletCustomerList(data);
|