Commit 09c7e5c9 by zhangxw

新增商品选择素材方式修改

1 parent c148e877
...@@ -65,3 +65,9 @@ export function editBrandSupplyMerchant(data) { ...@@ -65,3 +65,9 @@ export function editBrandSupplyMerchant(data) {
data.method = `${path}goods.type.editGoodsRelatedParty` data.method = `${path}goods.type.editGoodsRelatedParty`
return request(data, 'post') return request(data, 'post')
} }
// 获取素材详情
export function getProductInfo(data) {
data.method = `${path}goodsinfo.get.byId`
return request(data, 'post')
}
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
:placeholder="'请选择' + item.label" :placeholder="'请选择' + item.label"
:style="{'width': item.width || formItemWidth}" :style="{'width': item.width || formItemWidth}"
@change="selectAddAttr($event, item)" @change="selectAddAttr($event, item)"
@blur="selectBlur"
@focus="selectFocus"
filterable filterable
:disabled="item.isDisabled"> :disabled="item.isDisabled">
<el-option <el-option
...@@ -99,19 +101,30 @@ ...@@ -99,19 +101,30 @@
:label="subItem[item.optionLabel]" :label="subItem[item.optionLabel]"
:value="subItem[item.optionId]" :value="subItem[item.optionId]"
> >
<div class="flex-option"> <!-- 供应方 -->
<el-input v-show="editOptionIndex == subIndex" class="add-option-input" :autofocus="true" @click.stop.native="editOptionFocus" v-model="editOptionValue" size="small" placeholder="请输入"></el-input> <div class="flex-option" v-if="item.partitionFlag == 1">
<span v-show="!editOptionIndex || editOptionIndex != subIndex" class="add-option-input">{{ subItem[item.optionLabel] }}</span> <el-input v-show="editOptionIndex == subIndex" :maxlength="10" class="add-option-input" :autofocus="true" @click.stop.native="editOptionFocus" v-model.trim="editOptionValue" size="small" placeholder="请输入"></el-input>
<span v-show="editOptionIndex == -1 || editOptionIndex != subIndex" class="add-option-input">{{ subItem[item.optionLabel] }}</span>
<div> <div>
<i v-show="subIndex > (item.partitionFlag == 2 ? 1 : -1) && !editOptionIndex" class="el-icon-edit edit_icon" @click.stop="editOption(subIndex, subItem[item.optionLabel], item.partitionFlag)"></i> <i v-show="item.optionList.length > 1 && (editOptionIndex != subIndex)" class="el-icon-edit edit_icon" @click.stop="editOption(subIndex, subItem[item.optionLabel], item.partitionFlag)"></i>
<i v-show="subIndex > (item.partitionFlag == 2 ? 1 : -1) && editOptionIndex == subIndex" class="el-icon-check option_icon add_icon" @click.stop="editOptionConfirm(subItem[item.optionId], index, item.partitionFlag)"></i> <i v-show="item.optionList.length > 1 && editOptionIndex == subIndex" class="el-icon-check option_icon add_icon" @click.stop="editOptionConfirm(subItem[item.optionId], index, item.partitionFlag)"></i>
<i v-if="subIndex > (item.partitionFlag == 2 ? 1 : -1)" class="el-icon-close del_icon" @click.stop="delOption(subItem[item.optionId], index, item.partitionFlag, item)"></i> <i v-if="item.optionList.length > 1" class="el-icon-close del_icon" @click.stop="delOption(subItem[item.optionId], index, item.partitionFlag, item)"></i>
</div>
</div>
<!-- 服务方 -->
<div class="flex-option" v-else>
<el-input v-show="editOptionIndex == subIndex" :maxlength="10" class="add-option-input" :autofocus="true" @click.stop.native="editOptionFocus" v-model.trim="editOptionValue" size="small" placeholder="请输入"></el-input>
<span v-show="editOptionIndex == -1 || editOptionIndex != subIndex" class="add-option-input">{{ subItem[item.optionLabel] }}</span>
<div>
<i v-show="subItem[item.optionId] !== 12 && subItem[item.optionId] !== 13 && (editOptionIndex != subIndex)" class="el-icon-edit edit_icon" @click.stop="editOption(subIndex, subItem[item.optionLabel], item.partitionFlag)"></i>
<i v-show="subItem[item.optionId] !== 12 && subItem[item.optionId] !== 13 && editOptionIndex == subIndex" class="el-icon-check option_icon add_icon" @click.stop="editOptionConfirm(subItem[item.optionId], index, item.partitionFlag)"></i>
<i v-if="subItem[item.optionId] !== 12 && subItem[item.optionId] !== 13" class="el-icon-close del_icon" @click.stop="delOption(subItem[item.optionId], index, item.partitionFlag, item)"></i>
</div> </div>
</div> </div>
</el-option> </el-option>
<div class="add-option"> <div class="add-option">
<div v-if="showOptionInput" class="flex-option"> <div v-if="showOptionInput" class="flex-option">
<el-input class="add-option-input" v-model="addOptionValue" size="small" placeholder="请输入"></el-input> <el-input class="add-option-input" :maxlength="10" v-model.trim="addOptionValue" size="small" placeholder="请输入"></el-input>
<div> <div>
<i v-if="addOptionValue" class="el-icon-check option_icon add_icon" @click.stop="addOptionConfirm(item.partitionFlag)"></i> <i v-if="addOptionValue" class="el-icon-check option_icon add_icon" @click.stop="addOptionConfirm(item.partitionFlag)"></i>
<i class="el-icon-close option_icon del_icon" @click.stop="delOption(undefined)"></i> <i class="el-icon-close option_icon del_icon" @click.stop="delOption(undefined)"></i>
...@@ -568,7 +581,7 @@ export default { ...@@ -568,7 +581,7 @@ export default {
showOptionInput: false, showOptionInput: false,
addOptionValue: '', addOptionValue: '',
editOptionValue: '', editOptionValue: '',
editOptionIndex: undefined, editOptionIndex: -1,
selectedValue: '', selectedValue: '',
dialogObj: { dialogObj: {
url: '', url: '',
...@@ -660,8 +673,17 @@ export default { ...@@ -660,8 +673,17 @@ export default {
}, },
methods: { methods: {
selectBlur() {
this.editOptionIndex = -1
this.showOptionInput = false
},
selectFocus() {
this.editOptionIndex = -1
this.showOptionInput = false
},
addOption() { addOption() {
this.showOptionInput = true this.showOptionInput = true
this.addOptionValue = ''
}, },
addOptionConfirm(partitionFlag) { addOptionConfirm(partitionFlag) {
let data = { let data = {
...@@ -688,7 +710,7 @@ export default { ...@@ -688,7 +710,7 @@ export default {
partitionFlag: partitionFlag partitionFlag: partitionFlag
} }
this.$emit('handleEditBrandSupplyConfirm', data) this.$emit('handleEditBrandSupplyConfirm', data)
this.editOptionIndex = undefined this.editOptionIndex = -1
this.editOptionValue = '' this.editOptionValue = ''
}, },
delOption(e, index, partitionFlag, item) { delOption(e, index, partitionFlag, item) {
...@@ -733,7 +755,7 @@ export default { ...@@ -733,7 +755,7 @@ export default {
this.formData.sapCode = tempVal.sapCode this.formData.sapCode = tempVal.sapCode
} }
this.selectedValue = value this.selectedValue = value
this.editOptionIndex = undefined this.editOptionIndex = -1
if (targetItem.name == 'sceneType') { if (targetItem.name == 'sceneType') {
this.$emit('handleChangeSelect', value) this.$emit('handleChangeSelect', value)
} }
......
...@@ -270,7 +270,7 @@ export default { ...@@ -270,7 +270,7 @@ export default {
}, { }, {
label: '所属场景', label: '所属场景',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName', prop: 'sceneName',
width: '100' width: '100'
}, { }, {
label: '类目', label: '类目',
......
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
}) })
arr.push({ arr.push({
id: val.id, id: val.id,
specificationData: val.specificationData, // specificationData: val.specificationData,
merchantList: merchantList merchantList: merchantList
}) })
}) })
......
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
</td> </td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<span v-if="!showBatchInput">质保</span> <span v-if="!showBatchInput">质保</span>
<el-input style="width: 80px;" v-else size="small" placeholder="质保" v-model="batchObj.warrantyTime" :class="{ 'w-100-per': true }" @input="handleBatchWarrantyTimeInput" @blur="handleBatchWarrantyTimeInputBlur"></el-input> <el-input style="width: 80px;" v-else size="small" placeholder="质保" v-model="batchObj.warrantyPeriod" :class="{ 'w-100-per': true }" @input="handleBatchwarrantyPeriodInput" @blur="handleBatchwarrantyPeriodInputBlur"></el-input>
</td> </td>
<td style="width: 100px;display: inline-block;line-height: 60px;"><el-button type="text" @click="batchFilling">{{ !showBatchInput ? '批量填充' : '取消'}}</el-button></td> <td style="width: 100px;display: inline-block;line-height: 60px;"><el-button type="text" @click="batchFilling">{{ !showBatchInput ? '批量填充' : '取消'}}</el-button></td>
</tr> </tr>
...@@ -456,7 +456,7 @@ ...@@ -456,7 +456,7 @@
</td> </td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<div style="transform: translateX(10px);"> <div style="transform: translateX(10px);">
<el-input style="width: 80px;" placeholder="质保" size="small" v-model="subItem.warrantyTime" :class="{ 'w-100-per': true }" @input="handleWarrantyTimeInput($event, subIndex)"> <el-input style="width: 80px;" placeholder="质保" size="small" v-model="subItem.warrantyPeriod" :class="{ 'w-100-per': true }" @input="handlewarrantyPeriodInput($event, subIndex)">
</el-input><span style="margin-left: 5px;">年</span> </el-input><span style="margin-left: 5px;">年</span>
</div> </div>
</td> </td>
...@@ -599,6 +599,7 @@ import relateProDialog from './relateProDialog' ...@@ -599,6 +599,7 @@ import relateProDialog from './relateProDialog'
import relateStoreDialog from './relateStoreDialog' import relateStoreDialog from './relateStoreDialog'
import assiRelateStoreDialog from './assiRelateStoreDialog' import assiRelateStoreDialog from './assiRelateStoreDialog'
import { getGoodsList, getSpecDataByMerchent, saveAssignByMerchant, saveAssignBySpec } from '@/api/commodity' import { getGoodsList, getSpecDataByMerchent, saveAssignByMerchant, saveAssignBySpec } from '@/api/commodity'
import { getProductInfo } from '@/api/product'
// import { getParkStore } from '@api/editCustomer' // import { getParkStore } from '@api/editCustomer'
import { uploadImg } from '@/api/sys.base' import { uploadImg } from '@/api/sys.base'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
...@@ -673,7 +674,7 @@ export default { ...@@ -673,7 +674,7 @@ export default {
upgradePrice: '', upgradePrice: '',
shopMinPrice: '', shopMinPrice: '',
stock: '', stock: '',
warrantyTime: '', warrantyPeriod: '',
}, },
batchSubmitted: { batchSubmitted: {
shopPriceSub: false, shopPriceSub: false,
...@@ -851,28 +852,32 @@ export default { ...@@ -851,28 +852,32 @@ export default {
}, },
// 选择框-添加其他属性 // 选择框-添加其他属性
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
if (targetItem.name === 'goodsCode') { if (targetItem.name === 'goodsId') {
let materialList = [] // let materialList = []
targetItem.optionList.forEach(val => { // targetItem.optionList.forEach(val => {
val.children.forEach(v => { // val.children.forEach(v => {
v.children.forEach(it => { // v.children.forEach(it => {
materialList.push(it) // materialList.push(it)
}) // })
}) // })
// })
// 获取素材详情数据
getProductInfo({
id: value.constructor === Array ? value[value.length - 1] : value
}).then(tempVal => {
this.formData.goodsTypeName = tempVal.goodsTypeName
this.formData.goodsImgList = tempVal.goodsImgList || []
this.formData.thumbUrl = [tempVal.thumbUrl]
this.formData.sapCode = tempVal.sapCode
this.formData.sceneName = tempVal.sceneName
this.formData.brandMerchantName = tempVal.brandMerchantName
this.formData.supplierName = tempVal.supplierName
this.formData.baseGoodsName = tempVal.goodsName
this.showSpanText = Object.keys(tempVal).length
this.shopName = tempVal.goodsName
this.selectedSceneCode = tempVal.sceneType
this.formData.goodsCode = tempVal.goodsCode
}) })
let goodsCode = value.constructor === Array ? value[value.length - 1] : value
var tempVal = materialList.find(item => item.goodsCode === goodsCode)
this.formData.goodsTypeName = tempVal.goodsTypeName
this.formData.goodsImgList = tempVal.goodsImgList || []
this.formData.thumbUrl = [tempVal.thumbUrl]
this.formData.sapCode = tempVal.sapCode
this.formData.sceneName = tempVal.sceneName
this.formData.brandMerchantName = tempVal.brandMerchantName
this.formData.supplierName = tempVal.supplierName
this.formData.baseGoodsName = tempVal.goodsName
this.showSpanText = Object.keys(tempVal).length
this.shopName = tempVal.goodsName
this.selectedSceneCode = tempVal.sceneType
} }
}, },
handleAddPro(targetItem) { handleAddPro(targetItem) {
...@@ -1016,9 +1021,8 @@ export default { ...@@ -1016,9 +1021,8 @@ export default {
if (this.formData.speciLinkMerchants.length) { if (this.formData.speciLinkMerchants.length) {
getSpecDataByMerchent({ baseGoodsId: this.formData.baseGoodsId }).then(res => { getSpecDataByMerchent({ baseGoodsId: this.formData.baseGoodsId }).then(res => {
let arr = [] let arr = []
let merchantIds = []
let speciId = ''
res.forEach(val => { res.forEach(val => {
let merchantIds = []
let specsValueList = [] let specsValueList = []
this.formData.upgradeGoodsList && this.formData.upgradeGoodsList.forEach(item => { this.formData.upgradeGoodsList && this.formData.upgradeGoodsList.forEach(item => {
if (item.id == val.id) { if (item.id == val.id) {
...@@ -1026,13 +1030,12 @@ export default { ...@@ -1026,13 +1030,12 @@ export default {
specsValueList.push(it.split('-')[1]) specsValueList.push(it.split('-')[1])
}) })
} }
speciId = item.id
}) })
val.merchantList.forEach(i => { val.merchantList.forEach(i => {
merchantIds.push(i.merchantId) merchantIds.push(i.merchantId)
}) })
arr.push({ arr.push({
id: speciId, id: val.id,
specsValueList: specsValueList, specsValueList: specsValueList,
selectedMerchantIds: merchantIds, selectedMerchantIds: merchantIds,
selectedMerchantList: val.merchantList selectedMerchantList: val.merchantList
...@@ -1153,6 +1156,12 @@ export default { ...@@ -1153,6 +1156,12 @@ export default {
item.upgradePriceSub = true item.upgradePriceSub = true
return item return item
}) })
if (!this.specificationValueList.length) {
return this.$message({
message: '请添加规格',
type: 'error'
})
}
this.specificationValueList = arr this.specificationValueList = arr
this.rules['linkMerchants'][0].required = false this.rules['linkMerchants'][0].required = false
this.rules['speciLinkMerchants'][0].required = false this.rules['speciLinkMerchants'][0].required = false
...@@ -1195,8 +1204,7 @@ export default { ...@@ -1195,8 +1204,7 @@ export default {
this.saveAssignByMerchantEvent(this.formData.linkMerchants) this.saveAssignByMerchantEvent(this.formData.linkMerchants)
} else { } else {
// 按规格直接返回 // 按规格直接返回
this.notice.okTips() this.saveAssignByMerchantEvent(this.formData.speciLinkMerchants)
this.handleAddClose(true)
} }
} else { } else {
var needRuleList = Object.keys(options) var needRuleList = Object.keys(options)
...@@ -1240,6 +1248,7 @@ export default { ...@@ -1240,6 +1248,7 @@ export default {
} }
saveAssignByMerchant({ saveAssignByMerchant({
baseGoodsId: this.formData.baseGoodsId, baseGoodsId: this.formData.baseGoodsId,
distributionType: Number(this.formData.distributionType),
upgradeGoodsMerchantRefList: arrData upgradeGoodsMerchantRefList: arrData
}).then(res => { }).then(res => {
if (isDelete) { if (isDelete) {
...@@ -1399,7 +1408,7 @@ export default { ...@@ -1399,7 +1408,7 @@ export default {
upgradePrice: '', upgradePrice: '',
shopMinPrice: '', shopMinPrice: '',
stock: '', stock: '',
warrantyTime: '', warrantyPeriod: '',
} }
this.batchSubmitted = { this.batchSubmitted = {
shopPriceSub: false, shopPriceSub: false,
...@@ -1454,7 +1463,7 @@ export default { ...@@ -1454,7 +1463,7 @@ export default {
shopPrice: '', shopPrice: '',
shopMinPrice: '', shopMinPrice: '',
stock: '', stock: '',
warrantyTime: '' warrantyPeriod: ''
}) })
} else { } else {
var targetValLen = this.formData['specificationDetailList'][i].specificationValueList.length var targetValLen = this.formData['specificationDetailList'][i].specificationValueList.length
...@@ -1484,7 +1493,7 @@ export default { ...@@ -1484,7 +1493,7 @@ export default {
upgradePrice: '', upgradePrice: '',
shopMinPrice: '', shopMinPrice: '',
stock: '', stock: '',
warrantyTime: '', warrantyPeriod: '',
} }
this.specificationValueList.forEach((item, index) => { this.specificationValueList.forEach((item, index) => {
var specificationObj = {} var specificationObj = {}
...@@ -1549,13 +1558,13 @@ export default { ...@@ -1549,13 +1558,13 @@ export default {
this.batchSetValue('stock', newValue) this.batchSetValue('stock', newValue)
}, },
// 批量质保 // 批量质保
handleBatchWarrantyTimeInput(newValue) { handleBatchwarrantyPeriodInput(newValue) {
var oldValue = newValue var oldValue = newValue
this.$set(this.batchObj, 'warrantyTime', limitPrice(newValue, oldValue, 6, 2)) this.$set(this.batchObj, 'warrantyPeriod', limitPrice(newValue, oldValue, 6, 2))
}, },
handleBatchWarrantyTimeInputBlur(e) { handleBatchwarrantyPeriodInputBlur(e) {
let newValue = e.target.value let newValue = e.target.value
if (newValue) this.batchSetValue('warrantyTime', newValue) if (newValue) this.batchSetValue('warrantyPeriod', newValue)
}, },
// 校验零售价 // 校验零售价
handleUpgradePrice(newValue, index) { handleUpgradePrice(newValue, index) {
...@@ -1602,9 +1611,9 @@ export default { ...@@ -1602,9 +1611,9 @@ export default {
} }
}, },
// 质保 // 质保
handleWarrantyTimeInput(newValue, index) { handlewarrantyPeriodInput(newValue, index) {
var oldValue = newValue var oldValue = newValue
this.$set(this.specificationValueList[index], 'warrantyTime', limitPrice(newValue, oldValue, 6, 2)) this.$set(this.specificationValueList[index], 'warrantyPeriod', limitPrice(newValue, oldValue, 6, 2))
} }
} }
} }
......
...@@ -136,13 +136,13 @@ ...@@ -136,13 +136,13 @@
<el-table-column prop="merchantId" <el-table-column prop="merchantId"
label="商户编号" label="商户编号"
align="center" /> align="center" />
<el-table-column prop="userType" <!-- <el-table-column prop="userType"
label="商户类型" label="商户类型"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span> <span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="warrantyType" <el-table-column prop="warrantyType"
label="质保类型" label="质保类型"
align="center"> align="center">
...@@ -218,7 +218,7 @@ export default { ...@@ -218,7 +218,7 @@ export default {
getInfo(id) { getInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
this.commodityInfo = res this.commodityInfo = res
this.commodityInfo.linkMerchants = res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : [] this.commodityInfo.linkMerchants = res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : []
}) })
}, },
......
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
commodityAddSeviceMerchant: commodityAddSeviceMerchant, commodityAddSeviceMerchant: commodityAddSeviceMerchant,
getMerchantListByScene: getMerchantListByScene, getMerchantListByScene: getMerchantListByScene,
editData: { editData: {
// goodsCode: '', goodsCode: '',
goodsId: '',
goodsName: '', goodsName: '',
baseGoodsName: '', baseGoodsName: '',
goodsTypeName: '', goodsTypeName: '',
...@@ -64,7 +65,7 @@ export default { ...@@ -64,7 +65,7 @@ export default {
}, },
rules: { rules: {
// yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }], // yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
goodsCode: [{ required: true, message: '请选择素材', trigger: 'change' }], goodsId: [{ required: true, message: '请选择素材', trigger: 'change' }],
shopPrice: [{ required: true, message: '请输入产品成本', trigger: 'blur' }], shopPrice: [{ required: true, message: '请输入产品成本', trigger: 'blur' }],
retailPrice: [ retailPrice: [
{ required: true, message: '请输入零售价格', trigger: 'blur' }, { required: true, message: '请输入零售价格', trigger: 'blur' },
...@@ -79,7 +80,7 @@ export default { ...@@ -79,7 +80,7 @@ export default {
linkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }], linkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }],
speciLinkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }], speciLinkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }],
specificationDetailList: [{ required: true, message: '请添加规格并保存', trigger: 'change' }], specificationDetailList: [{ required: true, message: '请添加规格并保存', trigger: 'change' }],
baseGoodsName: [{ required:true, message: '请输入商品名称', trigger: ['blur', 'change'] }] baseGoodsName: [{ required: true, message: '请输入商品名称', trigger: ['blur', 'change'] }]
}, },
comFormRef: 'com', comFormRef: 'com',
editForm: [{ editForm: [{
...@@ -90,13 +91,13 @@ export default { ...@@ -90,13 +91,13 @@ export default {
// }, // },
formBlock: [ formBlock: [
{ {
name: 'goodsCode', name: 'goodsId',
label: '选择素材', label: '选择素材',
isRequired: true, isRequired: true,
type: 'cascader', type: 'cascader',
isClear: false, isClear: false,
optionList: [], optionList: [],
optionId: 'goodsCode', optionId: 'goodsId',
optionLabel: 'goodsName', optionLabel: 'goodsName',
width: '400px' width: '400px'
}, },
...@@ -178,13 +179,6 @@ export default { ...@@ -178,13 +179,6 @@ export default {
}, { }, {
title: '配规格', title: '配规格',
formBlock: [ formBlock: [
// {
// name: 'upgradeGoods',
// label: '',
// type: 'relatePro',
// optionValue: 'goodsCode',
// relateAttr: 'goodsCode'
// }
{ {
name: 'specificationDetailList', name: 'specificationDetailList',
label: '', label: '',
...@@ -229,7 +223,6 @@ export default { ...@@ -229,7 +223,6 @@ export default {
this.addOrEdit = this.$route.params.addOrEdit this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') { if (this.addOrEdit === 'edit') {
this.getGoodsInfo(this.$route.params.row.id) this.getGoodsInfo(this.$route.params.row.id)
// 编辑回显不可编辑 回显用select
} else { } else {
this.getGoodsList() this.getGoodsList()
this.editForm[0].formBlock[0].isDisabled = false this.editForm[0].formBlock[0].isDisabled = false
...@@ -242,9 +235,6 @@ export default { ...@@ -242,9 +235,6 @@ export default {
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
getGoodsList() { getGoodsList() {
// getGoodsList({}).then(res => {
// this.editForm[0].formBlock[0].optionList = res
// })
getThiredMaterialList({}).then(res => { getThiredMaterialList({}).then(res => {
res && res.forEach(item => { res && res.forEach(item => {
item.value = item.sceneType item.value = item.sceneType
...@@ -258,8 +248,9 @@ export default { ...@@ -258,8 +248,9 @@ export default {
}) })
let threeChildren = [] let threeChildren = []
val.threeMenu && val.threeMenu.forEach(v => { val.threeMenu && val.threeMenu.forEach(v => {
v.value = v.goodsCode
v.label = v.goodsName v.value = v.id
v.label = v.goods_name
threeChildren.push(v) threeChildren.push(v)
}) })
twoChildren[index].children = threeChildren twoChildren[index].children = threeChildren
...@@ -315,7 +306,8 @@ export default { ...@@ -315,7 +306,8 @@ export default {
goodsSpecificationNameList: res.goodsSpecificationNameList, goodsSpecificationNameList: res.goodsSpecificationNameList,
// linkMerchants: res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : [], // linkMerchants: res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : [],
linkMerchants: res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : [], linkMerchants: res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : [],
speciLinkMerchants: res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : [] speciLinkMerchants: res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : [],
goodsId: res.goodsInfo.goodsCode
} }
this.editForm[0].formBlock[0].type = 'select' this.editForm[0].formBlock[0].type = 'select'
this.markOldVal.shopPrice = res.shopPrice this.markOldVal.shopPrice = res.shopPrice
...@@ -359,7 +351,6 @@ export default { ...@@ -359,7 +351,6 @@ export default {
let data = deepClone(e) let data = deepClone(e)
let [goodsSpecificationNameList, goodsSpecificationList] = [[], []] let [goodsSpecificationNameList, goodsSpecificationList] = [[], []]
data.goodsCode = data.goodsCode.constructor === Array ? data.goodsCode[data.goodsCode.length - 1] : data.goodsCode
data.specificationDetailList.length && data.specificationDetailList.map(val => { data.specificationDetailList.length && data.specificationDetailList.map(val => {
let goodsSpecificationValueList = [] let goodsSpecificationValueList = []
val.specificationValueList.forEach(v => { val.specificationValueList.forEach(v => {
...@@ -391,7 +382,7 @@ export default { ...@@ -391,7 +382,7 @@ export default {
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
shopMinPrice: item.shopMinPrice, shopMinPrice: item.shopMinPrice,
stock: item.stock, stock: item.stock,
warrantyPeriod: item.warrantyTime warrantyPeriod: item.warrantyPeriod
}) })
}) })
var params = { var params = {
......
...@@ -207,14 +207,6 @@ export default { ...@@ -207,14 +207,6 @@ export default {
this.getBrandSupplyList(2) this.getBrandSupplyList(2)
this.getBaseData() this.getBaseData()
this.editForm[0].formBlock[1].optionList = scenCodeList this.editForm[0].formBlock[1].optionList = scenCodeList
// this.editForm[0].formBlock[4].optionList = brandMerchantList
// this.editForm[0].formBlock[5].optionList = [{
// confId: 1,
// confValue: '广联直营'
// }, {
// confId: 2,
// confValue: '供应商供应'
// }]
}, },
methods: { methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!