task_details.vue 12 KB

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