Commit 8eb2c42d by Jaxon

feat: 嘀加上架 - 流量方信息模块 - 业务规则校对

1 parent ea767998
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
formItems() { formItems() {
return this.schema.map(item => ({ return this.schema.map(item => ({
...item, ...item,
name: item.type === "select" ? item.optionLabel : item.name, name: item.descKey || (item.type === "select" ? item.optionLabel : item.name),
valueWidth: "314px", valueWidth: "314px",
labelWidth: "250px", labelWidth: "250px",
itemStyle: { itemStyle: {
......
...@@ -91,35 +91,6 @@ export default { ...@@ -91,35 +91,6 @@ export default {
handleAppendTraffic() { handleAppendTraffic() {
this.dialog.appendTraffic.show = !this.dialog.appendTraffic.show; this.dialog.appendTraffic.show = !this.dialog.appendTraffic.show;
}, },
// TODO: 运营模式:直营,默认,且不可编辑
dealPartnerMer() {
// const idx = this.editFormData.findIndex(
// item => item.name == "partnerMerchantId",
// );
// this.editFormData[idx].isDisabled = this.editData.operationMode == "1";
// if (this.editData.operationMode == "1") {
// const obj
// = this.baseData.partnerMerchantList.find(
// item => item.merchantName == "深圳嘀加",
// ) || {};
// this.editData.partnerMerchantId = obj?.merchantId;
// this.editData.partnerMerchantName = obj?.merchantName;
// this.SET_DATA({
// name: "shelfUpdateParMer",
// data: {
// merchantId: obj?.merchantId,
// merchantName: obj?.merchantName,
// scene: this.editData.sceneType,
// },
// });
// }
// this.SET_DATA({
// name: "operationMode",
// data: this.editData.operationMode,
// });
},
async validate() { async validate() {
const valid = await this.$refs.trafficFromRef.$refs.formRef.validate(); const valid = await this.$refs.trafficFromRef.$refs.formRef.validate();
if (valid) { if (valid) {
......
...@@ -82,7 +82,7 @@ export const ShopMerchantFormData = [ ...@@ -82,7 +82,7 @@ export const ShopMerchantFormData = [
optionLabel: "confName", optionLabel: "confName",
optionsName: "businessModeList", optionsName: "businessModeList",
isHide({ formModel }) { isHide({ formModel }) {
return !(formModel.sceneType === 1); return !(formModel.sceneType === 0);
}, },
render(h, { data }) { render(h, { data }) {
return h( return h(
...@@ -95,6 +95,7 @@ export const ShopMerchantFormData = [ ...@@ -95,6 +95,7 @@ export const ShopMerchantFormData = [
label: "签约主体", label: "签约主体",
name: "contractingMerchantId", name: "contractingMerchantId",
descKey: "contractingMerchantName", descKey: "contractingMerchantName",
isClear: true,
type: "select", type: "select",
optionList: [], optionList: [],
style: { width: "50%" }, style: { width: "50%" },
...@@ -153,7 +154,6 @@ export const ShopMerchantFormData = [ ...@@ -153,7 +154,6 @@ export const ShopMerchantFormData = [
}, },
}, },
{ {
// TODO: 后面加个 % 符号
label: "预估转化率", label: "预估转化率",
name: "estimatedUpgradeRate", name: "estimatedUpgradeRate",
type: "inputNumber", type: "inputNumber",
...@@ -164,7 +164,7 @@ export const ShopMerchantFormData = [ ...@@ -164,7 +164,7 @@ export const ShopMerchantFormData = [
precision: 2, precision: 2,
controls: false, controls: false,
}, },
append: "%", suffix: "%",
}, },
{ {
label: "预估平均客单价", label: "预估平均客单价",
...@@ -179,7 +179,7 @@ export const ShopMerchantFormData = [ ...@@ -179,7 +179,7 @@ export const ShopMerchantFormData = [
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=精品升级时展示 // 业务场景=精品升级时展示
return formModel.sceneType !== 0; return formModel.sceneType !== 1;
}, },
}, },
{ {
...@@ -195,7 +195,7 @@ export const ShopMerchantFormData = [ ...@@ -195,7 +195,7 @@ export const ShopMerchantFormData = [
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=精品升级时展示 // 业务场景=精品升级时展示
return formModel.sceneType !== 0; return formModel.sceneType !== 1;
}, },
}, },
{ {
...@@ -207,6 +207,13 @@ export const ShopMerchantFormData = [ ...@@ -207,6 +207,13 @@ export const ShopMerchantFormData = [
optionLabel: "confName", optionLabel: "confName",
optionsName: "operationModeList", optionsName: "operationModeList",
style: { width: "50%" }, style: { width: "50%" },
changeAttr(value, targetItem, formModel) {
// 如果运营模式变动. 值等于1 的话. 服务商要变成禁用状态, 且值变为 "深圳嘀加"
if (value === 1) {
formModel.partnerMerchantId = -1;
formModel.partnerMerchantName = "深圳嘀加";
}
},
render(h, { data }) { render(h, { data }) {
return h( return h(
"span", "span",
...@@ -215,17 +222,15 @@ export const ShopMerchantFormData = [ ...@@ -215,17 +222,15 @@ export const ShopMerchantFormData = [
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=会员权益升级时展示 // 业务场景=会员权益升级时展示
return formModel.sceneType !== 1; return formModel.sceneType !== 0;
}, },
}, },
// TODO: 需要核对确认
{ {
label: "服务商", label: "服务商",
name: "partnerMerchantId", name: "partnerMerchantId",
descKey: "partnerMerchantName", descKey: "partnerMerchantName",
type: "select", type: "select",
isDisabled: false,
optionList: [], optionList: [],
optionId: "merchantId", optionId: "merchantId",
optionLabel: "merchantName", optionLabel: "merchantName",
...@@ -234,6 +239,10 @@ export const ShopMerchantFormData = [ ...@@ -234,6 +239,10 @@ export const ShopMerchantFormData = [
useSync: true, useSync: true,
syncField: "partnerMerchantName", syncField: "partnerMerchantName",
}, },
isDisabled({ formModel }) {
// 运营模式 值等于1 的话. 服务商要变成禁用状态
return formModel.operationMode === 1;
},
style: { width: "50%" }, style: { width: "50%" },
}, },
...@@ -247,25 +256,25 @@ export const ShopMerchantFormData = [ ...@@ -247,25 +256,25 @@ export const ShopMerchantFormData = [
maxlength: 50, maxlength: 50,
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=会员权益升级 展示 // 业务场景=会员权益升级 展示
return formModel.sceneType !== 1; return formModel.sceneType !== 0;
}, },
}, },
// TODO: 对接selectOption
{ {
label: "服务商2", label: "服务商2",
name: "partnerMerchantId2", name: "partnerMerchantId2",
descKey: "partnerMerchantName2", descKey: "partnerMerchantName2",
style: { width: "50%" }, style: { width: "50%" },
type: "select", type: "select",
optionLabel: "confName", optionId: "merchantId",
optionsName: "onlinePointsEnabledList", optionLabel: "merchantName",
optionsName: "partnerMerchantList",
optionSync: { optionSync: {
useSync: true, useSync: true,
syncField: "partnerMerchantName2", syncField: "partnerMerchantName2",
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=会员权益升级 展示 // 业务场景=会员权益升级 展示
return formModel.sceneType !== 1; return formModel.sceneType !== 0;
}, },
}, },
{ {
...@@ -318,7 +327,7 @@ export const ShopMerchantFormData = [ ...@@ -318,7 +327,7 @@ export const ShopMerchantFormData = [
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 业务场景=精品升级 展示 // 业务场景=精品升级 展示
return formModel.sceneType !== 0; return formModel.sceneType !== 1;
}, },
}, },
......
...@@ -279,17 +279,17 @@ export default { ...@@ -279,17 +279,17 @@ export default {
// 流量方 - 联动 - 服务商下拉框 // 流量方 - 联动 - 服务商下拉框
async getServiceListData() { async getServiceListData() {
const res = await getServiceList({ currentPage: 1, pageSize: 100000 }); const res = await getServiceList({ currentPage: 1, pageSize: 100000 });
console.log("res", res.list);
res?.list?.forEach((val) => { res?.list?.forEach((val) => {
val.merchantId = val.merchantNo - 0; val.merchantId = val.merchantNo - 0;
}); });
res.list.unshift({
merchantId: -1,
merchantName: "深圳嘀加",
});
this.setFromItemOptions("partnerMerchantList", res?.list || []); this.setFromItemOptions("partnerMerchantList", res?.list || []);
// TODO: 完善这个函数
// this.dealPartnerMer();
}, },
// 如果运营模式变动. 值等于1 的话. 服务商要变成禁用状态, 且值变为 "深圳嘀加"
dealPartnerMer() {},
async getPlatformMerchantListData() { async getPlatformMerchantListData() {
const res = await getPlatformMerchantList({}); const res = await getPlatformMerchantList({});
res.unshift({ res.unshift({
...@@ -300,12 +300,15 @@ export default { ...@@ -300,12 +300,15 @@ export default {
}, },
setFromItemOptions(optionsName, optionList) { setFromItemOptions(optionsName, optionList) {
const formItem = this.trafficFromSchema.find(item => item.optionsName === optionsName); const formItem = this.trafficFromSchema.filter(item => item.optionsName === optionsName);
if (!formItem) { if (!formItem) {
console.log("optionsName不存在", optionsName); console.log("optionsName不存在", optionsName);
return; return;
} }
formItem.optionList = optionList; for (const form of formItem) {
form.optionList = optionList;
}
console.log("formItem", formItem);
}, },
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!