details.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-03-07 17:17:24
  6. * @Description: file content
  7. * @FilePath: \oms\pages\schedule\supervise\details.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>督办详情</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <view class="main-top">
  23. <view class="customer-box">
  24. <view class="header flex1">
  25. <view class="name flex_l">
  26. <image class="img" src="@/static/images/menu2.png" mode="scaleToFill" />
  27. <text>{{ details.taskTitle }}</text>
  28. </view>
  29. <view class="date">{{ parseTime(details.taskStartDate, '{y}-{m}-{d}') || '-' }}</view>
  30. </view>
  31. <view class="info">
  32. <view class="info-item">
  33. <u-row>
  34. <u-col span="6">
  35. <view class="flex_l">
  36. <view class="info-label">督办类型:</view>
  37. <text class="info-txt">{{ selectDictLabel(taskTypeOption, details.taskType) }}</text>
  38. </view>
  39. </u-col>
  40. <u-col span="6">
  41. <view class="flex_l">
  42. <view class="info-label">督办状态:</view>
  43. <text class="info-txt">{{ selectDictLabel(taskStatusOption, details.taskStatus) }}</text>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="info-item">
  49. <u-row justify="space-between">
  50. <u-col span="6">
  51. <view class="flex_l">
  52. <view class="info-label">是否超期:</view>
  53. <text class="info-txt">
  54. {{ isNotOverdue(parseTime(details.taskEndDate, '{y}-{m}-{d} 23:59:59')) ? '否' : '是' }}
  55. </text>
  56. </view>
  57. </u-col>
  58. <u-col span="6">
  59. <view class="flex_l">
  60. <view class="info-label">事项来源:</view>
  61. <text class="info-txt">{{ selectDictLabel(sourceOption, details.source) }}</text>
  62. </view>
  63. </u-col>
  64. </u-row>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- <view class="tabs">
  69. <u-tabs
  70. @change="changeTabs"
  71. :current="curTabIndex"
  72. :scrollable="false"
  73. :list="list"
  74. :activeStyle="{
  75. color: '#3E7EF8',
  76. fontWeight: 'bold',
  77. }"
  78. :inactiveStyle="{
  79. color: '#969696',
  80. }"></u-tabs>
  81. </view> -->
  82. </view>
  83. <view class="data-list">
  84. <view class="detail-wrap">
  85. <view class="info-item">
  86. <u-row justify="space-between" gutter="10">
  87. <u-col span="12">
  88. <view class="flex_l">
  89. <view class="label">督办内容:</view>
  90. <view class="desc">{{ details.taskDesc }}</view>
  91. </view>
  92. </u-col>
  93. </u-row>
  94. </view>
  95. <view class="info-item">
  96. <u-row justify="space-between" gutter="10">
  97. <u-col span="12">
  98. <view class="flex_l">
  99. <view class="label">要求完成时间:</view>
  100. <view class="desc">{{ parseTime(details.taskEndDate, '{y}-{m}-{d}') }}</view>
  101. </view>
  102. </u-col>
  103. </u-row>
  104. </view>
  105. <view class="info-item">
  106. <u-row justify="space-between" gutter="10">
  107. <u-col span="12">
  108. <view class="flex_l">
  109. <view class="label">负责人:</view>
  110. <view class="desc">{{ selectDictLabel(userList, details.mainUserId) }}</view>
  111. </view>
  112. </u-col>
  113. </u-row>
  114. </view>
  115. <view class="info-item">
  116. <u-row justify="space-between" gutter="10">
  117. <u-col span="12">
  118. <view class="flex_l">
  119. <view class="label">协办人:</view>
  120. <view class="desc">{{ generateOwnerUser(details.ownerUserId) }}</view>
  121. </view>
  122. </u-col>
  123. </u-row>
  124. </view>
  125. <view class="info-item">
  126. <u-row justify="space-between" gutter="10">
  127. <u-col span="12">
  128. <view class="flex_l">
  129. <view class="label">督办人:</view>
  130. <view class="desc">{{ selectDictLabel(userList, details.watchUserId) }}</view>
  131. </view>
  132. </u-col>
  133. </u-row>
  134. </view>
  135. <view class="info-item">
  136. <u-row justify="space-between" gutter="10">
  137. <u-col span="12">
  138. <view class="flex_l">
  139. <view class="label">监办人:</view>
  140. <view class="desc">{{ selectDictLabel(userList, details.supervisorUserId) }}</view>
  141. </view>
  142. </u-col>
  143. </u-row>
  144. </view>
  145. <o-progress ref="progress" :details="details" :type="type"></o-progress>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 新增按钮 -->
  150. <view class="fixed-btn-group">
  151. <view class="btn center" v-show="details.taskStatus === '10' && type == 1" @click="changeStatus(10)">接</view>
  152. <view
  153. class="btn center"
  154. v-show="details.taskStatus === '20' && details.step === 20 && type == 1"
  155. @click="changeStatus(20)">
  156. </view>
  157. </view>
  158. <!-- 确认接收 -->
  159. <u-modal
  160. :show="modalVisible"
  161. @confirm="confirmChangeStatus"
  162. ref="uModal"
  163. :asyncClose="true"
  164. :showCancelButton="true"
  165. :content="content"></u-modal>
  166. <!-- 提示 -->
  167. <u-toast ref="uToast"></u-toast>
  168. </view>
  169. </template>
  170. <script>
  171. import taskApi from '@/api/task'
  172. import userApi from '@/api/system/user'
  173. import to from 'await-to-js'
  174. import OProgress from './components/progress'
  175. export default {
  176. name: 'omsIndex',
  177. components: { OProgress },
  178. data() {
  179. return {
  180. height: '',
  181. paddingTop: '',
  182. curTabIndex: 0,
  183. list: [
  184. {
  185. name: '详细信息',
  186. index: 0,
  187. },
  188. {
  189. name: '进展情况',
  190. index: 1,
  191. },
  192. ],
  193. taskId: 0, //项目id
  194. details: {}, //督办列表
  195. taskTypeOption: [], //督办类型
  196. sourceOption: [], //来源列表
  197. userList: [], //用户列表
  198. taskStatusOption: [
  199. {
  200. key: '10',
  201. value: '发起',
  202. },
  203. {
  204. key: '20',
  205. value: '进行中',
  206. },
  207. {
  208. key: '30',
  209. value: '流程完成',
  210. },
  211. {
  212. key: '40',
  213. value: '审批拒绝',
  214. },
  215. {
  216. key: '50',
  217. value: '撤销',
  218. },
  219. ], //督办状态
  220. type: 0, //是否为我的待办
  221. modalVisible: false,
  222. progressVisible: false,
  223. content: '',
  224. step: '',
  225. }
  226. },
  227. onLoad(option) {
  228. this.taskId = option.id
  229. this.type = option.type
  230. this.getOptions()
  231. },
  232. created() {
  233. const navData = uni.getMenuButtonBoundingClientRect()
  234. this.height = navData.height + 'px'
  235. this.paddingTop = navData.top + 'px'
  236. },
  237. methods: {
  238. // 改变tab
  239. changeTabs(data) {
  240. this.curTabIndex = data.index
  241. },
  242. getOptions() {
  243. Promise.all([this.getDicts('task_type'), this.getDicts('plat_task_source'), userApi.getList()])
  244. .then(([types, source, user]) => {
  245. this.taskTypeOption = types.data.values || []
  246. this.sourceOption = source.data.values || []
  247. this.userList = user.data.list.map((item) => ({ key: '' + item.id, value: item.nickName }))
  248. this.getDetails()
  249. })
  250. .catch((err) => console.log(err))
  251. },
  252. // 判断是否没有超期
  253. isNotOverdue(date) {
  254. return new Date() <= new Date(date)
  255. },
  256. // 协办人
  257. generateOwnerUser(ids = null) {
  258. let nameArr = []
  259. if (ids) {
  260. let idList = ids.split(',')
  261. idList.forEach((item) => {
  262. let findUser = this.userList.find((user) => user.key == item)
  263. if (findUser && findUser.value) nameArr.push(findUser.value)
  264. })
  265. }
  266. return nameArr.join(',')
  267. },
  268. async getDetails() {
  269. let params = {
  270. operateType: this.type,
  271. taskId: this.taskId,
  272. }
  273. const [err, res] = await to(taskApi.getList(params))
  274. if (err) {
  275. return
  276. }
  277. if (res && res.code == 200) {
  278. this.details = res.data.list[0] || {}
  279. }
  280. },
  281. // 接收待办
  282. changeStatus(step) {
  283. this.modalVisible = true
  284. this.step = step
  285. if (step == 10) this.content = '确认接收督办?'
  286. else if (step == 20) this.content = '确认提交督办?'
  287. },
  288. async confirmChangeStatus() {
  289. let params = {
  290. taskId: parseInt(this.taskId),
  291. step: this.step,
  292. handleStatus: '' + this.step,
  293. handleDesc: '',
  294. progressList: this.$refs.progress.progressList,
  295. }
  296. const [err, res] = await to(taskApi.handleTask(params))
  297. if (err) return
  298. if (res && res.code == 200) {
  299. this.modalVisible = false
  300. this.$refs.uToast.show({
  301. type: 'success',
  302. message: '提交成功',
  303. complete: () => {
  304. this.goBack()
  305. },
  306. })
  307. }
  308. },
  309. goBack() {
  310. uni.reLaunch({
  311. url: '/pages/schedule/index?type=1',
  312. })
  313. },
  314. },
  315. }
  316. </script>
  317. <style>
  318. page {
  319. background: #f2f3f5;
  320. }
  321. </style>
  322. <style lang="scss" scoped>
  323. .home {
  324. padding-top: 200rpx;
  325. .nav {
  326. position: absolute;
  327. left: 0;
  328. top: 0;
  329. width: 100%;
  330. height: 356rpx;
  331. background: #3e7ef8;
  332. border-radius: 0 0 31rpx 31rpx;
  333. .title {
  334. position: relative;
  335. text-align: center;
  336. font-size: 32rpx;
  337. font-weight: bold;
  338. color: #ffffff;
  339. .back {
  340. position: absolute;
  341. top: 0;
  342. bottom: 0;
  343. margin: auto;
  344. left: 70rpx;
  345. display: flex;
  346. }
  347. }
  348. }
  349. .main {
  350. position: absolute;
  351. width: 100%;
  352. height: calc(100vh - 200rpx);
  353. overflow: hidden;
  354. padding-bottom: 64rpx;
  355. .main-top {
  356. padding: 0 32rpx;
  357. }
  358. .customer-box {
  359. width: 100%;
  360. background: #ffffff;
  361. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  362. border-radius: 32rpx;
  363. padding: 22rpx 38rpx 68rpx 40rpx;
  364. .header {
  365. .name {
  366. .img {
  367. width: 46rpx;
  368. height: 46rpx;
  369. border-radius: 50%;
  370. margin-right: 8rpx;
  371. }
  372. text {
  373. font-size: 28rpx;
  374. font-weight: bold;
  375. color: #323232;
  376. }
  377. }
  378. .date {
  379. font-size: 24rpx;
  380. color: #3e7ef8;
  381. }
  382. }
  383. .info {
  384. .info-item {
  385. margin-top: 18rpx;
  386. .info-label {
  387. width: 120rpx;
  388. text-align: left;
  389. font-size: 24rpx;
  390. color: #646464;
  391. }
  392. .info-txt {
  393. flex: 1;
  394. font-size: 24rpx;
  395. color: #323232;
  396. }
  397. }
  398. }
  399. }
  400. .data-list {
  401. margin-top: 16rpx;
  402. width: 100%;
  403. height: calc(100vh - 446rpx);
  404. background: #ffffff;
  405. padding: 32rpx;
  406. overflow: auto;
  407. // padding-bottom: 145rpx;
  408. .info-item {
  409. padding: 20rpx;
  410. .label {
  411. color: #646464;
  412. font-size: 26rpx;
  413. }
  414. .desc {
  415. font-size: 26rpx;
  416. text-indent: 20rpx;
  417. }
  418. }
  419. }
  420. }
  421. .fixed-btn-group {
  422. position: fixed;
  423. display: flex;
  424. justify-content: space-around;
  425. align-items: center;
  426. bottom: 50rpx;
  427. right: 50rpx;
  428. }
  429. .btn {
  430. width: 90rpx;
  431. height: 90rpx;
  432. border-radius: 50%;
  433. background: #3e7ef8;
  434. color: #ffffff;
  435. }
  436. .mb12 {
  437. margin-bottom: 12rpx;
  438. }
  439. }
  440. </style>