task_details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <template>
  2. <view class="total-page page-env-20 page-box">
  3. <Nav :title="'任务详情'" :genre="2" :fixedHeight="fixedHeight">
  4. <view class="task-tabs m-b20" :style=" {top:`${$tools.topHeight()}px`}">
  5. <view class="detail-bg m-lr20 m-b10 m-t10">
  6. <image class="detail-img" src="/page_task/static/img/task-details/top-bg.png" mode="aspectFill">
  7. </image>
  8. <view class="detail-content">
  9. <view class="row-c m-l10 m-t16 m-b20 text-color-fff">
  10. <image class="wh-45 r-circle" src="/page_task/static/img/task-details/head.png"
  11. mode="aspectFill">
  12. </image>
  13. <text class="size-28 m-lr16">{{business.name}}</text>
  14. <view class="size-24 row-c sys-bg-007038 r-100 p-lr16 p-tb6">
  15. <text>{{business.sex===1?'男':'女'}}</text>
  16. <view class="detail-line m-lr10"></view>
  17. <text>{{business.age}}岁</text>
  18. </view>
  19. <view class="row-c size-24 sys-bg-007038 r-100 p-lr16 p-tb6 m-l20">
  20. <image class="wh-20" src="/page_task/static/img/task-details/phone-two.png"
  21. mode="aspectFill">
  22. </image>
  23. <text>{{business.phone}}</text>
  24. </view>
  25. <image class="wh-60 animate__animated animate__fadeInDownBig" v-if="business.status>0"
  26. style="position: absolute;right: 20rpx;"
  27. :src="'/page_task/static/img/task-details/icon-'+business.status+'.png'"
  28. mode="aspectFill">
  29. </image>
  30. </view>
  31. <view class="row-justify-sb center buttom-titke sys-bg-BFD2CC text-color-12 size-24">
  32. <text class="size-28 text-color-E21 sys-weight-600">{{applyFor.quota}}万</text>
  33. <text>{{business.status_name}}</text>
  34. <text>{{applyFor.use_date}}用款</text>
  35. <view class="row-c">
  36. <image class="wh-25 m-r10" src="/page_task/static/img/task-details/usrr.png" mode="">
  37. </image>
  38. <text>{{business.creation_name}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <TaskTab :current="current" @onChange="onChange"></TaskTab>
  44. </view>
  45. </Nav>
  46. <view class="sys-list-background-color task-tabs-width page-env-160"
  47. :style="{top:`${$tools.topHeight()+fixedHeight}px`}">
  48. <view class="m-t20">
  49. <z-swiper ref="zSwiper" v-model="list" :options="options" v-if="current === 1" @slideChange="onSwiper">
  50. <z-swiper-item>
  51. <Identity ref="identity" class="identity" :height="`${maxHeight-60}px`" :business="business"
  52. :linkman="linkman" :client-key="clientKey" @onShowImg="onShowImg" :linkman-key="linkmanKey">
  53. </Identity>
  54. </z-swiper-item>
  55. <z-swiper-item v-show="product.product_types.indexOf('3')>=0">
  56. <Apply class="apply" :height="`${maxHeight-60}px`" :apply-for="applyFor"
  57. :applies-key="appliesKey" @onShowImg="onShowImg">
  58. </Apply>
  59. </z-swiper-item>
  60. <z-swiper-item v-show="product.product_types.indexOf('4')>=0">
  61. <ThirdParty class="third_party" :height="`${maxHeight-60}px`" :tripartite="tripartite"
  62. :tripartite-key="tripartiteKey" @onShowImg="onShowImg">
  63. </ThirdParty>
  64. </z-swiper-item>
  65. </z-swiper>
  66. <view class="" v-if="current === 2">
  67. <z-swiper v-model="lists" :options="options" @slideChange="onCreditSwiper">
  68. <z-swiper-item>
  69. <Property class="property" :height="`${creditHeight-60}px`" :property-list="propertyList"
  70. :property-key="propertyKey" @onShowImg="onShowImg">
  71. </Property>
  72. </z-swiper-item>
  73. <z-swiper-item>
  74. <credit-list class="credit_list" :height="`${creditHeight-60}px`" :credit-data="credit"
  75. :credit-key="creditKey" @onShowImg="onShowImg"></credit-list>
  76. </z-swiper-item>
  77. </z-swiper>
  78. </view>
  79. </view>
  80. <Record v-show="current === 3" ref="recordObj" :business-id="businessId" @onShowImg="onShowImg"></Record>
  81. <Steps ref="stepsObj" v-show="current === 4" :business-id="businessId"></Steps>
  82. </view>
  83. <view v-if="isExecute>0 && business.status<4">
  84. <EnButton v-if="isExecute===3" :text="'领取'" @onSubmit="takeTask"></EnButton>
  85. <EnButton v-else-if="isExecute===2" :is_both="1" :leftText="'作废'" :rightText="'反馈'"
  86. @onLeftSubmit="cancellation" @onSubmit="setTaskOperate(3)"></EnButton>
  87. <EnButton v-else-if="isExecute===4" :is_both="2" :leftText="'作废'" :rightText="'反馈'" centre-text="交接"
  88. @onLeftSubmit="cancellation" @onCentreSubmit="openExecute" @onSubmit="setTaskOperate(3)"></EnButton>
  89. <EnButton v-else-if="isExecute===5" :text="'完成'" @onSubmit="endTask"></EnButton>
  90. <EnButton v-else-if="isExecute===6" :is_both="1" :leftText="'拒绝'" :rightText="'同意'"
  91. @onLeftSubmit="auditTask(2)" @onSubmit="auditTask(1)"></EnButton>
  92. <EnButton v-else-if="isExecute===7" text="编辑" @onSubmit="editTask()"></EnButton>
  93. <EnButton v-else-if="isExecute===8" text="完善贷后" @onSubmit="setPostLoan()"></EnButton>
  94. <EnButton :is_both="1" :leftText="'交接'" :rightText="'操作'" v-else @onLeftSubmit="openExecute"
  95. @onSubmit="setTaskOperate(1)"></EnButton>
  96. </view>
  97. <!-- <EnButton :text="'冲销'" v-if="current === 1"></EnButton>-->
  98. <!-- <EnButton is_both :leftText="'交接'" :rightText="'操作'" @onSubmit="setTaskOperate(1)" @onLeftSubmit="openExecute"></EnButton>-->
  99. <uni-popup ref="executePopup" type="bottom">
  100. <EnSelect title="请选择任务接收人" :local-data="executeData" ref="system" v-model="executeId"
  101. @setAffirm="setNewExecute"></EnSelect>
  102. </uni-popup>
  103. </view>
  104. </template>
  105. <script>
  106. import TaskTab from "@/common/task/task_tab.vue"
  107. // 身份信息
  108. import Identity from "./module/identity.vue"
  109. // 申请信息
  110. import Apply from "./module/apply.vue"
  111. // 第三方信息
  112. import ThirdParty from "./module/third_party.vue"
  113. // 资产信息
  114. import Property from "./module/property.vue"
  115. // 审核进度
  116. import Steps from "./module/steps.vue"
  117. // 跟进记录
  118. import Record from "./module/record.vue"
  119. import tools from "@/service/tools";
  120. import {
  121. cancellation,
  122. endTask,
  123. getExecuteList,
  124. getStageList,
  125. getTaskDetail,
  126. setExecute,
  127. takeTask
  128. } from "@/api/task";
  129. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  130. import CreditList from "@/page_task/credit/credit.vue";
  131. export default {
  132. components: {
  133. CreditList,
  134. EnSelect,
  135. TaskTab,
  136. Identity,
  137. ThirdParty,
  138. Apply,
  139. Property,
  140. Record,
  141. Steps
  142. },
  143. data() {
  144. return {
  145. current: 1,
  146. fixedHeight: 200,
  147. options: {
  148. // autoHeight: true,
  149. slidesPerView: 1.1,
  150. centeredSlides: true,
  151. spaceBetween: 10,
  152. effect: 'cards'
  153. },
  154. list: [1, 2, 3],
  155. lists: [1, 2],
  156. businessId: '',
  157. product: {
  158. product_name: '',
  159. product_types: [],
  160. type_data: []
  161. },
  162. business: {
  163. id: 0,
  164. status: 0,
  165. phone: '',
  166. identity_one: '',
  167. identity_two: '',
  168. marriage_img: [],
  169. credit_img: [],
  170. }, //基本信息
  171. propertyList: [], //资产信息
  172. applyFor: {}, //申请信息
  173. credit: {}, //征信信息
  174. postLoan: {}, //贷后信息
  175. tripartite: [], //第三方信息
  176. linkman: [], //联系人信息
  177. stageData: {
  178. stageName: '',
  179. userName: ""
  180. },
  181. isAjax: false,
  182. isExecute: 0,
  183. msgList: [],
  184. executeData: [],
  185. showExecute: false,
  186. auditType: 0,
  187. previewList: [],
  188. imgKey: 0,
  189. imgList: [],
  190. replyId: "",
  191. stageList: [],
  192. businessStageList: [],
  193. businessFile: {
  194. fileList: [],
  195. imgList: [],
  196. videoList: [],
  197. },
  198. videoUrl: '',
  199. executeId: '',
  200. clientKey: [],
  201. propertyKey: [],
  202. appliesKey: [],
  203. tripartiteKey: [],
  204. linkmanKey: [],
  205. creditKey: [],
  206. identityHeight: 0,
  207. thirdPartHeight: 0,
  208. applyHeight: 0,
  209. propertyHeight: 0,
  210. creditListHeight: 0,
  211. maxHeight: '100%',
  212. creditHeight: '100%',
  213. }
  214. },
  215. onLoad(data) {
  216. console.log(data)
  217. if (data.taskId !== undefined) {
  218. this.businessId = data.taskId
  219. this.getTaskDetail()
  220. uni.$on('newTaskList', () => {
  221. this.getTaskDetail()
  222. this.$refs.stepsObj.getStageList()
  223. })
  224. } else {
  225. tools.leftClick()
  226. }
  227. },
  228. methods: {
  229. onShowImg(item) {
  230. if (this.businessFile.imgList.length < 0) {
  231. this.businessFile.imgList.push(item)
  232. }
  233. // 预览图片
  234. uni.previewImage({
  235. current: item,
  236. urls: this.businessFile.imgList,
  237. });
  238. },
  239. auditTask(auditType) {
  240. uni.navigateTo({
  241. url: '/page_task/task_operate/task_operate?businessId=' + this.business.id +
  242. '&type=2&auditType=' + auditType
  243. });
  244. },
  245. setPostLoan() {
  246. uni.navigateTo({
  247. url: '/pages-task/task-info/task-loan?id=' + this.business.id
  248. });
  249. },
  250. editTask() {
  251. uni.reLaunch({
  252. url: '/pages-task/add-client/new-add?businessId=' + this.business.id
  253. })
  254. },
  255. cancellation() {
  256. uni.showModal({
  257. title: '提示',
  258. content: '是否作废当前任务?',
  259. success: (res) => {
  260. console.log(res)
  261. if (res.confirm) {
  262. cancellation({
  263. 'id': this.business.id
  264. }).then((res) => {
  265. if (res.code === 1) {
  266. this.business.status = 5;
  267. this.isExecute = 0;
  268. tools.success(res.msg)
  269. uni.$emit('newReceiving')
  270. } else {
  271. tools.error(res.msg)
  272. }
  273. })
  274. }
  275. }
  276. });
  277. },
  278. endTask() {
  279. uni.showModal({
  280. title: '提示',
  281. content: '是否完成当前任务?',
  282. success: (res) => {
  283. console.log(res)
  284. if (res.confirm) {
  285. endTask({
  286. 'id': this.business.id
  287. }).then((res) => {
  288. if (res.code === 1) {
  289. this.business.status = 4;
  290. this.isExecute = 0;
  291. tools.success(res.msg)
  292. uni.$emit('newReceiving')
  293. } else {
  294. tools.error(res.msg)
  295. }
  296. })
  297. }
  298. }
  299. });
  300. },
  301. takeTask() {
  302. if (this.isAjax) {
  303. // return;
  304. }
  305. this.isAjax = true;
  306. takeTask({
  307. 'id': this.business.id
  308. }).then((res) => {
  309. if (res.code === 1) {
  310. tools.success('领取成功')
  311. uni.$emit('newReceiving')
  312. this.getTaskDetail()
  313. } else {
  314. this.isAjax = false;
  315. tools.error(res.msg)
  316. }
  317. })
  318. },
  319. setNewExecute(type) {
  320. if (type) {
  321. //设置新执行人
  322. if (this.executeId <= 0) {
  323. tools.error('请选择执行人')
  324. return
  325. }
  326. setExecute({
  327. 'business_id': this.businessId,
  328. 'user_id': this.executeId
  329. }).then((res) => {
  330. if (res.code === 1) {
  331. tools.success(res.msg)
  332. uni.$emit('newReceiving')
  333. this.getTaskDetail()
  334. } else {
  335. tools.error(res.msg)
  336. }
  337. })
  338. }
  339. this.$refs.executePopup.close('bottom')
  340. },
  341. openExecute() {
  342. this.executeData = [];
  343. getExecuteList({
  344. 'business_id': this.businessId
  345. }).then((res) => {
  346. if (res.code === 1) {
  347. this.executeData = res.data
  348. this.$refs.executePopup.open('bottom')
  349. }
  350. })
  351. },
  352. setTaskOperate(type) {
  353. uni.navigateTo({
  354. 'url': '/page_task/task_operate/task_operate?businessId=' + this.businessId + '&type=' + type
  355. })
  356. },
  357. async getTaskDetail() {
  358. const res = await getTaskDetail({
  359. id: this.businessId
  360. })
  361. if (res.code === 1) {
  362. this.product = res.data.product
  363. this.business = res.data.business
  364. this.propertyList = res.data.propertyList
  365. this.applyFor = res.data.applyFor
  366. this.tripartite = res.data.tripartite
  367. this.linkman = res.data.linkman
  368. this.credit = res.data.credit
  369. this.postLoan = res.data.postLoan
  370. this.stageData = res.data.stageData
  371. this.isExecute = res.data.isExecute
  372. this.businessFile = res.data.businessFile
  373. this.$refs.recordObj.startData()
  374. this.$refs.zSwiper.swiper
  375. this.getDetailsHeight()
  376. this.setShowKey()
  377. } else {
  378. tools.leftClick()
  379. }
  380. },
  381. setShowKey() {
  382. this.product.type_data.forEach(item => {
  383. switch (item.type) {
  384. case '1':
  385. this.clientKey = item.type_keys
  386. break;
  387. case '2':
  388. this.propertyKey = item.type_keys
  389. break;
  390. case '3':
  391. this.appliesKey = item.type_keys
  392. break;
  393. case '4':
  394. this.tripartiteKey = item.type_keys
  395. break;
  396. case '5':
  397. this.linkmanKey = item.type_keys
  398. break;
  399. case '6':
  400. this.creditKey = item.type_keys
  401. break;
  402. }
  403. })
  404. },
  405. // 获取详情高度Swiper
  406. getDetailsHeight() {
  407. this.maxHeight = '100%'
  408. this.$nextTick(() => {
  409. const query = uni.createSelectorQuery().in(this);
  410. setTimeout(() => {
  411. query.select('.identity').boundingClientRect(data => {
  412. if (data) {
  413. this.maxHeight = data.height
  414. console.log(this.maxHeight);
  415. uni.pageScrollTo({
  416. scrollTop: 0,
  417. duration: 300
  418. });
  419. }
  420. }).exec();
  421. }, 200)
  422. })
  423. },
  424. // 获取详情高度Swiper
  425. onSwiper(swiper, index) {
  426. this.maxHeight = '100%'
  427. const query = uni.createSelectorQuery().in(this);
  428. this.$nextTick(() => {
  429. setTimeout(() => {
  430. if (index == 0) {
  431. query.select('.identity').boundingClientRect(data => {
  432. if (data) {
  433. this.maxHeight = data.height
  434. }
  435. }).exec();
  436. }
  437. if (index == 1) {
  438. query.select('.apply').boundingClientRect(data => {
  439. if (data) {
  440. this.maxHeight = data.height
  441. }
  442. }).exec();
  443. }
  444. if (index == 2) {
  445. query.select('.third_party').boundingClientRect(data => {
  446. if (data) {
  447. this.maxHeight = data.height
  448. }
  449. }).exec();
  450. }
  451. uni.pageScrollTo({
  452. scrollTop: 0,
  453. duration: 300
  454. });
  455. }, 200)
  456. })
  457. },
  458. // 征信高度Swiper
  459. onCreditHeight() {
  460. this.creditHeight = '100%'
  461. this.$nextTick(() => {
  462. const query = uni.createSelectorQuery().in(this);
  463. setTimeout(() => {
  464. query.select('.property').boundingClientRect(data => {
  465. if (data) {
  466. this.creditHeight = data.height
  467. uni.pageScrollTo({
  468. scrollTop: 0,
  469. duration: 300
  470. });
  471. }
  472. }).exec();
  473. }, 200)
  474. })
  475. },
  476. // 征信高度Swiper
  477. onCreditSwiper(swiper, index) {
  478. this.creditHeight = '100%'
  479. const query = uni.createSelectorQuery().in(this);
  480. this.$nextTick(() => {
  481. setTimeout(() => {
  482. if (index == 0) {
  483. query.select('.property').boundingClientRect(data => {
  484. if (data) {
  485. this.creditHeight = data.height
  486. }
  487. }).exec();
  488. }
  489. if (index == 1) {
  490. query.select('.credit_list').boundingClientRect(data => {
  491. if (data) {
  492. this.creditHeight = data.height
  493. }
  494. }).exec();
  495. }
  496. uni.pageScrollTo({
  497. scrollTop: 0,
  498. duration: 300
  499. });
  500. }, 200)
  501. })
  502. },
  503. onChange(current) {
  504. if (current == 1) {
  505. this.getDetailsHeight()
  506. }
  507. if (current == 2) {
  508. this.onCreditHeight()
  509. }
  510. this.current = current
  511. uni.pageScrollTo({
  512. scrollTop: 0,
  513. duration: 300
  514. });
  515. },
  516. onSubmit() {
  517. uni.navigateTo({
  518. url: "/page_task/task_operate/task_operate"
  519. })
  520. }
  521. }
  522. }
  523. </script>
  524. <style lang="scss" scoped>
  525. .details_body {
  526. width: 100%;
  527. position: absolute;
  528. }
  529. .detail-bg {
  530. position: relative;
  531. }
  532. .detail-img {
  533. width: calc(100%);
  534. height: 220rpx;
  535. }
  536. .detail-content {
  537. position: absolute;
  538. top: 10rpx;
  539. left: 20rpx;
  540. .top-titke {
  541. height: 75rpx;
  542. line-height: 75rpx;
  543. // background: red;
  544. }
  545. .detail-line {
  546. width: 2rpx;
  547. height: 24rpx;
  548. background-color: #FFFFFF;
  549. }
  550. .buttom-titke {
  551. flex: 1;
  552. margin-top: 40rpx;
  553. height: 90rpx;
  554. width: 635rpx;
  555. line-height: 90rpx;
  556. border-radius: 20rpx;
  557. padding: 0 20rpx;
  558. }
  559. }
  560. .swiper-wrapper {
  561. z-index: 0 !important;
  562. }
  563. </style>