Commit b085c291 by 杨北旺

feat:定向礼包需求更新

1 parent c5817fa3
...@@ -251,6 +251,8 @@ export default { ...@@ -251,6 +251,8 @@ export default {
approvalStatus:1, approvalStatus:1,
approvalStatusVal:['审批中','审批通过','已驳回'], approvalStatusVal:['审批中','审批通过','已驳回'],
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E'], approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E'],
isChangeCoupons:true,
isChangePeople:true,
} }
}, },
...@@ -265,6 +267,16 @@ export default { ...@@ -265,6 +267,16 @@ export default {
this.editStatus = true this.editStatus = true
}, },
deep: true deep: true
},
'editForm.couponList':{
handler(val){
this.isChangeCoupons = this.judgeAddOrDel(val,this.currentCoupons,'id')
}
},
'editForm.staffList':{
handler(val){
this.isChangePeople = this.judgeAddOrDel(val,this.currentPeople,'staffUUID')
}
} }
}, },
...@@ -309,9 +321,24 @@ export default { ...@@ -309,9 +321,24 @@ export default {
this.editForm.couponList.forEach(item => { this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item) this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
}) })
this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
this.currentPeople = this.$common.utils.deepClone(this.editForm.staffList)
this.hasCouponBlock(false) this.hasCouponBlock(false)
}, },
// 用来判断券和发放员工是否有增删 type: id为礼券 staffUUID为发放员工
judgeAddOrDel(newArr,oldArr,type='id'){
let id1 = [],id2 = []
newArr.forEach(item=>{
id1.push(item[type])
})
oldArr.forEach(item=>{
id2.push(item[type])
})
let flag = id1.length === id2.length && id1.sort().toString() === id2.sort().toString();
return flag
},
receiveWayChange(val) { receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails') var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位' this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
...@@ -422,7 +449,7 @@ export default { ...@@ -422,7 +449,7 @@ export default {
// 插入判断是否存在审批模板 // 插入判断是否存在审批模板
const { session } = this.$globalState const { session } = this.$globalState
this.$apis.giftBag.templateModal({merchantId:session.merchantId}).then((result)=>{ this.$apis.giftBag.templateModal({merchantId:session.merchantId}).then((result)=>{
if(result.data!=null){ if(result.data!=null&&(!this.isChangeCoupons || !this.isChangePeople)){
this.$confirm(`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`, '提示', { this.$confirm(`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
......
...@@ -252,6 +252,13 @@ export default { ...@@ -252,6 +252,13 @@ export default {
}, },
handleDelete(row) { handleDelete(row) {
if(row.approveStatus==1){
this.$message({
message: '不支持删除审批中状态的礼包',
type: 'error'
})
return
}
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id }) this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
}, },
...@@ -267,6 +274,13 @@ export default { ...@@ -267,6 +274,13 @@ export default {
// add-新增;edit-编辑 // add-新增;edit-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
if(addOrEdit=='edit'&&row.approveStatus==1){
this.$message({
message: '不支持修改审批中状态的礼包',
type: 'error'
})
return
}
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包') $title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!