dmPickerViewCompleteMobile.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <dm-pop-view ref='popView' :isShowClose="false" :isShowTitle="false" :maskTapHide='maskTapHide' :isShowConfirm='false'>
  3. <view class="titleDiv">
  4. <view class="title">补全录入号码</view>
  5. <image class="pop-close" src="../../static/icons/icon_close@2x.png" mode="" @click="handleCancel"></image>
  6. </view>
  7. <view class="content_options" v-if="isShowComplet">
  8. <text class="options_title">补充客户完整号码后,系统将判定是否补录成功,并实时反馈补充结果。</text>
  9. <input class="input-info" placeholder="请输入完整号码" type="number" maxlength="11" @input="setInputPhone" />
  10. <view class="confirm" @click="upload" :style="{background: themeColor}">提交</view>
  11. <view class="think_again" @click="thinkAgain">我再想想</view>
  12. </view>
  13. <view v-else>
  14. <view class="content_options" v-if="isSuccess==1">
  15. <image src="../../static/icons/complete_success.png" mode="" class="icon_complete"></image>
  16. <text style="font-size: 36rpx;font-family: Verdana, Verdana-Bold;font-weight: 700;text-align: center;color: #333333;">补充成功</text>
  17. <text style="margin-top: 10rpx;font-size: 24rpx;font-family: Verdana, Verdana-Regular;font-weight: 400;text-align: center;color: #333333;">该客户全号码补充成功,点击确认刷新报备列表。</text>
  18. <view class="success_confirm" @click="successConfirm" :style="{background: themeColor}">确认</view>
  19. </view>
  20. <view class="content_options" v-if="isSuccess==2">
  21. <image src="../../static/icons/complete_failure.png" mode="" class="icon_complete"></image>
  22. <text style="font-size: 36rpx;font-family: Verdana, Verdana-Bold;font-weight: 700;text-align: center;color: #333333;">补充失败</text>
  23. <text style="margin-top: 10rpx;font-size: 24rpx;font-family: Verdana, Verdana-Regular;font-weight: 400;text-align: center;color: #333333; width: 504rpx;">{{message}}</text>
  24. <view class="success_confirm" @click="failureConfirm" :style="{background: themeColor}">确认</view>
  25. </view>
  26. </view>
  27. </dm-pop-view>
  28. </template>
  29. <script>
  30. import dmPopView from './dmPopView.vue'
  31. export default {
  32. props: {
  33. maskTapHide: {
  34. type: Boolean,
  35. default: true
  36. },
  37. options:{
  38. type:Object
  39. }
  40. },
  41. data() {
  42. return {
  43. themeColor: "",
  44. fuzhuClolor: "",
  45. themeColor25: "",
  46. themeColor50: "",
  47. isSuccess: -1,
  48. isShowComplet: true,
  49. completionPhone: "",
  50. completePhoneParam: null,
  51. message: "",
  52. brandId:"",
  53. userMobile:""
  54. }
  55. },
  56. mounted() {
  57. let app = getApp();
  58. this.themeColor = app.globalData.themeColor;
  59. this.fuzhuClolor = app.globalData.fuzhuColor;
  60. this.themeColor25 = app.globalData.themeColor25;
  61. this.themeColor50 = app.globalData.themeColor50;
  62. uni.getStorage({
  63. //获得保存在本地的用户信息
  64. key: 'userInfo',
  65. success: res => {
  66. if (res.data) {
  67. this.brandId = res.data.brandId;
  68. this.userMobile = res.data.mobile;
  69. }
  70. }
  71. });
  72. },
  73. methods: {
  74. setInputPhone(event) {
  75. this.completionPhone = event.detail.value
  76. },
  77. handleCancel() {
  78. this.$refs.popView.hide()
  79. },
  80. show() {
  81. this.isSuccess = -1
  82. this.isShowComplet = true
  83. this.$refs.popView.show()
  84. },
  85. thinkAgain() {
  86. this.$refs.popView.handleCancel();
  87. },
  88. failureConfirm() {
  89. this.$emit('updataDataPage','')
  90. this.$refs.popView.handleConfirm();
  91. },
  92. successConfirm() {
  93. this.$emit('updataDataPage','')
  94. this.$refs.popView.handleConfirm();
  95. },
  96. upload() {
  97. let item = this.options;
  98. let hiddenMobile = item.userMobile;
  99. let userId = item.userId;
  100. let name = item.userName;
  101. let reportTime = item.reportTime;
  102. let houseId = item.houseId;
  103. let reportId = item.id;
  104. let terminal = item.terminal;
  105. let reporterMobile = item.reporterMobile;
  106. this.completePhoneParam = {
  107. hiddenMobile,
  108. userId,
  109. houseId,
  110. reportId,
  111. name,
  112. reportTime,
  113. terminal,
  114. reporterMobile
  115. }
  116. if (this.completionPhone != '') { //输入了手机号
  117. if (this.completionPhone.length == 11) {
  118. let startPhone3 = this.completionPhone.slice(0, 3)
  119. let endPhone4 = this.completionPhone.slice(7)
  120. let start3 = this.completePhoneParam.hiddenMobile.slice(0, 3)
  121. let end4 = this.completePhoneParam.hiddenMobile.slice(7)
  122. if (startPhone3 == start3 && endPhone4 == end4) {
  123. if (this.faSongFangLJ) {
  124. return
  125. }
  126. this.faSongFangLJ = true;
  127. this.commitReport();
  128. } else {
  129. uni.showToast({
  130. title: '请输入与前三后四号码相匹配的手机号码',
  131. icon: "none",
  132. duration: 2000
  133. })
  134. }
  135. } else {
  136. uni.showToast({
  137. title: '请输入完整的手机号码',
  138. icon: "none",
  139. duration: 2000
  140. })
  141. }
  142. } else {
  143. uni.showToast({
  144. title: '请输入手机号码',
  145. icon: "none",
  146. duration: 2000
  147. })
  148. }
  149. },
  150. dateFormat(fmt, date) {
  151. date = new Date(date);
  152. let ret;
  153. const opt = {
  154. "Y+": date.getFullYear().toString(), // 年
  155. "m+": (date.getMonth() + 1).toString(), // 月
  156. "d+": date.getDate().toString(), // 日
  157. "H+": date.getHours().toString(), // 时
  158. "M+": date.getMinutes().toString(), // 分
  159. "S+": date.getSeconds().toString() // 秒
  160. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  161. };
  162. for (let k in opt) {
  163. ret = new RegExp("(" + k + ")").exec(fmt);
  164. if (ret) {
  165. fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
  166. };
  167. };
  168. return fmt;
  169. },
  170. /**
  171. * 补全号码
  172. */
  173. async commitReport() {
  174. let data = {
  175. brandId: this.brandId,
  176. hiddenMobile: this.completePhoneParam.hiddenMobile,
  177. houseId: this.completePhoneParam.houseId,
  178. mobile: this.completionPhone,
  179. name: this.completePhoneParam.name,
  180. reportId: this.completePhoneParam.reportId,
  181. reportTime: this.dateFormat("YYYY-mm-dd HH:MM:SS",this.completePhoneParam.reportTime),
  182. reporterMobile: this.completePhoneParam.reporterMobile,
  183. terminal: this.completePhoneParam.terminal,
  184. userId: this.completePhoneParam.userId,
  185. };
  186. let res = await this.$myRequest({
  187. url: "/elab-marketing-user/pre3post4/completePhone",
  188. data: data
  189. });
  190. if (res.data.success) {
  191. this.isSuccess = 1
  192. this.isShowComplet = false
  193. this.faSongFangLJ = false;
  194. } else {
  195. this.isSuccess = 2
  196. this.isShowComplet = false
  197. this.faSongFangLJ = false;
  198. this.message = res.data.message
  199. }
  200. },
  201. },
  202. components: {
  203. dmPopView
  204. }
  205. }
  206. </script>
  207. <style scoped lang="scss">
  208. .titleDiv {
  209. width: 100%;
  210. padding: 56rpx 30rpx 10rpx 40rpx;
  211. box-sizing: border-box;
  212. display: flex;
  213. justify-content: space-between;
  214. .title {
  215. font-size: 36rpx;
  216. font-weight: bold;
  217. }
  218. .pop-close {
  219. position: absolute;
  220. top: 64rpx;
  221. right: 30rpx;
  222. width: 40rpx;
  223. height: 40rpx;
  224. }
  225. }
  226. .content_options {
  227. width: 100%;
  228. display: flex;
  229. height: 700rpx;
  230. align-items: center;
  231. flex-direction: column;
  232. overflow-y: scroll;
  233. overflow-x: hidden;
  234. .options_title {
  235. font-size: 24rpx;
  236. font-family: Verdana, 'Verdana-Regular';
  237. font-weight: 400;
  238. text-align: left;
  239. color: #333333;
  240. margin-left: 40rpx;
  241. margin-right: 40rpx;
  242. margin-top: 20rpx;
  243. }
  244. .input-info {
  245. width: calc(100% - 60rpx);
  246. height: 96rpx;
  247. background: #f1f5f9;
  248. border-radius: 16rpx;
  249. padding-left: 30rpx;
  250. box-sizing: border-box;
  251. line-height: 96rpx;
  252. margin-top: 50rpx;
  253. margin-bottom: 140rpx;
  254. }
  255. .confirm {
  256. width: 260rpx;
  257. height: 84rpx;
  258. border-radius: 42rpx;
  259. display: flex;
  260. justify-content: center;
  261. align-items: center;
  262. font-size: 32rpx;
  263. font-family: Verdana, Verdana-Regular;
  264. font-weight: 400;
  265. text-align: center;
  266. color: #ffffff;
  267. }
  268. .think_again {
  269. font-size: 32rpx;
  270. font-family: Verdana, Verdana-Regular;
  271. font-weight: 400;
  272. text-align: center;
  273. color: #666666;
  274. margin-top: 50rpx;
  275. }
  276. .icon_complete {
  277. width: 118rpx;
  278. height: 118rpx;
  279. margin-top: 100rpx;
  280. margin-bottom: 30rpx;
  281. }
  282. .success_confirm {
  283. width: 280rpx;
  284. height: 84rpx;
  285. border-radius: 42rpx;
  286. display: flex;
  287. justify-content: center;
  288. align-items: center;
  289. font-size: 32rpx;
  290. font-family: Verdana, Verdana-Regular;
  291. font-weight: 400;
  292. text-align: center;
  293. color: #ffffff;
  294. margin-top: 160rpx;
  295. }
  296. }
  297. </style>