Commit fcabaa22 by 前端

Merge branch 'SAAS+V4.25.1' of http://192.168.3.233:8090/saas/scrm-micro-marketing into xuyl_

 Conflicts:
	src/common/constant.js
2 parents ea97cf4e cf86c7f9
...@@ -53,15 +53,15 @@ export default { ...@@ -53,15 +53,15 @@ export default {
} }
}, },
created() { created() {
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
if (typeof evt.stopPropagation == 'function') evt.stopPropagation() // if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false // return false
} // }
return true // return true
} // }
this.myMsg = this.msg this.myMsg = this.msg
this.myMessage = this.message this.myMessage = this.message
} }
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
getList(page, isMounted = false) { getList(page, isMounted = false) {
var params = { var params = {
goodsStatus: 1, goodsStatus: 1,
goodsSource: 1, goodsSources: [1,4],
currentPage: 1, currentPage: 1,
pageNum: 1, pageNum: 1,
pageSize: 100000, pageSize: 100000,
......
...@@ -38,7 +38,8 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -38,7 +38,8 @@ export async function bootstrap({history, common, messenger, globalState, router
secret, secret,
sign_common, sign_common,
request_common, request_common,
request_merchant request_merchant,
merchantId
} = await fetchConfig(false) } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
...@@ -46,6 +47,7 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -46,6 +47,7 @@ export async function bootstrap({history, common, messenger, globalState, router
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.$hmdMerchantId = merchantId
// 集团版集团账号 // 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4 Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({ Vue.prototype.$http = new common.Http({
......
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
params.merchantId = this.$globalState.session.merchantId
delete params.createDate delete params.createDate
return params return params
}, },
......
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="ctime"> <div :class="editForm.status == 3 ? 'darkColor' : ''" class="ctime">
<!-- <span class="ctime_name">使用限制:</span> --> <!-- <span class="ctime_name">使用限制:</span> -->
<span v-show="editForm.denomination" style="font-size: 12px;">¥</span> <span v-show="editForm.denomination" style="font-size: 12px;">¥</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{ <span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{ editForm.denomination }}</span>
editForm.denomination
}}</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无门槛' : '满' + editForm.full + '元可用' }}</span> <span class="ctime_content">{{ editForm.useBarriers == 1 ? '无门槛' : '满' + editForm.full + '元可用' }}</span>
</div> </div>
<div class="ccode"> <div class="ccode">
...@@ -81,9 +79,9 @@ ...@@ -81,9 +79,9 @@
<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" @change="haveChange" 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 v-model="editForm.effectiveTime" @click="getStartTime" @change="haveChange" 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-date-picker>
</el-radio> </el-radio>
<div class="el-form-item__error" v-if="isEffective">开始时间需大于当前时间</div>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
...@@ -106,16 +104,15 @@ ...@@ -106,16 +104,15 @@
<template slot="denominationHtml"> <template slot="denominationHtml">
<el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"></el-input> <el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"></el-input>
元 元
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ <span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券'
}}</span>
</template> </template>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<div v-else> <div v-else>
<el-input :disabled="apear != 'couponAdd'" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input> <el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张 张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="disabledContent" @change="updateStock">不限制库存</el-checkbox>
</div> </div>
</template> </template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 --> <!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
...@@ -165,6 +162,9 @@ export default { ...@@ -165,6 +162,9 @@ export default {
name: 'editCashCoupon', name: 'editCashCoupon',
data() { data() {
return { return {
isHmd: true,
isEffective:false,
isLimitStock: false,
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,
...@@ -303,7 +303,7 @@ export default { ...@@ -303,7 +303,7 @@ export default {
}, },
{ {
label: '库存', label: '库存',
name: 'stock', name: !this.isLimitStock ? 'stock' : '',
addHtml: 'stock' addHtml: 'stock'
// width: '150px', // width: '150px',
// type: 'input' // type: 'input'
...@@ -324,7 +324,7 @@ export default { ...@@ -324,7 +324,7 @@ export default {
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
} }
], ]
// 适用门店 // 适用门店
// merchantRule: { // merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] // scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -353,6 +353,13 @@ export default { ...@@ -353,6 +353,13 @@ export default {
}, },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp this.editRule.stock[0].required = !this.$isGroupUp
}, },
...@@ -466,11 +473,13 @@ export default { ...@@ -466,11 +473,13 @@ export default {
'editForm.effectiveType'(newValue, oldValue) { 'editForm.effectiveType'(newValue, oldValue) {
if (newValue == 3) { if (newValue == 3) {
this.isEffective = false
this.$refs['effectiveTime'].resetField() this.$refs['effectiveTime'].resetField()
this.$refs['effectiveDays'].resetField() this.$refs['effectiveDays'].resetField()
} else if (newValue == 2) { } else if (newValue == 2) {
this.$refs['effectiveDays'].resetField() this.$refs['effectiveDays'].resetField()
} else if (newValue == 1) { } else if (newValue == 1) {
this.isEffective = false
this.$refs['effectiveTime'].resetField() this.$refs['effectiveTime'].resetField()
} }
}, },
...@@ -483,10 +492,15 @@ export default { ...@@ -483,10 +492,15 @@ export default {
}, },
methods: { methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) { setAllDisabled(editName) {
this[editName].forEach(item => { this[editName] &&
item.isDisabled = true this[editName].forEach(item => {
}) item.isDisabled = true
})
}, },
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
...@@ -495,10 +509,12 @@ export default { ...@@ -495,10 +509,12 @@ export default {
}) })
}, },
haveChange() { haveChange() {
this.isEffective = false
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) { if (oDateOne < timeStamp) {
this.editForm.effectiveTime = [] this.isEffective = true
// this.editForm.effectiveTime = []
} }
}, },
// 编辑按钮 // 编辑按钮
...@@ -520,7 +536,7 @@ export default { ...@@ -520,7 +536,7 @@ export default {
pageSize: 100000, pageSize: 100000,
pageStart: 0, pageStart: 0,
goodsStatus: 1, goodsStatus: 1,
goodsSource: 1, goodsSources: [1, 4],
goodsName: '' goodsName: ''
} }
if (goodsName) { if (goodsName) {
...@@ -627,6 +643,10 @@ export default { ...@@ -627,6 +643,10 @@ export default {
// if (this.$isGroupUp) { // if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + '' // this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// } // }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
...@@ -720,8 +740,8 @@ export default { ...@@ -720,8 +740,8 @@ export default {
//面值 //面值
obj.denomination = form.denomination obj.denomination = form.denomination
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1 obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock obj.stock = form.stock
} }
// else { // else {
...@@ -767,6 +787,9 @@ export default { ...@@ -767,6 +787,9 @@ export default {
// merchantErrorObj = errorObj // merchantErrorObj = errorObj
// }) // })
// } // }
if(this.isEffective){
return
}
if (!valid) { if (!valid) {
this.whereToGo(Object.keys(errorObj)[0]) this.whereToGo(Object.keys(errorObj)[0])
} }
...@@ -796,15 +819,16 @@ export default { ...@@ -796,15 +819,16 @@ export default {
} }
console.log(params) console.log(params)
this.loading = true this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params)
this.$message({ .then(res => {
message: res.code == '0' ? '操作成功' : res.message, this.$message({
type: res.code == '0' ? 'success' : 'error' message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
}) })
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
...@@ -826,7 +850,7 @@ export default { ...@@ -826,7 +850,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -98,8 +98,11 @@ ...@@ -98,8 +98,11 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input> <template v-else>
张 <el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template> </template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" /> <el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
...@@ -126,6 +129,8 @@ export default { ...@@ -126,6 +129,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
isHmd: true,
isLimitStock: false,
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,
...@@ -242,7 +247,7 @@ export default { ...@@ -242,7 +247,7 @@ export default {
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
} }
], ]
// 适用门店 // 适用门店
// merchantRule: { // merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] // scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -271,6 +276,13 @@ export default { ...@@ -271,6 +276,13 @@ export default {
}, },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp this.editRule.stock[0].required = !this.$isGroupUp
}, },
...@@ -348,10 +360,15 @@ export default { ...@@ -348,10 +360,15 @@ export default {
} }
}, },
methods: { methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) { setAllDisabled(editName) {
this[editName].forEach(item => { this[editName] &&
item.isDisabled = true this[editName].forEach(item => {
}) item.isDisabled = true
})
}, },
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
...@@ -399,6 +416,10 @@ export default { ...@@ -399,6 +416,10 @@ export default {
// if (this.$isGroupUp) { // if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + '' // this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// } // }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//使用限制,满多少元可用 //使用限制,满多少元可用
if (this.editForm.useBarriers == 2) { if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full this.editForm.full = this.editForm.full
...@@ -475,8 +496,8 @@ export default { ...@@ -475,8 +496,8 @@ export default {
obj.full = form.full obj.full = form.full
} }
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1 obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock obj.stock = form.stock
} }
// else { // else {
...@@ -529,15 +550,16 @@ export default { ...@@ -529,15 +550,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
this.loading = true this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params)
this.$message({ .then(res => {
message: res.code == '0' ? '操作成功' : res.message, this.$message({
type: res.code == '0' ? 'success' : 'error' message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
}) })
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
...@@ -559,7 +581,7 @@ export default { ...@@ -559,7 +581,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -57,9 +57,12 @@ ...@@ -57,9 +57,12 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <template v-else>
<!-- <span slot="suffix">张</span> --> <el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
</el-input> <!-- <span slot="suffix">张</span> -->
</el-input>
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template> </template>
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<div> <div>
...@@ -114,6 +117,8 @@ export default { ...@@ -114,6 +117,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
isHmd: true,
isLimitStock: false,
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,
...@@ -213,7 +218,7 @@ export default { ...@@ -213,7 +218,7 @@ export default {
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
} }
], ]
// 适用门店 // 适用门店
// merchantRule: { // merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] // scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -242,6 +247,13 @@ export default { ...@@ -242,6 +247,13 @@ export default {
}, },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp this.editRule.stock[0].required = !this.$isGroupUp
}, },
...@@ -307,10 +319,15 @@ export default { ...@@ -307,10 +319,15 @@ export default {
}, },
methods: { methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) { setAllDisabled(editName) {
this[editName].forEach(item => { this[editName] &&
item.isDisabled = true this[editName].forEach(item => {
}) item.isDisabled = true
})
}, },
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
...@@ -347,6 +364,10 @@ export default { ...@@ -347,6 +364,10 @@ export default {
// if (this.$isGroupUp) { // if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + '' // this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// } // }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
...@@ -406,8 +427,8 @@ export default { ...@@ -406,8 +427,8 @@ export default {
} }
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1 obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock obj.stock = form.stock
} }
// else { // else {
...@@ -458,15 +479,16 @@ export default { ...@@ -458,15 +479,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
this.loading = true this.loading = true
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params)
this.$message({ .then(res => {
message: res.code == '0' ? '操作成功' : res.message, this.$message({
type: res.code == '0' ? 'success' : 'error' message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
}) })
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
...@@ -488,7 +510,7 @@ export default { ...@@ -488,7 +510,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -18,11 +18,19 @@ ...@@ -18,11 +18,19 @@
<!-- effectiveType:1, effectiveDays:5 --> <!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1" id="effectiveDays"> <el-radio :label="1" id="effectiveDays">
领取后 领取后
<el-input v-model="ruleForm.effectiveDays" maxlength="4" @input=" <el-input
v-model="ruleForm.effectiveDays"
maxlength="4"
@input="
val => { val => {
ruleForm.effectiveDays = val.replace(/[^\d]/g, '') ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
} }
" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1" placeholder="请输入" size="small" style="width: 100px"></el-input> "
:disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内有效 天内有效
</el-radio> </el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 --> <!-- effectiveStartTime effectiveEndTime +具体时间 -->
...@@ -46,11 +54,19 @@ ...@@ -46,11 +54,19 @@
</el-radio> </el-radio>
<el-radio :label="2" id="limitDays"> <el-radio :label="2" id="limitDays">
有效期内每 有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input=" <el-input
v-model="ruleForm.limitDays"
maxlength="4"
@input="
val => { val => {
ruleForm.limitDays = val.replace(/[^\d]/g, '') ruleForm.limitDays = val.replace(/[^\d]/g, '')
} }
" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2" placeholder="请输入" size="small" style="width: 100px"></el-input> "
:disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内可使用 天内可使用
<el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button> <el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span> <span class="numWrap">{{ ruleForm.limitTime2 }}</span>
...@@ -69,12 +85,13 @@ ...@@ -69,12 +85,13 @@
元 元
</el-form-item> </el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存:" prop="stock"> <el-form-item size="small" label="库存:" :prop="!isLimitStock ? 'stock' : ''">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> --> <!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<div v-else> <div v-else>
<el-input :disabled="title == '查看'" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input> <el-input :disabled="title == '查看' || isLimitStock" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
张 张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="title == '查看'" @change="updateStock">不限制库存</el-checkbox>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription"> <el-form-item size="small" label="使用说明:" prop="useDescription">
...@@ -190,7 +207,7 @@ export default { ...@@ -190,7 +207,7 @@ export default {
return callback(new Error('库存不能为空或负数')) return callback(new Error('库存不能为空或负数'))
} }
setTimeout(() => { setTimeout(() => {
if (!(/^[0-9]*$/.test(value))) { if (!/^[0-9]*$/.test(value)) {
callback(new Error('请输入数字值')) callback(new Error('请输入数字值'))
} else { } else {
if (value < 0) { if (value < 0) {
...@@ -202,7 +219,9 @@ export default { ...@@ -202,7 +219,9 @@ export default {
}, 1000) }, 1000)
} }
return { return {
isHmd: true,
timer: Function, timer: Function,
isLimitStock: false,
isEdit: false, isEdit: false,
showSubmit: true, showSubmit: true,
disabledDescription: false, disabledDescription: false,
...@@ -228,7 +247,8 @@ export default { ...@@ -228,7 +247,8 @@ export default {
shopPrice: '', shopPrice: '',
stock: '', stock: '',
useDescription: '', useDescription: '',
daterange: [] daterange: [],
limitStockFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
copyRuleForm: {}, copyRuleForm: {},
...@@ -254,7 +274,7 @@ export default { ...@@ -254,7 +274,7 @@ export default {
}, },
merchantId: '', merchantId: '',
merchantName: '', merchantName: '',
title: this.$route.query.title || '', title: this.$route.query.title || ''
// 适用门店 // 适用门店
// merchantRule: { // merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] // scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -317,6 +337,8 @@ export default { ...@@ -317,6 +337,8 @@ export default {
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName this.merchantName = this.$globalState.session.merchantName
} }
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
if (this.title == '编辑' || this.title == '查看') { if (this.title == '编辑' || this.title == '查看') {
this.isEdit = true this.isEdit = true
var breadcrumbTitle = this.title var breadcrumbTitle = this.title
...@@ -340,6 +362,9 @@ export default { ...@@ -340,6 +362,9 @@ export default {
} }
}, },
methods: { methods: {
updateStock(e) {
this.ruleForm.stock = ''
},
setAllDisabled(editName) { setAllDisabled(editName) {
this[editName].forEach(item => { this[editName].forEach(item => {
item.isDisabled = true item.isDisabled = true
...@@ -357,9 +382,9 @@ export default { ...@@ -357,9 +382,9 @@ export default {
this.ruleForm = res this.ruleForm = res
this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2) this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.ruleForm.customUseLimit = res.useType this.ruleForm.customUseLimit = res.useType
// if (this.$isGroupUp) { if (res.limitStockFlag == 2) {
// this.ruleForm.scopeApplication = res.scopeApplication + '' this.isLimitStock = true
// } }
if (res.effectiveType == 1) { if (res.effectiveType == 1) {
this.ruleForm.effectiveDays = res.effectiveDays this.ruleForm.effectiveDays = res.effectiveDays
} }
...@@ -467,8 +492,8 @@ export default { ...@@ -467,8 +492,8 @@ export default {
params.shopPrice = this.ruleForm.shopPrice params.shopPrice = this.ruleForm.shopPrice
// params.stock = this.ruleForm.stock // params.stock = this.ruleForm.stock
//库存 //库存
params.limitStockFlag = this.$isGroupUp ? 2 : 1 params.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp || !this.isLimitStock) {
params.stock = this.ruleForm.stock params.stock = this.ruleForm.stock
} }
// else { // else {
......
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftNameSlot" class="gift-name-slot">{{editForm.name}} <div class="group-label" v-if="editForm.merchantType==2">集团</div></div> <div slot="giftNameSlot" class="gift-name-slot">
{{ editForm.name }}
<div class="group-label" v-if="editForm.merchantType == 2">集团</div>
</div>
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0"> <div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title"> <div class="gift-title">
预估成本: 预估成本:
...@@ -45,11 +48,15 @@ ...@@ -45,11 +48,15 @@
<div slot="receiveDetails" :class="editForm.receiveRule == 4 ? 'user' : ''"> <div slot="receiveDetails" :class="editForm.receiveRule == 4 ? 'user' : ''">
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay && editForm.receiveDetails">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span> <span v-if="editForm.receiveRule == 2 && editForm.receiveWay && editForm.receiveDetails">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span> <span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<span v-if="editForm.receiveRule == 4"><span style="color: #f56c6c;margin-right: 4px;">*</span>用户手机号:</span> <span v-if="editForm.receiveRule == 4">
<span style="color: #f56c6c;margin-right: 4px;">*</span>
用户手机号:
</span>
<div v-if="editForm.receiveRule == 1 || editForm.receiveRule == 4" class="phone-wrap"> <div v-if="editForm.receiveRule == 1 || editForm.receiveRule == 4" class="phone-wrap">
<span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span> <span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div> </div>
</div> </div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0"> <div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper-detail"> <div :key="key" class="el-input-tag input-tag-wrapper-detail">
<el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)"> <el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)">
...@@ -58,6 +65,10 @@ ...@@ -58,6 +65,10 @@
</el-tag> </el-tag>
</div> </div>
</div> </div>
<div slot="giveMemberFlag" v-if="isHmd">
<span class="form-label">会员赠送:</span>
{{ editForm.giveMemberType == 1 ? '普通会员' : editForm.giveMemberType == 2 ? '银卡会员' : '金卡会员' }}
</div>
</glsx-combi-form> </glsx-combi-form>
<div class="approval_note_container"> <div class="approval_note_container">
<div class="line"></div> <div class="line"></div>
...@@ -85,6 +96,7 @@ export default { ...@@ -85,6 +96,7 @@ export default {
name: 'giftDetail', name: 'giftDetail',
data() { data() {
return { return {
isHmd: true,
size: 'small', size: 'small',
title: '礼包详情', title: '礼包详情',
loading: false, loading: false,
...@@ -150,7 +162,7 @@ export default { ...@@ -150,7 +162,7 @@ export default {
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }], staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }],
approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }], approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }],
stock: [{ required: true, message: '请选择库存数量', trigger: 'change' }], stock: [{ required: true, message: '请选择库存数量', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }], receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
...@@ -181,7 +193,7 @@ export default { ...@@ -181,7 +193,7 @@ export default {
addHtml: 'approveFlagBlock', addHtml: 'approveFlagBlock',
isHide: false isHide: false
}, },
{ {
label: '领取规则设置', label: '领取规则设置',
name: 'receiveRule', name: 'receiveRule',
type: 'radio', type: 'radio',
...@@ -209,13 +221,19 @@ export default { ...@@ -209,13 +221,19 @@ export default {
confName: '直接发送到小程序卡包', confName: '直接发送到小程序卡包',
suffixSonSlot: 'cardHolder' suffixSonSlot: 'cardHolder'
} }
]}, ]
},
{ {
label: '', label: '',
name: 'receiveWay', name: 'receiveWay',
addHtml: 'receiveDetails' addHtml: 'receiveDetails'
}, },
{ {
label: '',
name: 'giveMemberFlag',
addHtml: 'giveMemberFlag'
},
{
label: '发放员工', label: '发放员工',
name: 'staffList', name: 'staffList',
addHtml: 'staffListBlock' addHtml: 'staffListBlock'
...@@ -232,7 +250,14 @@ export default { ...@@ -232,7 +250,14 @@ export default {
approvalStatusColor: ['#FF6D00', '#2CCA74', '#EB4E4E', '#999999', '#999999'] approvalStatusColor: ['#FF6D00', '#2CCA74', '#EB4E4E', '#999999', '#999999']
} }
}, },
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
},
mounted() { mounted() {
this.setMinHeight() this.setMinHeight()
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
...@@ -249,13 +274,14 @@ export default { ...@@ -249,13 +274,14 @@ export default {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss') res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss') res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data this.editForm = res.data
if(res?.data?.receiveRule == 4){ console.log(this.editForm)
if (res?.data?.receiveRule == 4) {
let target = this.editFormData.find(item => item.name == 'stock') let target = this.editFormData.find(item => item.name == 'stock')
let targets = this.editFormData.find(item => item.name == 'approveFlag') let targets = this.editFormData.find(item => item.name == 'approveFlag')
target.isHide = true target.isHide = true
targets.isHide = true targets.isHide = true
} }
if(res?.data?.receiveRule == 1){ if (res?.data?.receiveRule == 1) {
let targetss = this.editFormData.find(item => item.name == 'receiveWay') let targetss = this.editFormData.find(item => item.name == 'receiveWay')
targetss.label = '领取条件' targetss.label = '领取条件'
} }
...@@ -321,38 +347,38 @@ export default { ...@@ -321,38 +347,38 @@ export default {
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
} }
.detail-page { .detail-page {
#receiveRule{ #receiveRule {
.el-radio-group{ .el-radio-group {
.is-checked { .is-checked {
.el-radio__input.is-checked .el-radio__inner{ .el-radio__input.is-checked .el-radio__inner {
border-color:#5850ff; border-color: #5850ff;
&::after{ &::after {
background-color: #5850ff; background-color: #5850ff;
} }
} }
} }
.el-radio__label{ .el-radio__label {
color: #333333!important; color: #333333 !important;
} }
} }
} }
} }
.marketing.edit-gift { .marketing.edit-gift {
// 礼包 // 礼包
.gift-name-slot{ .gift-name-slot {
display: flex; display: flex;
align-items: center; align-items: center;
.group-label{ .group-label {
width: 42px; width: 42px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
background: rgba(255,101,61,0.15); background: rgba(255, 101, 61, 0.15);
border-radius: 4px; border-radius: 4px;
margin-left: 4px; margin-left: 4px;
font-size: 12px; font-size: 12px;
display: inline-block; display: inline-block;
color: #FF653D; color: #ff653d;
} }
} }
.gift-block { .gift-block {
...@@ -531,4 +557,10 @@ export default { ...@@ -531,4 +557,10 @@ export default {
.user { .user {
margin-left: 144px; margin-left: 144px;
} }
.form-label {
width: 154px;
color: #666666;
display: inline-block;
text-align: right;
}
</style> </style>
...@@ -29,6 +29,12 @@ ...@@ -29,6 +29,12 @@
</div> </div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div> <div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
</el-form-item> </el-form-item>
<el-form-item size="small" label="会员专享:" v-if="isHmd" prop="memberPayFlags">
<el-checkbox-group v-model="ruleForm.memberPayFlags">
<el-checkbox v-for="(item, index) in memberList" :key="index" :label="item.name">{{ item.label }}</el-checkbox>
</el-checkbox-group>
<span class="give-tip" style=" margin: -15px 0 0 154px;">仅勾选的等级用户方可购买会员套餐</span>
</el-form-item>
<el-form-item label="赠送金卡会员:" prop="giveGoldFlag" v-if="showGh && accountLevel == 4"> <el-form-item label="赠送金卡会员:" prop="giveGoldFlag" v-if="showGh && accountLevel == 4">
<el-radio-group v-model="ruleForm.giveGoldFlag"> <el-radio-group v-model="ruleForm.giveGoldFlag">
<el-radio :label="2">赠送</el-radio> <el-radio :label="2">赠送</el-radio>
...@@ -113,6 +119,7 @@ export default { ...@@ -113,6 +119,7 @@ export default {
} }
} }
return { return {
isHmd: true,
memberPrice: '', //会员卡价格 memberPrice: '', //会员卡价格
sloading: false, sloading: false,
ruleForm: { ruleForm: {
...@@ -122,13 +129,15 @@ export default { ...@@ -122,13 +129,15 @@ export default {
// couponList:[], // couponList:[],
notes: '', notes: '',
giveGoldFlag: '', giveGoldFlag: '',
packageImg: '' packageImg: '',
memberPayFlags: []
}, },
copyRuleForm: {}, //用于检查页面信息是否改动 copyRuleForm: {}, //用于检查页面信息是否改动
rules: { rules: {
packageName: [{ required: true, message: '请输入套餐名称', trigger: 'blur' }], packageName: [{ required: true, message: '请输入套餐名称', trigger: 'blur' }],
packagePrice: [{ required: true, validator: validatePrice, trigger: 'blur' }], packagePrice: [{ required: true, validator: validatePrice, trigger: 'blur' }],
giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }] giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }],
memberPayFlags: [{ required: true, message: '请选择会员专享', trigger: 'change' }]
}, },
picOptions: { picOptions: {
width: '104px', width: '104px',
...@@ -142,8 +151,26 @@ export default { ...@@ -142,8 +151,26 @@ export default {
key: 'sharePosterImg', key: 'sharePosterImg',
isClose: true isClose: true
}, },
memberList: [
{
label: '普通用户',
name: 2
},
{
label: '普通会员',
name: 3
},
{
label: '银卡会员',
name: 4
},
{
label: '金卡用户',
name: 5
}
],
packageImgArr: [], packageImgArr: [],
sharePosterImgArr:[], sharePosterImgArr: [],
allItemList: [], allItemList: [],
choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'], choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'],
copyChoseItemList: [], //用于检查页面信息是否改动 copyChoseItemList: [], //用于检查页面信息是否改动
...@@ -223,6 +250,8 @@ export default { ...@@ -223,6 +250,8 @@ export default {
this.merchantName = this.$globalState.session.merchantName this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
} }
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.showGh = window.location.host.indexOf('cgacar') != -1 this.showGh = window.location.host.indexOf('cgacar') != -1
if (this.showGh) { if (this.showGh) {
this.getCardContentFun() this.getCardContentFun()
...@@ -312,8 +341,9 @@ export default { ...@@ -312,8 +341,9 @@ export default {
item.couponAmount = item.serviceQuantity item.couponAmount = item.serviceQuantity
item.id = item.serviceId item.id = item.serviceId
}) })
this.packageImgArr =res.data.packageImg? [res.data.packageImg]:[] !res.data.memberPayFlags ? (this.ruleForm.memberPayFlags = []) : ''
this.sharePosterImgArr =res.data.sharePosterImg? [res.data.sharePosterImg]:[] this.packageImgArr = res.data.packageImg ? [res.data.packageImg] : []
this.sharePosterImgArr = res.data.sharePosterImg ? [res.data.sharePosterImg] : []
this.recoveryCoupon() this.recoveryCoupon()
this.copyTotalPrice = this.totalPrice this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据 this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
...@@ -363,12 +393,12 @@ export default { ...@@ -363,12 +393,12 @@ export default {
param.packagePrice = this.ruleForm.packagePrice param.packagePrice = this.ruleForm.packagePrice
param.notes = this.ruleForm.notes param.notes = this.ruleForm.notes
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0 param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.isHmd) param.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) { if (this.showGh) {
param.giveGoldFlag = this.ruleForm.giveGoldFlag param.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) { if (this.accountLevel == 4) {
param.packageImg = this.ruleForm.packageImg param.packageImg = this.ruleForm.packageImg
param.sharePosterImg = this.ruleForm.sharePosterImg param.sharePosterImg = this.ruleForm.sharePosterImg
} }
} }
let lists = this.choseItemList let lists = this.choseItemList
...@@ -406,12 +436,13 @@ export default { ...@@ -406,12 +436,13 @@ export default {
params.packagePrice = this.ruleForm.packagePrice params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0 params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
// 海马刀传参
if (this.isHmd) params.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) { if (this.showGh) {
params.giveGoldFlag = this.ruleForm.giveGoldFlag params.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) { if (this.accountLevel == 4) {
params.packageImg = this.ruleForm.packageImg params.packageImg = this.ruleForm.packageImg
params.sharePosterImg = this.ruleForm.sharePosterImg params.sharePosterImg = this.ruleForm.sharePosterImg
} }
} }
let list = this.choseItemList let list = this.choseItemList
......
...@@ -402,7 +402,7 @@ export default { ...@@ -402,7 +402,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = '' this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => { this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) { if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList)) let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => { retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice return a.retailPrice - b.retailPrice
...@@ -418,7 +418,7 @@ export default { ...@@ -418,7 +418,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2) item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2) item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) { } else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2) item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock item.goodsStock = item.specificationDetailList[0].stock
......
...@@ -523,7 +523,7 @@ export default { ...@@ -523,7 +523,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = '' this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => { this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) { if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList)) let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => { retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice return a.retailPrice - b.retailPrice
...@@ -539,7 +539,7 @@ export default { ...@@ -539,7 +539,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2) item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2) item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) { } else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2) item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock item.goodsStock = item.specificationDetailList[0].stock
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!