task_details.vue 17 KB

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