1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<template>
<div>
<sub-title>本月实际完成情况</sub-title>
<table-double-view :data="dataBasic" :keyValue="keyValueDouble"></table-double-view>
<sub-title>今日营销记录</sub-title>
<div class="markdatastyle">
<div>今日营销记录</div>
<div style="color: #00a3ff;font-size: 18px" @click="selectMarkDetail('0')" v-if="JSON.stringify(this.marketingdata) == '{}'">新增</div>
<div style="color: #00a3ff;font-size: 18px" @click="selectMarkDetail('0')" v-if="JSON.stringify(this.marketingdata) != '{}'">修改</div>
</div>
<sub-title>历史营销记录</sub-title>
<div v-if="PlanList.length <= 0" style="width: 100%;text-align: center;font-size: 14px;color: #999999">
暂无数据!
</div>
<div v-if="PlanList.length > 0" v-for="(item, index) of PlanList" :key="index" class="markdatastyle" @click="selectMarkDetail('1', item)">
<div>{{ item.updTimeStr }}日营销记录</div>
<div>〉</div>
</div>
<base-popup :safe-area-inset-bottom="true" :showCancel="showCancel" showConfirm="true" @confirm="sendOut" :confirmText="confirmText" v-model="flagPopup" title="温馨提示">
<div class="popup-content">
<div v-if="dataview" class="popup-data">
是否确认提交该营销任务!
</div>
<div v-if="!dataview" class="popup-data">
提交成功!
</div>
</div>
</base-popup>
</div>
</template>
<script lang="ts">
import { Component, Emit, Prop, Vue } from "vue-property-decorator";
import TitleBar from "@/components/general/TitleBar.vue";
import MobileInput from "@/components/general/form/MobileInput.vue";
import DSelect from "@/components/general/form/DSelect.vue";
import DDatetimePicker from "@/components/general/form/DDatetimePicker.vue";
import IF from "@/public/factory/InterFaceFactory";
import { NativeUI } from "@/public/ts/NativeUI";
import BasePopup from "@/components/general/BasePopup.vue";
import { getText } from '@/stores';
import nettyApi from "@/constants/api/ms-netty/netty.api.ts";
import applicationApi from "@/constants/api/ms-application/application.api";
/**
* @Description:个人上门营销
* @author pd
* @date 2021-11-08 15:53:04
*/
@Component({
name: "JhdbxqView",
components: { TitleBar, MobileInput, DSelect, DDatetimePicker, BasePopup },
})
export default class JhdbxqView extends Vue {
@Prop() grsmyxSubmitClick: (() => void) | undefined; //触发保存并提交事件
flagPopup = false;
dataview = true;
showCancel = true;
operate = "1";
confirmText = "提交";
//本月实际完成情况
keyValueDouble = {
cus_id: '全口径消贷投放(万)',
ENT_NAME_OLD: '随意分申请户数(人)',
REPR_NAME: '添加微信户数(人)',
PT_STATE: '优易贷预授信新增户数(人)',
limittime: '优易贷提用户数(人)'
}
//本月实际完成情况数据
dataBasic = {}
marketingdata = {}
PlanList = [] //上门营销记录
mounted() {
this.initSaveSubmit();
this.PlanList = []; //上门营销记录
this.taskDetail().then(() => {
this.getPlanTime().then(() => {
NativeUI.closeWaiting();
});
});
}
/**
* @Description 初始化提交方法
* @Author JiangTao
* @Date 2022-02-17 下午 10:08
*/
@Emit("update:grsmyxSubmitClick")
initSaveSubmit(): any {
return () => {
//函数体
this.flagPopup = false;
this.dataview = true;
this.showCancel = true;
this.confirmText = "提交";
this.onSubmit();
};
}
/**
* @Description 营销任务处理详情查询
* @Author JiangTao
* @Date 2022-01-10 下午 07:41
*/
taskDetail() {
this.marketingdata = {};
const param = {
tc: 'MCEP'
};
const query = {
taskNum: this.$store.getters.getCusInfo.taskNum,
tc: 'MCEP'
};
NativeUI.showWaiting('查询中...');
return IF.transferDataInter(applicationApi.taskDetail, param, query).then((res: any) => {
if (res.code == '1') {
if (res.data && res.data != 'null') {
this.marketingdata = res.data;
}
} else {
NativeUI.toast(res.msg);
}
});
}
/**
* @Description 上门营销
* @Author JiangTao
* @Date 2022-01-12 下午 08:15
*/
getPlanTime() {
this.PlanList = [];
let param = {
taskNum: this.$store.getters.getCusInfo.taskNum,
exeUser: sessionStorage.getItem('workcode'),
tc: 'MCEP'
};
NativeUI.showWaiting('查询中...');
return IF.transferDataInter(applicationApi.taskTimeLine, param).then((res: any) => {
console.log(param);
console.log('时光轴', res);
NativeUI.closeWaiting();
if (res.code == '1') {
if (res.data && res.data != '' && res.data != '[]') {
//数据
if (res.data && res.data.length > 0) {
this.PlanList = res.data;
//随手礼数据
for (let i = 0; i < this.PlanList.length; i++) {
(this.PlanList as any)[i].updTimeStr = (this.PlanList as any)[i].updTimeStr.substring(0, 10);
if ((this.PlanList as any)[i].giftRels && (this.PlanList as any)[i].giftRels.length > 0) {
this.$set(this.PlanList[i], 'SSLListName', {});
this.$set(this.PlanList[i], 'SSLListData', {});
for (let j = 0; j < (this.PlanList as any)[i].giftRels.length; j++) {
this.$set(
(this.PlanList as any)[i].SSLListName,
(this.PlanList as any)[i].giftRels[j].giftType,
(this.PlanList as any)[i].giftRels[j].giftDes
);
this.$set(
(this.PlanList as any)[i].SSLListData,
(this.PlanList as any)[i].giftRels[j].giftType,
(this.PlanList as any)[i].giftRels[j].giftCount
);
}
}
}
}
}
console.log(this.PlanList);
console.log(this.PlanList.length);
} else {
NativeUI.toast(res.msg);
}
});
}
/**
* @Description 营销记录查询/营销记录新增
* @Author JiangTao
* @Date 2022-02-15 下午 11:04
*/
selectMarkDetail(type: any, item:any = {}) {
this.$router.push({
name: 'JHDBDetail',
params: {
type: type, //0为当日营销记录,1为之前已营销的记录
data: item
}
});
}
/**
* @Description 判断是否提交
* @Author JiangTao
* @Date 2022-01-11 下午 04:07
*/
onSubmit() {
if (this.PlanList.length > 0) {
this.flagPopup = true;
this.dataview = true;
} else {
NativeUI.toast('请对该任务进行营销!');
}
}
/**
* @Description 提交/修改任务状态——1-待分发 2-待营销,3-营销中,4-已完成,5-撤回、6作废
* @Author JiangTao
* @Date 2022-01-11 下午 04:07
*/
updateMarketTaskSingle(taskStatus: any) {
let param = {
taskNum: this.$store.getters.getCusInfo.taskNum,
taskStatus: taskStatus
};
NativeUI.showWaiting('提交中...');
return IF.transferDataInter(applicationApi.updateMarketTaskSingle, param).then((res: any) => {
NativeUI.closeWaiting();
if (res.code == '1') {
this.operate = '1';
} else {
this.operate = '2';
NativeUI.toast(res.msg);
}
});
}
sendOut() {
if (this.dataview) {
this.updateMarketTaskSingle(4).then(() => {
if (this.operate == '1') {
this.showCancel = false;
this.confirmText = "知道啦";
this.dataview = false;
}
});
} else {
this.flagPopup = false;
this.$router.go(-1);
}
}
}
</script>
<style scoped>
.markdatastyle {
height: 50px;
width: 88%;
border-bottom: 1px solid #e0e1e2;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
font-size: 16px;
}
.markdatastyle > div {
font-size: 16px;
}
.popup-data {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.popup-content {
height: 100%;
}
</style>