task_details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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. <Property :property-list="propertyList" :property-key="propertyKey" @onShowImg="onShowImg"></Property>
  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. export default {
  122. components: {
  123. EnSelect,
  124. TaskTab,
  125. Identity,
  126. ThirdParty,
  127. Apply,
  128. Property,
  129. Record,
  130. Steps
  131. },
  132. data() {
  133. return {
  134. current: 1,
  135. fixedHeight: 195,
  136. options: {
  137. autoHeight: true,
  138. slidesPerView: 1.1,
  139. centeredSlides: true,
  140. spaceBetween: 10,
  141. effect: 'cards'
  142. },
  143. list: [1, 2, 3],
  144. lists: [1, 2],
  145. businessId: '',
  146. product: {
  147. product_name: '',
  148. product_types: [],
  149. type_data: []
  150. },
  151. business: {
  152. id:0,
  153. status: 0,
  154. phone: '',
  155. identity_one: '',
  156. identity_two: '',
  157. marriage_img: [],
  158. credit_img: [],
  159. }, //基本信息
  160. propertyList: [], //资产信息
  161. applyFor: {}, //申请信息
  162. credit: {}, //征信信息
  163. postLoan: {}, //贷后信息
  164. tripartite: [], //第三方信息
  165. linkman: [], //联系人信息
  166. stageData: {
  167. stageName: '',
  168. userName: ""
  169. },
  170. isAjax: false,
  171. isExecute: 0,
  172. msgList: [],
  173. executeData: [],
  174. showExecute: false,
  175. auditType: 0,
  176. previewList: [],
  177. imgKey: 0,
  178. imgList: [],
  179. replyId: "",
  180. stageList: [],
  181. businessStageList: [],
  182. businessFile: {
  183. fileList: [],
  184. imgList: [],
  185. videoList: [],
  186. },
  187. videoUrl: '',
  188. executeId: '',
  189. clientKey: [],
  190. propertyKey: [],
  191. appliesKey: [],
  192. tripartiteKey: [],
  193. linkmanKey: [],
  194. creditKey: [],
  195. }
  196. },
  197. onLoad(data) {
  198. console.log(data)
  199. if (data.taskId !== undefined) {
  200. this.businessId = data.taskId
  201. this.getTaskDetail()
  202. uni.$on('newTaskList', () => {
  203. this.getTaskDetail()
  204. this.$refs.stepsObj.getStageList()
  205. })
  206. } else {
  207. tools.leftClick()
  208. }
  209. },
  210. methods: {
  211. onShowImg(item) {
  212. if (this.businessFile.imgList.length < 0) {
  213. this.businessFile.imgList.push(item)
  214. }
  215. // 预览图片
  216. uni.previewImage({
  217. current: item,
  218. urls: this.businessFile.imgList,
  219. });
  220. },
  221. auditTask(auditType) {
  222. uni.navigateTo({
  223. url: '/page_task/task_operate/task_operate?businessId=' + this.business.id +
  224. '&type=2&auditType=' + auditType
  225. });
  226. },
  227. setPostLoan() {
  228. uni.navigateTo({
  229. url: '/pages-task/task-info/task-loan?id=' + this.business.id
  230. });
  231. },
  232. editTask() {
  233. uni.reLaunch({
  234. url: '/pages-task/add-client/new-add?businessId=' + this.business.id
  235. })
  236. },
  237. cancellation() {
  238. uni.showModal({
  239. title: '提示',
  240. content: '是否作废当前任务?',
  241. success: (res) => {
  242. console.log(res)
  243. if (res.confirm) {
  244. cancellation({
  245. 'id': this.business.id
  246. }).then((res) => {
  247. if (res.code === 1) {
  248. this.business.status = 5;
  249. this.isExecute = 0;
  250. tools.success(res.msg)
  251. uni.$emit('newReceiving')
  252. } else {
  253. tools.error(res.msg)
  254. }
  255. })
  256. }
  257. }
  258. });
  259. },
  260. endTask() {
  261. uni.showModal({
  262. title: '提示',
  263. content: '是否完成当前任务?',
  264. success: (res) => {
  265. console.log(res)
  266. if (res.confirm) {
  267. endTask({
  268. 'id': this.business.id
  269. }).then((res) => {
  270. if (res.code === 1) {
  271. this.business.status = 4;
  272. this.isExecute = 0;
  273. tools.success(res.msg)
  274. uni.$emit('newReceiving')
  275. } else {
  276. tools.error(res.msg)
  277. }
  278. })
  279. }
  280. }
  281. });
  282. },
  283. takeTask() {
  284. if (this.isAjax) {
  285. // return;
  286. }
  287. this.isAjax = true;
  288. takeTask({
  289. 'id': this.business.id
  290. }).then((res) => {
  291. if (res.code === 1) {
  292. tools.success('领取成功')
  293. uni.$emit('newReceiving')
  294. this.getTaskDetail()
  295. } else {
  296. this.isAjax = false;
  297. tools.error(res.msg)
  298. }
  299. })
  300. },
  301. setNewExecute(type) {
  302. if (type) {
  303. //设置新执行人
  304. if (this.executeId <= 0) {
  305. tools.error('请选择执行人')
  306. return
  307. }
  308. setExecute({
  309. 'business_id': this.businessId,
  310. 'user_id': this.executeId
  311. }).then((res) => {
  312. if (res.code === 1) {
  313. tools.success(res.msg)
  314. uni.$emit('newReceiving')
  315. this.getTaskDetail()
  316. } else {
  317. tools.error(res.msg)
  318. }
  319. })
  320. }
  321. this.$refs.executePopup.close('bottom')
  322. },
  323. openExecute() {
  324. this.executeData = [];
  325. getExecuteList({
  326. 'business_id': this.businessId
  327. }).then((res) => {
  328. if (res.code === 1) {
  329. this.executeData = res.data
  330. this.$refs.executePopup.open('bottom')
  331. }
  332. })
  333. },
  334. setTaskOperate(type) {
  335. uni.navigateTo({
  336. 'url': '/page_task/task_operate/task_operate?businessId=' + this.businessId + '&type=' + type
  337. })
  338. },
  339. async getTaskDetail() {
  340. const res = await getTaskDetail({
  341. id: this.businessId
  342. })
  343. if (res.code === 1) {
  344. this.product = res.data.product
  345. this.business = res.data.business
  346. this.propertyList = res.data.propertyList
  347. this.applyFor = res.data.applyFor
  348. this.tripartite = res.data.tripartite
  349. this.linkman = res.data.linkman
  350. this.credit = res.data.credit
  351. this.postLoan = res.data.postLoan
  352. this.stageData = res.data.stageData
  353. this.isExecute = res.data.isExecute
  354. this.businessFile = res.data.businessFile
  355. this.$refs.recordObj.startData()
  356. this.$refs.zSwiper.swiper
  357. this.setShowKey()
  358. } else {
  359. tools.leftClick()
  360. }
  361. },
  362. setShowKey() {
  363. this.product.type_data.forEach(item => {
  364. switch (item.type) {
  365. case '1':
  366. this.clientKey = item.type_keys
  367. break;
  368. case '2':
  369. this.propertyKey = item.type_keys
  370. break;
  371. case '3':
  372. this.appliesKey = item.type_keys
  373. break;
  374. case '4':
  375. this.tripartiteKey = item.type_keys
  376. break;
  377. case '5':
  378. this.linkmanKey = item.type_keys
  379. break;
  380. case '6':
  381. this.creditKey = item.type_keys
  382. break;
  383. }
  384. })
  385. },
  386. onChange(current) {
  387. this.current = current
  388. },
  389. onSubmit() {
  390. uni.navigateTo({
  391. url: "/page_task/task_operate/task_operate"
  392. })
  393. }
  394. }
  395. }
  396. </script>
  397. <style lang="scss" scoped>
  398. .details_body {
  399. width: 100%;
  400. position: absolute;
  401. }
  402. .detail-bg {
  403. position: relative;
  404. }
  405. .detail-img {
  406. width: calc(100%);
  407. height: 220rpx;
  408. }
  409. .detail-content {
  410. position: absolute;
  411. top: 10rpx;
  412. left: 20rpx;
  413. .top-titke {
  414. height: 75rpx;
  415. line-height: 75rpx;
  416. // background: red;
  417. }
  418. .detail-line {
  419. width: 2rpx;
  420. height: 24rpx;
  421. background-color: #FFFFFF;
  422. }
  423. .buttom-titke {
  424. flex: 1;
  425. margin-top: 40rpx;
  426. height: 90rpx;
  427. width: 635rpx;
  428. line-height: 90rpx;
  429. border-radius: 20rpx;
  430. padding: 0 20rpx;
  431. }
  432. }
  433. .swiper-wrapper {
  434. z-index: 0 !important;
  435. }
  436. </style>