task_details.vue 16 KB

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