fixed 修改全部选中导出问题
This commit is contained in:
parent
1622ae2880
commit
dd2aa7c558
@ -213,11 +213,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -236,11 +236,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -214,11 +214,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -261,11 +261,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -227,11 +227,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -29,10 +29,10 @@
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="商品类目" prop="goodsCategoryGuid">
|
||||
<el-form-item :label-width="labelWidth" label="商品类目" prop="shopGoodsCategoryGuid">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||
placeholder="请选择商品类目" clearable v-model="formData.goodsCategoryGuid">
|
||||
placeholder="请选择商品类目" clearable v-model="formData.shopGoodsCategoryGuid">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
@ -539,7 +539,7 @@ const imgData = ref({
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
shopGuid: [{ required: true, message: "店铺不能为空", trigger: "blur" }],
|
||||
goodsCategoryGuid: [{ required: true, message: "商品类目不能为空", trigger: "blur" }],
|
||||
shopGoodsCategoryGuid: [{ required: true, message: "商品类目不能为空", trigger: "blur" }],
|
||||
goodsSpecType: [{ required: true, message: "规格类型不能为空", trigger: "blur" }],
|
||||
deliveryGuid: [{ required: true, message: "配送模板不能为空", trigger: "blur" }],
|
||||
goodsName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||
|
@ -25,10 +25,10 @@
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="商品类目" prop="goodsCategoryGuid">
|
||||
<el-form-item :label-width="labelWidth" label="商品类目" prop="shopGoodsCategoryGuid">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||
placeholder="请选择商品类目" clearable v-model="formData.goodsCategoryGuid">
|
||||
placeholder="请选择商品类目" clearable v-model="formData.shopGoodsCategoryGuid">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
@ -524,7 +524,7 @@ const imgData = ref({
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
shopGuid: [{ required: true, message: "店铺不能为空", trigger: "blur" }],
|
||||
goodsCategoryGuid: [{ required: true, message: "商品类目不能为空", trigger: "blur" }],
|
||||
shopGoodsCategoryGuid: [{ required: true, message: "商品类目不能为空", trigger: "blur" }],
|
||||
goodsSpecType: [{ required: true, message: "规格类型不能为空", trigger: "blur" }],
|
||||
deliveryGuid: [{ required: true, message: "配送模板不能为空", trigger: "blur" }],
|
||||
goodsName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||
|
@ -15,9 +15,25 @@
|
||||
<el-form-item label="店铺名称">
|
||||
<el-input v-model.number="queryParams.shopName" placeholder="请输入店铺名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类目guid" prop="goodsCategoryGuid">
|
||||
<el-input v-model.number="queryParams.goodsCategoryGuid" placeholder="请输入选择商品类目" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
<el-form-item label="经营类目" prop="goodsCategoryGuid" v-if="userid == 1">
|
||||
<el-cascader class="w100" :options="goodsCategoryTreeListData"
|
||||
:props="{ checkStrictly: true, value: 'goodsCategoryGuid', label: 'goodsCategoryName', emitPath: false }"
|
||||
placeholder="请选择经营类目" clearable v-model="queryParams.goodsCategoryGuid" @change="handleQuery">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.goodsCategoryName }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类目" prop="goodsCategoryGuid" v-else>
|
||||
<el-cascader class="w100" :options="shopGoodsCategoryTreeListData"
|
||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||
placeholder="请选择商品类目" clearable v-model="queryParams.shopGoodsCategoryGuid" @change="handleQuery">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="goodsName">
|
||||
<el-input v-model="queryParams.goodsName" placeholder="请输入商品名称" clearable @keyup.enter="handleQuery" />
|
||||
@ -64,7 +80,8 @@
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column prop="goodsId" width="100" label="商品ID" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopName" width="150" label="店铺名称" align="center" :show-overflow-tooltip="true" v-if="userid == 1" />
|
||||
<el-table-column prop="shopName" width="150" label="店铺名称" align="center" :show-overflow-tooltip="true"
|
||||
v-if="userid == 1" />
|
||||
<el-table-column prop="goodsPicture" label="图片" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain"
|
||||
@ -75,7 +92,7 @@
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsName" label="商品名称" width="500" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="goodsName" label="商品名称" width="450" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="goodsPriceLowest" label="价格" align="center" />
|
||||
<el-table-column prop="goodsSalesActual" label="实际销量" align="center" />
|
||||
<el-table-column prop="goodsTotalInventory" label="库存总量" align="center" />
|
||||
@ -85,7 +102,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsSort" label="排序" align="center" />
|
||||
<el-table-column prop="createTime" label="添加时间" align="center" />
|
||||
<el-table-column prop="createTime" label="添加时间" width="150" align="center" />
|
||||
|
||||
<el-table-column label="操作" width="250" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
@ -115,6 +132,8 @@
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { exportGoods, goodsList, delGoods } from '@/api/business/GoodsManager/Goodss/goods.js'
|
||||
import { goodsCategoryTreeList } from '@/api/business/GoodsManager/GoodsCategorys/goodsCategory.js'
|
||||
import { shopGoodsCategoryTreeList } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js'
|
||||
import AddDialog from "./components/AddDialog.vue";
|
||||
import EditDialog from "./components/EditDialog.vue";
|
||||
import DetailDialog from "./components/DetailDialog.vue";
|
||||
@ -219,7 +238,27 @@ async function getshelf_status() {
|
||||
getshelf_status()
|
||||
|
||||
|
||||
// 获取商品类目树形列表
|
||||
const shopGoodsCategoryTreeListData = ref([])
|
||||
async function getShopGoodsCategoryTreeList() {
|
||||
shopGoodsCategoryTreeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
shopGoodsCategoryTreeListData.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
getShopGoodsCategoryTreeList()
|
||||
|
||||
// 获取经营类目树形列表
|
||||
const goodsCategoryTreeListData = ref([])
|
||||
async function getGoodsCategoryTreeList() {
|
||||
goodsCategoryTreeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
goodsCategoryTreeListData.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
getGoodsCategoryTreeList()
|
||||
|
||||
//基础方法
|
||||
|
||||
@ -240,6 +279,7 @@ function getList() {
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection,'检查 selection 中的内容'); // 检查 selection 中的内容
|
||||
ids.value = selection.map((item) => item.goodsId)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
@ -277,15 +317,13 @@ function handleDelete(row) {
|
||||
function handleExport(row) {
|
||||
const Ids = row.goodsId || ids.value
|
||||
const name = ref("所有")
|
||||
|
||||
console.log(Ids,'ids是什么呢');
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
console.log(queryParams.value,'搜索内容');
|
||||
}
|
||||
|
||||
ElMessageBox.confirm('是否确认导出' + name.value + '数据?', '警告', {
|
||||
|
@ -245,11 +245,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -205,11 +205,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -192,11 +192,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -203,11 +203,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
@ -230,11 +230,8 @@ function handleExport(row) {
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
const ids = Object.values(Ids).map(value => String(value));
|
||||
const str = ids.join(',');
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user