task_details.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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" @close="closeExecutePopup"></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. closeExecutePopup(){
  327. this.$refs.executePopup.close('bottom')
  328. },
  329. setNewExecute(type) {
  330. if (type) {
  331. //设置新执行人
  332. if (this.executeId <= 0) {
  333. tools.error('请选择执行人')
  334. return
  335. }
  336. setExecute({
  337. 'business_id': this.businessId,
  338. 'user_id': this.executeId
  339. }).then((res) => {
  340. if (res.code === 1) {
  341. tools.success(res.msg)
  342. uni.$emit('newReceiving')
  343. this.getTaskDetail()
  344. } else {
  345. tools.error(res.msg)
  346. }
  347. })
  348. }
  349. this.$refs.executePopup.close('bottom')
  350. },
  351. openExecute() {
  352. this.executeData = [];
  353. getExecuteList({
  354. 'business_id': this.businessId
  355. }).then((res) => {
  356. if (res.code === 1) {
  357. this.executeData = res.data
  358. this.$refs.executePopup.open('bottom')
  359. }
  360. })
  361. },
  362. setTaskOperate(type) {
  363. uni.navigateTo({
  364. 'url': '/page_task/task_operate/task_operate?businessId=' + this.businessId + '&type=' + type
  365. })
  366. },
  367. async getTaskDetail() {
  368. const res = await getTaskDetail({
  369. id: this.businessId
  370. })
  371. if (res.code === 1) {
  372. this.product = res.data.product
  373. this.business = res.data.business
  374. this.business.stageName = res.data.stageData.stageName
  375. this.propertyList = res.data.propertyList
  376. this.applyFor = res.data.applyFor
  377. this.tripartite = res.data.tripartite
  378. this.linkman = res.data.linkman
  379. this.credit = res.data.credit
  380. this.postLoan = res.data.postLoan
  381. this.stageData = res.data.stageData
  382. this.isExecute = res.data.isExecute
  383. this.businessFile = res.data.businessFile
  384. this.$refs.recordObj.startData()
  385. this.$refs.zSwiper.swiper
  386. this.getDetailsHeight()
  387. this.setShowKey()
  388. } else {
  389. tools.leftClick()
  390. }
  391. },
  392. setShowKey() {
  393. this.product.type_data.forEach(item => {
  394. switch (item.type) {
  395. case '1':
  396. this.clientKey = item.type_keys
  397. break;
  398. case '2':
  399. this.propertyKey = item.type_keys
  400. break;
  401. case '3':
  402. this.appliesKey = item.type_keys
  403. break;
  404. case '4':
  405. this.tripartiteKey = item.type_keys
  406. break;
  407. case '5':
  408. this.linkmanKey = item.type_keys
  409. break;
  410. case '6':
  411. this.creditKey = item.type_keys
  412. break;
  413. }
  414. })
  415. },
  416. // 获取详情高度Swiper
  417. getDetailsHeight() {
  418. this.maxHeight = '100%'
  419. this.$nextTick(() => {
  420. const query = uni.createSelectorQuery().in(this);
  421. setTimeout(() => {
  422. query.select('.identity').boundingClientRect(data => {
  423. if (data) {
  424. this.maxHeight = data.height
  425. console.log(this.maxHeight);
  426. uni.pageScrollTo({
  427. scrollTop: 0,
  428. duration: 300
  429. });
  430. }
  431. }).exec();
  432. }, 200)
  433. })
  434. },
  435. // 获取详情高度Swiper
  436. onSwiper(swiper, index) {
  437. this.maxHeight = '100%'
  438. const query = uni.createSelectorQuery().in(this);
  439. this.$nextTick(() => {
  440. setTimeout(() => {
  441. if (index == 0) {
  442. query.select('.identity').boundingClientRect(data => {
  443. if (data) {
  444. this.maxHeight = data.height
  445. }
  446. }).exec();
  447. }
  448. if (index == 1) {
  449. query.select('.apply').boundingClientRect(data => {
  450. if (data) {
  451. this.maxHeight = data.height
  452. }
  453. }).exec();
  454. }
  455. if (index == 2) {
  456. query.select('.third_party').boundingClientRect(data => {
  457. if (data) {
  458. this.maxHeight = data.height
  459. }
  460. }).exec();
  461. }
  462. uni.pageScrollTo({
  463. scrollTop: 0,
  464. duration: 300
  465. });
  466. }, 200)
  467. })
  468. },
  469. // 征信高度Swiper
  470. onCreditHeight() {
  471. this.creditHeight = '100%'
  472. this.$nextTick(() => {
  473. const query = uni.createSelectorQuery().in(this);
  474. setTimeout(() => {
  475. query.select('.property').boundingClientRect(data => {
  476. if (data) {
  477. this.creditHeight = data.height
  478. uni.pageScrollTo({
  479. scrollTop: 0,
  480. duration: 300
  481. });
  482. }
  483. }).exec();
  484. }, 200)
  485. })
  486. },
  487. // 征信高度Swiper
  488. onCreditSwiper(swiper, index) {
  489. this.creditHeight = '100%'
  490. const query = uni.createSelectorQuery().in(this);
  491. this.$nextTick(() => {
  492. setTimeout(() => {
  493. if (index == 0) {
  494. query.select('.property').boundingClientRect(data => {
  495. if (data) {
  496. this.creditHeight = data.height
  497. }
  498. }).exec();
  499. }
  500. if (index == 1) {
  501. query.select('.credit_list').boundingClientRect(data => {
  502. if (data) {
  503. this.creditHeight = data.height
  504. }
  505. }).exec();
  506. }
  507. uni.pageScrollTo({
  508. scrollTop: 0,
  509. duration: 300
  510. });
  511. }, 200)
  512. })
  513. },
  514. onChange(current) {
  515. if (current == 1) {
  516. this.getDetailsHeight()
  517. }
  518. if (current == 2) {
  519. this.onCreditHeight()
  520. }
  521. this.current = current
  522. uni.pageScrollTo({
  523. scrollTop: 0,
  524. duration: 300
  525. });
  526. },
  527. onSubmit() {
  528. uni.navigateTo({
  529. url: "/page_task/task_operate/task_operate"
  530. })
  531. }
  532. }
  533. }
  534. </script>
  535. <style lang="scss" scoped>
  536. .swiper-box{
  537. .swiper-item{
  538. transition: .5s ease;
  539. }
  540. }
  541. .details_body {
  542. width: 100%;
  543. position: absolute;
  544. }
  545. .detail-bg {
  546. position: relative;
  547. }
  548. .detail-img {
  549. width: calc(100%);
  550. height: 220rpx;
  551. }
  552. .detail-content {
  553. position: absolute;
  554. top: 10rpx;
  555. left: 20rpx;
  556. .top-titke {
  557. height: 75rpx;
  558. line-height: 75rpx;
  559. // background: red;
  560. }
  561. .detail-line {
  562. width: 2rpx;
  563. height: 24rpx;
  564. background-color: #FFFFFF;
  565. }
  566. .buttom-titke {
  567. flex: 1;
  568. margin-top: 40rpx;
  569. height: 90rpx;
  570. width: 635rpx;
  571. line-height: 90rpx;
  572. border-radius: 20rpx;
  573. padding: 0 20rpx;
  574. }
  575. }
  576. .swiper-wrapper {
  577. z-index: 0 !important;
  578. }
  579. .video-box {
  580. height: 70vh;
  581. width: 100vw;
  582. .myVideo {
  583. height: 70vh;
  584. width: 100vw;
  585. }
  586. }
  587. </style>