|
@ -39,6 +39,7 @@ const addConsume = ref({ |
|
|
rechargeCoin: 0, |
|
|
rechargeCoin: 0, |
|
|
taskCoin: 0, |
|
|
taskCoin: 0, |
|
|
updateType: "1", |
|
|
updateType: "1", |
|
|
|
|
|
indexName:"", //这个是指标字段,后面绑定 |
|
|
}); |
|
|
}); |
|
|
// 这是添加消费信息的接口 |
|
|
// 这是添加消费信息的接口 |
|
|
const add = async function () { |
|
|
const add = async function () { |
|
@ -130,6 +131,19 @@ const rules = reactive({ |
|
|
{ required: true, message: "消费金币总数不能为空", trigger: "blur" }, |
|
|
{ required: true, message: "消费金币总数不能为空", trigger: "blur" }, |
|
|
{ validator: checkFreeGoldRadio, trigger: "blur" }, |
|
|
{ validator: checkFreeGoldRadio, trigger: "blur" }, |
|
|
], |
|
|
], |
|
|
|
|
|
indexName: [ |
|
|
|
|
|
{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
|
if (isHC.value === 1 && !value) { |
|
|
|
|
|
callback(new Error("请选择指标")); |
|
|
|
|
|
} else { |
|
|
|
|
|
callback(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
trigger: ["change", "blur"], |
|
|
|
|
|
}, |
|
|
|
|
|
] |
|
|
}); |
|
|
}); |
|
|
//这是重置方法 |
|
|
//这是重置方法 |
|
|
const delteConsume = function () { |
|
|
const delteConsume = function () { |
|
@ -305,17 +319,22 @@ const getIndexs = async function (type) { |
|
|
const isHC = ref(0); |
|
|
const isHC = ref(0); |
|
|
const handleProductSelect = (productName) => { |
|
|
const handleProductSelect = (productName) => { |
|
|
// 根据商品名称获取对应的商品信息 |
|
|
// 根据商品名称获取对应的商品信息 |
|
|
indexs.value.productName = productName; |
|
|
|
|
|
if (productName == "homilychart") { |
|
|
|
|
|
|
|
|
// indexs.value.productName = productName;为什么直接绑定??? |
|
|
|
|
|
if (productName === "homilychart") { |
|
|
isHC.value = 1; |
|
|
isHC.value = 1; |
|
|
|
|
|
addConsume.value.productName = "homilychart"; // 商品名 |
|
|
|
|
|
addConsume.value.indexName = ""; // 指标名 |
|
|
} else { |
|
|
} else { |
|
|
isHC.value = 0; |
|
|
isHC.value = 0; |
|
|
|
|
|
addConsume.value.productName = productName; |
|
|
|
|
|
addConsume.value.indexName = ""; |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
const indexs = ref([]); |
|
|
const indexs = ref([]); |
|
|
const handleIndexSelect = (indexName) => { |
|
|
|
|
|
indexs.value.productName = "homilychart" + indexName; |
|
|
|
|
|
console.log("选择的指标是", indexs.value.productName); |
|
|
|
|
|
|
|
|
const handleIndexSelect = () => { |
|
|
|
|
|
if (isHC.value === 1 && addConsume.value.indexName) { |
|
|
|
|
|
addConsume.value.productName = "homilychart" + addConsume.value.indexName; |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 挂载 |
|
|
// 挂载 |
|
@ -388,12 +407,13 @@ const handleSelectBlur = (value) => { |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item prop="productName" label="指标" v-if="isHC == 1"> |
|
|
|
|
|
|
|
|
<!-- prop为什么绑定productName --> |
|
|
|
|
|
<el-form-item prop="indexName" label="指标" v-if="isHC == 1"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="indexs.name" |
|
|
|
|
|
|
|
|
v-model="addConsume.indexName" |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
|
style="width: 100px" |
|
|
style="width: 100px" |
|
|
@change="handleIndexSelect(indexs.name)" |
|
|
|
|
|
|
|
|
@change="handleIndexSelect" |
|
|
filterable |
|
|
filterable |
|
|
allow-create |
|
|
allow-create |
|
|
default-first-option |
|
|
default-first-option |
|
|