task_details.vue 12 KB

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