【类 型】:fix

【主	题】:修改spu添加的穿梭框
【描	述】:
	[原因]:sku列表取的为第一个用户的shop_id 导致切换用户之后 不能正确选中自己的sku
	[过程]:每次切换用户 清空sku列表数组
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
szdot 2024-05-26 01:16:49 +08:00 committed by szdot
parent acc84b9e9f
commit 7e91eb115d
6 changed files with 18 additions and 10 deletions

View File

@ -8,7 +8,8 @@ export default {
name: 'skuTransfer', name: 'skuTransfer',
props: { props: {
tit: String, tit: String,
val: Array val: Array,
shop_id: String
}, },
data () { data () {
return { return {
@ -18,7 +19,7 @@ export default {
computed: { computed: {
// sku // sku
skuList () { skuList () {
return this.$store.state.skuList return this.$store.state.skuList.filter(item => item.shop_id === this.shop_id)
}, },
// sku // sku
skuListArr () { skuListArr () {
@ -37,6 +38,10 @@ export default {
watch: { watch: {
value (val) { value (val) {
this.updateValue(val) this.updateValue(val)
},
// "" sku穿
shop_id () {
this.value = []
} }
}, },
created () { created () {

View File

@ -363,6 +363,7 @@ const store = new Vuex.Store({
}).then(() => { }).then(() => {
const params = new URLSearchParams() const params = new URLSearchParams()
params.append('idArr', idArr) params.append('idArr', idArr)
console.log(params)
api.post('deleteAir', params).then(res => { api.post('deleteAir', params).then(res => {
if (res.data.status === 1) { if (res.data.status === 1) {
Message.success(res.data.msg) Message.success(res.data.msg)

View File

@ -26,7 +26,7 @@
<span :class="data.show == 0 ? 'hideColor' : ''">{{ data.name }}</span> <span :class="data.show == 0 ? 'hideColor' : ''">{{ data.name }}</span>
<span> <span>
<el-button type="text" @click.stop="" <el-button type="text" @click.stop=""
@click="openWin(`${data.name} : 添加子分类`, { id: data.id, path: data.path, photo: '' })"> @click="openWin(`${data.name} : 添加子分类`, { id: data.id, path: data.path, photo: '' })" disabled>
添加子分类 添加子分类
</el-button> </el-button>
<el-button type="text" class="textEditBut" @click.stop="" @click="openWin(`${data.name} : 编辑`, data)"> <el-button type="text" class="textEditBut" @click.stop="" @click="openWin(`${data.name} : 编辑`, data)">

View File

@ -12,7 +12,7 @@
</el-header> </el-header>
<el-main class="border p-20"> <el-main class="border p-20">
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="所属商铺"> <el-form-item v-if="pageState === 'add'" label="所属商铺">
<SelectionShopId v-model="form.shop_id" /> <SelectionShopId v-model="form.shop_id" />
</el-form-item> </el-form-item>
<el-form-item label="单品名称"> <el-form-item label="单品名称">

View File

@ -12,7 +12,7 @@
</el-header> </el-header>
<el-main class="border p-20"> <el-main class="border p-20">
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="所属商铺"> <el-form-item v-if="pageState === 'add'" label="所属商铺">
<SelectionShopId v-model="form.shop_id" /> <SelectionShopId v-model="form.shop_id" />
</el-form-item> </el-form-item>
<el-form-item label="所属分类"> <el-form-item label="所属分类">
@ -27,8 +27,8 @@
<el-form-item label="排序"> <el-form-item label="排序">
<el-input v-model="form.sort" placeholder="数值大排在前面,缺省值为0" /> <el-input v-model="form.sort" placeholder="数值大排在前面,缺省值为0" />
</el-form-item> </el-form-item>
<el-form-item label="热销数"> <el-form-item label="热销数">
<el-input v-model="form.hot" placeholder="用与前台显示虚假销量,虚假销量=热销数+真实销量" /> <el-input v-model="form.hot" placeholder="用与前台显示虚假销量,虚假销量=热销数+真实销量" />
</el-form-item> </el-form-item>
<el-form-item :label="form.recommend === true ? '前台首页推荐' : '前台首页推荐'"> <el-form-item :label="form.recommend === true ? '前台首页推荐' : '前台首页推荐'">
<el-switch v-model="form.recommend" /> <el-switch v-model="form.recommend" />
@ -73,7 +73,7 @@
</span> </span>
<el-button v-else @click="showSkuInput" icon="el-icon-plus">添加规格</el-button> <el-button v-else @click="showSkuInput" icon="el-icon-plus">添加规格</el-button>
<div class="m-t-10 relative-container" v-for="(t, index) in form.bind_sku" :key="index"> <div class="m-t-10 relative-container" v-for="(t, index) in form.bind_sku" :key="index">
<SkuTransfer :tit="t.tit" :val="t.value" @input="handleTransferInput(index, $event)" /> <SkuTransfer :tit="t.tit" :val="t.value" :shop_id="shop_id" @input="handleTransferInput(index, $event)" />
<el-button type="danger" icon="el-icon-delete" class="absolute-center-button" @click="delBind_skuArr" /> <el-button type="danger" icon="el-icon-delete" class="absolute-center-button" @click="delBind_skuArr" />
</div> </div>
</el-form-item> </el-form-item>

View File

@ -56,7 +56,7 @@
:src="form.oldFile[0]" class="avatar" /> :src="form.oldFile[0]" class="avatar" />
<template v-else> <template v-else>
<i class="el-icon-plus f-s-30 m-t-70 seatFontColor"></i> <i class="el-icon-plus f-s-30 m-t-70 seatFontColor"></i>
<div class="el-upload__text"><em>建议200*200像素 <br> jpg png gif </em></div> <div class="el-upload__text"><em>建议200*200像素 <br> jpg png gif svg</em></div>
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -124,6 +124,7 @@ export default {
methods: { methods: {
/* 文件上传表单 */ /* 文件上传表单 */
handleUpSuccess (res) { handleUpSuccess (res) {
console.log(res)
if (res.status === 0) { if (res.status === 0) {
this.$message.error(res.msg) this.$message.error(res.msg)
} else { } else {
@ -139,7 +140,8 @@ export default {
return isJPG return isJPG
}, },
handleUpErr () { handleUpErr () {
this.$message.error('接口访问失败') // this.$message.error('访')
this.$message.error(this.action)
}, },
// Date // Date
parseTimeString (timeString) { parseTimeString (timeString) {