增加一个渠道绑定

This commit is contained in:
wuweihua
2026-11-10 16:21:07 +08:00
parent e6a9fcf0a2
commit 1a0483c7fe
20 changed files with 940 additions and 147 deletions
+31 -5
View File
@@ -14,10 +14,13 @@
<set-customer-table :set="setInfo" @refresh="loadHeader" />
<label-channel-table ref="channelTableRef" :price-set-id="priceSetId" />
<label-version-table
:versions="versions"
@edit="openEditVersion"
@reschedule="openReschedule"
@remove="removeVersion"
@open-details="openVersionDetails"
@create-version="openCreateVersion"
/>
@@ -45,13 +48,14 @@
<el-form-item label="生效时间" prop="effectiveTime">
<el-date-picker
v-model="activateForm.effectiveTime"
type="date"
value-format="YYYY-MM-DD"
type="datetime"
value-format="YYYY-MM-DD HH:00:00"
format="YYYY-MM-DD HH:00"
placeholder="请选择生效时间"
style="width: 100%"
/>
</el-form-item>
<div class="activate-hint">仅待生效版本可修改;未到生效日仍为待生效,到日后自动按生效处理。</div>
<div class="activate-hint">仅待生效版本可修改;精确到小时。未到生效时间仍为待生效,到时自动按生效处理。</div>
</el-form>
<template #footer>
<el-button @click="activateVisible = false">取消</el-button>
@@ -66,6 +70,7 @@ import {
getLabelPackage,
listLabelVersions,
activateLabelVersion,
deleteLabelVersion,
listLabelCustomer,
addLabelCustomer,
batchAddLabelCustomer,
@@ -78,6 +83,7 @@ import SetCustomerTable from '../set/components/detail/SetCustomerTable.vue'
import LabelImportDialog from './components/LabelImportDialog.vue'
import LabelVersionTable from './components/LabelVersionTable.vue'
import LabelVersionProductDrawer from './components/LabelVersionProductDrawer.vue'
import LabelChannelTable from './components/LabelChannelTable.vue'
const labelModuleApi = {
...priceSetApi,
@@ -127,6 +133,7 @@ const setInfo = reactive({
})
const versions = ref([])
const importRef = ref()
const channelTableRef = ref()
const productDrawerVisible = ref(false)
const activeVersion = ref(null)
@@ -176,6 +183,7 @@ async function loadVersions() {
async function reloadAll() {
await loadHeader()
await loadVersions()
channelTableRef.value?.reload?.()
}
function openVersionDetails(row) {
@@ -196,7 +204,7 @@ function openCreateVersion() {
})
}
/** 编辑待生效版本价卡 */
/** 编辑待生效/已生效版本价卡 */
function openEditVersion(row) {
if (!priceSetId.value || !row?.versionNo) return
proxy.$router.push({
@@ -209,10 +217,28 @@ function openEditVersion(row) {
})
}
function removeVersion(row) {
if (!priceSetId.value || !row?.versionNo) return
const label = row.versionLabel || ('V' + row.versionNo)
proxy.$modal.confirm('确认删除待生效版本 ' + label + '?该版产品价卡将一起清除。').then(() => {
return deleteLabelVersion(priceSetId.value, row.versionNo)
}).then(() => {
proxy.$modal.msgSuccess('版本已删除')
reloadAll()
}).catch(() => {})
}
function toHourValue(val) {
const text = String(val || '').replace('T', ' ')
if (text.length >= 13) return text.slice(0, 13) + ':00:00'
if (text.length >= 10) return text.slice(0, 10) + ' 00:00:00'
return undefined
}
function openReschedule(row) {
activateForm.versionNo = row.versionNo
activateForm.versionLabel = row.versionLabel || ('V' + row.versionNo)
activateForm.effectiveTime = row.effectiveTime ? String(row.effectiveTime).slice(0, 10) : undefined
activateForm.effectiveTime = row.effectiveTime ? toHourValue(row.effectiveTime) : undefined
activateVisible.value = true
}