Commit 385e60b6 by 前端

Merge branch 'dev_v4.20.0' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into dev_v4.20.0
2 parents d82d386e a9a98f1c
......@@ -10,11 +10,11 @@ export function getProductManageList(data) {
// 新增产品
export function addProductManage(data) {
data.method = `${path}productManager.add`
return request(data)
return request(data, 'post')
}
// 编辑产品
export function UpdateProductManage(data) {
data.method = `${path}productManager.update`
return request(data)
return request(data, 'post')
}
\ No newline at end of file
......@@ -75,12 +75,10 @@
<el-select v-else-if="item.type === 'select'"
v-model="formData[item.name]"
:clearable="item.isClear"
:remote="item.name == 'merchantId'"
:placeholder="'请选择' + item.label"
@change="selectAddAttr($event, item)"
:style="{'width': item.width || formItemWidth}"
filterable
:remote-method="remoteMethod">
filterable>
<el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
......@@ -313,20 +311,20 @@ export default {
})
},
// 搜索上架门店
remoteMethod(queryString) {
if (queryString) {
this.loading = true
setTimeout(() => {
this.loading = false
var params = { currentPage: 1, pageSize: 1000, merchantName: queryString }
commodityAddSeviceMerchant(params).then(res => {
this.formList[0].formBlock[0].optionList = res.list || []
})
}, 600);
} else {
this.formList[0].formBlock[0].optionList = []
}
},
// remoteMethod(queryString) {
// if (queryString) {
// this.loading = true
// setTimeout(() => {
// this.loading = false
// var params = { currentPage: 1, pageSize: 1000, merchantName: queryString }
// commodityAddSeviceMerchant(params).then(res => {
// this.formList[0].formBlock[0].optionList = res.list || []
// })
// }, 600);
// } else {
// this.formList[0].formBlock[0].optionList = []
// }
// },
// 修复直接调用可以会因为没有对应方法报错的问题
input(event, item) {
item.handleInput && this.handleInput(event, item)
......
<!-- 上架编辑 -->
<template>
<d2-container class="edit-commodity" v-loading="$store.state.d2admin.loading.value">
<d2-container class="edit-commodity" v-loading="!show">
<div class="" v-if="show">
<grounding-form
ref="d2GroundingForm"
......@@ -23,6 +23,7 @@ import { BaseData, positionTypeList } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { addOrUpdateAPI, getAllGroupByCategory } from '@api/grounding'
import { getShopMerchantList } from '@api/deviceManage'
export default {
name: 'editGrounding',
components: {
......@@ -41,7 +42,7 @@ export default {
isRequired: true,
type: 'select',
isClear: false,
optionList: [],
optionList: this.merchantServiceList,
optionId: 'merchantId',
optionLabel: 'merchantName',
width: '432px'
......@@ -180,14 +181,15 @@ export default {
recoveryCostPrice: '',
reconcilyCostPrice: ''
},
secondGoodsList: []
secondGoodsList: [],
merchantServiceList: []
}
},
mounted() {
this.getProductServiceItemList()
this.getBaseData()
let id = this.$route.params.id
this.getProductServiceItemList()
this.getAllShopMerchantList()
if (!id) {
this.getGoodsList()
} else {
......@@ -199,9 +201,17 @@ export default {
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
// 获取权益升级类目 服务项目
async getProductServiceItemList() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
},
// 获取全部4s店
getAllShopMerchantList() {
getShopMerchantList({}).then(res => {
let formList = this.editForm[0].formBlock
formList[formList.findIndex(val => val.name == 'merchantId')].optionList = res || []
})
},
// 获取上架商品数据
getGoodsList(flag) {
getAllGroupByCategory({}).then(res => {
......@@ -211,6 +221,7 @@ export default {
const twoChildren = []
item.baseGoods && item.baseGoods.forEach(val => {
val.upgradeGoodsList && val.upgradeGoodsList.forEach(v => {
let positionNamesArr = v.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : []
twoChildren.push({
value: v.id,
label: v.upgradeGoodsName,
......@@ -221,13 +232,14 @@ export default {
goodsTypeName: val.goodsInfo?.goodsTypeName,
upgradePrice: v.upgradePrice,
purchasePrice: v.purchasePrice,
position: v.position
positionNames: positionNamesArr.length ? positionNamesArr[0]?.confName : '' // 部位
}
})
})
})
item.children = twoChildren
})
console.log(res)
this.secondGoodsList = res
if (flag) {
this.decorate(flag, res)
......@@ -284,7 +296,6 @@ export default {
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
this.editForm[0].formBlock[0].optionList = [{merchantId: res.merchantId, merchantName: res.merchantName}] || []
let productType = []
let positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : []
if (res?.upgradeProductFlag == 'Y') productType.push(2)
......
......@@ -91,7 +91,6 @@
</d2-container>
</template>
<script>
import { commodityAddSeviceMerchant } from '@api/commodity'
import { getProductTypeBySceneId, getList } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById } from '@api/grounding'
import { deepClone, Util } from '@/common/util'
......@@ -99,6 +98,7 @@ import { sceneCodeList, sceneList } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex'
import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data'
import { getShopMerchantList } from '@api/deviceManage'
export default {
name: 'groundingIndex',
data() {
......@@ -114,7 +114,8 @@ export default {
goodsType: '',
goodsAlias: '',
status: '',
yqMerchantId: ''
yqMerchantId: '',
goodsSource: 0
},
getListApi: getGroundingManageList,
drawerDetailVisible: false,
......@@ -240,7 +241,7 @@ export default {
},
width: 130
}, {
label: '所属素材',
label: '所属系列',
parentProp: 'goodsInfo',
prop: 'goodsName',
width: 140
......@@ -374,11 +375,8 @@ export default {
this.getOptionsList()
})
// 获取门店
commodityAddSeviceMerchant({
currentPage: 1,
pageSize: 9999
}).then(res => {
this.baseData.merchantServiceList = res.list
getShopMerchantList({}).then(res => {
this.baseData.merchantServiceList = res
this.getOptionsList()
})
// 获取全部分类
......@@ -448,7 +446,8 @@ export default {
goodsType: '',
goodsAlias: '',
status: '',
yqMerchantId: ''
yqMerchantId: '',
goodsSource: 0
}
},
beforeSearchFn() {
......
......@@ -54,7 +54,7 @@
<span>可选择的服务项目(多选)</span>
</td>
<!-- 仅分发至单店时,隐藏采购价/卷,无需填写 -->
<td :style="{ width: specsWidth }" v-show="goodsInfoData.shoppingMallFlag !== '0'">
<td :style="{ width: specsWidth }" v-show="!equitySceneType.includes(goodsInfoData.goodsType) && goodsInfoData.shoppingMallFlag !== '0'">
<span class="color-red">*</span>
<el-input
style="width: 80px;"
......@@ -227,7 +227,7 @@
</el-popover>
</el-select>
</td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.shoppingMallFlag !== '0'">
<td :style="{ width: specsWidth }" v-show="!equitySceneType.includes(goodsInfoData.goodsType) && goodsInfoData.shoppingMallFlag !== '0'">
<el-input placeholder="采购价"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice)) && subItem.purchasePriceEmpty }"
......
......@@ -19,7 +19,7 @@
<span class="color-red">*</span>
<span>可选择的服务项目(多选)</span>
</td>
<td :style="{ width: specsWidth }" v-show="goodsInfoData.shoppingMallFlag !== '0'">
<td :style="{ width: specsWidth }" v-show="!equitySceneType.includes(goodsInfoData.goodsType) && goodsInfoData.shoppingMallFlag !== '0'">
<span class="color-red">*</span>
<span>采购价/卷</span>
</td>
......
......@@ -15,7 +15,7 @@
<el-button icon="el-icon-plus" v-if="goodsInfoData.specificationType == '1'" @click="addShop">新增商品</el-button>
<div class="assi_type">
<span>规格:</span>
<el-radio-group v-model="goodsInfoData.specificationType">
<el-radio-group v-model="goodsInfoData.specificationType" @change="changeRadio">
<el-radio :label="'1'">单规格</el-radio>
<el-radio :label="'2'">多规格</el-radio>
</el-radio-group>
......@@ -73,6 +73,14 @@ export default {
// 新增商品
addShop() {
this.$refs['singleSpecificationFormRef'].addShop()
},
// 切换规格将数据清空
changeRadio(value) {
if (value == 1) { // 单规格
this.setUpdateGoodsInfo({specificationSingleDetailList: [], goodsSpecificationSingleList: []})
} else { // 多规格
this.setUpdateGoodsInfo({specificationDetailList: []})
}
}
}
}
......
<!-- 商品编辑 -->
<template>
<d2-container class="edit-productManage">
<d2-container class="edit-productManage" v-loading="$store.state.d2admin.loading.value">
<div v-if="show">
<!-- SPU -->
<sourceMaterial ref="source-material-form" :addOrEdit="addOrEdit" :formData="productFormData"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!