task_details.vue 12 KB

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