|
@@ -100,8 +100,8 @@ const Upsert = useUpsert({
|
|
|
'code',
|
|
|
channels.value.filter((item: any) => item.payType === data).map((item: any) => {
|
|
|
return {
|
|
|
- label: item.code,
|
|
|
- value: item.code
|
|
|
+ label: item.code + '(' + item.currency + ')',
|
|
|
+ value: item.code + '_' + item.currency
|
|
|
}
|
|
|
})
|
|
|
);
|
|
@@ -119,15 +119,27 @@ const Upsert = useUpsert({
|
|
|
props: {
|
|
|
onChange(data) {
|
|
|
const channel: any = channels.value.find((item: any) => {
|
|
|
- return item.code === data
|
|
|
+ return item.code + '_' + item.currency === data
|
|
|
})
|
|
|
if (channel) {
|
|
|
Upsert.value?.setForm('payType', channel.payType)
|
|
|
+ Upsert.value?.setForm('currency', channel.currency)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- required: true
|
|
|
+ required: true,
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "currency",
|
|
|
+ label: "货币单位",
|
|
|
+ required: true,
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: { readonly: true }
|
|
|
+ },
|
|
|
+ span: 12
|
|
|
},
|
|
|
{
|
|
|
prop: "weight",
|
|
@@ -167,12 +179,24 @@ const Upsert = useUpsert({
|
|
|
'code',
|
|
|
channels.value.map((item: any) => {
|
|
|
return {
|
|
|
- label: item.code,
|
|
|
- value: item.code
|
|
|
+ label: item.code + '(' + item.currency + ')',
|
|
|
+ value: item.code + '_' + item.currency
|
|
|
}
|
|
|
})
|
|
|
);
|
|
|
- }
|
|
|
+ if (data.code) {
|
|
|
+ data.code = data.code + '_' + data.currency;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async onSubmit(data, { next }) {
|
|
|
+ const channel: any = channels.value.find((item: any) => {
|
|
|
+ return item.code + '_' + item.currency === data.code
|
|
|
+ })
|
|
|
+ if (channel) {
|
|
|
+ data.code = channel.code
|
|
|
+ }
|
|
|
+ next(data);
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
// cl-table
|
|
@@ -185,6 +209,10 @@ const Table = useTable({
|
|
|
prop: "code",
|
|
|
label: "通道编码",
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: "currency",
|
|
|
+ label: "货币单位",
|
|
|
+ },
|
|
|
{ prop: "weight", label: "权重" },
|
|
|
{ prop: "status", label: "状态", component: { name: "cl-switch" } },
|
|
|
{ type: "op", buttons: ["edit", "delete"] }
|