diff --git a/src/views/regionalSpotManage/components/addProduct.vue b/src/views/regionalSpotManage/components/addProduct.vue index 6f67c94045b2c45fe7fbfd4083a1298f13f9f23c..148afc2c1fc1b76bbbc121fb5b72ef0bf75dd269 100644 --- a/src/views/regionalSpotManage/components/addProduct.vue +++ b/src/views/regionalSpotManage/components/addProduct.vue @@ -104,8 +104,8 @@ const getLeftData = () => { ] if (rightData.value.length > 0) { for (let i = 0; i < rightData.value.length; i++) { - if (leftData.value.findIndex((v) => v.sysid === rightData.value[i].sysid) !== -1) { - leftData.value.find((v) => v.sysid === rightData.value[i].sysid).choice = true + if (leftData.value.findIndex((v) => v.brand + v.goodsNo + v.spec === rightData.value[i].brand + rightData.value[i].goodsNo + rightData.value[i].spec) !== -1) { + leftData.value.find((v) => v.brand + v.goodsNo + v.spec === rightData.value[i].brand + rightData.value[i].goodsNo + rightData.value[i].spec).choice = true } } } @@ -131,8 +131,8 @@ const toRight = () => { let arr = JSON.parse(JSON.stringify(selectedRows.value)) rightData.value = [...arr, ...rightData.value] for (let i = 0; i < selectedRows.value.length; i++) { - if (leftData.value.findIndex((v) => v.sysid === selectedRows.value[i].sysid) !== -1) { - leftData.value.find((v) => v.sysid === selectedRows.value[i].sysid).choice = true + if (leftData.value.findIndex((v) => v.brand + v.goodsNo + v.spec === selectedRows.value[i].brand + selectedRows.value[i].goodsNo + selectedRows.value[i].spec) !== -1) { + leftData.value.find((v) => v.brand + v.goodsNo + v.spec === selectedRows.value[i].brand + selectedRows.value[i].goodsNo + selectedRows.value[i].spec).choice = true } } leftData.value = [...leftData.value] @@ -153,15 +153,15 @@ const rightRowSelection = computed(() => { }) const toLeft = () => { for (let i = 0; i < rightSelectedRows.value.length; i++) { - if (leftData.value.findIndex((v) => v.sysid === rightSelectedRows.value[i].sysid) !== -1) { - leftData.value.find((v) => v.sysid === rightSelectedRows.value[i].sysid).choice = false + if (leftData.value.findIndex((v) => v.brand + v.goodsNo + v.spec === rightSelectedRows.value[i].brand + rightSelectedRows.value[i].goodsNo + rightSelectedRows.value[i].spec) !== -1) { + leftData.value.find((v) => v.brand + v.goodsNo + v.spec === rightSelectedRows.value[i].brand + rightSelectedRows.value[i].goodsNo + rightSelectedRows.value[i].spec).choice = false rightData.value.splice( - rightData.value.findIndex((v) => v.sysid == rightSelectedRows.value[i].sysid), + rightData.value.findIndex((v) => v.brand + v.goodsNo + v.spec == rightSelectedRows.value[i].brand + rightSelectedRows.value[i].goodsNo + rightSelectedRows.value[i].spec), 1 ) } else { rightData.value.splice( - rightData.value.findIndex((v) => v.sysid == rightSelectedRows.value[i].sysid), + rightData.value.findIndex((v) => v.brand + v.goodsNo + v.spec == rightSelectedRows.value[i].brand + rightSelectedRows.value[i].goodsNo + rightSelectedRows.value[i].spec), 1 ) } @@ -319,7 +319,7 @@ const confirm = async () => { :columns="leftColumns" :pagination="pagination" :row-selection="rowSelection" - :rowKey="(record) => record.sysid" + :rowKey="(record) => record.brand + record.goodsNo + record.spec" :scroll="{ x: false, y: 280 }" :rowClassName="rowClassName" :loading="loading" @@ -366,7 +366,7 @@ const confirm = async () => { :data-source="rightData" :columns="leftColumns" :pagination="false" - :rowKey="(record) => record.sysid" + :rowKey="(record) => record.brand + record.goodsNo + record.spec" :scroll="{ x: false, y: 280 }" :rowClassName="rowClassName" :row-selection="rightRowSelection" diff --git a/src/views/regionalSpotManage/components/list.vue b/src/views/regionalSpotManage/components/list.vue index 5194da52acab4c56cddace049c5e8776a2337250..1a7e90d47dead5fbdf84cdcd391e8a6e8720cd28 100644 --- a/src/views/regionalSpotManage/components/list.vue +++ b/src/views/regionalSpotManage/components/list.vue @@ -55,7 +55,11 @@ const typesOption = ref([ let searchBrandList = ref([]) const handleSearch = async (value) => { const res = await regionalSpotManageBrandListApi({brand: value}); - searchBrandList.value = res.data + if (res.code === 20000) { + searchBrandList.value = res.data + } else { + searchBrandList.value = [] + } } let listLoading = ref(false) const pagination = ref({ @@ -465,203 +469,205 @@ const goTaskCenter = () => {