Commit f99afae7 by wuwx

优惠券精确到时分秒,新建商品添加业务类型,新建商品关联优惠券

1 parent 550ea9b2
...@@ -97,4 +97,14 @@ const getGoodsCommentListApi = params => { ...@@ -97,4 +97,14 @@ const getGoodsCommentListApi = params => {
}) })
} }
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi, getGoodsCommentListApi }
\ No newline at end of file \ No newline at end of file
const getBusinessTypeByIdApi = params => {
params.method = 'scrm.api.shopmall.goods.getBusinessTypeById'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {getBusinessTypeByIdApi, getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi, getGoodsCommentListApi }
\ No newline at end of file \ No newline at end of file
...@@ -18,9 +18,9 @@ module.exports = { ...@@ -18,9 +18,9 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn/', // baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/', // baseURL: 'http://192.168.2.42:8064/',
// baseURL: 'http://scrm.dev.glsx.com.cn/', baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -21,9 +21,9 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -21,9 +21,9 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-dc073d36-45f8-48f4-ab10-dde84cacfed4-rop' } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: 'scrm-base-dc073d36-45f8-48f4-ab10-dde84cacfed4-rop' } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: 'scrm-base-dc073d36-45f8-48f4-ab10-dde84cacfed4-rop' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) // Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
......
...@@ -34,15 +34,16 @@ ...@@ -34,15 +34,16 @@
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio> <el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
</template> </template>
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">否</el-radio> <el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">是</el-radio> <el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
</template> </template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br /> <br />
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
...@@ -239,13 +240,6 @@ export default { ...@@ -239,13 +240,6 @@ export default {
// index:4 // index:4
}, },
{ {
label: '定向礼包专用',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '适用商品', label: '适用商品',
name: 'goods', name: 'goods',
addHtml: 'goodsHtml', addHtml: 'goodsHtml',
...@@ -273,6 +267,13 @@ export default { ...@@ -273,6 +267,13 @@ export default {
// index:9 // index:9
}, },
{ {
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
...@@ -665,7 +666,7 @@ export default { ...@@ -665,7 +666,7 @@ export default {
} }
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
if (res.code == '0') { if (res.code == '0') {
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
......
...@@ -105,6 +105,15 @@ export default { ...@@ -105,6 +105,15 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'statusList' optionsName: 'statusList'
},
{
label: '使用规则',
name: 'directionalFlag',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'directionalFlagList'
} }
], ],
// 表格 // 表格
...@@ -160,6 +169,14 @@ export default { ...@@ -160,6 +169,14 @@ export default {
return useChannel return useChannel
} }
}, },
{
label: '使用规则',
name: 'directionalFlag',
width: '150px',
formatter: cellValue => {
return this.baseData.directionalFlagList.find(item => item.confId == cellValue.directionalFlag).confName
}
},
{ {
label: '优惠券状态', label: '优惠券状态',
name: 'status', name: 'status',
...@@ -190,6 +207,20 @@ export default { ...@@ -190,6 +207,20 @@ export default {
// confName: '会员服务' // confName: '会员服务'
// } // }
], ],
directionalFlagList:[
{
confId: '1',
confName: '所有客户可用'
},
{
confId: '2',
confName: '定向礼包专用'
},
{
confId: '3',
confName: '关联商品可用'
}
],
statusList: [ statusList: [
{ {
confId: '1', confId: '1',
...@@ -380,7 +411,7 @@ export default { ...@@ -380,7 +411,7 @@ export default {
couponName: '', couponName: '',
discountType: '', discountType: '',
status: '', status: '',
discountTypes: [2, 3, 4] discountTypes: [2, 3, 4],
} }
this.handleSearch() this.handleSearch()
}, },
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
// 表格 // 表格
searchForm: { searchForm: {
phone: '', phone: '',
// isYes:'' wechatUserFlag:''
}, },
tableSearchForm: {}, tableSearchForm: {},
// 搜索 // 搜索
...@@ -88,12 +88,12 @@ export default { ...@@ -88,12 +88,12 @@ export default {
}, },
{ {
label:'是否加企微', label:'是否加企微',
name:'isYes', name:'wechatUserFlag',
type:'select', type:'select',
optionList:[], optionList:[],
optionId: 'statusId', optionId: 'statusId',
optionLabel: 'statusName', optionLabel: 'statusName',
optionsName: 'isYesStatusList' optionsName: 'wechatUserFlagList'
} }
], ],
// 表格 // 表格
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
}, },
{ {
label: '是否加入企微', label: '是否加入企微',
prop: 'isYes', prop: 'wechatUserFlag',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.isYesStatusList.find(item => item.statusId == cellValue.isYes).statusName return this.baseData.wechatUserFlagList.find(item => item.statusId == cellValue.wechatUserFlag).statusName
} }
}, },
{ {
...@@ -153,9 +153,9 @@ export default { ...@@ -153,9 +153,9 @@ export default {
confName: '已过期' confName: '已过期'
} }
], ],
isYesStatusList: [ wechatUserFlagList: [
{ {
statusId: '0', statusId: '2',
statusName: '是' statusName: '是'
}, },
{ {
...@@ -288,7 +288,7 @@ export default { ...@@ -288,7 +288,7 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
phone: '', phone: '',
isYes:'' wechatUserFlag:''
} }
this.handleSearch() this.handleSearch()
}, },
......
...@@ -24,10 +24,8 @@ ...@@ -24,10 +24,8 @@
@handleImgDelete="handleFormImgDelete" @handleImgDelete="handleFormImgDelete"
> >
<template slot="businessType" slot-scope="scope"> <template slot="businessType" slot-scope="scope">
<!-- {{ scope.scope }} --> <el-checkbox-group v-model="editForm.businessType">
<!-- <div v-for="(item, idx) in scope.scope.optionList" :key="idx">{{item.confName}}</div> --> <el-checkbox :disabled="routeInfo.addOrEdit == 3" v-for="value in scope.scope.businessTypeList" :key="value.businessType" :label="value.businessType">{{ value.businessTypeName }}</el-checkbox>
<el-checkbox-group v-model="editForm.applicationType" @change="checkApplication">
<el-checkbox v-for="value in scope.scope.optionList" :key="value.confId" :label="value.confId">{{ value.confName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<template slot="describeBtn"> <template slot="describeBtn">
...@@ -98,6 +96,43 @@ ...@@ -98,6 +96,43 @@
</div> </div>
</div> </div>
</div> </div>
<template slot="association">
<el-button type="text" @click="dialogTableVisible = true" v-if="routeInfo.addOrEdit !== 3">选择</el-button>
<el-dialog title="选择优惠券" v-if="dialogTableVisible" :visible.sync="dialogTableVisible">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="coupon" :hasNum="false" :getListApi="getListApi" :searchForm="associationTableSearchForm" :tableParams="associationTableParams" :pageConf="pageConf" :beforeSearchFn="associationBeforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="association" slot-scope="scope" class="association">
<el-radio :label="scope.scope.id" v-model="radio" @change.native="getCurrentRow()"></el-radio>
</div>
</GLTable>
<!-- 表格区域 end -->
<div class="associationBtn">
<el-button type="primary" @click="associationConfirm">确定</el-button>
<el-button type="default" @click="associationCancel">取消</el-button>
</div>
</el-dialog>
<div class="association-X" v-if="editForm.relatedCouponId">
<div class="associationRow">
<span class="associationLists">名称</span>
<span class="associationLists">优惠卷类型</span>
<span class="associationLists">使用途径</span>
<span class="associationLists" v-if="routeInfo.addOrEdit !== 3">操作</span>
</div>
<div class="associationRow">
<el-tooltip effect="dark" :content="editForm.relatedCouponName" placement="bottom">
<span class="associationLists">{{editForm.relatedCouponName}}</span>
</el-tooltip>
<span class="associationLists">{{editForm.relatedDiscountType}}</span>
<span class="associationLists">{{editForm.relatedUseChannel}}</span>
<span class="associationLists" v-if="routeInfo.addOrEdit !== 3"><el-button type="text" @click="del()">删除</el-button></span>
</div>
</div>
</template>
<template slot="proSpecsBtn"> <template slot="proSpecsBtn">
<el-button :disabled="isDisabled" type="default" @click="handleSpecsEdit(1)">+添加规格项目</el-button> <el-button :disabled="isDisabled" type="default" @click="handleSpecsEdit(1)">+添加规格项目</el-button>
</template> </template>
...@@ -420,6 +455,98 @@ export default { ...@@ -420,6 +455,98 @@ export default {
name: 'editProduct', name: 'editProduct',
data() { data() {
return { return {
dialogTableVisible: false,
radio:"",
templateSelection: [],
associationList:[],
relatedDiscountType:'',
// associationUseChannel:'',
// associationShow: false,
// 关联优惠券表格
searchForm: {
couponName: '',
directionalFlag:3,
status: 2,
discountTypes: [2, 3, 4]
},
associationTableSearchForm: {status:2,directionalFlag:3},
// 搜索
searchFormData: [
{
label: '名称',
name: 'couponName',
type: 'input',
maxlength: 20
},
],
getListApi: this.$apis.couponManage.getMerchantListApi,
associationTableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
prop: 'association',
addHtml: 'association',
width:'100'
},
{
label:'序号',
prop:'num',
width:'100'
},
{
label: '名称',
prop: 'couponName',
line: 2
},
{
label: '优惠券类型',
prop: 'discountType',
formatter: cellValue => {
return this.associationBaseData.discountTypeList.find(item => item.confId == cellValue.discountType).confName
}
},
{
label: '使用途径',
prop: 'useChannel',
formatter: cellValue => {
var useChannel = ''
if (cellValue.useChannel) {
useChannel = this.associationBaseData.useChannelList.find(item => item.confId == cellValue.useChannel).confName
}
return useChannel
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
associationBaseData: {
// 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
discountTypeList: [
{
confId: '2',
confName: '折扣券'
},
{
confId: '3',
confName: '代金券'
},
{
confId: '4',
confName: '兑换券'
}
],
useChannelList: [
{
confId: '1',
confName: '线上商品'
},
{
confId: '2',
confName: '到店核销'
}
]
},
size: 'small', size: 'small',
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
...@@ -489,6 +616,12 @@ export default { ...@@ -489,6 +616,12 @@ export default {
spescInputVal: '', spescInputVal: '',
// 表单 // 表单
editForm: { editForm: {
businessType: [],
businessTypeList:[],
relatedCouponName:'',
relatedDiscountType:'',
relatedUseChannel:'',
relatedCouponId:'',
goodsName: '', goodsName: '',
goodsImage: '', goodsImage: '',
goodsDetailImageList: [], goodsDetailImageList: [],
...@@ -496,8 +629,7 @@ export default { ...@@ -496,8 +629,7 @@ export default {
classifyIdList: [], classifyIdList: [],
zoneId: '', zoneId: '',
descImgList: [], descImgList: [],
businessType:'', // applicationType: [],
applicationType: [],
// 商品规格 // 商品规格
// specificationDetailList: [], // specificationDetailList: [],
retailPrice: '', retailPrice: '',
...@@ -594,20 +726,7 @@ export default { ...@@ -594,20 +726,7 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false, isDisabled: false,
optionList: [ businessTypeList:[]
{
confId: 1,
confName: '123'
},
{
confId: 2,
confName: '456'
},
{
confId: 3,
confName: '789'
}
],
// handleRadioChange: val => { // handleRadioChange: val => {
// this.handleTypeChange(val) // this.handleTypeChange(val)
// } // }
...@@ -655,7 +774,17 @@ export default { ...@@ -655,7 +774,17 @@ export default {
label: '', label: '',
name: 'descImgList', name: 'descImgList',
addHtml: 'descImgs' addHtml: 'descImgs'
} },
{
label: '关联优惠券',
name: '',
addHtml: 'association'
},
// {
// label: '',
// name: '',
// addHtml: 'associationInput'
// }
] ]
}, },
{ {
...@@ -852,6 +981,8 @@ export default { ...@@ -852,6 +981,8 @@ export default {
created() { created() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.businessGetBusinessTypeById();
}, },
mounted() { mounted() {
...@@ -868,13 +999,45 @@ export default { ...@@ -868,13 +999,45 @@ export default {
this.routeInfo.groupOrStore == 2 && this.storeNoExitAttr() this.routeInfo.groupOrStore == 2 && this.storeNoExitAttr()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.routeInfo.addOrEdit == 3 && this.setAllDisabled() this.routeInfo.addOrEdit == 3 && this.setAllDisabled()
this.getOptionsList('searchFormData')
}, },
methods: { methods: {
checkApplication(res1,res2,res3) { businessGetBusinessTypeById() {
console.log('res1',res1); this.$apis.proManage.getBusinessTypeByIdApi({}).then(
console.log('res2',res2); res => {
console.log('res3',res3); console.log('res',res);
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
this.externalFormList[0].editFormData[idx].businessTypeList = res;
}
)
},
del(){
this.associationShow = false;
this.editForm.relatedCouponId = '';
this.editForm.relatedCouponName = '';
this.editForm.relatedDiscountType = '';
this.editForm.relatedUseChannel = '';
},
associationConfirm(){
this.dialogTableVisible = false;
this.associationShow = true;
this.editForm.relatedUseChannel = '';
this.editForm.relatedCouponId = this.associationList[0].id;
this.editForm.relatedCouponName = this.associationList[0].couponName;
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == this.associationList[0].discountType).confName;
this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel).confName;
},
associationCancel(){
this.dialogTableVisible = false;
},
getCurrentRow(){
//获取选中数据
// this.radio
let inx = this.templateSelection.findIndex(value => value.id == this.radio);
this.associationList.pop();
this.associationList.push(this.templateSelection[inx]);
console.log('this.associationList',this.associationList);
}, },
getBaseDate() { getBaseDate() {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -1222,7 +1385,15 @@ export default { ...@@ -1222,7 +1385,15 @@ export default {
supplyPrice: res.supplyPrice ? (res.supplyPrice / 100).toFixed(2) : '', supplyPrice: res.supplyPrice ? (res.supplyPrice / 100).toFixed(2) : '',
describeTxt: '', describeTxt: '',
descImgList: [], descImgList: [],
applicationType:[] businessType:[]
}
this.editForm.businessType = this.editForm.businessTypeList.filter(item => item.isChoose == 1).map(item => item.businessType)
console.log(this.editForm)
if(res.relatedCoupon) {
this.editForm.relatedCouponId = res.relatedCoupon.id;
this.editForm.relatedCouponName = res.relatedCoupon.couponName;
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == res.relatedCoupon.discountType).confName;;
this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == res.relatedCoupon.useChannel).confName;
} }
// 是否需要安装 // 是否需要安装
this.editForm.install = this.editForm.install || 'Y' this.editForm.install = this.editForm.install || 'Y'
...@@ -1327,6 +1498,7 @@ export default { ...@@ -1327,6 +1498,7 @@ export default {
}, },
// 图片-描述-end // 图片-描述-end
handleConfirm() { handleConfirm() {
console.log(this.editForm)
var isJump = false var isJump = false
this.submitted = true this.submitted = true
for (var i = 0; i < this.externalFormList.length; i++) { for (var i = 0; i < this.externalFormList.length; i++) {
...@@ -1362,6 +1534,19 @@ export default { ...@@ -1362,6 +1534,19 @@ export default {
if (this.routeInfo.addOrEdit == 2) { if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id params.id = this.routeInfo.id
} }
// 业务类型
params.businessTypeList = params.businessType
if(!params.businessTypeList) {
delete params.businessTypeList
} else {
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
var list = this.externalFormList[0].editFormData[idx].businessTypeList
params.businessTypeList = []
this.editForm.businessType.forEach(item => {
console.log(item)
params.businessTypeList.push(list.find(k => k.businessType == item))
})
}
// 描述 // 描述
params.goodsDescList = [] params.goodsDescList = []
this.editForm.descImgList.forEach(item => { this.editForm.descImgList.forEach(item => {
...@@ -1414,11 +1599,11 @@ export default { ...@@ -1414,11 +1599,11 @@ export default {
deleteAttrList.forEach(item => { deleteAttrList.forEach(item => {
delete params[item] delete params[item]
}) })
// console.log(params) console.log(params)
this.$apis.proManage.insertOrUpdateProApi(params).then(res => { this.$apis.proManage.insertOrUpdateProApi(params).then(res => {
console.log('res',res); // console.log('res',res);
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
if (res.code == '0') { if (res.code == '0') {
...@@ -1444,7 +1629,38 @@ export default { ...@@ -1444,7 +1629,38 @@ export default {
} else { } else {
this.cancelJump() this.cancelJump()
} }
} },
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
// 关联优惠券请求
associationBeforeSearchFn() {
return new Promise(resolve => {
this.associationTableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
resolve()
})
},
setTableFinishFun() {
let num = 0;
let pageSize = Number(this.$refs.coupon[0].page.pageSize);
let pageNum = Number(this.$refs.coupon[0].page.pageNum);
let sum = (pageSize*(pageNum - 1));
// console.log(pageSize,pageNum);
this.$refs.coupon[0].data.forEach(val => {
if(num <= pageSize) val.num = ++num;
if(pageNum > 1) val.num = ++sum;
})
// console.log('this.$refs.coupon',this.$refs.coupon[0])
//接收到的数据为空
this.templateSelection = this.$refs.coupon[0].data;
this.$refs.coupon[0].data.length ? (this.$refs.coupon[0].tableHeightValues = '') : this.$refs.coupon[0].setTableHeightFun()
},
handleSearch() {
this.$refs.coupon[0].refreshTable()
},
} }
} }
</script> </script>
...@@ -1621,4 +1837,28 @@ export default { ...@@ -1621,4 +1837,28 @@ export default {
background: #FFFFFF !important; background: #FFFFFF !important;
border: 1px solid #FFFFFF !important; border: 1px solid #FFFFFF !important;
} }
.edit-pro .association .el-radio__label {
display: none;
}
.edit-pro .associationBtn {
position: absolute;
right: 19px;
bottom: 26px;
}
.association-X {
width: 320px;
margin-left: -25px;
}
.association-X .associationRow {
display: flex;
/* justify-content:space-evenly; */
}
.association-X .associationRow .associationLists {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
text-align: center;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!