throughTrainDetails.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <template>
  2. <view class="container">
  3. <view class="mim-view mim-flex-vertical">
  4. <view v-if="detail.content" class="mim-font-16 content">
  5. {{detail.content || '--'}}
  6. </view>
  7. <view class="pre-box">
  8. <view class="pre-item" v-for="(item,index) in detail.relevant_document_urls" :key="index">
  9. <u-image v-if="item.type==1" :src="item.url" mode="aspectFit" @click="previewImage(index)"
  10. class="pre-item-image" height="160"></u-image>
  11. <video v-if="item.type==2" :src="item.url" class="pre-item-image" :show-fullscreen-btn="true"
  12. style="width: 100%; height: 100%; object-fit: cover;"></video>
  13. </view>
  14. </view>
  15. <u-divider border-color='#f2f2f2' bg-color='#f2f2f2' margin-top='24' margin-bottom='24' use-slot>
  16. </u-divider>
  17. <view class="mim-flex-wrap-space-between">
  18. <text class="mim-font-14">投诉人</text>
  19. <text class="mim-font-14">{{detail.complaint_name}}</text>
  20. </view>
  21. <view class="mim-flex-wrap-space-between storm">
  22. <text class="mim-font-14">投诉人手机号</text>
  23. <text class="mim-font-14">{{detail.complaint_phone}}</text>
  24. </view>
  25. <view class="mim-flex-wrap-space-between storm">
  26. <text class="mim-font-14">投诉时间</text>
  27. <text class="mim-font-14">{{detail.created_at}}</text>
  28. </view>
  29. </view>
  30. <view v-if="type == '1'">
  31. <view class="mim-view" style="margin-bottom: -48rpx;border-radius: 8rpx 8rpx 0 0;">
  32. <view>
  33. <view class="mim-font-16 bold mim-flex-wrap-left">
  34. <text class="mim-font-16 bold">事项分类</text>
  35. <text class="mim-font-16 bold mimRed">*</text>
  36. </view>
  37. <view class="select">
  38. <u-input type="select" v-model="category_name" placeholder='请选择事项分类'
  39. placeholder-style="color: #BDBDBD;" height="96" cursor-spacing="12" :clearable='false'
  40. disabled :custom-style="customStyle" @click="selectFenlei" />
  41. <u-image src='@/static/icon/jt.png' class="select_img" width="64rpx" height="64rpx"></u-image>
  42. </view>
  43. <selectLei ref="lei" @fetch-data="fetchData" />
  44. </view>
  45. </view>
  46. <view class="mim-view" v-for="(_, index) in list" :key="index" :class="{margin24 : index > 0 }">
  47. <view class="mim-font-16 bold mim-flex-wrap-space-between">
  48. <view class="mim-font-16 bold mim-flex-wrap-left">
  49. <text class="mim-font-16 bold">处理部门</text>
  50. <text class="mim-font-16 bold mimRed">*</text>
  51. </view>
  52. <view class="mim-flex-wrap-right">
  53. <text class="mim-button mim-font-14" @click="addDepartment">添加</text>
  54. <text v-if="index > 0" class="mim-button mim-button-del mim-font-14" style="margin-left: 24rpx;"
  55. @click="deleteDepartment(index)">删除</text>
  56. </view>
  57. </view>
  58. <view v-if="index == 0" class="mim-font-14 mimRed marginTop">*默认第一个部门为主负责部门</view>
  59. <view class="select">
  60. <u-input type="select" v-model="list[index].deal_department_name" placeholder='请选择处理部门'
  61. placeholder-style="color: #BDBDBD;" height="96" cursor-spacing="12" :clearable='false'
  62. :custom-style="customStyle" @click="selectDepartment(index)" />
  63. <u-image src='@/static/icon/jt.png' class="select_img" width="64rpx" height="64rpx"></u-image>
  64. <u-select v-if="selectVisible[index]" v-model="show" :list="select_list" @confirm="confirmSelect"
  65. :default-value='defaultValue[index]'></u-select>
  66. </view>
  67. <view class="marginTop">
  68. <view class="mim-font-16 bold mim-flex-wrap-left">
  69. <text class="mim-font-16 bold">处理期限(天)</text>
  70. <text class="mim-font-16 bold mimRed">*</text>
  71. </view>
  72. <u-input type="number" v-model="list[index].limit_day" placeholder='请填写处理期限'
  73. placeholder-style="color: #BDBDBD;" height="96" cursor-spacing="12" :clearable='false'
  74. :custom-style="customStyle" @input="validateInput(index)" />
  75. </view>
  76. <view class="marginTop">
  77. <view class="mim-font-16 bold mim-flex-wrap-left">
  78. <text class="mim-font-16 bold">处理意见</text>
  79. <text class="mim-font-16 bold mimRed">*</text>
  80. </view>
  81. <u-input type="textarea" v-model="list[index].body" placeholder='请填写处理意见'
  82. placeholder-style="color: #BDBDBD;" height="160" :auto-height='true' :clearable='false'
  83. :custom-style="customTestStyle" maxlength="-1" cursor-spacing="12" />
  84. </view>
  85. </view>
  86. </view>
  87. <view v-if="type != '1'" class="mim-view mim-flex-vertical">
  88. <view class="mim-font-16 bold">指派信息</view>
  89. <view class="xiezhu-item-div" v-if="detail.extra">
  90. <view class="xiezhu-item" v-for="(item,index) in detail.extra" :key="index">
  91. <view class="mim-flex-wrap-space-between storm">
  92. <text class="mim-font-14">指派时间</text>
  93. <text class="mim-font-14">{{detail.manage_messages.created_at || '--'}}</text>
  94. </view>
  95. <view class="mim-flex-wrap-space-between storm">
  96. <text class="mim-font-14">指派部门</text>
  97. <text class="mim-font-14">{{item.deal_department_name || '--'}}</text>
  98. </view>
  99. <view class="mim-flex-wrap-space-between storm">
  100. <text class="mim-font-14">指派人员</text>
  101. <text class="mim-font-14">{{detail.manage_messages.assign_admin.name || '--'}}</text>
  102. </view>
  103. <view class="mim-flex-vertical storm">
  104. <text class="mim-font-14">处理意见</text>
  105. <text class="mim-font-14 xiezhu-content">{{item.body || '--'}}</text>
  106. </view>
  107. <view class="mim-flex-wrap-space-between storm">
  108. <text class="mim-font-14">处理期限</text>
  109. <text class="mim-font-14">{{item.limit_day || '--'}}天</text>
  110. </view>
  111. <view class="mim-flex-vertical storm" v-if="type == 3 || type == 4 ">
  112. <text class="mim-font-14">处理结果</text>
  113. <text class="mim-font-14 xiezhu-content">{{item.deal_idea || '--'}}</text>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="mim-view mim-flex-vertical" v-if="type != '1'">
  119. <view class="mim-font-16 bold">处理信息</view>
  120. <view class="img_type">
  121. <u-image v-if="type == '2'" src="@/static/images/index/clz.png" width="240rpx" height="240rpx">
  122. </u-image>
  123. <u-image v-else-if="type =='3' || type =='4'" src="@/static/images/index/clwj.png" width="240rpx"
  124. height="240rpx"></u-image>
  125. </view>
  126. <view class="mim-flex-wrap-space-between storm">
  127. <text class="mim-font-14">处理状态</text>
  128. <text v-if="type == '1'" class="mim-font-14">待处理</text>
  129. <text v-if="type == '2'" class="mim-font-14">处理中</text>
  130. <text v-if="type == '3'" class="mim-font-14">处理完结</text>
  131. <text v-if="type == '4'" class="mim-font-14">处理完结</text>
  132. </view>
  133. <view v-if="type == '3'|| type == '4'">
  134. <view class="mim-flex-wrap-space-between storm">
  135. <text class="mim-font-14">处理时间</text>
  136. <text class="mim-font-14">{{detail.manage_messages.deal_time}}</text>
  137. </view>
  138. <!-- <view class="mim-flex-wrap-space-between storm">
  139. <text class="mim-font-14">处理期限</text>
  140. <text class="mim-font-14">{{detail.manage_messages.deal_limit_day}}天</text>
  141. </view>
  142. <view class="mim-flex-vertical storm">
  143. <text class="mim-font-14">处理意见</text>
  144. <text class="mim-font-14 xiezhu-content">{{detail.deal_idea}}</text>
  145. </view>
  146. <view class="mim-flex-vertical storm">
  147. <text class="mim-font-14">处理结果</text>
  148. <text class="mim-font-14 xiezhu-content">{{detail.deal_result || '--' }}</text>
  149. </view> -->
  150. <u-divider v-if="type == 4 " border-color='#f2f2f2' bg-color='#f2f2f2' margin-top='24'
  151. margin-bottom='24' use-slot></u-divider>
  152. <view class="mim-flex-wrap-space-between" v-if="type == 4 ">
  153. <text class="mim-font-14 bold">群众满意度</text>
  154. <text class="mim-font-14">{{detail.deal_evaluation}} 分</text>
  155. </view>
  156. </view>
  157. </view>
  158. <view class="mim-view-list"></view>
  159. <view class="mim-view-last" v-if="type == '1'"></view>
  160. <view class="mim-foot" v-if="type == '1'">
  161. <view class="mim-foot-button mim-flex-wrap" @click="confirm">
  162. 确定
  163. </view>
  164. </view>
  165. </view>
  166. </template>
  167. <script>
  168. import selectLei from './components/selectLei.vue'
  169. export default {
  170. components: {
  171. selectLei
  172. },
  173. data() {
  174. return {
  175. form: {
  176. id: '',
  177. category_id: '',
  178. multiData: []
  179. },
  180. category_name: '',
  181. type: '', //1 待处理 2 处理中 3 待评价 4处理完结,
  182. customStyle: {
  183. marginTop: '24rpx',
  184. fontSize: '32rpx',
  185. paddingLeft: '24rpx',
  186. background: '#f7f7f7',
  187. borderRadius: '8rpx'
  188. },
  189. customTestStyle: {
  190. "box-sizing": 'border-box',
  191. marginTop: '24rpx',
  192. fontSize: '32rpx',
  193. padding: '32rpx 24rpx',
  194. background: '#f7f7f7',
  195. borderRadius: '8rpx',
  196. },
  197. list: [{
  198. deal_department_name: '', //部门名称
  199. department_id: '', //部门id
  200. limit_day: 1, //处理期限
  201. body: '' //处理意见
  202. }],
  203. detail: {},
  204. fenleiShow: false, //分类选择弹框
  205. show: false, //处理部门的弹框
  206. select_list: [], //处理部门的数组
  207. listFenlei: [], //分类数组
  208. selectVisible: [], // 存储每个 u-select 的显示状态
  209. defaultValue: [
  210. [0]
  211. ],
  212. index: 0
  213. };
  214. },
  215. onLoad(e) {
  216. this.form.id = e.id
  217. this.getFneleiListFn()
  218. this.getdepartmentFn()
  219. },
  220. mounted() {
  221. this.throughTrainDetailsFn()
  222. },
  223. methods: {
  224. //获取分类选项列表
  225. async getFneleiListFn() {
  226. const res = await this.$u.api.getFneleiList({
  227. status: 1
  228. })
  229. if (res.status === "success") {
  230. this.listFenlei = res.data
  231. }
  232. },
  233. //回传的数据
  234. fetchData(data) {
  235. this.form.category_id = data.id
  236. this.category_name = data.name
  237. },
  238. //选择事项分类
  239. selectFenlei() {
  240. this.$refs['lei'].showEdit(this.listFenlei)
  241. },
  242. //显示图片
  243. previewImage(index) {
  244. const images = this.detail.relevant_document_urls
  245. .filter(item => item.type === 1); // 过滤出图片类型的数据
  246. const urls = images.map(item => item.url); // 获取图片地址数组
  247. const current = this.detail.relevant_document_urls[index].url; // 当前显示的图片地址
  248. uni.previewImage({
  249. current: current, // 当前显示的图片地址
  250. urls: urls, // 图片地址数组
  251. });
  252. },
  253. //添加部门
  254. addDepartment() {
  255. this.list.push({
  256. deal_department_name: '',
  257. department_id: '',
  258. limit_day: 1,
  259. body: ''
  260. })
  261. this.$u.toast('添加成功!')
  262. },
  263. //删除部门
  264. deleteDepartment(index) {
  265. this.list = this.list.filter((_, index1) => {
  266. return index1 !== index
  267. })
  268. this.$u.toast('删除成功!')
  269. },
  270. //确保用户输入非0正整数
  271. validateInput(index) {
  272. const value = this.list[index].limit_day;
  273. const regex = /^[1-9]\d*$/; // 非零正整数的正则表达式
  274. if (!regex.test(value)) {
  275. // 如果输入不符合要求,可以根据需要进行处理,比如清空输入或者修改输入值
  276. // this.list[index].limit_day = ''; // 清空输入
  277. // 或者将输入修改为符合要求的值
  278. this.list[index].limit_day = Number(Math.max(parseInt(value), 1));
  279. }
  280. },
  281. goPage(e) {
  282. switch (e) {
  283. case 'application': //申请协助页面
  284. this.$u.route('/pages/command/application', {
  285. id: this.form.id
  286. });
  287. break;
  288. case 'finish': //去完结页面
  289. this.$u.route('/pages/command/finish', {
  290. id: this.form.id
  291. });
  292. break;
  293. default:
  294. console.log('Unknown fruit');
  295. break;
  296. }
  297. },
  298. //页面渲染
  299. async throughTrainDetailsFn() {
  300. const res = await this.$u.api.throughTrainDetails(this.form)
  301. if (res.status === "success") {
  302. this.type = res.data.deal_status
  303. this.detail = res.data
  304. }
  305. },
  306. //确定选择的部门
  307. confirmSelect(e) {
  308. this.list[Number(this.index)].department_id = e[0].value
  309. this.list[Number(this.index)].deal_department_name = e[0].label
  310. this.show = false
  311. },
  312. //选择部门
  313. selectDepartment(index) {
  314. this.selectVisible = this.select_list.map((_, i) => i === index);
  315. this.show = true
  316. this.index = index
  317. },
  318. //获取部门列表
  319. async getdepartmentFn() {
  320. const res = await this.$u.api.getdepartment({
  321. status: 1,
  322. })
  323. const newArray = res.data.map(item => ({
  324. value: item.id,
  325. label: item.name
  326. }))
  327. this.select_list = newArray
  328. },
  329. //确定
  330. confirm() {
  331. if (!this.form.category_id) {
  332. this.$u.toast('请选择事项分类!')
  333. return false
  334. }
  335. let arr = []
  336. arr = this.list.filter((item) => {
  337. return !item.department_id || !item.limit_day || !item.body
  338. })
  339. if (arr.length > 0) {
  340. this.$u.toast('请将处理信息填写完整!')
  341. return false
  342. }
  343. this.form.multiData = this.list
  344. console.log(this.form)
  345. this.confirmAssignFn()
  346. },
  347. //确定指派接口
  348. async confirmAssignFn() {
  349. const res = await this.$u.api.confirmAssign(this.form)
  350. if (res.status === "success") {
  351. this.$u.toast(res.message)
  352. setTimeout(() => {
  353. this.$u.route({
  354. type: 'navigateBack',
  355. url: '/pages/throughTrain/throughTrain'
  356. });
  357. }, 1500)
  358. }
  359. },
  360. }
  361. }
  362. </script>
  363. <style lang="scss">
  364. page {
  365. background-color: #f7f7f7;
  366. .container {
  367. .mim-view {
  368. overflow: hidden;
  369. u-input {
  370. /deep/ .u-input__right-icon {
  371. display: none !important;
  372. }
  373. }
  374. .mim-button {
  375. background: rgba(20, 195, 195, 0.15);
  376. border: 2rpx solid #14C3C3;
  377. height: 56rpx;
  378. width: 120rpx;
  379. color: #14C3C3;
  380. }
  381. .mim-button-del {
  382. height: 56rpx;
  383. width: 120rpx;
  384. color: #DE2E27;
  385. background: rgba(222, 46, 39, 0.15);
  386. border: 2rpx solid #DE2E27;
  387. }
  388. .content {
  389. max-height: 550rpx;
  390. overflow-y: scroll;
  391. -webkit-overflow-scrolling: touch;
  392. scrollbar-width: none;
  393. /* Firefox */
  394. -ms-overflow-style: none;
  395. /* IE and Edge */
  396. &::-webkit-scrollbar {
  397. display: none;
  398. }
  399. }
  400. .xiezhu-item-div {
  401. .xiezhu-item {
  402. border-top: dashed 1px #dcdbde;
  403. margin-top: 30rpx;
  404. &:first-child {
  405. border-top: none !important;
  406. margin-top: 0rpx !important;
  407. }
  408. }
  409. }
  410. .xiezhu-content {
  411. padding: 20rpx;
  412. background-color: #f7f7f7;
  413. border-radius: 10rpx;
  414. margin-top: 10rpx;
  415. }
  416. .margin24 {
  417. margin-top: 24rpx;
  418. }
  419. .marginTop {
  420. margin-top: 24rpx;
  421. }
  422. .storm {
  423. margin-top: 24rpx;
  424. }
  425. .img_type {
  426. position: absolute;
  427. top: -70rpx;
  428. right: -50rpx;
  429. border-bottom: none;
  430. }
  431. .pre-box {
  432. margin-top: 24rpx;
  433. display: flex;
  434. align-items: center;
  435. // justify-content: space-between;
  436. flex-wrap: wrap;
  437. }
  438. .pre-item {
  439. width: 160rpx;
  440. height: 160rpx;
  441. overflow: hidden;
  442. position: relative;
  443. margin-left: 20rpx;
  444. margin-bottom: 20rpx;
  445. }
  446. .pre-item-image {
  447. width: 100%;
  448. height: 160rpx;
  449. object-fit: cover;
  450. }
  451. .select {
  452. position: relative;
  453. .select_img {
  454. position: absolute;
  455. right: 0;
  456. top: 38rpx;
  457. }
  458. }
  459. }
  460. .mim-view-last {
  461. padding: 56rpx;
  462. background: transparent;
  463. }
  464. .mim-foot {
  465. width: 100%;
  466. height: 136rpx;
  467. position: fixed;
  468. bottom: 0;
  469. left: 0;
  470. background-color: #ffffff;
  471. padding: 20rpx 24rpx;
  472. box-sizing: border-box;
  473. z-index: 9;
  474. &-button {
  475. width: 100%;
  476. border-radius: 48rpx;
  477. opacity: 1;
  478. background: #DE2E27;
  479. font-size: 32rpx;
  480. font-weight: normal;
  481. line-height: 32rpx;
  482. letter-spacing: 0px;
  483. color: #FFFFFF;
  484. height: 96rpx;
  485. cursor: pointer;
  486. &-first {
  487. width: 100%;
  488. border-radius: 48rpx;
  489. opacity: 1;
  490. background: rgba(222, 46, 39, 0.2);
  491. font-size: 32rpx;
  492. font-weight: normal;
  493. line-height: 32rpx;
  494. letter-spacing: 0px;
  495. color: #DE2E27;
  496. height: 96rpx;
  497. cursor: pointer;
  498. border: 2rpx solid #DE2E27;
  499. margin-right: 30rpx;
  500. }
  501. }
  502. }
  503. }
  504. }
  505. </style>