task_details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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" mode="aspectFill">
  11. </image>
  12. <text class="size-28 m-lr16">{{business.name}}</text>
  13. <view class="size-24 row-c sys-bg-007038 r-100 p-lr16 p-tb6">
  14. <text>{{business.sex===1?'男':'女'}}</text>
  15. <view class="detail-line m-lr10"></view>
  16. <text>{{business.age}}岁</text>
  17. </view>
  18. <view class="row-c size-24 sys-bg-007038 r-100 p-lr16 p-tb6 m-l20">
  19. <image class="wh-20" src="/page_task/static/img/task-details/phone-two.png"
  20. mode="aspectFill">
  21. </image>
  22. <text>{{business.phone}}</text>
  23. </view>
  24. <image class="wh-60 animate__animated animate__fadeInDownBig" v-if="business.status>0"
  25. style="position: absolute;right: 20rpx;"
  26. :src="'/page_task/static/img/task-details/icon-'+business.status+'.png'"
  27. mode="aspectFill">
  28. </image>
  29. </view>
  30. <view class="row-justify-sb center buttom-titke sys-bg-BFD2CC text-color-12 size-24">
  31. <text class="size-28 text-color-E21 sys-weight-600">{{applyFor.quota}}万</text>
  32. <text>{{business.status_name}}</text>
  33. <text>{{applyFor.use_date}}用款</text>
  34. <view class="row-c">
  35. <image class="wh-25 m-r10" src="/page_task/static/img/task-details/usrr.png" mode="">
  36. </image>
  37. <text>{{business.creation_name}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <TaskTab :current="current" @onChange="onChange"></TaskTab>
  43. </view>
  44. </Nav>
  45. <view class="sys-list-background-color task-tabs-width page-env-160"
  46. :style="{top:`${$tools.topHeight()+fixedHeight}px`}">
  47. <view class="m-t20">
  48. <z-swiper ref="zSwiper" v-model="list" :options="options" v-if="current === 1">
  49. <z-swiper-item>
  50. <Identity :business="business" :linkman="linkman" :client-key="clientKey" @onShowImg="onShowImg"
  51. :linkman-key="linkmanKey"></Identity>
  52. </z-swiper-item>
  53. <z-swiper-item v-show="product.product_types.indexOf('3')>=0">
  54. <Apply :apply-for="applyFor" :applies-key="appliesKey" @onShowImg="onShowImg"></Apply>
  55. </z-swiper-item>
  56. <z-swiper-item v-show="product.product_types.indexOf('4')>=0">
  57. <ThirdParty :tripartite="tripartite" :tripartite-key="tripartiteKey" @onShowImg="onShowImg"></ThirdParty>
  58. </z-swiper-item>
  59. </z-swiper>
  60. <view class="" v-if="current === 2">
  61. <z-swiper v-model="lists" :options="options">
  62. <z-swiper-item>
  63. <Property :property-list="propertyList" :property-key="propertyKey" @onShowImg="onShowImg"></Property>
  64. </z-swiper-item>
  65. <z-swiper-item>
  66. <credit-list :credit-data="credit" :credit-key="creditKey" @onShowImg="onShowImg"></credit-list>
  67. </z-swiper-item>
  68. </z-swiper>
  69. </view>
  70. </view>
  71. <Record v-show="current === 3" ref="recordObj" :business-id="businessId" @onShowImg="onShowImg"></Record>
  72. <Steps ref="stepsObj" v-show="current === 4" :business-id="businessId"></Steps>
  73. </view>
  74. <view v-if="isExecute>0 && business.status<4">
  75. <EnButton v-if="isExecute===3" :text="'领取'" @onSubmit="takeTask"></EnButton>
  76. <EnButton v-else-if="isExecute===2" :is_both="1" :leftText="'作废'" :rightText="'反馈'"
  77. @onLeftSubmit="cancellation" @onSubmit="setTaskOperate(3)"></EnButton>
  78. <EnButton v-else-if="isExecute===4" :is_both="2" :leftText="'作废'" :rightText="'反馈'" centre-text="交接"
  79. @onLeftSubmit="cancellation" @onCentreSubmit="openExecute" @onSubmit="setTaskOperate(3)"></EnButton>
  80. <EnButton v-else-if="isExecute===5" :text="'完成'" @onSubmit="endTask"></EnButton>
  81. <EnButton v-else-if="isExecute===6" :is_both="1" :leftText="'拒绝'" :rightText="'同意'"
  82. @onLeftSubmit="auditTask(2)" @onSubmit="auditTask(1)"></EnButton>
  83. <EnButton v-else-if="isExecute===7" text="编辑" @onSubmit="editTask()"></EnButton>
  84. <EnButton v-else-if="isExecute===8" text="完善贷后" @onSubmit="setPostLoan()"></EnButton>
  85. <EnButton :is_both="1" :leftText="'交接'" :rightText="'操作'" v-else @onLeftSubmit="openExecute"
  86. @onSubmit="setTaskOperate(1)"></EnButton>
  87. </view>
  88. <!-- <EnButton :text="'冲销'" v-if="current === 1"></EnButton>-->
  89. <!-- <EnButton is_both :leftText="'交接'" :rightText="'操作'" @onSubmit="setTaskOperate(1)" @onLeftSubmit="openExecute"></EnButton>-->
  90. <uni-popup ref="executePopup" type="bottom">
  91. <EnSelect title="请选择任务接收人" :local-data="executeData" ref="system" v-model="executeId"
  92. @setAffirm="setNewExecute"></EnSelect>
  93. </uni-popup>
  94. </view>
  95. </template>
  96. <script>
  97. import TaskTab from "@/common/task/task_tab.vue"
  98. // 身份信息
  99. import Identity from "./module/identity.vue"
  100. // 申请信息
  101. import Apply from "./module/apply.vue"
  102. // 第三方信息
  103. import ThirdParty from "./module/third_party.vue"
  104. // 资产信息
  105. import Property from "./module/property.vue"
  106. // 审核进度
  107. import Steps from "./module/steps.vue"
  108. // 跟进记录
  109. import Record from "./module/record.vue"
  110. import tools from "@/service/tools";
  111. import {
  112. cancellation,
  113. endTask,
  114. getExecuteList,
  115. getStageList,
  116. getTaskDetail,
  117. setExecute,
  118. takeTask
  119. } from "@/api/task";
  120. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  121. import CreditList from "@/page_task/credit/credit.vue";
  122. export default {
  123. components: {
  124. CreditList,
  125. EnSelect,
  126. TaskTab,
  127. Identity,
  128. ThirdParty,
  129. Apply,
  130. Property,
  131. Record,
  132. Steps
  133. },
  134. data() {
  135. return {
  136. current: 1,
  137. fixedHeight: 195,
  138. options: {
  139. autoHeight: true,
  140. slidesPerView: 1.1,
  141. centeredSlides: true,
  142. spaceBetween: 10,
  143. effect: 'cards'
  144. },
  145. list: [1, 2, 3],
  146. lists: [1, 2],
  147. businessId: '',
  148. product: {
  149. product_name: '',
  150. product_types: [],
  151. type_data: []
  152. },
  153. business: {
  154. id:0,
  155. status: 0,
  156. phone: '',
  157. identity_one: '',
  158. identity_two: '',
  159. marriage_img: [],
  160. credit_img: [],
  161. }, //基本信息
  162. propertyList: [], //资产信息
  163. applyFor: {}, //申请信息
  164. credit: {}, //征信信息
  165. postLoan: {}, //贷后信息
  166. tripartite: [], //第三方信息
  167. linkman: [], //联系人信息
  168. stageData: {
  169. stageName: '',
  170. userName: ""
  171. },
  172. isAjax: false,
  173. isExecute: 0,
  174. msgList: [],
  175. executeData: [],
  176. showExecute: false,
  177. auditType: 0,
  178. previewList: [],
  179. imgKey: 0,
  180. imgList: [],
  181. replyId: "",
  182. stageList: [],
  183. businessStageList: [],
  184. businessFile: {
  185. fileList: [],
  186. imgList: [],
  187. videoList: [],
  188. },
  189. videoUrl: '',
  190. executeId: '',
  191. clientKey: [],
  192. propertyKey: [],
  193. appliesKey: [],
  194. tripartiteKey: [],
  195. linkmanKey: [],
  196. creditKey: [],
  197. }
  198. },
  199. onLoad(data) {
  200. console.log(data)
  201. if (data.taskId !== undefined) {
  202. this.businessId = data.taskId
  203. this.getTaskDetail()
  204. uni.$on('newTaskList', () => {
  205. this.getTaskDetail()
  206. this.$refs.stepsObj.getStageList()
  207. })
  208. } else {
  209. tools.leftClick()
  210. }
  211. },
  212. methods: {
  213. onShowImg(item) {
  214. if (this.businessFile.imgList.length < 0) {
  215. this.businessFile.imgList.push(item)
  216. }
  217. // 预览图片
  218. uni.previewImage({
  219. current: item,
  220. urls: this.businessFile.imgList,
  221. });
  222. },
  223. auditTask(auditType) {
  224. uni.navigateTo({
  225. url: '/page_task/task_operate/task_operate?businessId=' + this.business.id +
  226. '&type=2&auditType=' + auditType
  227. });
  228. },
  229. setPostLoan() {
  230. uni.navigateTo({
  231. url: '/pages-task/task-info/task-loan?id=' + this.business.id
  232. });
  233. },
  234. editTask() {
  235. uni.reLaunch({
  236. url: '/pages-task/add-client/new-add?businessId=' + this.business.id
  237. })
  238. },
  239. cancellation() {
  240. uni.showModal({
  241. title: '提示',
  242. content: '是否作废当前任务?',
  243. success: (res) => {
  244. console.log(res)
  245. if (res.confirm) {
  246. cancellation({
  247. 'id': this.business.id
  248. }).then((res) => {
  249. if (res.code === 1) {
  250. this.business.status = 5;
  251. this.isExecute = 0;
  252. tools.success(res.msg)
  253. uni.$emit('newReceiving')
  254. } else {
  255. tools.error(res.msg)
  256. }
  257. })
  258. }
  259. }
  260. });
  261. },
  262. endTask() {
  263. uni.showModal({
  264. title: '提示',
  265. content: '是否完成当前任务?',
  266. success: (res) => {
  267. console.log(res)
  268. if (res.confirm) {
  269. endTask({
  270. 'id': this.business.id
  271. }).then((res) => {
  272. if (res.code === 1) {
  273. this.business.status = 4;
  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. takeTask() {
  286. if (this.isAjax) {
  287. // return;
  288. }
  289. this.isAjax = true;
  290. takeTask({
  291. 'id': this.business.id
  292. }).then((res) => {
  293. if (res.code === 1) {
  294. tools.success('领取成功')
  295. uni.$emit('newReceiving')
  296. this.getTaskDetail()
  297. } else {
  298. this.isAjax = false;
  299. tools.error(res.msg)
  300. }
  301. })
  302. },
  303. setNewExecute(type) {
  304. if (type) {
  305. //设置新执行人
  306. if (this.executeId <= 0) {
  307. tools.error('请选择执行人')
  308. return
  309. }
  310. setExecute({
  311. 'business_id': this.businessId,
  312. 'user_id': this.executeId
  313. }).then((res) => {
  314. if (res.code === 1) {
  315. tools.success(res.msg)
  316. uni.$emit('newReceiving')
  317. this.getTaskDetail()
  318. } else {
  319. tools.error(res.msg)
  320. }
  321. })
  322. }
  323. this.$refs.executePopup.close('bottom')
  324. },
  325. openExecute() {
  326. this.executeData = [];
  327. getExecuteList({
  328. 'business_id': this.businessId
  329. }).then((res) => {
  330. if (res.code === 1) {
  331. this.executeData = res.data
  332. this.$refs.executePopup.open('bottom')
  333. }
  334. })
  335. },
  336. setTaskOperate(type) {
  337. uni.navigateTo({
  338. 'url': '/page_task/task_operate/task_operate?businessId=' + this.businessId + '&type=' + type
  339. })
  340. },
  341. async getTaskDetail() {
  342. const res = await getTaskDetail({
  343. id: this.businessId
  344. })
  345. if (res.code === 1) {
  346. this.product = res.data.product
  347. this.business = res.data.business
  348. this.propertyList = res.data.propertyList
  349. this.applyFor = res.data.applyFor
  350. this.tripartite = res.data.tripartite
  351. this.linkman = res.data.linkman
  352. this.credit = res.data.credit
  353. this.postLoan = res.data.postLoan
  354. this.stageData = res.data.stageData
  355. this.isExecute = res.data.isExecute
  356. this.businessFile = res.data.businessFile
  357. this.$refs.recordObj.startData()
  358. this.$refs.zSwiper.swiper
  359. this.setShowKey()
  360. } else {
  361. tools.leftClick()
  362. }
  363. },
  364. setShowKey() {
  365. this.product.type_data.forEach(item => {
  366. switch (item.type) {
  367. case '1':
  368. this.clientKey = item.type_keys
  369. break;
  370. case '2':
  371. this.propertyKey = item.type_keys
  372. break;
  373. case '3':
  374. this.appliesKey = item.type_keys
  375. break;
  376. case '4':
  377. this.tripartiteKey = item.type_keys
  378. break;
  379. case '5':
  380. this.linkmanKey = item.type_keys
  381. break;
  382. case '6':
  383. this.creditKey = item.type_keys
  384. break;
  385. }
  386. })
  387. },
  388. onChange(current) {
  389. this.current = current
  390. },
  391. onSubmit() {
  392. uni.navigateTo({
  393. url: "/page_task/task_operate/task_operate"
  394. })
  395. }
  396. }
  397. }
  398. </script>
  399. <style lang="scss" scoped>
  400. .details_body {
  401. width: 100%;
  402. position: absolute;
  403. }
  404. .detail-bg {
  405. position: relative;
  406. }
  407. .detail-img {
  408. width: calc(100%);
  409. height: 220rpx;
  410. }
  411. .detail-content {
  412. position: absolute;
  413. top: 10rpx;
  414. left: 20rpx;
  415. .top-titke {
  416. height: 75rpx;
  417. line-height: 75rpx;
  418. // background: red;
  419. }
  420. .detail-line {
  421. width: 2rpx;
  422. height: 24rpx;
  423. background-color: #FFFFFF;
  424. }
  425. .buttom-titke {
  426. flex: 1;
  427. margin-top: 40rpx;
  428. height: 90rpx;
  429. width: 635rpx;
  430. line-height: 90rpx;
  431. border-radius: 20rpx;
  432. padding: 0 20rpx;
  433. }
  434. }
  435. .swiper-wrapper {
  436. z-index: 0 !important;
  437. }
  438. </style>