backlogDetail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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" scoped>
  195. .back-content {
  196. background-color: #eee;
  197. height: 100%;
  198. display: flex;
  199. flex-direction: column;
  200. .content{
  201. flex: 1;
  202. overflow-y: scroll;
  203. }
  204. // 轮播图
  205. .top-ad-swiper{
  206. height: 340upx;
  207. }
  208. .noPic{
  209. width: 750upx;
  210. height: 400upx;
  211. font-size: 38upx;
  212. text-align: center;
  213. line-height: 400upx;
  214. color: #666;
  215. }
  216. // 详情内容
  217. .back-text{
  218. background: #ffffff;
  219. padding: 10upx 20upx;
  220. margin-bottom: 20upx;
  221. border-radius: 6upx;
  222. box-shadow: 1px 1px 3px #EEEEEE;
  223. .text-item{
  224. display: flex;
  225. align-items: center;
  226. padding: 10upx 10upx;
  227. font-size: 28upx;
  228. justify-content: space-between;
  229. .margin-left{
  230. margin-left: 30upx;
  231. }
  232. .time{
  233. color: #888;
  234. font-size: 26upx;
  235. margin-left: 10upx;
  236. }
  237. > view{
  238. &:first-child{
  239. flex: 1;
  240. width: 200upx;
  241. }
  242. }
  243. .desc{
  244. word-break: break-word;
  245. width: 80%;
  246. text-align: right;
  247. }
  248. }
  249. }
  250. // 步骤条
  251. .step-content {
  252. padding: 0 20upx;
  253. background-color: #fff;
  254. }
  255. // 底部按钮
  256. .footer {
  257. background-color: #fff;
  258. // margin-top: 20upx;
  259. .check-pending{
  260. display: flex;
  261. .act-btn {
  262. width: 50%;
  263. }
  264. }
  265. .comment-input{
  266. width: 100%;
  267. padding: 20upx;
  268. .input-cont{
  269. width: 100%;
  270. background-color: #f4f4f4;
  271. border-radius: 10upx;
  272. display: flex;
  273. justify-content: space-between;
  274. align-items: center;
  275. padding: 0 20upx;
  276. textarea{
  277. padding: 20upx;
  278. height: 100%;
  279. flex: 1;
  280. }
  281. .active{
  282. background-color: #fff;
  283. margin: 20upx 20upx 20upx 0;
  284. }
  285. .input-btn{
  286. padding: 20upx;
  287. height: 60upx;
  288. }
  289. }
  290. view{
  291. margin-top: 20upx;
  292. }
  293. }
  294. .dsh{
  295. color: red;
  296. }
  297. .dzg{
  298. color: #007AFF;
  299. }
  300. .ywc {
  301. color: #10c71e;
  302. }
  303. }
  304. .ygq {
  305. color: #999;
  306. }
  307. }
  308. </style>