diff --git a/bms-front/src/views/price/label/components/LabelChannelPickerDialog.vue b/bms-front/src/views/price/label/components/LabelChannelPickerDialog.vue new file mode 100644 index 00000000..a2b23fa8 --- /dev/null +++ b/bms-front/src/views/price/label/components/LabelChannelPickerDialog.vue @@ -0,0 +1,189 @@ + + + + + 共 {{ filteredRows.length }} 项,已选 {{ picked.length }} 项 + + + + + + + + + 启用 + 停用 + + + + + + 绑定为收款(AR),落库 srv_channel_product_map;一个渠道同一收付类型仅保留一条产品映射。已绑定渠道不可重复勾选。 + + + + 取 消 + 确 定 + + + + + + + diff --git a/bms-front/src/views/price/label/components/LabelVersionProductDrawer.vue b/bms-front/src/views/price/label/components/LabelVersionProductDrawer.vue index 8b65e05f..1ee1b71a 100644 --- a/bms-front/src/views/price/label/components/LabelVersionProductDrawer.vue +++ b/bms-front/src/views/price/label/components/LabelVersionProductDrawer.vue @@ -73,46 +73,11 @@ - - - - - {{ bindProductName }} - - - - - - - {{ bindHint }} - - - - 取消 - 保存 - - + :exclude-channel-ids="currentBoundIds()" + @confirm="onPickerConfirm" + /> { const v = props.version || {} @@ -212,11 +169,6 @@ const filteredRows = computed(() => { }) }) -const addableChannelOptions = computed(() => { - const bound = new Set((boundChannels.value || []).map(item => String(item.channelId))) - return (channelOptions.value || []).filter(item => item && item.id != null && !bound.has(String(item.id))) -}) - function formatHour(val) { if (!val) return '' const text = String(val).replace('T', ' ') @@ -269,12 +221,6 @@ async function load() { } } -async function ensureChannelOptions() { - if (channelOptions.value.length) return - const res = await listChannelOptions({ blOpen: '1' }) - channelOptions.value = res.data || [] -} - async function loadBoundChannels() { if (!bindProductId.value) { boundChannels.value = [] @@ -323,33 +269,21 @@ function onBindListClosed() { bindProductName.value = '' boundChannels.value = [] addVisible.value = false - addChannelIds.value = [] } async function openAddChannels() { - addChannelIds.value = [] addVisible.value = true - addLoading.value = true - try { - await ensureChannelOptions() - } finally { - addLoading.value = false - } -} - -function onAddClosed() { - addChannelIds.value = [] } function currentBoundIds() { return (boundChannels.value || []).map(item => String(item.channelId)).filter(Boolean) } -function submitAddChannels() { +function onPickerConfirm(list) { if (!bindProductId.value) return - const selected = (addChannelIds.value || []).map(String).filter(Boolean) + const selected = (list || []).map(item => String(item.id)).filter(Boolean) if (!selected.length) { - proxy.$modal.msgWarning('请先选择要添加的渠道') + proxy.$modal.msgWarning('请先勾选要添加的渠道') return } const merged = Array.from(new Set(currentBoundIds().concat(selected))) @@ -398,10 +332,4 @@ watch(() => [props.visible, props.priceSetId, props.version?.versionNo], ([vis]) justify-content: flex-end; margin-bottom: 12px; } -.bind-hint { - margin: -4px 0 0 88px; - color: #909399; - font-size: 12px; - line-height: 1.5; -}