task_details.vue 17 KB

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