backlogDetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="back-content">
  3. <!-- 轮播图 -->
  4. <swiper v-if="infoData.backlogPhotoList && infoData.backlogPhotoList.length" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
  5. <swiper-item v-for="(item,index) in infoData.backlogPhotoList" :key="index">
  6. <div class="swiper-item uni-bg-red">
  7. <u-image mode="scaleToFill" width="750upx" height="400upx" :src="item.photo"></u-image>
  8. </div>
  9. </swiper-item>
  10. </swiper>
  11. <view v-else class="noPic">
  12. 暂无图片
  13. </view>
  14. <view class="back-text">
  15. <!-- 门店 -->
  16. <view class="text-item">
  17. <view class="ellipsis-one">
  18. {{infoData.storeName}}
  19. </view>
  20. <view class="time ">
  21. {{infoData.effectiveEndTime}} 到期
  22. </view>
  23. </view>
  24. <!-- 创建人 -->
  25. <view class="text-item">
  26. <view>
  27. <text>创建人</text>
  28. <text class="margin-left ellipsis-one">{{infoData.putUserName}}</text>
  29. </view>
  30. <view class="time">
  31. {{infoData.createTime}} 创建
  32. </view>
  33. </view>
  34. <!-- 指标 -->
  35. <view class="text-item">
  36. <view>
  37. 考评指标
  38. </view>
  39. <view class="margin-left">
  40. {{infoData.clsName}}
  41. </view>
  42. </view>
  43. <!-- 描述 -->
  44. <view class="text-item">
  45. <view>
  46. 描述
  47. </view>
  48. <view class="margin-left">
  49. {{infoData.problemDesc}}
  50. </view>
  51. </view>
  52. </view>
  53. <view class="step-content">
  54. <u-steps :list="numList" direction ="column" :current="0"></u-steps>
  55. </view>
  56. <view class="footer">
  57. <!-- receiveFlag 接收人/责任人标记 只有处理人可以整改-->
  58. <!-- 目前版本不做 -->
  59. <!-- <u-button @click="handleSubmit(0)" v-if="infoData.receiveFlag && infoData.receiveFlag == 1 && infoData.statusDictValue=='待整改'" type="primary">整改完成</u-button> -->
  60. <!-- putFlag 创建人标记 只有创建人可以审核-->
  61. <view v-if="infoData.putFlag && infoData.putFlag == 1 && infoData.statusDictValue=='待审核'" class="check-pending">
  62. <u-button @click="handleSubmit(1)" class="act-btn" type="error">整改不通过</u-button>
  63. <u-button @click="handleSubmit(2)" class="act-btn" type="success">整改通过</u-button>
  64. </view>
  65. <!-- copyFlag 抄送标识 只有抄送人可以评论-->
  66. <view v-if="infoData.copyFlag && infoData.copyFlag==1" class="comment-input">
  67. <view class="input-cont">
  68. <textarea auto-height :class="[isFocus?'active':'']" v-model="comment" @focus="sendComment" placeholder="请输入评论..."/>
  69. <u-button @click="handleSubmit(3)" class="input-btn" v-if="isFocus" size="mini" type="warning">发送</u-button>
  70. </view>
  71. <view>整改状态:<text :class="clsStatus(infoData.statusDictValue)">{{infoData.statusDictValue}}</text></view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import { getBackLogDetail, getBackLogRecord, handleBackLog } from '@/api/backLog.js'
  78. export default {
  79. components: {
  80. },
  81. data() {
  82. return {
  83. backlogId: '', // 待办id
  84. infoData:{}, // 详情数据
  85. numList: [],
  86. comment: '', // 评论
  87. isFocus: false, // 评论键盘是否弹起
  88. handleType: ['SOLVE','AUDIT_NO','AUDIT_YES','COMMENTS'] //SOLVE("SOLVE", "整改问题"),AUDIT_YES("AUDIT_YES", "审核通过"),AUDIT_NO("AUDIT_NO", "审核不通过"),COMMENTS("COMMENTS", "发表评论");
  89. }
  90. },
  91. onLoad(option) {
  92. console.log(option.id)
  93. this.backlogId = option.id
  94. this.getData(option.id)
  95. this.getRecordData(option.id)
  96. },
  97. methods: {
  98. // 获取详情数据
  99. getData (id) {
  100. getBackLogDetail({id:id}).then(res=>{
  101. if(res.status==200){
  102. this.infoData = res.data
  103. } else {
  104. this.toashMsg(res.message)
  105. this.infoData = {}
  106. }
  107. })
  108. },
  109. // 获取进度数据
  110. getRecordData (id) {
  111. getBackLogRecord({id:id}).then(res=>{
  112. if(res.status==200){
  113. let arr = []
  114. res.data.map(item=>{
  115. const p = {}
  116. const k = '\xa0\xa0\xa0\xa0\xa0\xa0'
  117. p.name = item.handleTime + k + item.handleTypeDictValue + k + (item.handleDesc ? item.handleDesc : '')
  118. arr.push(p)
  119. })
  120. this.numList = arr
  121. } else {
  122. this.toashMsg(res.message)
  123. this.numList = []
  124. }
  125. })
  126. },
  127. sendComment (v) {
  128. console.log(v,'vvvvvvvvvv')
  129. this.isFocus = true
  130. },
  131. // 提交处理
  132. handleSubmit(index) {
  133. const params = {
  134. backlogId: this.backlogId,
  135. handleDesc: this.comment,
  136. handleType: this.handleType[index]
  137. }
  138. handleBackLog(params).then(res=>{
  139. if(res.status==200){
  140. this.comment = ''
  141. this.isFocus = false
  142. this.getRecordData(this.backlogId)
  143. }
  144. this.toashMsg(res.message)
  145. })
  146. },
  147. // 状态颜色处理
  148. clsStatus(status){
  149. if(status == '待审核'){
  150. return 'dsh'
  151. }
  152. if(status == '待整改'){
  153. return 'dzg'
  154. }
  155. if(status == '整改完成'){
  156. return 'ywc'
  157. }
  158. if(status == '已过期'){
  159. return 'ygq'
  160. }
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .back-content {
  167. background-color: #eee;
  168. height: 100%;
  169. display: flex;
  170. flex-direction: column;
  171. // 轮播图
  172. .top-ad-swiper{
  173. height: 340upx;
  174. }
  175. .noPic{
  176. width: 750upx;
  177. height: 400upx;
  178. font-size: 38upx;
  179. text-align: center;
  180. line-height: 400upx;
  181. color: #666;
  182. }
  183. // 详情内容
  184. .back-text{
  185. background: #ffffff;
  186. padding: 10upx 20upx;
  187. margin-bottom: 20upx;
  188. border-radius: 6upx;
  189. box-shadow: 1px 1px 3px #EEEEEE;
  190. .text-item{
  191. display: flex;
  192. align-items: center;
  193. padding: 10upx 10upx;
  194. font-size: 28upx;
  195. justify-content: space-between;
  196. .margin-left{
  197. margin-left: 30upx;
  198. }
  199. .time{
  200. color: #888;
  201. font-size: 26upx;
  202. margin-left: 10upx;
  203. }
  204. > view{
  205. &:first-child{
  206. flex: 1;
  207. }
  208. }
  209. }
  210. }
  211. // 步骤条
  212. .step-content {
  213. padding: 0 20upx;
  214. background-color: #fff;
  215. flex: 1;
  216. overflow-y: scroll;
  217. }
  218. // 底部按钮
  219. .footer {
  220. background-color: #fff;
  221. // margin-top: 20upx;
  222. .check-pending{
  223. display: flex;
  224. .act-btn {
  225. width: 50%;
  226. }
  227. }
  228. .comment-input{
  229. width: 100%;
  230. padding: 20upx;
  231. .input-cont{
  232. width: 100%;
  233. background-color: #f4f4f4;
  234. border-radius: 10upx;
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. padding: 0 20upx;
  239. textarea{
  240. padding: 20upx;
  241. height: 100%;
  242. flex: 1;
  243. }
  244. .active{
  245. background-color: #fff;
  246. margin: 20upx;
  247. }
  248. .input-btn{
  249. padding: 20upx;
  250. height: 60upx;
  251. }
  252. }
  253. view{
  254. margin-top: 20upx;
  255. }
  256. }
  257. .dsh{
  258. color: red;
  259. }
  260. .dzg{
  261. color: #007AFF;
  262. }
  263. .ygq {
  264. color: #999;
  265. }
  266. .ywc {
  267. color: #10c71e;
  268. }
  269. }
  270. }
  271. </style>