Commit 76cecef2 by 张权

0802定向礼包开发

1 parent 09427590
......@@ -55,21 +55,32 @@ export default {
})
},
/**根据id获取定向礼包详情(企微) */
getGiftDetail (id) {
getGiftDetail (params) {
let data = {
method: 'scrm.api.coupon.weChat.directional.gift.detail',
id
...params
}
return window.$HTTP({
url,
data
})
},
/**根据id获取定向礼包详情(企微) */
getUserGiftDetail (id) {
/**根据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 = {
method: 'scrm.api.coupon.weChat.user.directional.gift.detail',
id
...params
}
return window.$HTTP({
url,
......@@ -93,6 +104,14 @@ export default {
data
})
},
// 指定条件创建
createPerfectGift (data) {
data.method = 'scrm.api.coupon.weChat.perfect.directional.gift'
return window.$HTTP({
url,
data
})
},
/**根据定向礼包id获取二维码路径 */
createQr (data) {
data.method = 'scrm.api.coupon.directional.gift.qr.code'
......
......@@ -115,7 +115,7 @@ const actions = {
util.showLoading()
let appid = getParams('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 })
// 'ww657a2d4ae89a4424'
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
......
......@@ -191,9 +191,16 @@ export default {
this.total = total
return res
},
getDetail (id) {
let { perfectFlag } = this.getQuery()
giftApi.getGiftDetail(id).then(res => {
getDetail () {
let { id,pageIdx, childId,perfectFlag } = this.getQuery()
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()
if(perfectFlag==2 || res?.receivedStock){
this.disabledList=['name','remark','add']
......@@ -305,8 +312,19 @@ export default {
params.staffCreateRequests = obj.staffList
}
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('提交中...')
giftApi.createOrupdataGift(params).then(res => {
const API =(id && perfectFlag==2) ? giftApi.createPerfectGift : giftApi.createOrupdataGift
API(params).then(res => {
this.hideLoading()
if(res.approveFlag ===2){
wxConfig.thirdPartyOpenPage(setApproveParam(res))
......
......@@ -138,7 +138,7 @@
</div>
</div>
</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
class="text-center sub-btn"
@click="changeGift"
......@@ -173,14 +173,14 @@ export default {
approveStatus: 0,
perfectFlag: 0,
isShowApprovalDetail: true,
pageIdx:0
pageIdx:0,
}
},
mounted () {
const {approveStatus,perfectFlag,pageIdx} = this.getQuery()
this.approveStatus = approveStatus
this.perfectFlag = perfectFlag || 0 //待完善跳过来,1是已完善信息未审批,2是未完善
this.pageIdx = pageIdx || 0 //1是已领取 其他值不用管
this.pageIdx = pageIdx || 0
this.showLoading()
this.getDetail()
wxConfig.init(['thirdPartyOpenPage'])
......@@ -213,9 +213,15 @@ export default {
return res
},
getDetail () {
let { id,pageIdx } = this.getQuery()
let API = pageIdx==1? giftApi.getUserGiftDetail : giftApi.getGiftDetail
API(id).then(res => {
let { id,pageIdx, childId } = this.getQuery()
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()
res = this.setCouponData(res)
this.flag = true
......@@ -283,11 +289,11 @@ export default {
})
},
changeGift () {
let { id,perfectFlag } = this.getQuery()
let { id,perfectFlag,pageIdx,childId } = this.getQuery()
if(perfectFlag==1){
this.pushApproval()
}else{
let query = {id}
let query = {id,pageIdx,childId}
if(perfectFlag==2) query.perfectFlag = perfectFlag
this.$router.replace({ name: 'gift.create', query })
}
......
......@@ -85,7 +85,7 @@
</div>
<div class="gift-box">
<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>
<div class="time flex">{{new Date(i.receivedDate).format('yyyy-MM-dd hh:mm:ss')}}</div>
......@@ -102,13 +102,14 @@
<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 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>
<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 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>
</van-swipe-cell>
</template>
......@@ -197,9 +198,9 @@ export default {
this.activeTab = val
this.clearData()
},
toAppprove({id}){
toAppprove({id,childId}){
this.showLoading()
giftApi.toApproveById({id}).then(res => {
giftApi.toApproveById({id,childId}).then(res => {
this.hideLoading()
if(res.approveFlag ===2){
wxConfig.thirdPartyOpenPage(setApproveParam(res))
......@@ -288,12 +289,18 @@ export default {
params.perfectFlag = item.perfectFlag
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 })
},
getMiniParams (e) {
let { merchantId, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo')
const { shopmall_appid } = window.$fetchConfig
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}`
this.showLoading('生成中...')
return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!