task_details.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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" @click="makingCall(business.phone)">
  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.stageName}}</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 swiper-box">
  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 swiper-item" :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 swiper-item" :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 swiper-item" :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 swiper-item" :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 swiper-item" :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. makingCall(phone){
  230. tools.makingCall(phone)
  231. },
  232. onShowImg(item) {
  233. console.log(this.businessFile.imgList)
  234. let imgIndex=this.businessFile.imgList.indexOf(item)
  235. if (imgIndex < 0) {
  236. this.businessFile.imgList.push(item)
  237. imgIndex=this.businessFile.imgList.length-1
  238. }
  239. console.log(this.businessFile.imgList)
  240. // 预览图片
  241. uni.previewImage({
  242. current: imgIndex,
  243. urls: this.businessFile.imgList,
  244. });
  245. },
  246. auditTask(auditType) {
  247. uni.navigateTo({
  248. url: '/page_task/task_operate/task_operate?businessId=' + this.business.id +
  249. '&type=2&auditType=' + auditType
  250. });
  251. },
  252. setPostLoan() {
  253. uni.navigateTo({
  254. url: '/pages-task/task-info/task-loan?id=' + this.business.id
  255. });
  256. },
  257. editTask() {
  258. uni.reLaunch({
  259. url: '/pages-task/add-client/new-add?businessId=' + this.business.id
  260. })
  261. },
  262. cancellation() {
  263. uni.showModal({
  264. title: '提示',
  265. content: '是否作废当前任务?',
  266. success: (res) => {
  267. console.log(res)
  268. if (res.confirm) {
  269. cancellation({
  270. 'id': this.business.id
  271. }).then((res) => {
  272. if (res.code === 1) {
  273. this.business.status = 5;
  274. this.isExecute = 0;
  275. tools.success(res.msg)
  276. uni.$emit('newReceiving')
  277. } else {
  278. tools.error(res.msg)
  279. }
  280. })
  281. }
  282. }
  283. });
  284. },
  285. endTask() {
  286. uni.showModal({
  287. title: '提示',
  288. content: '是否完成当前任务?',
  289. success: (res) => {
  290. console.log(res)
  291. if (res.confirm) {
  292. endTask({
  293. 'id': this.business.id
  294. }).then((res) => {
  295. if (res.code === 1) {
  296. this.business.status = 4;
  297. this.isExecute = 0;
  298. tools.success(res.msg)
  299. uni.$emit('newReceiving')
  300. } else {
  301. tools.error(res.msg)
  302. }
  303. })
  304. }
  305. }
  306. });
  307. },
  308. takeTask() {
  309. if (this.isAjax) {
  310. // return;
  311. }
  312. this.isAjax = true;
  313. takeTask({
  314. 'id': this.business.id
  315. }).then((res) => {
  316. if (res.code === 1) {
  317. tools.success('领取成功')
  318. uni.$emit('newReceiving')
  319. this.getTaskDetail()
  320. } else {
  321. this.isAjax = false;
  322. tools.error(res.msg)
  323. }
  324. })
  325. },
  326. setNewExecute(type) {
  327. if (type) {
  328. //设置新执行人
  329. if (this.executeId <= 0) {
  330. tools.error('请选择执行人')
  331. return
  332. }
  333. setExecute({
  334. 'business_id': this.businessId,
  335. 'user_id': this.executeId
  336. }).then((res) => {
  337. if (res.code === 1) {
  338. tools.success(res.msg)
  339. uni.$emit('newReceiving')
  340. this.getTaskDetail()
  341. } else {
  342. tools.error(res.msg)
  343. }
  344. })
  345. }
  346. this.$refs.executePopup.close('bottom')
  347. },
  348. openExecute() {
  349. this.executeData = [];
  350. getExecuteList({
  351. 'business_id': this.businessId
  352. }).then((res) => {
  353. if (res.code === 1) {
  354. this.executeData = res.data
  355. this.$refs.executePopup.open('bottom')
  356. }
  357. })
  358. },
  359. setTaskOperate(type) {
  360. uni.navigateTo({
  361. 'url': '/page_task/task_operate/task_operate?businessId=' + this.businessId + '&type=' + type
  362. })
  363. },
  364. async getTaskDetail() {
  365. const res = await getTaskDetail({
  366. id: this.businessId
  367. })
  368. if (res.code === 1) {
  369. this.product = res.data.product
  370. this.business = res.data.business
  371. this.business.stageName = res.data.stageData.stageName
  372. this.propertyList = res.data.propertyList
  373. this.applyFor = res.data.applyFor
  374. this.tripartite = res.data.tripartite
  375. this.linkman = res.data.linkman
  376. this.credit = res.data.credit
  377. this.postLoan = res.data.postLoan
  378. this.stageData = res.data.stageData
  379. this.isExecute = res.data.isExecute
  380. this.businessFile = res.data.businessFile
  381. this.$refs.recordObj.startData()
  382. this.$refs.zSwiper.swiper
  383. this.getDetailsHeight()
  384. this.setShowKey()
  385. } else {
  386. tools.leftClick()
  387. }
  388. },
  389. setShowKey() {
  390. this.product.type_data.forEach(item => {
  391. switch (item.type) {
  392. case '1':
  393. this.clientKey = item.type_keys
  394. break;
  395. case '2':
  396. this.propertyKey = item.type_keys
  397. break;
  398. case '3':
  399. this.appliesKey = item.type_keys
  400. break;
  401. case '4':
  402. this.tripartiteKey = item.type_keys
  403. break;
  404. case '5':
  405. this.linkmanKey = item.type_keys
  406. break;
  407. case '6':
  408. this.creditKey = item.type_keys
  409. break;
  410. }
  411. })
  412. },
  413. // 获取详情高度Swiper
  414. getDetailsHeight() {
  415. this.maxHeight = '100%'
  416. this.$nextTick(() => {
  417. const query = uni.createSelectorQuery().in(this);
  418. setTimeout(() => {
  419. query.select('.identity').boundingClientRect(data => {
  420. if (data) {
  421. this.maxHeight = data.height
  422. console.log(this.maxHeight);
  423. uni.pageScrollTo({
  424. scrollTop: 0,
  425. duration: 300
  426. });
  427. }
  428. }).exec();
  429. }, 200)
  430. })
  431. },
  432. // 获取详情高度Swiper
  433. onSwiper(swiper, index) {
  434. this.maxHeight = '100%'
  435. const query = uni.createSelectorQuery().in(this);
  436. this.$nextTick(() => {
  437. setTimeout(() => {
  438. if (index == 0) {
  439. query.select('.identity').boundingClientRect(data => {
  440. if (data) {
  441. this.maxHeight = data.height
  442. }
  443. }).exec();
  444. }
  445. if (index == 1) {
  446. query.select('.apply').boundingClientRect(data => {
  447. if (data) {
  448. this.maxHeight = data.height
  449. }
  450. }).exec();
  451. }
  452. if (index == 2) {
  453. query.select('.third_party').boundingClientRect(data => {
  454. if (data) {
  455. this.maxHeight = data.height
  456. }
  457. }).exec();
  458. }
  459. uni.pageScrollTo({
  460. scrollTop: 0,
  461. duration: 300
  462. });
  463. }, 200)
  464. })
  465. },
  466. // 征信高度Swiper
  467. onCreditHeight() {
  468. this.creditHeight = '100%'
  469. this.$nextTick(() => {
  470. const query = uni.createSelectorQuery().in(this);
  471. setTimeout(() => {
  472. query.select('.property').boundingClientRect(data => {
  473. if (data) {
  474. this.creditHeight = data.height
  475. uni.pageScrollTo({
  476. scrollTop: 0,
  477. duration: 300
  478. });
  479. }
  480. }).exec();
  481. }, 200)
  482. })
  483. },
  484. // 征信高度Swiper
  485. onCreditSwiper(swiper, index) {
  486. this.creditHeight = '100%'
  487. const query = uni.createSelectorQuery().in(this);
  488. this.$nextTick(() => {
  489. setTimeout(() => {
  490. if (index == 0) {
  491. query.select('.property').boundingClientRect(data => {
  492. if (data) {
  493. this.creditHeight = data.height
  494. }
  495. }).exec();
  496. }
  497. if (index == 1) {
  498. query.select('.credit_list').boundingClientRect(data => {
  499. if (data) {
  500. this.creditHeight = data.height
  501. }
  502. }).exec();
  503. }
  504. uni.pageScrollTo({
  505. scrollTop: 0,
  506. duration: 300
  507. });
  508. }, 200)
  509. })
  510. },
  511. onChange(current) {
  512. if (current == 1) {
  513. this.getDetailsHeight()
  514. }
  515. if (current == 2) {
  516. this.onCreditHeight()
  517. }
  518. this.current = current
  519. uni.pageScrollTo({
  520. scrollTop: 0,
  521. duration: 300
  522. });
  523. },
  524. onSubmit() {
  525. uni.navigateTo({
  526. url: "/page_task/task_operate/task_operate"
  527. })
  528. }
  529. }
  530. }
  531. </script>
  532. <style lang="scss" scoped>
  533. .swiper-box{
  534. .swiper-item{
  535. transition: .5s ease;
  536. }
  537. }
  538. .details_body {
  539. width: 100%;
  540. position: absolute;
  541. }
  542. .detail-bg {
  543. position: relative;
  544. }
  545. .detail-img {
  546. width: calc(100%);
  547. height: 220rpx;
  548. }
  549. .detail-content {
  550. position: absolute;
  551. top: 10rpx;
  552. left: 20rpx;
  553. .top-titke {
  554. height: 75rpx;
  555. line-height: 75rpx;
  556. // background: red;
  557. }
  558. .detail-line {
  559. width: 2rpx;
  560. height: 24rpx;
  561. background-color: #FFFFFF;
  562. }
  563. .buttom-titke {
  564. flex: 1;
  565. margin-top: 40rpx;
  566. height: 90rpx;
  567. width: 635rpx;
  568. line-height: 90rpx;
  569. border-radius: 20rpx;
  570. padding: 0 20rpx;
  571. }
  572. }
  573. .swiper-wrapper {
  574. z-index: 0 !important;
  575. }
  576. </style>