complaintDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <view class="content">
  3. <view class="datebox">
  4. <!-- <view class="form-item">
  5. <text class="label">日期</text>
  6. <view class="right-box">
  7. <view class="input-box">
  8. {{form.completeTime}}
  9. </view>
  10. </view>
  11. <picker class="birth-picker" mode="date" @change="bindDateChange">
  12. <view class="right-box">
  13. <view class="input-box">
  14. <input type="text" :value="form.dueDate" placeholder="请选择日期" placeholder-class="form-input" disabled="disabled" />
  15. </view>
  16. <image class="w48 h48" src="@/static/images/health/right_arrow_right_icon24.png"></image>
  17. </view>
  18. </picker>
  19. </view> -->
  20. <view class="form-item">
  21. <text class="label">创建时间</text>
  22. <view class="right-box">
  23. <view class="input-box">
  24. {{utils.timeFormat(form.createTime,'yyyy-mm-dd hh:MM:ss')}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="form-item">
  29. <text class="label">联系方式</text>
  30. <view class="right-box">
  31. <view class="input-box">
  32. {{form.contactPhone}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="form-item">
  37. <text class="label">处理状态</text>
  38. <picker class="birth-picker" mode="selector" @change="bindStatusChange($event,tags)" :range="tags" range-key="dictLabel">
  39. <view class="right-box">
  40. <view class="input-box">
  41. <input type="text" :value="form.statusName" placeholder="请选择状态" placeholder-class="form-input" disabled="disabled" />
  42. </view>
  43. <image class="w48 h48" src="@/static/images/health/right_arrow_right_icon24.png"></image>
  44. </view>
  45. </picker>
  46. </view>
  47. </view>
  48. <view class="datebox2">
  49. <view class="bold">投诉内容</view>
  50. <view class="textinput">
  51. <textarea v-model="form.content" auto-height maxlength='500' placeholder="请输入事项情况" disabled="true"/>
  52. </view>
  53. </view>
  54. <view class="btn-box">
  55. <view class="sub-btn" @click="submit()">
  56. 确定
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {getComplaintById,updateComplaint,getCategory} from '@/api/companyUser.js'
  63. import {getDictByKey} from '@/api/common.js'
  64. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  65. export default {
  66. mixins: [MescrollMixin],
  67. data() {
  68. return {
  69. time:this.utils.timeFormat(new Date(),'yyyy-mm-dd'),
  70. type:null,
  71. showType:1,
  72. mescroll:null,
  73. tags:[
  74. {id:1,dictLabel:'待处理'},
  75. {id:2,dictLabel:'处理中'},
  76. {id:3,dictLabel:'已完成'},
  77. {id:4,dictLabel:'已关闭'},
  78. ],
  79. // 上拉加载的配置
  80. upOption: {
  81. onScroll:true,
  82. use: true, // 是否启用上拉加载; 默认true
  83. page: {
  84. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  85. size: 10 // 每页数据的数量,默认10
  86. },
  87. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  88. empty: {
  89. icon:'/static/images/no_data.png',
  90. tip: '暂无数据'
  91. }
  92. },
  93. form:{
  94. }
  95. }
  96. },
  97. onLoad(option) {
  98. this.type=option.type;
  99. console.log(this.type)
  100. if(this.type=='edit'){
  101. this.id=option.id;
  102. this.getInfo();
  103. }
  104. // this.getDictByKey()
  105. },
  106. methods: {
  107. navgetTo(url){
  108. uni.navigateTo({
  109. url:url
  110. })
  111. },
  112. bindDateChange: function(e) {
  113. this.form.dueDate= e.target.value
  114. },
  115. bindTimeChange: function(e) {
  116. this.form.completeTime = e.target.value
  117. },
  118. bindStatusChange: function(e,list) {
  119. this.form.status = list[e.target.value].id
  120. this.form.statusName=list[e.target.value].dictLabel
  121. },
  122. getDictByKey(){
  123. // var data={key:'todo_item_status'}
  124. getCategory().then(
  125. res => {
  126. if(res.code==200){
  127. this.tags=res.data;
  128. }
  129. },
  130. err => {
  131. }
  132. );
  133. },
  134. getInfo(){
  135. // var data={id:this.recordId};
  136. getComplaintById(this.id).then(
  137. res => {
  138. if(res.code==200){
  139. this.form=res.data;
  140. // this.form.completeTime=this.form.completeTime.slice(0,5)
  141. }else{
  142. uni.showToast({
  143. title: res.msg,
  144. });
  145. }
  146. },
  147. rej => {}
  148. );
  149. },
  150. submit(){
  151. if(this.form.status==null){
  152. uni.showToast({
  153. icon:'none',
  154. title: "请选择状态",
  155. });
  156. return;
  157. }
  158. // if(this.form.recordTime==null){
  159. // uni.showToast({
  160. // icon:'none',
  161. // title: "记录时间不能为空",
  162. // });
  163. // return;
  164. // }
  165. // if(this.form.mealDescription==null){
  166. // uni.showToast({
  167. // icon:'none',
  168. // title: "用餐情况不能为空",
  169. // });
  170. // return;
  171. // }
  172. if(this.type=="add"){
  173. this.addRecord()
  174. }
  175. else if(this.type=="edit"){
  176. this.updateById()
  177. }
  178. },
  179. updateById(){
  180. updateComplaint(this.id,this.form).then(
  181. res => {
  182. if(res.code==200){
  183. uni.showToast({
  184. icon:'success',
  185. title: "操作成功",
  186. });
  187. setTimeout(function() {
  188. uni.$emit('refreshComplaintList');
  189. uni.navigateBack({
  190. delta: 1
  191. })
  192. }, 500);
  193. }else{
  194. uni.showToast({
  195. icon:'none',
  196. title: res.msg,
  197. });
  198. }
  199. },
  200. rej => {}
  201. );
  202. },
  203. addRecord(){
  204. addRecord(this.form).then(
  205. res => {
  206. if(res.code==200){
  207. uni.showToast({
  208. icon:'success',
  209. title: "操作成功",
  210. });
  211. setTimeout(function() {
  212. uni.$emit('refreshToDoList');
  213. uni.navigateBack({
  214. delta: 1
  215. })
  216. }, 500);
  217. }else{
  218. uni.showToast({
  219. icon:'none',
  220. title: res.msg,
  221. });
  222. }
  223. },
  224. rej => {}
  225. );
  226. },
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. @mixin u-flex($flexD, $alignI, $justifyC) {
  232. display: flex;
  233. flex-direction: $flexD;
  234. align-items: $alignI;
  235. justify-content: $justifyC;
  236. }
  237. .flex-bt {
  238. @include u-flex(row, center, space-between);
  239. }
  240. .default {
  241. font-weight: 400;
  242. font-size: 28rpx;
  243. color: #999999;
  244. }
  245. .content{
  246. padding: 20upx;
  247. .datebox {
  248. padding: 0 30rpx;
  249. margin-bottom: 20rpx;
  250. background: #FFFFFF;
  251. border-radius: 16rpx 16rpx 16rpx 16rpx;
  252. .form-item{
  253. padding: 30upx 0;
  254. display: flex;
  255. align-items: flex-start;
  256. border-bottom: 1px solid #F1F1F1;
  257. &:last-child{
  258. border-bottom: none;
  259. }
  260. .label{
  261. flex:1;
  262. font-family: PingFang SC, PingFang SC;
  263. font-weight: 500;
  264. font-size: 32rpx;
  265. color: #222426;
  266. line-height: 34rpx;
  267. text-align: left;
  268. }
  269. input{
  270. text-align: right;
  271. }
  272. .form-input{
  273. font-size: 30upx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #999999;
  277. text-align: right;
  278. }
  279. .form-textarea{
  280. font-size: 30upx;
  281. color: #999999;
  282. height: 100upx;
  283. padding: 4upx 0;
  284. }
  285. .birth-picker {
  286. flex: 1;
  287. display: flex;
  288. align-items: center;
  289. .right-box{
  290. width: 100%;
  291. display: flex;
  292. align-items: center;
  293. .input-box{
  294. // width: 470upx;
  295. }
  296. .arrow{
  297. width: 13upx;
  298. height: 23upx;
  299. margin-left: 20upx;
  300. }
  301. }
  302. }
  303. }
  304. }
  305. .datebox2{
  306. background: #FFFFFF;
  307. padding:30rpx;
  308. border-radius: 16rpx 16rpx 16rpx 16rpx;
  309. .textinput{
  310. margin-top: 30rpx;
  311. height:200rpx;
  312. color: #999;
  313. overflow-y: scroll;
  314. }
  315. }
  316. .top-fixed{
  317. width: 100%;
  318. position: fixed;
  319. top: 0;
  320. left: 0;
  321. z-index: 10;
  322. }
  323. .pub-tab-box{
  324. box-sizing: border-box;
  325. width: 100%;
  326. padding: 0 40upx;
  327. background-color: #FFFFFF;
  328. .tab-inner{
  329. height: 88upx;
  330. line-height: 88upx;
  331. display: flex;
  332. align-items: center;
  333. justify-content: space-between;
  334. overflow-x: auto;
  335. }
  336. .item{
  337. flex:1;
  338. font-size: 28upx;
  339. white-space: nowrap;
  340. line-height: 1;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. color: #626468;
  344. // margin-right: 60upx;
  345. display: flex;
  346. align-items: center;
  347. justify-content: center;
  348. &:last-child{
  349. margin-right: 0;
  350. }
  351. &.active{
  352. font-weight: bold;
  353. color:#008FD3;
  354. &::after {
  355. content: "";
  356. width: 48rpx;
  357. height: 8rpx;
  358. background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
  359. position: absolute;
  360. bottom: 0;
  361. border-radius: 6upx 6upx 0upx 0;
  362. }
  363. }
  364. .text{
  365. position: relative;
  366. z-index: 1;
  367. }
  368. .tab-bg{
  369. width: 72upx;
  370. height: 28upx;
  371. position: absolute;
  372. top: 17upx;
  373. left: 50%;
  374. transform: translateX(-36upx);
  375. z-index: -1;
  376. }
  377. }
  378. }
  379. .btn-box{
  380. z-index: 9999;
  381. width: 100%;
  382. padding: 30upx;
  383. // position: fixed;
  384. bottom: 0;
  385. left: 0;
  386. box-sizing: border-box;
  387. // background: #FFFFFF;
  388. display: flex;
  389. align-items: center;
  390. justify-content: space-between;
  391. padding-bottom: 40rpx;
  392. .sub-btn{
  393. flex:1;
  394. // width: 100%;
  395. height: 88upx;
  396. line-height: 88upx;
  397. text-align: center;
  398. font-size: 32upx;
  399. font-family: PingFang SC;
  400. font-weight: bold;
  401. color: #FFFFFF;
  402. background: #008FD3;
  403. border-radius: 44upx;
  404. display: flex;
  405. align-items: center;
  406. border: 2rpx solid #008FD3;
  407. justify-content: center;
  408. image{
  409. margin-right: 16rpx;
  410. }
  411. }
  412. .sub-btn2{
  413. flex:1;
  414. height: 88upx;
  415. line-height: 88upx;
  416. text-align: center;
  417. font-size: 32rpx;
  418. color: #008FD3;
  419. font-family: PingFang SC;
  420. font-weight: bold;
  421. background: #FFFFFF;
  422. border-radius: 44rpx 44rpx 44rpx 44rpx;
  423. border: 2rpx solid #008FD3;
  424. margin-right: 20rpx;
  425. }
  426. }
  427. .phone-list{
  428. // padding: 30rpx;
  429. .item{
  430. display: flex;
  431. align-items: center;
  432. justify-content: space-between;
  433. background: #FFFFFF;
  434. border-radius: 16rpx 16rpx 16rpx 16rpx;
  435. // border-bottom: 1rpx solid #ECECEC;
  436. padding: 20rpx;
  437. margin-bottom: 20rpx;
  438. &:last-child{
  439. margin-bottom: 0;
  440. }
  441. .phone-name{
  442. display: flex;
  443. flex-direction: column;
  444. align-items: flex-start;
  445. // justify-content: flex-start;
  446. // padding-left: 24rpx;
  447. flex: 1;
  448. .name{
  449. font-family: PingFang SC, PingFang SC;
  450. font-weight: 500;
  451. font-size: 32rpx;
  452. color: #222426;
  453. text-align: left;
  454. }
  455. .type{
  456. font-family: PingFang SC;
  457. font-weight: 400;
  458. font-size: 28rpx;
  459. color: #626468;
  460. text-align: right;
  461. }
  462. .time{
  463. font-family: PingFang SC;
  464. font-weight: 400;
  465. font-size: 24rpx;
  466. color: #898E91;
  467. text-align: left;
  468. margin-top: 14rpx;
  469. }
  470. }
  471. }
  472. }
  473. .sms-list{
  474. .item{
  475. padding: 30rpx;
  476. background: #FFFFFF;
  477. border-radius: 16rpx 16rpx 16rpx 16rpx;
  478. margin-bottom: 20rpx;
  479. .title{
  480. font-family: PingFang SC;
  481. font-weight: 500;
  482. font-size: 32rpx;
  483. color: #222426;
  484. text-align: left;
  485. }
  486. .box{
  487. display: flex;
  488. align-items: center;
  489. justify-content: space-between;
  490. padding-top: 22rpx;
  491. .time{
  492. font-family: PingFang SC;
  493. font-weight: 400;
  494. font-size: 24rpx;
  495. color: #898E91;
  496. text-align: left;
  497. }
  498. .state{
  499. font-family: PingFang SC;
  500. font-weight: 400;
  501. font-size: 24rpx;
  502. color: #2CAE5C;
  503. text-align: right;
  504. }
  505. }
  506. }
  507. }
  508. }
  509. </style>