task_details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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="/static/img/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="/static/img/task-details/phone-two.png" mode="aspectFill">
  19. </image>
  20. <text>{{business.phone}}</text>
  21. </view>
  22. <image class="wh-60 animate__animated animate__zoomIn"
  23. style="position: absolute;right: 20rpx;" src="/static/img/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="/static/img/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. } else {
  178. tools.leftClick()
  179. }
  180. },
  181. methods: {
  182. auditTask(auditType) {
  183. this.$refs.popup.open("bottom");
  184. this.auditType = auditType
  185. this.$refs.taskSetObj.startAuditType(auditType);
  186. },
  187. setPostLoan(){
  188. uni.navigateTo({
  189. url: '/pages-task/task-info/task-loan?id=' + this.business.id
  190. });
  191. },
  192. editTask() {
  193. // uni.reLaunch({
  194. // url: '/pages/add-client/add-client?businessId=' + this.business.id
  195. // })
  196. uni.reLaunch({
  197. url: '/pages-task/add-client/new-add?businessId=' + this.business.id
  198. })
  199. },
  200. cancellation() {
  201. uni.showModal({
  202. title: '提示',
  203. content: '是否作废当前任务?',
  204. success: (res) => {
  205. console.log(res)
  206. if (res.confirm) {
  207. cancellation({
  208. 'id': this.business.id
  209. }).then((res) => {
  210. if (res.code === 1) {
  211. this.business.status = 5;
  212. this.isExecute = 0;
  213. tools.success(res.msg)
  214. uni.$emit('newReceiving')
  215. } else {
  216. tools.error(res.msg)
  217. }
  218. })
  219. }
  220. }
  221. });
  222. },
  223. endTask() {
  224. uni.showModal({
  225. title: '提示',
  226. content: '是否完成当前任务?',
  227. success: (res) => {
  228. console.log(res)
  229. if (res.confirm) {
  230. endTask({
  231. 'id': this.business.id
  232. }).then((res) => {
  233. if (res.code === 1) {
  234. this.business.status = 4;
  235. this.isExecute = 0;
  236. tools.success(res.msg)
  237. uni.$emit('newReceiving')
  238. } else {
  239. tools.error(res.msg)
  240. }
  241. })
  242. }
  243. }
  244. });
  245. },
  246. takeTask() {
  247. if (this.isAjax) {
  248. // return;
  249. }
  250. this.isAjax = true;
  251. takeTask({
  252. 'id': this.business.id
  253. }).then((res) => {
  254. if (res.code === 1) {
  255. tools.success('领取成功')
  256. uni.$emit('newReceiving')
  257. this.getTaskDetail()
  258. } else {
  259. this.isAjax = false;
  260. tools.error(res.msg)
  261. }
  262. })
  263. },
  264. setNewExecute(type) {
  265. if(type){
  266. //设置新执行人
  267. if(this.executeId<=0){
  268. tools.error('请选择执行人')
  269. return
  270. }
  271. setExecute({
  272. 'business_id': this.businessId,
  273. 'user_id': this.executeId
  274. }).then((res) => {
  275. if (res.code === 1) {
  276. tools.success(res.msg)
  277. uni.$emit('newReceiving')
  278. this.getTaskDetail()
  279. } else {
  280. tools.error(res.msg)
  281. }
  282. })
  283. }
  284. this.$refs.executePopup.close('bottom')
  285. },
  286. openExecute() {
  287. this.executeData = [];
  288. getExecuteList({
  289. 'business_id': this.businessId
  290. }).then((res) => {
  291. if (res.code === 1) {
  292. this.executeData=res.data
  293. this.$refs.executePopup.open('bottom')
  294. }
  295. })
  296. },
  297. setTaskOperate(type){
  298. uni.navigateTo({
  299. 'url':'/page_task/task_operate/task_operate?businessId='+this.businessId+'&type='+type
  300. })
  301. },
  302. async getTaskDetail() {
  303. const res = await getTaskDetail({
  304. id: this.businessId
  305. })
  306. if (res.code === 1) {
  307. this.product = res.data.product
  308. this.business = res.data.business
  309. this.propertyList = res.data.propertyList
  310. this.applyFor = res.data.applyFor
  311. this.tripartite = res.data.tripartite
  312. this.linkman = res.data.linkman
  313. this.credit = res.data.credit
  314. this.postLoan = res.data.postLoan
  315. this.stageData = res.data.stageData
  316. this.isExecute = res.data.isExecute
  317. this.businessFile = res.data.businessFile
  318. this.$refs.recordObj.startData()
  319. } else {
  320. tools.leftClick()
  321. }
  322. },
  323. onChange(current) {
  324. this.current = current
  325. },
  326. onSubmit() {
  327. uni.navigateTo({
  328. url: "/page_task/task_operate/task_operate"
  329. })
  330. }
  331. }
  332. }
  333. </script>
  334. <style lang="scss" scoped>
  335. .details_body {
  336. width: 100%;
  337. position: absolute;
  338. }
  339. .detail-bg {
  340. position: relative;
  341. }
  342. .detail-img {
  343. width: calc(100%);
  344. height: 220rpx;
  345. }
  346. .detail-content {
  347. position: absolute;
  348. top: 10rpx;
  349. left: 20rpx;
  350. .top-titke {
  351. height: 75rpx;
  352. line-height: 75rpx;
  353. // background: red;
  354. }
  355. .detail-line {
  356. width: 2rpx;
  357. height: 24rpx;
  358. background-color: #FFFFFF;
  359. }
  360. .buttom-titke {
  361. flex: 1;
  362. margin-top: 40rpx;
  363. height: 90rpx;
  364. width: 635rpx;
  365. line-height: 90rpx;
  366. border-radius: 20rpx;
  367. padding: 0 20rpx;
  368. }
  369. }
  370. .swiper-wrapper {
  371. z-index: 0 !important;
  372. }
  373. </style>