Commit d6eeb4ad by yancanhua

fix: 三月中旬上架管理新增售价有效期功能开发

1 parent afe82fab
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
:clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" /> :clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<!-- <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> -->
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true" <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> :maxlength="50" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']" <el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']"
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
>{{ subItem.label }}</el-radio >{{ subItem.label }}</el-radio
> >
</el-radio-group> </el-radio-group>
<el-tooltip class="item" effect="dark" placement="top"> <el-tooltip v-if="item.name === 'financeCheckFlag'" class="item" effect="dark" placement="top">
<template slot="content"> <template slot="content">
<p style="width: 260px"> <p style="width: 260px">
<i class="el-icon-info"></i <i class="el-icon-info"></i
...@@ -280,6 +280,22 @@ ...@@ -280,6 +280,22 @@
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
</div> </div>
<div v-if="item.type === 'datePicker' && formData.sellPriceValidType == '2'">
<el-form-item
:prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '180px' : '0px'"
class="dis-in-block"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"
>
<template >
<el-date-picker v-model="formData[item.name]" type="daterange" :style="{ width: item.width || formItemWidth }" range-separator="至" format="yyyy-MM-dd" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
</template>
</el-form-item>
</div>
<!-- 按钮 --> <!-- 按钮 -->
<div v-if="item.type === 'button'"> <div v-if="item.type === 'button'">
<el-form-item <el-form-item
...@@ -638,7 +654,13 @@ export default { ...@@ -638,7 +654,13 @@ export default {
message: "请选择是否开启财务规则校验", message: "请选择是否开启财务规则校验",
trigger: "change" trigger: "change"
} }
] ],
sellPriceValidType: [
{ required: true, message: "请选择售价有效期", trigger: "change" }
],
tempValidDate: [
{ required: true, message: "请选择有效期", trigger: "blur" }
],
}, },
storeSelected: [], storeSelected: [],
relateStoreVisible: false, relateStoreVisible: false,
...@@ -1230,7 +1252,14 @@ export default { ...@@ -1230,7 +1252,14 @@ export default {
handleUp(e) { handleUp(e) {
this.$refs[this.formRef + "d2FormRuleForm"].validate((valid, options) => { this.$refs[this.formRef + "d2FormRuleForm"].validate((valid, options) => {
if (valid) { if (valid) {
this.$emit("handleAddConfirm", { ...this.formData, num: e }) const { tempValidDate } = this.formData;
let tempValidStartDate = '';
let tempValidEndDate = '';
if(this.formData.sellPriceValidType == '2'){
tempValidStartDate = tempValidDate[0] || '';
tempValidEndDate = tempValidDate[1] || '';
}
this.$emit("handleAddConfirm", { ...this.formData, tempValidStartDate, tempValidEndDate, num: e })
} else { } else {
var needRuleList = Object.keys(options) var needRuleList = Object.keys(options)
this.jumpScroll(needRuleList[0]) this.jumpScroll(needRuleList[0])
......
...@@ -14,7 +14,7 @@ import { getMerchantGoodsInfo, addOrUpdateAPI, checkGroundingLog } from '@api/gr ...@@ -14,7 +14,7 @@ import { getMerchantGoodsInfo, addOrUpdateAPI, checkGroundingLog } from '@api/gr
import groundingForm from "./components/groundingForm.vue" import groundingForm from "./components/groundingForm.vue"
import { BaseData, sceneCodeList } from '@/common/constants.js' import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { filterSpecsStr, convertYuanToWan } from "../filterOption" import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default { export default {
...@@ -177,6 +177,23 @@ export default { ...@@ -177,6 +177,23 @@ export default {
width: '432px', width: '432px',
unit: true, unit: true,
handleInput: true handleInput: true
},{
name: 'sellPriceValidType',
label: '售价有效期',
type: 'flagRadio',
radioGroupList: [{
label: '终生有效',
value: 1
}, {
label: '临时有效',
value: 2
}]
}, {
name: 'tempValidDate',
label: '有效期',
type: 'datePicker',
maxlength: 120,
width: '432px'
}, { }, {
name: 'financeCheckFlag', name: 'financeCheckFlag',
label: '财务规则校验', label: '财务规则校验',
...@@ -234,6 +251,8 @@ export default { ...@@ -234,6 +251,8 @@ export default {
voucherList: [], voucherList: [],
validMinSellPriceFlag: true, validMinSellPriceFlag: true,
validMinSellPrice: 'Y', validMinSellPrice: 'Y',
sellPriceValidType: 1,
tempValidDate: [],
financeCheckFlag: 'N' financeCheckFlag: 'N'
}, },
secondGoodsList: [], secondGoodsList: [],
...@@ -303,6 +322,13 @@ export default { ...@@ -303,6 +322,13 @@ export default {
}) })
res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店 res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店
res.voucherList = res.voucherList || [] // 上架凭证 res.voucherList = res.voucherList || [] // 上架凭证
let tempValidDate = [];
if(res?.sellPriceValidType && res?.sellPriceValidType == 2 ){
if(res?.tempValidStartDate && res?.tempValidEndDate){
tempValidDate = [Util.dateFormate(res?.tempValidStartDate, 'YYYY-MM-DD'), Util.dateFormate(res?.tempValidEndDate, 'YYYY-MM-DD')]
}
}
res.tempValidDate = tempValidDate
res.upgradeGoods = { res.upgradeGoods = {
...res?.upgradeGoods, ...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
...@@ -313,7 +339,9 @@ export default { ...@@ -313,7 +339,9 @@ export default {
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods), specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode upgradeCommodityCode: res?.upgradeGoods?.commodityCode,
sellPriceValidType: res?.sellPriceValidType ? res?.sellPriceValidType + '' : '1',
tempValidDate: tempValidDate,
} }
this.editData = res || {} this.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
...@@ -364,14 +392,19 @@ export default { ...@@ -364,14 +392,19 @@ export default {
}) })
// 整理上传凭证数据 // 整理上传凭证数据
delete formObj?.productType delete formObj?.productType
const params = { let params = {
saveDraft: num === 2, // 是否存草稿 saveDraft: num === 2, // 是否存草稿
id: data.id, id: data.id,
...formObj, ...formObj,
merchantGoodsRefList: arr, merchantGoodsRefList: arr,
voucherList: fileArr, voucherList: fileArr,
existCheck, existCheck,
validMinSellPrice: data?.validMinSellPrice validMinSellPrice: data?.validMinSellPrice,
tempValidStartDate: data?.tempValidStartDate || '',
tempValidEndDate: data?.tempValidEndDate || '',
}
if(params.tempValidDate){
delete params.tempValidDate
} }
if (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.warning('太阳膜类商品仅支持上架至精品升级场景') if (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.warning('太阳膜类商品仅支持上架至精品升级场景')
if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0) return this.$message.warning('延保类商品仅支持上架至会员/权益升级场景') if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0) return this.$message.warning('延保类商品仅支持上架至会员/权益升级场景')
...@@ -381,7 +414,12 @@ export default { ...@@ -381,7 +414,12 @@ export default {
upgradeGoodsId: formObj.upgradeGoodsId, upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || '', position: formObj.position || '',
sceneType: formObj.sceneType, sceneType: formObj.sceneType,
merchantIdList: arr?.map(val => { return val.merchantId }) merchantIdList: arr?.map(val => { return val.merchantId }),
tempValidStartDate: data?.tempValidStartDate || '',
tempValidEndDate: data?.tempValidEndDate || '',
}
if(params.tempValidDate){
delete params.tempValidDate
} }
if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示 if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
......
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
warrantyTypeStr: [{ required: true }], warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }], djCost: [{ required: true }],
thirdPartyCost: [{ required: true }], thirdPartyCost: [{ required: true }],
sellPriceValidType: [{ required: true }],
financeCheckFlagStr: [{ required: true }] financeCheckFlagStr: [{ required: true }]
}, },
editForm: [{ editForm: [{
...@@ -134,6 +135,9 @@ export default { ...@@ -134,6 +135,9 @@ export default {
label: '第三方成本', label: '第三方成本',
unit: true unit: true
}, { }, {
name: 'sellPriceValidType',
label: '售价有效期',
}, {
name: 'financeCheckFlagStr', name: 'financeCheckFlagStr',
label: '财务规则校验' label: '财务规则校验'
}] }]
...@@ -221,6 +225,13 @@ export default { ...@@ -221,6 +225,13 @@ export default {
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || '' res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.supplierCode = res?.goodsInfo?.supplierCode res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-' res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-'
let sellPriceValidTxt = ''
if (res?.sellPriceValidType == 2 && res?.tempValidStartDate && res?.tempValidEndDate) {
sellPriceValidTxt = `${Util.dateFormate(res?.tempValidStartDate, 'YYYY-MM-DD')} 至 ${Util.dateFormate(res?.tempValidEndDate, 'YYYY-MM-DD')}`
}
res.sellPriceValidType = res?.sellPriceValidType == 1 ? '终生有效' : res?.sellPriceValidType == 2 ? sellPriceValidTxt : '-'
res.upgradeGoods = { res.upgradeGoods = {
...res.upgradeGoods, ...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!