Commit 2c097084 authored by limengyang's avatar limengyang

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

parent d6c4dc63
......@@ -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"
......
......@@ -55,7 +55,11 @@ const typesOption = ref([
let searchBrandList = ref<any[]>([])
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 = () => {
</script>
<template>
<div class="body-box">
<Form :model="searchForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" class="top-search">
<Row :gutter="20">
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="品牌名称" name="brandList">
<!-- <Input v-model:value="searchForm.brandList" allow-clear placeholder="请输入品牌名称" /> -->
<a-select
v-model:value="searchForm.brandList"
show-search
mode="multiple"
placeholder="请输入品牌名称"
style="width: 100%"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="handleSearch"
>
<a-select-option v-for="item in searchBrandList" :key="item.value" :label="item.label" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="货号" name="goodsNo">
<Input v-model:value="searchForm.goodsNo" allow-clear placeholder="请输入货号" />
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="现货区域" name="areaIds">
<Select v-model:value="searchForm.areaIds" allowClear mode="multiple" placeholder="请选择现货区域" style="width: 100%">
<SelectOption v-for="(item, index) in areaIdsOption" :key="index" :value="item.value">{{ item.label }}</SelectOption>
</Select>
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="商品分组" name="types">
<Select v-model:value="searchForm.types" allowClear mode="multiple" placeholder="请选择商品分组" style="width: 100%">
<SelectOption v-for="(item, index) in typesOption" :key="index" :value="item.value">{{ item.label }}</SelectOption>
</Select>
</FormItem>
</Col>
<Col :span="24" style="display: flex;justify-content: space-between;">
<div>
<Button type="primary" style="margin: 0 5px" @click="onSearch">查询</Button>
<Button style="margin: 0 5px" @click="onRset">重置</Button>
<Button type="primary" @click="addProduct" style="margin: 0 5px">新增商品</Button>
<Button type="primary" @click="batchImport" style="margin: 0 5px">批量导入</Button>
<Button type="primary" @click="batchDel" style="margin: 0 5px">批量删除</Button>
</div>
<Button @click="goTaskCenter" style="margin: 0 5px">任务中心日志</Button>
</Col>
</Row>
</Form>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:pagination="pagination"
:rowKey="(record) => record.sysid"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, columnWidth: 65 }"
style="margin-top: 15px"
>
<a-table-column title="商品名称" align="center" :width="100">
<template v-slot="{record}">
{{ record.productName }}
</template>
</a-table-column>
<a-table-column title="品牌" align="center" :width="100">
<template v-slot="{record}">
{{ record.brand }}
</template>
</a-table-column>
<a-table-column title="货号" align="center" :width="100">
<template v-slot="{record}">
{{ record.goodsNo }}
</template>
</a-table-column>
<a-table-column title="规格" align="center" :width="100">
<template v-slot="{record}">
{{ record.spec }}
</template>
</a-table-column>
<a-table-column title="当前现货区域" align="center" :width="100">
<template v-slot="{record}">
<Button type="link" @click="viewCurrent(record)">查看区域现货</Button>
</template>
</a-table-column>
<a-table-column title="上架状态" align="center" :width="100">
<template v-slot="{record}">
{{ record.productStatus }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}">
<Button type="link" @click="addArea(record)">增加区域</Button>
<Button type="link" style="margin-left: 5px" @click="del(record)">删除</Button>
</template>
</a-table-column>
</a-table>
</div>
<addProductModal v-if="showModal" @close="closeVisible"></addProductModal>
<a-modal v-model:visible="visible" title="商品可提供现货区域查看" :width="600" @ok="visible = false" :footer="null" :maskClosable="false" okText="提交">
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div>
<a-table
:data-source="regionalSpotGoods"
bordered
:loading="loading1"
:pagination="false"
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="区域" align="center" :width="100">
<template v-slot="{record}">
{{ record.provinceName }}-{{ record.cityName }}
</template>
</a-table-column>
<a-table-column title="添加时间" align="center" :width="100">
<template v-slot="{record}">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="添加人" align="center" :width="100">
<template v-slot="{record}">
{{ record.createName }}
<div>
<div class="body-box">
<Form :model="searchForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" class="top-search">
<Row :gutter="20">
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="品牌名称" name="brandList">
<!-- <Input v-model:value="searchForm.brandList" allow-clear placeholder="请输入品牌名称" /> -->
<a-select
v-model:value="searchForm.brandList"
show-search
mode="multiple"
placeholder="请输入品牌名称"
style="width: 100%"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="handleSearch"
>
<a-select-option v-for="item in searchBrandList" :key="item.value" :label="item.label" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="货号" name="goodsNo">
<Input v-model:value="searchForm.goodsNo" allow-clear placeholder="请输入货号" />
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="现货区域" name="areaIds">
<Select v-model:value="searchForm.areaIds" allowClear mode="multiple" placeholder="请选择现货区域" style="width: 100%">
<SelectOption v-for="(item, index) in areaIdsOption" :key="index" :value="item.value">{{ item.label }}</SelectOption>
</Select>
</FormItem>
</Col>
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="商品分组" name="types">
<Select v-model:value="searchForm.types" allowClear mode="multiple" placeholder="请选择商品分组" style="width: 100%">
<SelectOption v-for="(item, index) in typesOption" :key="index" :value="item.value">{{ item.label }}</SelectOption>
</Select>
</FormItem>
</Col>
<Col :span="24" style="display: flex;justify-content: space-between;">
<div>
<Button type="primary" style="margin: 0 5px" @click="onSearch">查询</Button>
<Button style="margin: 0 5px" @click="onRset">重置</Button>
<Button type="primary" @click="addProduct" style="margin: 0 5px">新增商品</Button>
<Button type="primary" @click="batchImport" style="margin: 0 5px">批量导入</Button>
<Button type="primary" @click="batchDel" style="margin: 0 5px">批量删除</Button>
</div>
<Button @click="goTaskCenter" style="margin: 0 5px">任务中心日志</Button>
</Col>
</Row>
</Form>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:pagination="pagination"
:rowKey="(record) => record.sysid"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, columnWidth: 65 }"
style="margin-top: 15px"
>
<a-table-column title="商品名称" align="center" :width="100">
<template v-slot="{record}">
{{ record.productName }}
</template>
</a-table-column>
<a-table-column title="品牌" align="center" :width="100">
<template v-slot="{record}">
{{ record.brand }}
</template>
</a-table-column>
<a-table-column title="货号" align="center" :width="100">
<template v-slot="{record}">
{{ record.goodsNo }}
</template>
</a-table-column>
<a-table-column title="规格" align="center" :width="100">
<template v-slot="{record}">
{{ record.spec }}
</template>
</a-table-column>
<a-table-column title="当前现货区域" align="center" :width="100">
<template v-slot="{record}">
<Button type="link" @click="viewCurrent(record)">查看区域现货</Button>
</template>
</a-table-column>
<a-table-column title="上架状态" align="center" :width="100">
<template v-slot="{record}">
{{ record.productStatus }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}">
<Button type="link" @click="addArea(record)">增加区域</Button>
<Button type="link" style="margin-left: 5px" @click="del(record)">删除</Button>
</template>
</a-table-column>
</a-table>
</div>
<addProductModal v-if="showModal" @close="closeVisible"></addProductModal>
<a-modal v-model:visible="visible" title="商品可提供现货区域查看" :width="600" @ok="visible = false" :footer="null" :maskClosable="false" okText="提交">
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div>
<a-table
:data-source="regionalSpotGoods"
bordered
:loading="loading1"
:pagination="false"
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="区域" align="center" :width="100">
<template v-slot="{record}">
{{ record.provinceName }}-{{ record.cityName }}
</template>
</a-table-column>
<a-table-column title="添加时间" align="center" :width="100">
<template v-slot="{record}">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="添加人" align="center" :width="100">
<template v-slot="{record}">
{{ record.createName }}
</template>
</a-table-column>
</a-table>
</a-modal>
<!-- 删除 -->
<a-modal v-model:visible="delVisible" title="区域现货商品删除" :width="650" :maskClosable="false" :keyboard="false" @cancel="delVisibleCancel" @ok="confirmDel" :confirmLoading="delConfirLoading" okText="提交">
<p>您已选中 <span style="color: #1684FC">{{ deleteNum }}条</span> 商品</p>
<a-spin v-if="delLoading" style="height: 150px;width: 100%;line-height: 150px" />
<p v-else>选择需要删除的现货区域:
<a-radio-group v-model:value="radioValue">
<a-radio :value="1">全部区域</a-radio>
<a-radio :value="2">部分区域</a-radio>
</a-radio-group>
<a-checkbox-group v-model:value="delCheckboxValue" :disabled="radioValue === 1" style="width: 100%;margin-top: 15px">
<a-row>
<a-col :span="6" v-for="(item, index) in delAreaList" :key="index">
<a-checkbox :value="item.id">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</p>
</a-modal>
<!-- 增加区域 -->
<a-modal v-model:visible="addVisible" title="现货商品增加区域" :width="700" :maskClosable="false" @cancel="addVisibleCancel" @ok="confirmAddArea" okText="提交" :confirmLoading="confirmAddLoading">
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div>
<p style="margin-top: 15px">选择可提供现货的区域:</p>
<a-checkbox-group v-model:value="addCheckboxValue" style="width: 100%">
<a-row>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</a-modal>
<!-- 批量导入 -->
<a-modal v-model:visible="importVisible" title="区域现货商品批量导入" :width="700" :maskClosable="false" okText="提交" @ok="confirmImport" @cancel="importCancel" :confirmLoading="importLoading">
<a-alert type="warning">
<template #message>
<span style="color: red">特别提醒:</span>若商品之前已设置现货区域,则本次设置为在之前设置基础上新增。例如,原来商品设置为 北京市-直辖市;天津市-直辖市。本次设置为,北京市-直辖市;四川省-成都市。提交后,商品现货区域将更新为 北京市-直辖市;天津市-直辖市;四川省-成都市。
</template>
</a-table-column>
</a-table>
</a-modal>
<!-- 删除 -->
<a-modal v-model:visible="delVisible" title="区域现货商品删除" :width="650" :maskClosable="false" :keyboard="false" @cancel="delVisibleCancel" @ok="confirmDel" :confirmLoading="delConfirLoading" okText="提交">
<p>您已选中 <span style="color: #1684FC">{{ deleteNum }}条</span> 商品</p>
<a-spin v-if="delLoading" style="height: 150px;width: 100%;line-height: 150px" />
<p v-else>选择需要删除的现货区域:
<a-radio-group v-model:value="radioValue">
<a-radio :value="1">全部区域</a-radio>
<a-radio :value="2">部分区域</a-radio>
</a-radio-group>
<a-checkbox-group v-model:value="delCheckboxValue" :disabled="radioValue === 1" style="width: 100%;margin-top: 15px">
</a-alert>
<div style="margin-top: 15px;display: flex;align-items: center">
<span>上传商品文件:</span>
<a-upload
accept=".xls,.xlsx"
:file-list="productExcelList"
:before-upload="productExcelBeforeUpload"
@remove="productExcelRemove"
>
<a-button><upload-outlined></upload-outlined>上传文件</a-button>
</a-upload>
<span style="margin-left: 15px">
下载
<a @click="downLoad">区域现货商品上传模板</a>
</span>
</div>
<p style="margin-top: 15px">选择现货区域:</p>
<a-checkbox-group v-model:value="impotrCheckboxValue" style="width: 100%;">
<a-row>
<a-col :span="6" v-for="(item, index) in delAreaList" :key="index">
<a-checkbox :value="item.id">{{ item.province }}-{{ item.city }}</a-checkbox>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</p>
</a-modal>
<!-- 增加区域 -->
<a-modal v-model:visible="addVisible" title="现货商品增加区域" :width="700" :maskClosable="false" @cancel="addVisibleCancel" @ok="confirmAddArea" okText="提交" :confirmLoading="confirmAddLoading">
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div>
<p style="margin-top: 15px">选择可提供现货的区域:</p>
<a-checkbox-group v-model:value="addCheckboxValue" style="width: 100%">
<a-row>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</a-modal>
<!-- 批量导入 -->
<a-modal v-model:visible="importVisible" title="区域现货商品批量导入" :width="700" :maskClosable="false" okText="提交" @ok="confirmImport" @cancel="importCancel" :confirmLoading="importLoading">
<a-alert type="warning">
<template #message>
<span style="color: red">特别提醒:</span>若商品之前已设置现货区域,则本次设置为在之前设置基础上新增。例如,原来商品设置为 北京市-直辖市;天津市-直辖市。本次设置为,北京市-直辖市;四川省-成都市。提交后,商品现货区域将更新为 北京市-直辖市;天津市-直辖市;四川省-成都市。
</template>
</a-alert>
<div style="margin-top: 15px;display: flex;align-items: center">
<span>上传商品文件:</span>
<a-upload
accept=".xls,.xlsx"
:file-list="productExcelList"
:before-upload="productExcelBeforeUpload"
@remove="productExcelRemove"
>
<a-button><upload-outlined></upload-outlined>上传文件</a-button>
</a-upload>
<span style="margin-left: 15px">
下载
<a @click="downLoad">区域现货商品上传模板</a>
</span>
</div>
<p style="margin-top: 15px">选择现货区域:</p>
<a-checkbox-group v-model:value="impotrCheckboxValue" style="width: 100%;">
<a-row>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</a-modal>
</a-modal>
</div>
</template>
<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