Commit 76cecef2 by 张权

0802定向礼包开发

1 parent 09427590
...@@ -55,21 +55,32 @@ export default { ...@@ -55,21 +55,32 @@ export default {
}) })
}, },
/**根据id获取定向礼包详情(企微) */ /**根据id获取定向礼包详情(企微) */
getGiftDetail (id) { getGiftDetail (params) {
let data = { let data = {
method: 'scrm.api.coupon.weChat.directional.gift.detail', method: 'scrm.api.coupon.weChat.directional.gift.detail',
id ...params
} }
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
}, },
/**根据id获取定向礼包详情(企微) */ /**根据id获取从审批中进入定向礼包详情(企微) */
getUserGiftDetail (id) { getApproveGiftDetail (params) {
let data = {
method: 'scrm.api.coupon.weChat.directional.gift.approve.in.detail',
...params
}
return window.$HTTP({
url,
data
})
},
/**根据id获取已领取列表定向礼包详情(企微) */
getUserGiftDetail (params) {
let data = { let data = {
method: 'scrm.api.coupon.weChat.user.directional.gift.detail', method: 'scrm.api.coupon.weChat.user.directional.gift.detail',
id ...params
} }
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -93,6 +104,14 @@ export default { ...@@ -93,6 +104,14 @@ export default {
data data
}) })
}, },
// 指定条件创建
createPerfectGift (data) {
data.method = 'scrm.api.coupon.weChat.perfect.directional.gift'
return window.$HTTP({
url,
data
})
},
/**根据定向礼包id获取二维码路径 */ /**根据定向礼包id获取二维码路径 */
createQr (data) { createQr (data) {
data.method = 'scrm.api.coupon.directional.gift.qr.code' data.method = 'scrm.api.coupon.directional.gift.qr.code'
......
...@@ -115,7 +115,7 @@ const actions = { ...@@ -115,7 +115,7 @@ const actions = {
util.showLoading() util.showLoading()
let appid = getParams('corpId') //从链接获取 let appid = getParams('corpId') //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId') let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'ww7ee69c648ae1b7e6' if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'wwc33bc9a3c72d45f3'
util.setLocalStorage('dj_scrm_corpId', { corpId: appid }) util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
// 'ww657a2d4ae89a4424' // 'ww657a2d4ae89a4424'
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize' const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
......
...@@ -191,9 +191,16 @@ export default { ...@@ -191,9 +191,16 @@ export default {
this.total = total this.total = total
return res return res
}, },
getDetail (id) { getDetail () {
let { perfectFlag } = this.getQuery() let { id,pageIdx, childId,perfectFlag } = this.getQuery()
giftApi.getGiftDetail(id).then(res => { let API = pageIdx==1? giftApi.getUserGiftDetail : pageIdx==2 ? giftApi.getApproveGiftDetail : giftApi.getGiftDetail
let pramas
if(pageIdx==2 || pageIdx==0){
pramas = {id,childId}
}else{
pramas = {id}
}
API(pramas).then(res => {
this.hideLoading() this.hideLoading()
if(perfectFlag==2 || res?.receivedStock){ if(perfectFlag==2 || res?.receivedStock){
this.disabledList=['name','remark','add'] this.disabledList=['name','remark','add']
...@@ -305,8 +312,19 @@ export default { ...@@ -305,8 +312,19 @@ export default {
params.staffCreateRequests = obj.staffList params.staffCreateRequests = obj.staffList
} }
params.requestSource = 2 params.requestSource = 2
let { perfectFlag } = this.getQuery()
if(id && perfectFlag==2){
params = {
id,
receiveWay:obj.receiveWay,
receiveDetail: obj.receiveWay == 1 ? obj.phone : obj.vin,
giveReason: obj.giveReason,
}
}
this.showLoading('提交中...') this.showLoading('提交中...')
giftApi.createOrupdataGift(params).then(res => { const API =(id && perfectFlag==2) ? giftApi.createPerfectGift : giftApi.createOrupdataGift
API(params).then(res => {
this.hideLoading() this.hideLoading()
if(res.approveFlag ===2){ if(res.approveFlag ===2){
wxConfig.thirdPartyOpenPage(setApproveParam(res)) wxConfig.thirdPartyOpenPage(setApproveParam(res))
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
</div> </div>
</div> </div>
</template> </template>
<div v-if="flag && (!(approveStatus == 1 || pageIdx==1 || (pageIdx!=3 && receiveDetailList.length>1)))" class="submit-btn"> <div v-if="flag && (!(approveStatus == 1 || pageIdx==1 || pageIdx==2 || (pageIdx!=3 && receiveDetailList.length>1)))" class="submit-btn">
<div <div
class="text-center sub-btn" class="text-center sub-btn"
@click="changeGift" @click="changeGift"
...@@ -173,14 +173,14 @@ export default { ...@@ -173,14 +173,14 @@ export default {
approveStatus: 0, approveStatus: 0,
perfectFlag: 0, perfectFlag: 0,
isShowApprovalDetail: true, isShowApprovalDetail: true,
pageIdx:0 pageIdx:0,
} }
}, },
mounted () { mounted () {
const {approveStatus,perfectFlag,pageIdx} = this.getQuery() const {approveStatus,perfectFlag,pageIdx} = this.getQuery()
this.approveStatus = approveStatus this.approveStatus = approveStatus
this.perfectFlag = perfectFlag || 0 //待完善跳过来,1是已完善信息未审批,2是未完善 this.perfectFlag = perfectFlag || 0 //待完善跳过来,1是已完善信息未审批,2是未完善
this.pageIdx = pageIdx || 0 //1是已领取 其他值不用管 this.pageIdx = pageIdx || 0
this.showLoading() this.showLoading()
this.getDetail() this.getDetail()
wxConfig.init(['thirdPartyOpenPage']) wxConfig.init(['thirdPartyOpenPage'])
...@@ -213,9 +213,15 @@ export default { ...@@ -213,9 +213,15 @@ export default {
return res return res
}, },
getDetail () { getDetail () {
let { id,pageIdx } = this.getQuery() let { id,pageIdx, childId } = this.getQuery()
let API = pageIdx==1? giftApi.getUserGiftDetail : giftApi.getGiftDetail let API = pageIdx==1? giftApi.getUserGiftDetail : pageIdx==2 ? giftApi.getApproveGiftDetail : giftApi.getGiftDetail
API(id).then(res => { let pramas
if(pageIdx==2 || pageIdx==0){
pramas = {id,childId}
}else{
pramas = {id}
}
API(pramas).then(res => {
this.hideLoading() this.hideLoading()
res = this.setCouponData(res) res = this.setCouponData(res)
this.flag = true this.flag = true
...@@ -283,11 +289,11 @@ export default { ...@@ -283,11 +289,11 @@ export default {
}) })
}, },
changeGift () { changeGift () {
let { id,perfectFlag } = this.getQuery() let { id,perfectFlag,pageIdx,childId } = this.getQuery()
if(perfectFlag==1){ if(perfectFlag==1){
this.pushApproval() this.pushApproval()
}else{ }else{
let query = {id} let query = {id,pageIdx,childId}
if(perfectFlag==2) query.perfectFlag = perfectFlag if(perfectFlag==2) query.perfectFlag = perfectFlag
this.$router.replace({ name: 'gift.create', query }) this.$router.replace({ name: 'gift.create', query })
} }
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</div> </div>
<div class="gift-box"> <div class="gift-box">
<div class="title">{{i.name}}</div> <div class="title">{{i.name}}</div>
<div class="text">指定领取{{i.receiveWay == 1?'手机号':'车架号'}}:{{i.receiveDetail}}</div> <div class="text" v-if="i.receiveRule!=3">指定领取{{i.receiveWay == 1?'手机号':'车架号'}}:{{i.receiveDetail}}</div>
<div class="text">备注名称:{{i.remarkName}}</div> <div class="text">备注名称:{{i.remarkName}}</div>
</div> </div>
<div class="time flex">{{new Date(i.receivedDate).format('yyyy-MM-dd hh:mm:ss')}}</div> <div class="time flex">{{new Date(i.receivedDate).format('yyyy-MM-dd hh:mm:ss')}}</div>
...@@ -102,13 +102,14 @@ ...@@ -102,13 +102,14 @@
<div class="text item-flex"><span class="nowrap">备注名称:</span><div>{{i.remarkName}}</div></div> <div class="text item-flex"><span class="nowrap">备注名称:</span><div>{{i.remarkName}}</div></div>
<div class="text">预估成本:<span style="font-weight:600;">{{(i.anticipatedCost/100).toFixed(2)}}</span>元</div> <div class="text">预估成本:<span style="font-weight:600;">{{(i.anticipatedCost/100).toFixed(2)}}</span>元</div>
<div class="text item-flex"><span class="nowrap">赠送原因:</span><div>{{i.giveReason}}</div></div> <div class="text item-flex"><span class="nowrap">赠送原因:</span><div>{{i.giveReason}}</div></div>
<div v-if="i.approveStatus==1 || i.approveStatus==3" class="text item-flex"> <div v-if="i.approveStatus==1 || i.approveStatus==3 || i.approveStatus==5" class="text item-flex">
<span class="nowrap">审批状态:</span> <span class="nowrap">审批状态:</span>
<div> <div>
<span :style="{color: i.approveStatus==1 ? '#3975C6':'#F1515C','margin-right':'5px'}">{{i.approveStatus==1 ? '审批中' : '已驳回'}}</span>({{i.approveBy}}) <span :style="{color: i.approveStatus==1 || i.approveStatus==5 ? '#3975C6':'#F1515C','margin-right':'5px'}">{{i.approveStatus==1 ? '审批中':i.approveStatus==5 ? '待审批': '已驳回'}}</span>
<span v-if="i.approveStatus!=5">({{i.approveBy}})</span>
</div> </div>
</div> </div>
<div class="text item-flex" v-if="i.approveStatus==3"><span class="nowrap">驳回原因:</span><div style="color: #F1515C;">{{i.approveExplain}}</div></div> <div class="text item-flex" v-if="i.approveStatus==3"><span class="nowrap">驳回原因:</span><div style="color: #F1515C;">{{i.approveExplain || '--'}}</div></div>
</div> </div>
</van-swipe-cell> </van-swipe-cell>
</template> </template>
...@@ -197,9 +198,9 @@ export default { ...@@ -197,9 +198,9 @@ export default {
this.activeTab = val this.activeTab = val
this.clearData() this.clearData()
}, },
toAppprove({id}){ toAppprove({id,childId}){
this.showLoading() this.showLoading()
giftApi.toApproveById({id}).then(res => { giftApi.toApproveById({id,childId}).then(res => {
this.hideLoading() this.hideLoading()
if(res.approveFlag ===2){ if(res.approveFlag ===2){
wxConfig.thirdPartyOpenPage(setApproveParam(res)) wxConfig.thirdPartyOpenPage(setApproveParam(res))
...@@ -288,12 +289,18 @@ export default { ...@@ -288,12 +289,18 @@ export default {
params.perfectFlag = item.perfectFlag params.perfectFlag = item.perfectFlag
params.pageIdx = 3 params.pageIdx = 3
} }
if(this.tabIndex==2 || (this.tabIndex==0 && this.activeTab==1)){
params.childId = item.childId
}
this.$router.push({ name: 'gift.detail', query: params }) this.$router.push({ name: 'gift.detail', query: params })
}, },
getMiniParams (e) { getMiniParams (e) {
let { merchantId, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo') let { merchantId, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo')
const { shopmall_appid } = window.$fetchConfig const { shopmall_appid } = window.$fetchConfig
let scene = `id=${e.id}&merchantId=${merchantId}&staffUUID=${uuid}` let scene = `id=${e.id}&merchantId=${merchantId}&staffUUID=${uuid}`
if(e.receiveRule == 2){
scene = `id=${e.id}&merchantId=${merchantId}&staffUUID=${uuid}&childId=${e.childId}`
}
if (sapCode) scene = `${scene}&storeCode=${sapCode}` if (sapCode) scene = `${scene}&storeCode=${sapCode}`
this.showLoading('生成中...') this.showLoading('生成中...')
return { return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!