Commit 2c097084 authored by limengyang's avatar limengyang

fix(lmy):解决不能跳转问题

parent d6c4dc63
...@@ -104,8 +104,8 @@ const getLeftData = () => { ...@@ -104,8 +104,8 @@ const getLeftData = () => {
] ]
if (rightData.value.length > 0) { if (rightData.value.length > 0) {
for (let i = 0; i < rightData.value.length; i++) { for (let i = 0; i < rightData.value.length; i++) {
if (leftData.value.findIndex((v) => v.sysid === rightData.value[i].sysid) !== -1) { 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.sysid === rightData.value[i].sysid).choice = true 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 = () => { ...@@ -131,8 +131,8 @@ const toRight = () => {
let arr = JSON.parse(JSON.stringify(selectedRows.value)) let arr = JSON.parse(JSON.stringify(selectedRows.value))
rightData.value = [...arr, ...rightData.value] rightData.value = [...arr, ...rightData.value]
for (let i = 0; i < selectedRows.value.length; i++) { for (let i = 0; i < selectedRows.value.length; i++) {
if (leftData.value.findIndex((v) => v.sysid === selectedRows.value[i].sysid) !== -1) { 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.sysid === selectedRows.value[i].sysid).choice = true 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] leftData.value = [...leftData.value]
...@@ -153,15 +153,15 @@ const rightRowSelection = computed(() => { ...@@ -153,15 +153,15 @@ const rightRowSelection = computed(() => {
}) })
const toLeft = () => { const toLeft = () => {
for (let i = 0; i < rightSelectedRows.value.length; i++) { for (let i = 0; i < rightSelectedRows.value.length; i++) {
if (leftData.value.findIndex((v) => v.sysid === rightSelectedRows.value[i].sysid) !== -1) { 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.sysid === rightSelectedRows.value[i].sysid).choice = false 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.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 1
) )
} else { } else {
rightData.value.splice( 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 1
) )
} }
...@@ -319,7 +319,7 @@ const confirm = async () => { ...@@ -319,7 +319,7 @@ const confirm = async () => {
:columns="leftColumns" :columns="leftColumns"
:pagination="pagination" :pagination="pagination"
:row-selection="rowSelection" :row-selection="rowSelection"
:rowKey="(record) => record.sysid" :rowKey="(record) => record.brand + record.goodsNo + record.spec"
:scroll="{ x: false, y: 280 }" :scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName" :rowClassName="rowClassName"
:loading="loading" :loading="loading"
...@@ -366,7 +366,7 @@ const confirm = async () => { ...@@ -366,7 +366,7 @@ const confirm = async () => {
:data-source="rightData" :data-source="rightData"
:columns="leftColumns" :columns="leftColumns"
:pagination="false" :pagination="false"
:rowKey="(record) => record.sysid" :rowKey="(record) => record.brand + record.goodsNo + record.spec"
:scroll="{ x: false, y: 280 }" :scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName" :rowClassName="rowClassName"
:row-selection="rightRowSelection" :row-selection="rightRowSelection"
......
...@@ -55,7 +55,11 @@ const typesOption = ref([ ...@@ -55,7 +55,11 @@ const typesOption = ref([
let searchBrandList = ref<any[]>([]) let searchBrandList = ref<any[]>([])
const handleSearch = async (value) => { const handleSearch = async (value) => {
const res = await regionalSpotManageBrandListApi({brand: value}); const res = await regionalSpotManageBrandListApi({brand: value});
if (res.code === 20000) {
searchBrandList.value = res.data searchBrandList.value = res.data
} else {
searchBrandList.value = []
}
} }
let listLoading = ref(false) let listLoading = ref(false)
const pagination = ref({ const pagination = ref({
...@@ -465,6 +469,7 @@ const goTaskCenter = () => { ...@@ -465,6 +469,7 @@ const goTaskCenter = () => {
</script> </script>
<template> <template>
<div>
<div class="body-box"> <div class="body-box">
<Form :model="searchForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" class="top-search"> <Form :model="searchForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" class="top-search">
<Row :gutter="20"> <Row :gutter="20">
...@@ -662,6 +667,7 @@ const goTaskCenter = () => { ...@@ -662,6 +667,7 @@ const goTaskCenter = () => {
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
</a-modal> </a-modal>
</div>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment