Commit 10efb442 by 张立顺

fix bug

1 parent 2a0c15fb
......@@ -9,11 +9,12 @@
</el-form-item>
<el-form-item label="车系:" prop="merchantName">
<el-cascader :size="size" :props="props" v-model="storeSearchForm.seriesId" :options="options"
@change="handleChangeCar"></el-cascader>
@change="handleChangeCar" filterable placeholder="搜索/请先选择车系" v-loading="carLoading"></el-cascader>
<span class="carTips">请先选择车系</span>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
<el-button :size="size" @click="handleSearchReset">重置</el-button>
<!-- <el-button :size="size" @click="handleSearchReset">重置</el-button> -->
</el-form-item>
</el-form>
<el-row>
......@@ -79,37 +80,8 @@ export default {
pageNum: 1,
pageSize: 20,
size: 'small',
options: [{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}, {
value: 'xiaolv',
label: '效率'
}, {
value: 'kekong',
label: '可控'
}]
}, {
value: 'daohang',
label: '导航',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
},]
carLoading: false,
options: []
}
},
......@@ -200,8 +172,10 @@ export default {
},
getSelectingList() {
console.log(this.upgradeGoodsInfo, 'this.upgradeGoodsInfo')
this.carLoading = true
this.$apis.purchaseShopping.getCanSelectCarBrandList({ upgradeGoodsId: this.upgradeGoodsInfo.upgradeGoodsId || this.upgradeGoodsInfo.upgradeGoodsList[0].id }).then(res => {
console.log(res, 'getSelectingList')
this.carLoading = false
this.options = res.data
})
},
......@@ -261,6 +235,7 @@ export default {
},
handleCurrentChange(val) {
this.pageNum = val
this.handleChangeCar()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
......@@ -284,6 +259,11 @@ export default {
}
</script>
<style lang="scss" scoped>
.carTips {
margin-left: 20px;
color: #666;
}
.relateStore {
.title {
font-size: 16px;
......@@ -311,22 +291,23 @@ export default {
.box_content {
padding: 12px 8px;
overflow-y: scroll;
height: calc(100% - 40px);
min-height: calc(100% - 40px);
box-sizing: border-box;
.select_item {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
min-height: 32px;
padding: 0 8px;
cursor: pointer;
.text_value {
width: calc(100% - 50px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
}
.select_clear {
......
......@@ -6,7 +6,7 @@
<!-- 商品详情 -->
<div class="goodsInfoCom">
<div class="goodsInfoCom__left">
<img :src="goodsInfo.thumbUrl" alt="" />
<img v-if="goodsInfo" :src="goodsInfo.thumbUrl" alt="" />
</div>
<div class="goodsInfoCom__right">
<p class="title two-line-ellipsis">{{ goodsInfo.goodsName }}</p>
......@@ -46,10 +46,7 @@
<div class="label">规格:</div>
<div class="itemCon">
<div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="
selectIndex = index
setHandleItemInfo(item)
">
v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="singleClick(item, index)">
{{ item.upgradeGoodsName }}
</div>
</div>
......@@ -66,9 +63,9 @@
</div>
<div class="munCom" v-if="upgradeGoodsInfo.suitCarType == 2">
<div class="label">适用车型:</div>
<div class="munItem">
<el-select ref="choose" width='300' multiple @focus="handleCarDialog" value-key="carTypeId"
v-model="goodsInfo.suitCarTypeList" collapse-tags style="margin-left: 20px;width: 300px;"
<div class="munItem car-select">
<el-select ref="choose" :clearable="false" width='300' collapse-tags multiple @focus="handleCarDialog"
value-key="carTypeId" v-model="goodsInfo.suitCarTypeList" style="margin-left: 20px;width: 300px;"
placeholder="请选择">
<el-option v-for="(children) in goodsInfo.suitCarTypeList" :key="children.carTypeId"
:label="children.carTypeName" :value="children">
......@@ -650,6 +647,11 @@ export default {
this.getGoodsDetail()
},
methods: {
singleClick(item, index) {
this.setHandleItemInfo(item)
this.selectIndex = index
this.upgradeGoodsInfo = item
},
handleConfirm(list) {
console.log()
this.goodsInfo.suitCarTypeList = list
......@@ -943,7 +945,7 @@ export default {
}
// 如果是专用商品 但没有选适配车型
if (this.upgradeGoodsInfo.suitCarType == 2 && !this.goodsInfo.suitCarTypeList?.length) {
return this.$message.error('请选择适配车型');
return this.$message.error('请完善商品适用车型')
}
// 判断是否有值
params.upgradeGoodsId &&
......@@ -959,6 +961,12 @@ export default {
</script>
<style lang="scss" scoped>
.car-select {
::v-deep .el-select__tags-text {
max-width: 170px;
}
}
.goodsInfoCom {
display: flex;
......
......@@ -46,14 +46,13 @@
</template>
<template slot="upgradeGoodsName" slot-scope="scope">
<div>
<img v-if="scope.scope.refundStatus == 'Y'" class="retrun" src="@/assets/retrun.png" alt="">
<img v-if="scope.scope.refundStatus == 'Y'" class="return" src="@/assets/retrun.png" alt="">
<span>{{ scope.scope.upgradeGoodsName }}</span>
</div>
</template>
<template slot="carName" slot-scope="scope">
<!-- <div>{{ JSON.stringify(scope.scope.suitCarTypeList) }}</div> -->
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content">
<div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div>
</div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
......@@ -101,6 +100,7 @@ export default {
this.$emit('update:visible', val)
}
}
},
data() {
return {
......@@ -128,6 +128,7 @@ export default {
},
{
label: '适用车型',
prop: 'carName',
addHtml: 'carName',
width: 200,
},
......@@ -194,6 +195,14 @@ export default {
},
created() {
this.dynamicParams()
console.log(this.paramsObj, 'paramsObj')
// 不是商城采购过滤掉车型和备注
if (this.paramsObj.purchaseType != 1) {
this.tableParams.tableColumns = this.tableParams.tableColumns.filter(item => {
return item.prop !== 'carName' && item.prop !== 'remark'
})
// console.log(this.tableParams.tableColumns, ' this.tableParams.tableColumns ')
}
},
methods: {
dynamicParams() {
......@@ -255,7 +264,12 @@ export default {
</script>
<style lang="scss" scoped>
.retrun {
.car-type-list {
max-height: 300px;
overflow-y: scroll;
}
.return {
width: 15px;
height: 14px;
}
......
......@@ -169,11 +169,14 @@ export default {
},
methods: {
handleConfirm() {
let selectedData = this.$refs.purchaseOrderDetailTable.mutiSelectArr[this.tableParams.mutiSelectName]
let selectedData = this.$refs.purchaseOrderDetailTable.mutiSelectArr[this.tableParams.mutiSelectName] || []
// selectedData = selectedData.filter(item => item.refundStatus == 'N')
if (selectedData.some(item => item.refundStatus == 'Y')) {
return this.$message.error('商品已退货,请确认后重新操作');
}
if (!selectedData.length) {
return this.$message.error('请勾选需退货的商品');
}
let params = {
orderCode: this.paramsObj.orderCode,
purchaseOrderGoodsIdList: selectedData.map(item => item.id)
......@@ -181,9 +184,13 @@ export default {
console.log(selectedData, 'selectedData')
this.$apis.purchaseShopping.purchaseOrderGoodsRefund(params).then(res => {
console.log(res)
this.$message.success('操作成功')
this.dialogShow = false
this.$emit('handleConfirm')
if (res.code == 0) {
this.$message.success('操作成功')
this.dialogShow = false
this.$emit('handleConfirm')
} else {
this.$message.error(res.message)
}
}).catch((err) => {
console.log(err)
})
......
......@@ -58,11 +58,10 @@
{{ membraneTypeList.includes(goodsItem.goodsType) ? `卷(1卷=${goodsItem.convertedValue || 30}米)` : '件' }}
</div>
<div class="munCom" v-if="goodsItem.suitCarTypeList && goodsItem.suitCarTypeList.length">
<!-- <div class="label">适用车型:</div> -->
<div class="munItem">
<el-select :ref="'choose' + goodsItem.id" name="munComInput" size="mini" multiple
@focus="handleCarDialog(goodsItem)" value-key="carTypeId" v-model="goodsItem.suitCarTypeList"
collapse-tags style="margin-top: 10px;width: 240px;" placeholder="请选择">
<el-select @remove-tag="handleTagDelete(goodsItem)" :ref="'choose' + goodsItem.id" collapse-tags
name="munComInput" size="mini" multiple @focus="handleCarDialog(goodsItem)" value-key="carTypeId"
v-model="goodsItem.suitCarTypeList" style="margin-top: 10px;width: 240px;" placeholder="请选择">
<el-option v-for="(children) in goodsItem.suitCarTypeList" :key="children.carTypeId"
:label="children.carTypeName" :value="children">
</el-option>
......@@ -136,13 +135,10 @@
</template>
<template slot="film" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length > 1" placement="top">
<!-- <div slot="content">多行信息<br />第二行信息</div> -->
<div slot="content">
<div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div>
</div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
<!-- <span v-for="(item, index) in " :key="index">{{ item.carTypeName
}}<br /></span> -->
</el-tooltip>
<div v-else>--</div>
</template>
......@@ -159,7 +155,7 @@
<div class="item-remark orderInfoCom">
<div class="label">备注:</div>
<div class="item-content">
<el-input show-word-limit type="textarea" maxlength="200" :rows="1" placeholder="备注说明"
<el-input show-word-limit type="textarea" maxlength="200" :rows="3" placeholder="备注说明"
v-model="remarks"></el-input>
</div>
</div>
......@@ -338,6 +334,12 @@ export default {
})
},
methods: {
handleTagDelete(item) {
console.log(item)
// let {} =item
this.goodsInfo = item
this.handleConfirm(item.suitCarTypeList)
},
handleConfirm(list) {
console.log(list, 'list')
// this.goodsInfo.suitCarTypeList = list
......@@ -558,6 +560,11 @@ export default {
</script>
<style lang="scss" scoped>
.car-type-list {
max-height: 300px;
overflow-y: scroll;
}
ul,
li {
padding: 0;
......
......@@ -216,7 +216,8 @@ export default {
type: 'text'
},
condition: row => {
return [1, 2, 5].includes(row.status) && row.purchaseType == 1
// 全部发货不能退货
return [1, 2, 5].includes(row.status) && row.purchaseType == 1 && row.deliveryStatus != 2
},
listeners: {
click: this.handleReturnedProducts
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!