task_details.vue 17 KB

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