|
@@ -71,7 +71,7 @@
|
|
|
<a-select
|
|
|
v-model="configForm.creativeSale"
|
|
|
style="width: 100px"
|
|
|
- :filter-option="filterOption"
|
|
|
+ :filter-option="handleFilterOption"
|
|
|
show-search
|
|
|
>
|
|
|
<a-select-option
|
|
@@ -180,8 +180,8 @@
|
|
|
size="small"
|
|
|
show-size-changer
|
|
|
show-quick-jumper
|
|
|
- @change="onShowSizeChange"
|
|
|
- @showSizeChange="onShowSizeChange"
|
|
|
+ @change="handleOnShowSizeChange"
|
|
|
+ @showSizeChange="handleOnShowSizeChange"
|
|
|
/>
|
|
|
</div>
|
|
|
<!-- 被拒理由 -->
|
|
@@ -244,7 +244,7 @@
|
|
|
</div>
|
|
|
<div class="policy-line-left">
|
|
|
<span class="line-left-spn">区域:</span>
|
|
|
- <span class="line-right-spn">{{ queryByIdList.nickName }}</span>
|
|
|
+ <span class="line-right-spn">{{ queryByIdList.areaInfo }}</span>
|
|
|
</div>
|
|
|
<div class="policy-line-left">
|
|
|
<span class="line-left-spn">我司主体:</span>
|
|
@@ -364,26 +364,6 @@
|
|
|
allow-clear
|
|
|
/>
|
|
|
</a-form-model-item>
|
|
|
- <!-- <a-form-model-item label="产品名称">
|
|
|
- <a-button type="primary" @click="handleAddOrigin">
|
|
|
- <a-icon type="plus"/>产品名称
|
|
|
- </a-button>
|
|
|
- <span class="especial-label">*</span>
|
|
|
- </a-form-model-item>
|
|
|
- <div class="adver-position-radio">
|
|
|
- <a-form-model-item
|
|
|
- v-for="(item, index) in policyOperationForm.defaultFormList"
|
|
|
- :key="item.id"
|
|
|
- :prop="'defaultFormList.' + index + '.value'"
|
|
|
- :rules="[
|
|
|
- {required: true, message: '请输入', trigger: 'blur'},
|
|
|
- {min: 6, max: 9, message: '请输入6-9个字', trigger: 'blur'},
|
|
|
- ]"
|
|
|
- >
|
|
|
- <a-input class="input-common-short" v-model="item.value" placeholder="请输入" allow-clear/>
|
|
|
- <a-icon class="circle-icon-class" type="minus-circle" @click="handleDelOrigin(item)"/>
|
|
|
- </a-form-model-item>
|
|
|
- </div> -->
|
|
|
<div class="product-name-class" v-for="(item, index) in policyOperationForm.defaultFormList" :key="item.id">
|
|
|
<a-form-model-item
|
|
|
:label="index === 0 ? '产品名称' : ''"
|
|
@@ -407,7 +387,7 @@
|
|
|
<a-select
|
|
|
v-model="policyOperationForm.createUserId"
|
|
|
style="width: 100px"
|
|
|
- :filter-option="filterOption"
|
|
|
+ :filter-option="handleFilterOption"
|
|
|
show-search
|
|
|
>
|
|
|
<a-select-option
|
|
@@ -430,17 +410,17 @@
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="我司主体" prop="companySubjectId">
|
|
|
+ <a-form-model-item label="我司主体" prop="companySubjectName">
|
|
|
<a-select
|
|
|
- v-model="policyOperationForm.companySubjectId"
|
|
|
+ v-model="policyOperationForm.companySubjectName"
|
|
|
placeholder="请选择我司主体"
|
|
|
- :filter-option="filterOption"
|
|
|
+ :filter-option="handleFilterOption"
|
|
|
show-search
|
|
|
>
|
|
|
<a-select-option
|
|
|
v-for="item in addSubjectList"
|
|
|
- :key="item.id"
|
|
|
- :value="item.id"
|
|
|
+ :key="item.companySubjectName"
|
|
|
+ :value="item.companySubjectName"
|
|
|
>
|
|
|
{{ item.companySubjectName }}
|
|
|
</a-select-option>
|
|
@@ -479,6 +459,7 @@
|
|
|
<a-form-model-item label="返点比例" prop="rebateRate">
|
|
|
<a-input-number
|
|
|
v-model="policyOperationForm.rebateRate"
|
|
|
+ :step="0.01"
|
|
|
:precision="2"
|
|
|
/> %
|
|
|
</a-form-model-item>
|
|
@@ -506,6 +487,7 @@
|
|
|
<a-form-model-item label="垫付返点" prop="dianPayCompanyRebateRate">
|
|
|
<a-input-number
|
|
|
v-model="policyOperationForm.dianPayCompanyRebateRate"
|
|
|
+ :step="0.01"
|
|
|
:precision="2"
|
|
|
/>
|
|
|
</a-form-model-item>
|
|
@@ -545,8 +527,11 @@ export default {
|
|
|
let handleCharacterLen30 = (rule, value, callback) => {
|
|
|
this.handleExportRules(value, 1, 30, callback);
|
|
|
};
|
|
|
+ let handleCharacterLen100 = (rule, value, callback) => {
|
|
|
+ this.handleDescRules(value, 5, 100, callback);
|
|
|
+ };
|
|
|
return {
|
|
|
- controlLoading: true,
|
|
|
+ controlLoading: false,
|
|
|
allSaleListOption: [],
|
|
|
creativeMediaOptions: [
|
|
|
{
|
|
@@ -624,18 +609,18 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
companyName: '',
|
|
|
- advancePay: 1,
|
|
|
+ advancePay: 0,
|
|
|
advertiserName: '',
|
|
|
rebateType: undefined,
|
|
|
mediaType: 1,
|
|
|
createUserId: undefined,
|
|
|
areaInfo: undefined,
|
|
|
- companySubjectId: undefined,
|
|
|
+ companySubjectName: undefined,
|
|
|
promotionType: 1,
|
|
|
groupAbbreviation: '',
|
|
|
rebateRate: '',
|
|
|
accountingPeriod: '',
|
|
|
- isDianPay: undefined,
|
|
|
+ isDianPay: 0,
|
|
|
dianPayCompanyName: '',
|
|
|
dianPayCompanyRebateRate: '',
|
|
|
addTimes: [],
|
|
@@ -657,7 +642,7 @@ export default {
|
|
|
mediaType: [{required: true, message: '请选择投放媒体', trigger: 'change'}],
|
|
|
createUserId: [{required: true, message: '请选择所属销售', trigger: 'change'}],
|
|
|
areaInfo: [{required: true, message: '请选择区域', trigger: 'change'}],
|
|
|
- companySubjectId: [{required: true, message: '请选择我司主体', trigger: 'change'}],
|
|
|
+ companySubjectName: [{required: true, message: '请选择我司主体', trigger: 'change'}],
|
|
|
rebateRate: [{required: true, message: '请输入返点比例', trigger: 'blur'}],
|
|
|
accountingPeriod: [{required: true, message: '请输入账期', trigger: 'blur'}],
|
|
|
dianPayCompanyName: [
|
|
@@ -670,7 +655,7 @@ export default {
|
|
|
reasonRules: {
|
|
|
desc: [
|
|
|
{required: true, message: '请输入审核拒绝理由', trigger: 'blur'},
|
|
|
- {min: 5, max: 100, message: '请输入5-100个字符', trigger: 'blur'}
|
|
|
+ {validator: handleCharacterLen100, trigger: 'blur'}
|
|
|
]
|
|
|
},
|
|
|
dataSource: [],
|
|
@@ -831,7 +816,7 @@ export default {
|
|
|
methods: {
|
|
|
...mapGetters(['userInfo']),
|
|
|
moment,
|
|
|
- filterOption(input, option) {
|
|
|
+ handleFilterOption(input, option) {
|
|
|
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
},
|
|
|
handleAddTimesChange(date, dateString) {
|
|
@@ -845,7 +830,7 @@ export default {
|
|
|
if (result.code === 0) {
|
|
|
const defaultList = result.result[0].UserCompany;
|
|
|
this.saleShowOption = defaultList;
|
|
|
- this.addAreaList = defaultList[0].nickName.split(',');
|
|
|
+ this.addAreaList = defaultList[0].nickName.split(',');
|
|
|
this.addSubjectList = result.result[0].companySubjects;
|
|
|
}
|
|
|
else {
|
|
@@ -883,7 +868,7 @@ export default {
|
|
|
};
|
|
|
getAction(urlAcount + '/finance/cwjsPolicyInfo/getAllSaleList', paramsData).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
- this.allSaleListOption = result.result;
|
|
|
+ this.allSaleListOption = result.result || [];
|
|
|
}
|
|
|
else {
|
|
|
this.$message.error(result.message);
|
|
@@ -906,7 +891,7 @@ export default {
|
|
|
createUserId: this.configForm.creativeSale === 'no' ? '' : this.configForm.creativeSale,
|
|
|
promotionType: this.configForm.creativeOperate === 'no' ? '' : this.configForm.creativeOperate,
|
|
|
approvedStatus: this.configForm.searchStatus === 'no' ? '' : this.configForm.searchStatus,
|
|
|
- startTime: this.configForm.time[0],
|
|
|
+ startTime: this.configForm.time[0],
|
|
|
endTime: this.configForm.time[1],
|
|
|
pageNo: this.tablePag.page,
|
|
|
pageSize: this.tablePag.size
|
|
@@ -915,7 +900,7 @@ export default {
|
|
|
if (result.code === 0) {
|
|
|
let defaultList = result.result.list;
|
|
|
defaultList.forEach(item => {
|
|
|
- item.updatePolicyProductName = item.policyProductName.join(',');
|
|
|
+ item.updatePolicyProductName = item.policyProductName.join(',');
|
|
|
item.remarks = item.remarks ? item.remarks : '-';
|
|
|
item.updateOperation = item.operation.split('|');
|
|
|
item.updateMediaType = this.creativeMediaOptions.filter(val => val.id === item.mediaType)[0].name;
|
|
@@ -1007,7 +992,7 @@ export default {
|
|
|
this.policyOperationForm.isDianPay = undefined;
|
|
|
}
|
|
|
else if (e.target.value === 0) {
|
|
|
- this.policyOperationForm.isDianPay = 1;
|
|
|
+ this.policyOperationForm.isDianPay = 0;
|
|
|
}
|
|
|
},
|
|
|
handleExportRules(value, min, max, callback) {
|
|
@@ -1029,8 +1014,27 @@ export default {
|
|
|
callback(`只能输入${min}-${max}个汉字`);
|
|
|
}
|
|
|
},
|
|
|
+ handleDescRules(value, min, max, callback) {
|
|
|
+ let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
|
|
|
+ let length = 0;
|
|
|
+ let strArr = value.split('');
|
|
|
+ strArr.forEach(item => {
|
|
|
+ if (cnReg.test(item)) {
|
|
|
+ length += 2;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ length += 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (min <= length && length <= max) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ callback(`只能输入${min}-${max}个字符`);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 分页操作按钮
|
|
|
- onShowSizeChange(current, pageSize) {
|
|
|
+ handleOnShowSizeChange(current, pageSize) {
|
|
|
this.tablePag = {
|
|
|
page: current,
|
|
|
size: pageSize
|
|
@@ -1063,12 +1067,12 @@ export default {
|
|
|
// 新增政策按钮
|
|
|
handleAddAccountPolicy() {
|
|
|
this.addType = 'add';
|
|
|
- this.policyOperationForm.createUserId = this.saleShowOption[0].userId;
|
|
|
+ this.policyOperationForm.createUserId = this.saleShowOption[0].userId || '';
|
|
|
this.policyOperationStatus = true;
|
|
|
},
|
|
|
// 新增政策确定按钮
|
|
|
handlePolicyOperationSure() {
|
|
|
- const {companyName, advancePay, advertiserName, rebateType, mediaType, defaultFormList, addTimes, createUserId, areaInfo, companySubjectId, promotionType, groupAbbreviation, rebateRate, accountingPeriod, isDianPay, dianPayCompanyName, dianPayCompanyRebateRate, remarks, id} = this.policyOperationForm;
|
|
|
+ const {companyName, advancePay, advertiserName, rebateType, mediaType, defaultFormList, addTimes, createUserId, areaInfo, companySubjectName, promotionType, groupAbbreviation, rebateRate, accountingPeriod, isDianPay, dianPayCompanyName, dianPayCompanyRebateRate, remarks, id} = this.policyOperationForm;
|
|
|
const paramsData = {
|
|
|
policyProductName: defaultFormList.map(item => item.value),
|
|
|
policyStartDate: addTimes[0],
|
|
@@ -1080,7 +1084,7 @@ export default {
|
|
|
mediaType,
|
|
|
createUserId,
|
|
|
areaInfo,
|
|
|
- companySubjectId,
|
|
|
+ companySubjectName,
|
|
|
promotionType,
|
|
|
groupAbbreviation,
|
|
|
rebateRate,
|
|
@@ -1108,16 +1112,18 @@ export default {
|
|
|
postAction(urlAcount + url, data).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.$message.success(result.message);
|
|
|
+ this.handlePolicyOperationCancel();
|
|
|
+ this.handleInitTable();
|
|
|
}
|
|
|
else {
|
|
|
this.$message.error(result.message);
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
console.log(error, 'eeee');
|
|
|
- }).finally(() => {
|
|
|
- this.policyOperationStatus = false;
|
|
|
- this.handleInitTable();
|
|
|
});
|
|
|
+ // .finally(() => {
|
|
|
+ // this.handlePolicyOperationCancel();
|
|
|
+ // });
|
|
|
},
|
|
|
// 新增政策取消按钮
|
|
|
handlePolicyOperationCancel() {
|
|
@@ -1129,18 +1135,18 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
companyName: '',
|
|
|
- advancePay: 1,
|
|
|
+ advancePay: 0,
|
|
|
advertiserName: '',
|
|
|
rebateType: undefined,
|
|
|
mediaType: 1,
|
|
|
createUserId: undefined,
|
|
|
areaInfo: undefined,
|
|
|
- companySubjectId: undefined,
|
|
|
+ companySubjectName: undefined,
|
|
|
promotionType: 1,
|
|
|
groupAbbreviation: '',
|
|
|
rebateRate: '',
|
|
|
accountingPeriod: '',
|
|
|
- isDianPay: undefined,
|
|
|
+ isDianPay: 0,
|
|
|
dianPayCompanyName: '',
|
|
|
dianPayCompanyRebateRate: '',
|
|
|
addTimes: [],
|