backlogDetail.vue 7.6 KB

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