Commit 486c2b98 by wuwx

修改代码格式,屏蔽业务类型

1 parent 7a0179d2
...@@ -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,
// 携带凭证 // 携带凭证
......
...@@ -15,7 +15,7 @@ Vue.use(ElementUI) ...@@ -15,7 +15,7 @@ Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant} = await fetchConfig(false) const { response, request, request2, sign, secret, sign_common, request_common, request_merchant } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -33,28 +33,18 @@ ...@@ -33,28 +33,18 @@
<el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio> <el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio>
<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" v-if="editForm.useChannel != 1"> <template slot="directionalFlagHtml">
<div> <div>
<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>
<span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span> <span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span>
</div> </div>
<div> <div>
<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>
<span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span> <span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span>
</div> </div>
<div> <div v-if="editForm.useChannel != 1">
<el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="3" :disabled="apear != 'couponAdd'">关联商品可用</el-radio>
<span class="promptCopy">关联商品,用户支付成功后才能进行核销使用</span> <span class="promptCopy">关联商品,用户支付成功后才能进行核销使用</span>
</div>
</template>
<template slot="directionalFlagHtml" v-else>
<div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
<span class="promptCopy">创建成功后立即生效,所有小程序用户均可领用</span>
</div>
<div>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">定向礼包专用</el-radio>
<span class="promptCopy">企微员工通过企微工作台定向礼包发送给客户</span>
</div> </div>
</template> </template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
...@@ -133,7 +123,7 @@ export default { ...@@ -133,7 +123,7 @@ export default {
data() { data() {
return { return {
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间 defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: "yyyy-MM-dd HH:mm:ss", // 日期显示格式 format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true, showSubmit: true,
userDisable: false, userDisable: false,
size: 'small', size: 'small',
...@@ -362,7 +352,7 @@ export default { ...@@ -362,7 +352,7 @@ export default {
'editForm.effectiveTime'(newValue, oldValue) { 'editForm.effectiveTime'(newValue, oldValue) {
if (newValue && newValue.length == 2) { if (newValue && newValue.length == 2) {
// this.couponTime = this.setDateString(newValue[0], true) + ' ~ ' + this.setDateString(newValue[1], true) // this.couponTime = this.setDateString(newValue[0], true) + ' ~ ' + this.setDateString(newValue[1], true)
this.couponTime = newValue[0] + ' ~ ' + newValue[1] this.couponTime = newValue[0] + ' ~ ' + newValue[1]
} else { } else {
this.couponTime = '' this.couponTime = ''
} }
...@@ -375,17 +365,15 @@ export default { ...@@ -375,17 +365,15 @@ export default {
'editForm.useChannel'(newValue, oldValue) { 'editForm.useChannel'(newValue, oldValue) {
let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods') let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods')
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable') let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
this.editFormData[goodHtmlIndex].isHide = newValue != 1
this.editForm.directionalFlag = '1'
if (newValue == 1) { if (newValue == 1) {
this.editForm.directionalFlag = '1'
this.editFormData[goodHtmlIndex].isHide = false
if (this.editForm.goodsRefList.length) { if (this.editForm.goodsRefList.length) {
this.editFormData[proTableIndex].isHide = false this.editFormData[proTableIndex].isHide = false
} }
} else { } else {
this.editForm.directionalFlag = '1'
this.editForm.useBarriers = '1' this.editForm.useBarriers = '1'
this.editForm.full = '' this.editForm.full = ''
this.editFormData[goodHtmlIndex].isHide = true
this.editFormData[proTableIndex].isHide = true this.editFormData[proTableIndex].isHide = true
} }
}, },
...@@ -439,9 +427,11 @@ export default { ...@@ -439,9 +427,11 @@ export default {
methods: { methods: {
haveChange() { haveChange() {
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime() let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime() let timeStamp = new Date().getTime()
if(oDateOne < timeStamp) this.editForm.effectiveTime = [] if (oDateOne < timeStamp) {
this.editForm.effectiveTime = []
}
}, },
// 编辑按钮 // 编辑按钮
editMessage() { editMessage() {
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<div v-for="(item, index) in externalFormList" :key="index"> <div v-for="(item, index) in externalFormList" :key="index">
<p class="edit-title">{{ item.title }}</p> <p class="edit-title">{{ item.title }}</p>
<glsx-combi-form class="edit-form-container m-b-60" ref="editFormRef" :labelWidth="labelWidth" :isEdit="isEdit" defaultWidth="320px" :isBlock="true" :formRef="item.editChildRef" :formObj="editForm" :formData="item.editFormData" :formRules="item.editRule" @handleImgDelete="handleFormImgDelete"> <glsx-combi-form class="edit-form-container m-b-60" ref="editFormRef" :labelWidth="labelWidth" :isEdit="isEdit" defaultWidth="320px" :isBlock="true" :formRef="item.editChildRef" :formObj="editForm" :formData="item.editFormData" :formRules="item.editRule" @handleImgDelete="handleFormImgDelete">
<template slot="businessType" slot-scope="scope"> <!-- <template slot="businessType" slot-scope="scope">
<el-checkbox-group v-model="editForm.businessType"> <el-checkbox-group v-model="editForm.businessType">
<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 :disabled="routeInfo.addOrEdit == 3" v-for="value in scope.scope.businessTypeList" :key="value.businessType" :label="value.businessType">{{ value.businessTypeName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</template> </template> -->
<template slot="describeBtn"> <template slot="describeBtn">
<el-button :disabled="isDisabled" type="default" @click="handleDescribeImgAdd">+添加图片</el-button> <el-button :disabled="isDisabled" type="default" @click="handleDescribeImgAdd">+添加图片</el-button>
<span class="edit-tips m-l-20">最多可添加10张图片</span> <span class="edit-tips m-l-20">最多可添加10张图片</span>
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="coupon" :hasNum="false" :getListApi="getListApi" :searchForm="associationTableSearchForm" :tableParams="associationTableParams" :pageConf="pageConf" :beforeSearchFn="associationBeforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="coupon" :hasNum="false" :getListApi="getListApi" :searchForm="searchForm" :tableParams="associationTableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="association" slot-scope="scope" class="association"> <div slot="association" slot-scope="scope" class="association">
<el-radio :label="scope.scope.id" v-model="radio" @change.native="getCurrentRow()"></el-radio> <el-radio :label="scope.scope.id" v-model="associationRadio" @change.native="getCurrentRow()"></el-radio>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -291,12 +291,10 @@ export default { ...@@ -291,12 +291,10 @@ export default {
data() { data() {
return { return {
dialogTableVisible: false, dialogTableVisible: false,
radio: '', associationRadio: '',
templateSelection: [], templateSelection: [],
associationList: [], associationList: [],
relatedDiscountType: '', relatedDiscountType: '',
// associationUseChannel:'',
// associationShow: false,
// 关联优惠券表格 // 关联优惠券表格
searchForm: { searchForm: {
couponName: '', couponName: '',
...@@ -304,7 +302,6 @@ export default { ...@@ -304,7 +302,6 @@ export default {
status: 2, status: 2,
discountTypes: [2, 3, 4] discountTypes: [2, 3, 4]
}, },
associationTableSearchForm: { status: 2, directionalFlag: 3 },
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
...@@ -554,18 +551,15 @@ export default { ...@@ -554,18 +551,15 @@ export default {
}) })
} }
}, },
{ // {
label: '业务类型', // label: '业务类型',
name: 'businessType', // name: 'businessType',
addHtml: 'businessType', // addHtml: 'businessType',
optionId: 'confId', // optionId: 'confId',
optionLabel: 'confName', // optionLabel: 'confName',
isDisabled: false, // isDisabled: false,
businessTypeList: [] // businessTypeList: []
// handleRadioChange: val => { // },
// this.handleTypeChange(val)
// }
},
{ {
label: '商品分类', label: '商品分类',
name: 'classifyIdList', name: 'classifyIdList',
...@@ -832,17 +826,13 @@ export default { ...@@ -832,17 +826,13 @@ export default {
}, },
// 关联优惠券radio // 关联优惠券radio
'editForm.relatedCouponId'(newValue, oldValue) { 'editForm.relatedCouponId'(newValue, oldValue) {
if (newValue) { this.associationRadio = newValue
this.radio = newValue
} else {
this.radio = newValue
}
} }
}, },
created() { created() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.businessGetBusinessTypeById() // this.businessGetBusinessTypeById()
}, },
mounted() { mounted() {
...@@ -862,15 +852,15 @@ export default { ...@@ -862,15 +852,15 @@ export default {
}, },
methods: { methods: {
businessGetBusinessTypeById() { //业务类型请求
this.$apis.proManage.getBusinessTypeByIdApi({}).then(res => { // businessGetBusinessTypeById() {
console.log('res', res) // this.$apis.proManage.getBusinessTypeByIdApi({}).then(res => {
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType') // console.log('res', res)
this.externalFormList[0].editFormData[idx].businessTypeList = res // var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
}) // this.externalFormList[0].editFormData[idx].businessTypeList = res
}, // })
// },
del() { del() {
this.associationShow = false
this.editForm.relatedCouponId = '' this.editForm.relatedCouponId = ''
this.editForm.relatedCouponName = '' this.editForm.relatedCouponName = ''
this.editForm.relatedDiscountType = '' this.editForm.relatedDiscountType = ''
...@@ -878,21 +868,22 @@ export default { ...@@ -878,21 +868,22 @@ export default {
}, },
associationConfirm() { associationConfirm() {
this.dialogTableVisible = false this.dialogTableVisible = false
this.associationShow = true
this.editForm.relatedUseChannel = '' this.editForm.relatedUseChannel = ''
this.editForm.relatedCouponId = this.associationList[0].id this.editForm.relatedCouponId = this.associationList[0].id
this.editForm.relatedCouponName = this.associationList[0].couponName this.editForm.relatedCouponName = this.associationList[0].couponName
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == this.associationList[0].discountType).confName this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == this.associationList[0].discountType).confName
if (this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel)) this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel).confName if (this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel)) {
this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel).confName
}
}, },
associationCancel() { associationCancel() {
this.radio = this.editForm.relatedCouponId this.associationRadio = this.editForm.relatedCouponId
this.dialogTableVisible = false this.dialogTableVisible = false
}, },
getCurrentRow() { getCurrentRow() {
//获取选中数据 //获取选中数据
// this.radio // this.radio
let inx = this.templateSelection.findIndex(value => value.id == this.radio) let inx = this.templateSelection.findIndex(value => value.id == this.associationRadio)
this.associationList.pop() this.associationList.pop()
this.associationList.push(this.templateSelection[inx]) this.associationList.push(this.templateSelection[inx])
}, },
...@@ -1231,7 +1222,7 @@ export default { ...@@ -1231,7 +1222,7 @@ export default {
// 获取商品信息 // 获取商品信息
getInfo() { getInfo() {
this.$apis.proManage.getProInfoApi({ id: this.routeInfo.id }).then(res => { this.$apis.proManage.getProInfoApi({ id: this.routeInfo.id }).then(res => {
console.log('res', res) // console.log('res', res)
this.editForm = { this.editForm = {
...res, ...res,
goodsVideo: res.goodsVideo || '', goodsVideo: res.goodsVideo || '',
...@@ -1250,7 +1241,9 @@ export default { ...@@ -1250,7 +1241,9 @@ export default {
this.editForm.relatedCouponId = res.relatedCoupon.id this.editForm.relatedCouponId = res.relatedCoupon.id
this.editForm.relatedCouponName = res.relatedCoupon.couponName this.editForm.relatedCouponName = res.relatedCoupon.couponName
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == res.relatedCoupon.discountType).confName 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 if (this.associationBaseData.useChannelList.find(item => item.confId == res.relatedCoupon.useChannel)) {
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'
...@@ -1392,18 +1385,18 @@ export default { ...@@ -1392,18 +1385,18 @@ export default {
params.id = this.routeInfo.id params.id = this.routeInfo.id
} }
// 业务类型 // 业务类型
params.businessTypeList = params.businessType // params.businessTypeList = params.businessType
if (!params.businessTypeList) { // if (!params.businessTypeList) {
delete params.businessTypeList // delete params.businessTypeList
} else { // } else {
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType') // var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
var list = this.externalFormList[0].editFormData[idx].businessTypeList // var list = this.externalFormList[0].editFormData[idx].businessTypeList
params.businessTypeList = [] // params.businessTypeList = []
this.editForm.businessType.forEach(item => { // this.editForm.businessType.forEach(item => {
console.log(item) // console.log(item)
params.businessTypeList.push(list.find(k => k.businessType == item)) // params.businessTypeList.push(list.find(k => k.businessType == item))
}) // })
} // }
// 描述 // 描述
params.goodsDescList = [] params.goodsDescList = []
this.editForm.descImgList.forEach(item => { this.editForm.descImgList.forEach(item => {
...@@ -1492,14 +1485,6 @@ export default { ...@@ -1492,14 +1485,6 @@ export default {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
// 关联优惠券请求
associationBeforeSearchFn() {
return new Promise(resolve => {
this.associationTableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
resolve()
})
},
setTableFinishFun() { setTableFinishFun() {
let num = 0 let num = 0
let pageSize = Number(this.$refs.coupon[0].page.pageSize) let pageSize = Number(this.$refs.coupon[0].page.pageSize)
...@@ -1513,7 +1498,6 @@ export default { ...@@ -1513,7 +1498,6 @@ export default {
// console.log('this.$refs.coupon',this.$refs.coupon[0]) // console.log('this.$refs.coupon',this.$refs.coupon[0])
//接收到的数据为空 //接收到的数据为空
this.templateSelection = this.$refs.coupon[0].data this.templateSelection = this.$refs.coupon[0].data
// this.$refs.coupon[0].data.length ? (this.$refs.coupon[0].tableHeightValues = '') : this.$refs.coupon[0].setTableHeightFun()
}, },
handleSearch() { handleSearch() {
this.$refs.coupon[0].refreshTable() this.$refs.coupon[0].refreshTable()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!