Commit 8eb2c42d by Jaxon

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

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