Commit bcc366d0 by 前端

Merge branch 'dev_v4.32.0_1130' into 'master'

Dev v4.32.0 1130

See merge request !4
2 parents 385ab76d 806cc51e
...@@ -30,6 +30,29 @@ const getGoodsSeries = params => { ...@@ -30,6 +30,29 @@ const getGoodsSeries = params => {
}) })
} }
// 自建商品类列表
const getGoodsCategory = params => {
params.method = 'scrm.api.partner.goods.goodsCategoryConfiguration.page'
return http({
url: 'rop-scrm-partner/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取商品部位
const getGoodsPosList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.goodsPosition.list'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const updateGoods = params => { const updateGoods = params => {
params.method = 'scrm.api.partner.goods.insertOrUpdate' params.method = 'scrm.api.partner.goods.insertOrUpdate'
return http({ return http({
...@@ -73,4 +96,4 @@ const exportGoods = params => { ...@@ -73,4 +96,4 @@ const exportGoods = params => {
}) })
} }
export default { getListApi, getSimpleMerchantList, getGoodsSeries, updateGoods, getGoodsDetail, deleteGoods, exportGoods } export default { getListApi, getSimpleMerchantList, getGoodsSeries, getGoodsCategory, getGoodsPosList, updateGoods, getGoodsDetail, deleteGoods, exportGoods }
...@@ -4,17 +4,14 @@ ...@@ -4,17 +4,14 @@
<div class="edit-box "> <div class="edit-box ">
<div class="m-b-20 bgf"> <div class="m-b-20 bgf">
<p class="edit-title">基础信息</p> <p class="edit-title">基础信息</p>
<el-form label-width="120px" :inline="true" class="context-wrap"> <el-form label-width="120px" :inline="true" class="context-wrap content" v-if="isShow">
<el-row v-for="(item, index) in detailFormDataRow" :key="index"> <div v-for="(subItem, index) in detailFormData" :key="index" :class="[detailForm[subItem.name] != '-' ? 'w-30' : '']">
<span v-for="(subItem, subIndex) in item.rowList" :key="subIndex"> <template v-if="detailForm[subItem.name] != '-'">
<template v-if="detailForm[subItem.name] != '-'"> <el-form-item :label="subItem.label + ':'" class="row-item">
<el-form-item :label="subItem.label + ':'" class="row-item"> <span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] === null ? '-' : detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : subItem.isNum ? '0' + (subItem.suffix || '') : '-' }}</span>
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : subItem.isNum ? '0' + (subItem.suffix || '') : '-' }}</span>
</el-form-item> </el-form-item>
</template> </template>
</span> </div>
</el-row>
</el-form> </el-form>
</div> </div>
<div class="edit-container bgf"> <div class="edit-container bgf">
...@@ -22,9 +19,6 @@ ...@@ -22,9 +19,6 @@
<GLTable ref="warehousListRef" class="context-wrap" :hasPage="false" :tableParams="tableParams" :tableData="detailForm.merchantList"></GLTable> <GLTable ref="warehousListRef" class="context-wrap" :hasPage="false" :tableParams="tableParams" :tableData="detailForm.merchantList"></GLTable>
</div> </div>
</div> </div>
<!-- <GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
</GLFooter> -->
</div> </div>
</template> </template>
...@@ -36,6 +30,7 @@ export default { ...@@ -36,6 +30,7 @@ export default {
size: 'small', size: 'small',
title: '查看商品', title: '查看商品',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
isShow: false,
routeInfo: { routeInfo: {
orderCode: '' orderCode: ''
}, },
...@@ -43,7 +38,6 @@ export default { ...@@ -43,7 +38,6 @@ export default {
orderRefund: null, orderRefund: null,
orderGoods: [], orderGoods: [],
// 订单信息 // 订单信息
detailFormDataRow: [],
detailFormData: [ detailFormData: [
{ {
label: '商品名称', label: '商品名称',
...@@ -54,8 +48,8 @@ export default { ...@@ -54,8 +48,8 @@ export default {
name: 'type' name: 'type'
}, },
{ {
label: '所属系列', label: '所属分类',
name: 'goodsCodeName' name: 'goodsTypeName'
}, },
{ {
label: '品牌方', label: '品牌方',
...@@ -66,47 +60,62 @@ export default { ...@@ -66,47 +60,62 @@ export default {
name: 'supplierName' name: 'supplierName'
}, },
{ {
label: '适用部位',
name: 'posTxt'
},
{
label: '比例换算',
name: 'convertedValueTxt'
},
{
label: '扣减标准',
name: 'deductionStandard',
suffix: '米/车'
},
{
label: '产品类型', label: '产品类型',
name: 'typeTxt' name: 'typeTxt'
}, },
// {
// label: '所属系列',
// name: 'goodsCode'
// },
{ {
label: '售价/元', label: '售价',
name: 'sellPrice', name: 'sellPrice',
isNum: true isNum: true,
suffix: '元/件'
}, },
{ {
label: '最低售价/元', label: '最低售价',
name: 'minSellPrice', name: 'minSellPrice',
isNum: true isNum: true,
suffix: '元/件'
}, },
{ {
label: '赠送成本/元', label: '赠送成本',
name: 'giftCost', name: 'giftCost',
isNum: true isNum: true,
suffix: '元/车'
}, },
{ {
label: '产品成本/元', label: '产品成本',
name: 'productCost', name: 'productCost',
isNum: true,
suffix: '元/件'
},
{
label: '质保年限/年',
name: 'warrantyPeriod',
isNum: true isNum: true
}, },
{ {
label: '库存下限预警', label: '库存下限预警',
name: 'warningValue', name: 'warningValue',
isNum: true isNum: true,
suffix: '米'
}, },
{ {
label: '库存预警上限', label: '库存上限预警',
name: 'warningValueMax', name: 'warningValueMax',
isNum: true isNum: true,
}, suffix: '米'
{
label: '质保年限',
name: 'warrantyPeriod',
isNum: true
} }
], ],
// 门店表格 // 门店表格
...@@ -125,10 +134,6 @@ export default { ...@@ -125,10 +134,6 @@ export default {
} }
}, },
created() {
this.formToRow('detailFormData')
},
mounted() { mounted() {
this.setMinHeight('.edit-box') this.setMinHeight('.edit-box')
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
...@@ -136,40 +141,56 @@ export default { ...@@ -136,40 +141,56 @@ export default {
}, },
methods: { methods: {
formToRow(formName, numOfRow = 3) { getGoodsPosList() {
var rowNum = Math.ceil(this[formName].length / numOfRow) this.$apis.commodity.getGoodsPosList({}).then(res => {
for (var i = 0; i < rowNum; i++) { this.goodsPosList = res
for (var j = 0; j < numOfRow; j++) { let obj = this.goodsPosList.find(item => item.positionValue == this.detailForm.position)
if (j == 0) { this.detailForm.posTxt = obj ? obj.positionName : '-'
this[formName + 'Row'][i] = { })
rowList: [] },
} changeFormAttr(formName, attrName, labelList, attrValue) {
} labelList.forEach(item => {
if (i * numOfRow + j < this[formName].length) { this[formName].forEach(k => {
this[formName + 'Row'][i].rowList.push(this[formName][i * numOfRow + j]) if (k.label == item) {
k[attrName] = attrValue
} }
} })
} })
console.log(this.detailFormDataRow, 'detailFormDataRow---')
}, },
getInfo() { getInfo() {
this.$apis.commodity.getGoodsDetail({ upgradeGoodsId: this.routeInfo.info.upgradeGoodsId }).then(res => { this.$apis.commodity.getGoodsDetail({ upgradeGoodsId: this.routeInfo.info.upgradeGoodsId }).then(res => {
this.detailForm = res this.detailForm = {
...res,
posTxt: ''
}
let list = [] let list = []
let baseLabelList = ['售价', '最低售价', '产品成本']
let unitLabelList = ['库存下限预警', '库存上限预警']
this.detailForm.baseProductFlag == 'Y' ? list.push('基础产品') : '' this.detailForm.baseProductFlag == 'Y' ? list.push('基础产品') : ''
this.detailForm.upgradeProductFlag == 'Y' ? list.push('升级产品') : '' this.detailForm.upgradeProductFlag == 'Y' ? list.push('升级产品') : ''
this.detailForm.typeTxt = list.join(',') this.detailForm.typeTxt = list.join(',')
this.changeFormAttr('detailFormData', 'suffix', baseLabelList, this.detailForm.goodsTypeName == '自建商品-精品' ? '元/件' : '元/车')
this.changeFormAttr('detailFormData', 'suffix', unitLabelList, this.detailForm.goodsTypeName == '自建商品-精品' ? '件' : '米')
this.detailForm.convertedValueTxt = this.detailForm.convertedValue ? '1卷=' + this.detailForm.convertedValue + '米' : '-'
this.getGoodsPosList()
if (list.length != 2 && this.detailForm.baseProductFlag == 'Y') { if (list.length != 2 && this.detailForm.baseProductFlag == 'Y') {
this.detailForm.sellPrice = '-' this.detailForm.sellPrice = '-'
this.detailForm.minSellPrice = '-' this.detailForm.minSellPrice = '-'
this.detailForm.productCost = '-' this.detailForm.productCost = '-'
} }
if (this.detailForm.goodsCodeName != '太阳膜') { if (list.length != 2 && this.detailForm.upgradeProductFlag == 'Y') {
this.detailForm.giftCost = '-'
}
if (this.detailForm.goodsTypeName != '自建商品-太阳膜') {
this.detailForm.warrantyPeriod = '-' this.detailForm.warrantyPeriod = '-'
this.detailForm.giftCost = '-' this.detailForm.giftCost = '-'
this.detailForm.deductionStandard = '-'
this.detailForm.typeTxt = '-'
} else { } else {
this.detailForm.warrantyPeriod = (this.detailForm.warrantyPeriod || 0) + '年' this.detailForm.warrantyPeriod = (this.detailForm.warrantyPeriod || 0) + '年'
} }
// console.log(this.detailForm, '000')
this.isShow = true
}) })
}, },
handleCancel() { handleCancel() {
...@@ -193,9 +214,17 @@ export default { ...@@ -193,9 +214,17 @@ export default {
.marketing.order-detail .flex { .marketing.order-detail .flex {
justify-content: flex-start; justify-content: flex-start;
} }
.marketing.order-detail .row-item { .order-detail .content {
display: flex;
flex-wrap: wrap;
}
.order-detail .w-30 {
width: 33%; width: 33%;
} }
.marketing.order-detail .row-item {
display: inline-block;
/* width: 33%; */
}
.detail-txt { .detail-txt {
display: inline-block; display: inline-block;
width: 220px; width: 220px;
......
...@@ -29,6 +29,15 @@ const commodityObj = { ...@@ -29,6 +29,15 @@ const commodityObj = {
maxlength: 20 maxlength: 20
}, },
{ {
label: '产品类型',
name: 'proType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'typeList'
},
{
label: '使用门店', label: '使用门店',
name: 'merchantIdList', name: 'merchantIdList',
type: 'select', type: 'select',
...@@ -38,29 +47,24 @@ const commodityObj = { ...@@ -38,29 +47,24 @@ const commodityObj = {
optionsName: 'merchantList' optionsName: 'merchantList'
}, },
{ {
label: '所属系列', label: '所属分类',
name: 'goodsCode',
type: 'select',
optionList: [],
optionId: 'goodsCode',
optionLabel: 'goodsName',
optionsName: 'goodsSeriesList'
},
{
label: '产品类型',
name: 'goodsType', name: 'goodsType',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'categoryType',
optionLabel: 'confValue', optionLabel: 'categoryName',
optionsName: 'typeList' optionsName: 'goodsCategoryList'
} }
] ]
} }
const editCommodityObj = { const editCommodityObj = {
editRule: { editRule: {
goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }], goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
goodsCode: [{ required: true, message: '请选择所属系列', trigger: 'change' }], // goodsCode: [{ required: true, message: '请选择所属系列', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择所属分类', trigger: 'change' }],
position: [{ required: true, message: '请选择适用部位', trigger: 'change' }],
convertedValue: [{ required: true, message: '请输入比例换算', trigger: 'change' }],
deductionStandard: [{ required: true, message: '请输入扣减标准', trigger: 'change' }],
sellPrice: [{ required: true, message: '请输入售价', trigger: 'change' }], sellPrice: [{ required: true, message: '请输入售价', trigger: 'change' }],
minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }], minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }],
giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }], giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }],
...@@ -84,23 +88,30 @@ const editCommodityObj = { ...@@ -84,23 +88,30 @@ const editCommodityObj = {
maxlength: 50 maxlength: 50
}, },
{ {
label: '所属系列', label: '所属分类',
name: 'goodsCode', name: 'goodsType',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'goodsCode', optionId: 'categoryType',
optionLabel: 'goodsName', optionLabel: 'categoryName',
optionsName: 'goodsSeriesList', optionsName: 'goodsCategoryList',
changeAttr: function(val, targetItem, that) { changeAttr: function(val, targetItem, that) {
let labeList = ['产品类型', '质保年限'] let labelList = ['适用部位', '扣减标准', '产品类型', '质保年限']
let txt = targetItem.optionList.find(k => k.goodsCode == val)?.goodsName || '' let jpLabelList = ['比例换算']
that.changeFormAttr('editFormData', 'isHide', labeList, txt != '太阳膜') let baseLabelList = ['售价', '最低售价', '产品成本']
if (val != '1') { let unitLabelList = ['库存下限预警', '库存上限预警']
that.editForm.baseProductFlag = 'N' let txt = targetItem.optionList.find(k => k.categoryType == val)?.categoryName || ''
that.editForm.upgradeProductFlag = 'Y' that.changeFormAttr('editFormData', 'isHide', labelList, txt != '自建商品-太阳膜')
that.handleCheckChange('Y', 'upgradeProductFlag') that.changeFormAttr('editFormData', 'isHide', jpLabelList, txt == '自建商品-精品')
that.handleCheckChange('N', 'baseProductFlag') that.changeFormAttr('editFormData', 'append', baseLabelList, txt == '自建商品-精品' ? '元/件' : '元/车')
that.changeFormAttr('editFormData', 'append', unitLabelList, txt == '自建商品-精品' ? '件' : '米')
if (txt != '自建商品-太阳膜') {
that.changeFormAttr('editFormData', 'isHide', baseLabelList, !(txt != '自建商品-太阳膜'))
} }
that.editForm.baseProductFlag = 'N'
that.editForm.upgradeProductFlag = 'Y'
that.handleCheckChange('Y', 'upgradeProductFlag')
that.handleCheckChange('N', 'baseProductFlag')
} }
}, },
{ {
...@@ -116,6 +127,31 @@ const editCommodityObj = { ...@@ -116,6 +127,31 @@ const editCommodityObj = {
maxlength: 20 maxlength: 20
}, },
{ {
label: '适用部位',
name: 'position',
type: 'select',
isHide: true,
optionList: [],
optionId: 'positionValue',
optionLabel: 'positionName',
optionsName: 'goodsPosList'
},
{
label: '比例换算',
name: 'convertedValue',
type: 'slot',
addHtml: 'convertedValue',
isHide: true
},
{
label: '扣减标准',
name: 'deductionStandard',
type: 'slot',
addHtml: 'deductionStandard',
placeholder: '请输入米数',
isHide: true
},
{
label: '产品类型', label: '产品类型',
name: '', name: '',
type: 'slot', type: 'slot',
...@@ -124,38 +160,44 @@ const editCommodityObj = { ...@@ -124,38 +160,44 @@ const editCommodityObj = {
tips: '说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中' tips: '说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
}, },
{ {
label: '售价/元', label: '售价',
name: 'sellPrice', name: 'sellPrice',
type: 'input', type: 'input',
isHide: true isHide: true,
append: '元/件'
}, },
{ {
label: '最低售价/元', label: '最低售价',
name: 'minSellPrice', name: 'minSellPrice',
type: 'input', type: 'input',
isHide: true isHide: true,
append: '元/件'
}, },
{ {
label: '赠送成本/元', label: '赠送成本',
name: 'giftCost', name: 'giftCost',
type: 'input', type: 'input',
isHide: true isHide: true,
append: '元/车'
}, },
{ {
label: '产品成本/元', label: '产品成本',
name: 'productCost', name: 'productCost',
type: 'input', type: 'input',
isHide: true isHide: true,
append: '元/件'
}, },
{ {
label: '库存下限预警/件', label: '库存下限预警',
name: 'warningValue', name: 'warningValue',
type: 'input' type: 'input',
append: '米'
}, },
{ {
label: '库存上限预警/件', label: '库存上限预警',
name: 'warningValueMax', name: 'warningValueMax',
type: 'input' type: 'input',
append: '米'
}, },
{ {
label: '质保年限', label: '质保年限',
......
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">基础信息</p> <p class="edit-title">基础信息</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :pageThat="this" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :pageThat="this" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="convertedValue" slot-scope="scope">
<span>一卷等于</span>
<el-input style="width: 136px; margin: 0 8px;" :placeholder="scope.scope.placeholder || '请输入' + scope.scope.label" v-bind="scope.scope.attrs ? scope.scope.attrs : {}" v-model.trim="editForm[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input>
<span>米</span>
</div>
<div slot="deductionStandard" slot-scope="scope">
<el-input style="width: 136px; margin-right: 8px;" :placeholder="scope.scope.placeholder || '请输入' + scope.scope.label" v-bind="scope.scope.attrs ? scope.scope.attrs : {}" v-model.trim="editForm[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input>
<span>米/车,1卷膜预估可适用{{ editForm.deductionStandard ? Math.floor(editForm.convertedValue / editForm.deductionStandard) : '--' }}车</span>
</div>
<div slot="productFlag"> <div slot="productFlag">
<el-checkbox v-model="editForm.baseProductFlag" true-label="Y" false-label="N" label="基础产品" @change="val => handleCheckChange(val, 'baseProductFlag')"></el-checkbox> <el-checkbox v-model="editForm.baseProductFlag" true-label="Y" false-label="N" label="基础产品" @change="val => handleCheckChange(val, 'baseProductFlag')"></el-checkbox>
<el-checkbox v-model="editForm.upgradeProductFlag" true-label="Y" false-label="N" label="升级产品" @change="val => handleCheckChange(val, 'upgradeProductFlag')"></el-checkbox> <el-checkbox v-model="editForm.upgradeProductFlag" true-label="Y" false-label="N" label="升级产品" @change="val => handleCheckChange(val, 'upgradeProductFlag')"></el-checkbox>
...@@ -63,7 +72,8 @@ export default { ...@@ -63,7 +72,8 @@ export default {
editForm: { editForm: {
baseProductFlag: 'N', baseProductFlag: 'N',
upgradeProductFlag: 'N', upgradeProductFlag: 'N',
merchantList: [] merchantList: [],
goodsType: ''
}, },
isEdit: true, isEdit: true,
editRule: constData.editCommodityObj.editRule, editRule: constData.editCommodityObj.editRule,
...@@ -95,7 +105,9 @@ export default { ...@@ -95,7 +105,9 @@ export default {
] ]
}, },
baseData: { baseData: {
goodsSeriesList: [] goodsCategoryList: [],
goodsPosList: []
// goodsSeriesList: []
} }
} }
}, },
...@@ -142,13 +154,15 @@ export default { ...@@ -142,13 +154,15 @@ export default {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.editType != 'add' ? this.getInfo() : '' this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.$utils.getOptionsList(this, 'editFormData', false) this.$utils.getOptionsList(this, 'editFormData', false)
this.getGoodsSeries() this.getGoodsCategory()
this.getGoodsPosList()
// this.getGoodsSeries()
// this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false) // this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
}, },
methods: { methods: {
keyDown() { keyDown() {
document.onkeydown = function() { document.onkeydown = function () {
var evt = window.event || arguments[0] var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) { if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
...@@ -163,21 +177,27 @@ export default { ...@@ -163,21 +177,27 @@ export default {
upgradeGoodsId: this.routeInfo.info.upgradeGoodsId upgradeGoodsId: this.routeInfo.info.upgradeGoodsId
} }
this.$apis.commodity.getGoodsDetail(params).then(res => { this.$apis.commodity.getGoodsDetail(params).then(res => {
let changeProduct = this.validateProduct(res.goodsCodeName) let changeProduct = this.validateProduct(res.goodsTypeName)
if (changeProduct) { if (changeProduct) {
this.handleCheckChange(res.baseProductFlag, 'baseProductFlag') this.handleCheckChange(res.baseProductFlag, 'baseProductFlag')
this.handleCheckChange(res.upgradeProductFlag, 'upgradeProductFlag') this.handleCheckChange(res.upgradeProductFlag, 'upgradeProductFlag')
} }
let baseLabelList = ['售价', '最低售价', '产品成本']
let unitLabelList = ['库存下限预警', '库存上限预警']
this.changeFormAttr('editFormData', 'append', baseLabelList, res.goodsTypeName == '自建商品-精品' ? '元/件' : '元/车')
this.changeFormAttr('editFormData', 'append', unitLabelList, res.goodsTypeName == '自建商品-精品' ? '件' : '米')
this.editForm = res this.editForm = res
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
}, },
validateProduct(goodsCodeName) { validateProduct(goodsTypeName) {
let isFlag = goodsCodeName != '太阳膜' let isFlag = goodsTypeName != '自建商品-太阳膜'
let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限'] // let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限']
let AttrList = isFlag ? ['售价', '最低售价', '产品成本'] : ['适用部位', '比例换算', '扣减标准', '产品类型', '质保年限']
goodsTypeName != '自建商品-精品' && AttrList.push('比例换算')
this.changeFormAttr('editFormData', 'isHide', AttrList, false) this.changeFormAttr('editFormData', 'isHide', AttrList, false)
if (!isFlag) if (!isFlag)
return (val, attr) => { return (val, attr) => {
...@@ -188,16 +208,28 @@ export default { ...@@ -188,16 +208,28 @@ export default {
// seriesClear() { // seriesClear() {
// this.editForm // this.editForm
// }, // },
getGoodsSeries() { // getGoodsSeries() {
this.$apis.commodity.getGoodsSeries({}).then(res => { // this.$apis.commodity.getGoodsSeries({}).then(res => {
this.baseData.goodsSeriesList = res // this.baseData.goodsSeriesList = res
this.$utils.getOptionsList(this, 'editFormData', false, 'goodsCode') // this.$utils.getOptionsList(this, 'editFormData', false, 'goodsCode')
// })
// },
getGoodsCategory() {
this.$apis.commodity.getGoodsCategory({}).then(res => {
this.baseData.goodsCategoryList = res
this.$utils.getOptionsList(this, 'editFormData', false, 'goodsType')
})
},
getGoodsPosList() {
this.$apis.commodity.getGoodsPosList({}).then(res => {
this.baseData.goodsPosList = res
this.$utils.getOptionsList(this, 'editFormData', false, 'position')
}) })
}, },
// 产品类型改变 // 产品类型改变
handleCheckChange(val, attr) { handleCheckChange(val, attr) {
let baseAttrList = ['赠送成本/元'] let baseAttrList = ['赠送成本']
let upAttrList = ['售价/元', '最低售价/元', '产品成本/元'] let upAttrList = ['售价', '最低售价', '产品成本']
switch (attr) { switch (attr) {
case 'baseProductFlag': case 'baseProductFlag':
this.changeFormAttr('editFormData', 'isHide', baseAttrList, val != 'Y') this.changeFormAttr('editFormData', 'isHide', baseAttrList, val != 'Y')
...@@ -261,10 +293,29 @@ export default { ...@@ -261,10 +293,29 @@ export default {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
params.merchantIdList = [] params.merchantIdList = []
params.merchantIdList = params.merchantList.map(item => item.merchantId) params.merchantIdList = params.merchantList.map(item => item.merchantId)
params.goodsTypeName = this.baseData.goodsCategoryList.find(item => item.categoryType == params.goodsType).categoryName
delete params.merchantList delete params.merchantList
if (this.routeInfo.editType == 'edit') { if (this.routeInfo.editType == 'edit') {
params.upgradeGoodsId = this.routeInfo.info.upgradeGoodsId params.upgradeGoodsId = this.routeInfo.info.upgradeGoodsId
} }
if (params.goodsTypeName != '自建商品-太阳膜') {
params.baseProductFlag = 'N'
params.upgradeProductFlag = 'N'
params.position = ''
params.deductionStandard = ''
params.giftCost = ''
params.warrantyPeriod = ''
} else if (params.upgradeProductFlag == 'N') {
params.sellPrice = ''
params.minSellPrice = ''
params.productCost = ''
} else if (params.baseProductFlag == 'N') {
params.giftCost = ''
}
if (params.goodsTypeName == '自建商品-精品') {
params.convertedValue = ''
}
console.log(params, '00000')
this.$apis.commodity.updateGoods(params).then(res => { this.$apis.commodity.updateGoods(params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
...@@ -292,7 +343,7 @@ export default { ...@@ -292,7 +343,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
<div slot="content"> <div slot="content">
<div class="text-3 font-12 weight-6" style="line-height:24px">上家门店</div> <div class="text-3 font-12 weight-6" style="line-height:24px">上家门店</div>
<div class="merchant-wrap"> <div class="merchant-wrap">
<div class="text-6 font-12" style="line-height:24px" v-for="item in scope.scope.merchantList" :key="item">{{ item.merchantName }}</div> <div class="text-6 font-12" style="line-height:24px" v-for="item in scope.scope.merchantList" :key="item">{{ item.merchantName }}</div>
</div> </div>
</div> </div>
<div class="use-store"> <div class="use-store">
<img src="@/assets/store.png" /> <img src="@/assets/store.png" />
...@@ -53,6 +52,7 @@ export default { ...@@ -53,6 +52,7 @@ export default {
goodsCode: '', goodsCode: '',
merchantIdList: [], merchantIdList: [],
type: '', type: '',
proType: '',
goodsType: '' goodsType: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
...@@ -79,9 +79,9 @@ export default { ...@@ -79,9 +79,9 @@ export default {
line: 1 line: 1
}, },
{ {
label: '所属系列', label: '所属分类',
prop: 'goodsCodeName', prop: 'goodsTypeName',
width: '100' width: '150'
}, },
{ {
label: '品牌方', label: '品牌方',
...@@ -189,7 +189,8 @@ export default { ...@@ -189,7 +189,8 @@ export default {
merchantList: [], merchantList: [],
brandList: [], brandList: [],
typeList: baseList.typeList, typeList: baseList.typeList,
goodsSeriesList: [] goodsSeriesList: [],
goodsCategoryList: []
}, },
imgVisible: false, imgVisible: false,
previewImgUrl: '' previewImgUrl: ''
...@@ -199,12 +200,13 @@ export default { ...@@ -199,12 +200,13 @@ export default {
mounted() { mounted() {
this.getGoodsSeries() this.getGoodsSeries()
this.getMerchantList() this.getMerchantList()
this.getGoodsCategory()
this.$utils.getOptionsList(this, 'searchFormData') this.$utils.getOptionsList(this, 'searchFormData')
}, },
methods: { methods: {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
switch (params.goodsType) { switch (params.proType) {
case 1: case 1:
params.baseProductFlag = 'Y' params.baseProductFlag = 'Y'
break break
...@@ -259,6 +261,12 @@ export default { ...@@ -259,6 +261,12 @@ export default {
}) })
}, },
getGoodsCategory() {
this.$apis.commodity.getGoodsCategory({}).then(res => {
this.baseData.goodsCategoryList = res
this.$utils.getOptionsList(this, 'searchFormData', true, 'goodsType')
})
},
// 删除 // 删除
handleDelete(info) { handleDelete(info) {
this.$utils.secondConfirm(this, '删除提示', '删除后不可恢复,是否确定删除?', 'commodity', 'deleteGoods', { upgradeGoodsId: info.upgradeGoodsId }) this.$utils.secondConfirm(this, '删除提示', '删除后不可恢复,是否确定删除?', 'commodity', 'deleteGoods', { upgradeGoodsId: info.upgradeGoodsId })
...@@ -282,6 +290,7 @@ export default { ...@@ -282,6 +290,7 @@ export default {
goodsCode: '', goodsCode: '',
merchantIdList: [], merchantIdList: [],
type: '', type: '',
proType: '',
goodsType: '' goodsType: ''
} }
this.handleSearch() this.handleSearch()
...@@ -290,8 +299,8 @@ export default { ...@@ -290,8 +299,8 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container{ .container {
padding:20px; padding: 20px;
} }
.use-store { .use-store {
display: flex; display: flex;
...@@ -305,19 +314,19 @@ export default { ...@@ -305,19 +314,19 @@ export default {
} }
} }
.table-header { .table-header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 10px; margin-bottom: 10px;
margin-top: 20px; margin-top: 20px;
h2 { h2 {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
} }
.merchant-wrap{ .merchant-wrap {
max-height:200px; max-height: 200px;
overflow: scroll; overflow: scroll;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!