backlogDetail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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. <uni-steps :active-color="'rgb(41, 121, 255)'" :options="numList" direction ="column" :active="0"></uni-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 uniSteps from '@/components/uni-steps/uni-steps.vue'
  84. import { getBackLogDetail, getBackLogRecord, handleBackLog } from '@/api/backLog.js'
  85. export default {
  86. components: {
  87. uniSteps
  88. },
  89. data() {
  90. return {
  91. status: 'loading',
  92. backlogId: '', // 待办id
  93. infoData:{}, // 详情数据
  94. backlogPhotoList: [], // 图片列表
  95. numList: [],
  96. comment: '', // 评论
  97. isFocus: false // 评论键盘是否弹起
  98. }
  99. },
  100. onLoad(option) {
  101. this.backlogId = option.id
  102. this.getData(option.id)
  103. this.getRecordData(option.id)
  104. },
  105. methods: {
  106. // 图片预览
  107. showImg () {
  108. uni.previewImage({
  109. urls: this.backlogPhotoList
  110. })
  111. },
  112. // 获取详情数据
  113. getData (id) {
  114. this.status = 'loading'
  115. getBackLogDetail({id:id}).then(res=>{
  116. // console.log(res,'rrrrrrrr')
  117. if(res.status==200){
  118. this.infoData = res.data
  119. let arr = []
  120. if (this.infoData.backlogPhotoList) {
  121. this.infoData.backlogPhotoList.map(item=>{
  122. if(item.photoPath) {
  123. arr.push(item.photoPath)
  124. }
  125. })
  126. }
  127. this.backlogPhotoList = arr
  128. } else {
  129. this.toashMsg(res.message)
  130. this.infoData = {}
  131. this.backlogPhotoList = []
  132. }
  133. this.status = 'nomore'
  134. })
  135. },
  136. // 获取进度数据
  137. getRecordData (id) {
  138. getBackLogRecord({id:id}).then(res=>{
  139. if(res.status==200){
  140. let arr = []
  141. res.data.map(item=>{
  142. const p = {}
  143. const k = '\xa0\xa0\xa0\xa0\xa0\xa0'
  144. p.title = item.handleTime + k + item.handleTypeDictValue
  145. p.desc = item.handleDesc ? item.handleDesc : ''
  146. arr.push(p)
  147. })
  148. this.numList = arr
  149. } else {
  150. this.toashMsg(res.message)
  151. this.numList = []
  152. }
  153. })
  154. },
  155. // 提交处理
  156. //type: SOLVE("SOLVE", "整改问题"),AUDIT_YES("AUDIT_YES", "审核通过"),AUDIT_NO("AUDIT_NO", "审核不通过"),COMMENTS("COMMENTS", "发表评论");
  157. handleSubmit(type) {
  158. const params = {
  159. id: this.backlogId,
  160. handleDesc: this.comment,
  161. handleType: type
  162. }
  163. handleBackLog(params).then(res=>{
  164. this.toashMsg(res.message)
  165. if(res.status==200){
  166. uni.$emit('refreshBl-handle')
  167. if (type=='COMMENTS') {
  168. this.comment = ''
  169. this.isFocus = false
  170. this.getRecordData(this.backlogId)
  171. } else {
  172. setTimeout(()=>{
  173. uni.navigateBack()
  174. },300)
  175. }
  176. }
  177. })
  178. },
  179. // 状态颜色处理
  180. clsStatus(status){
  181. if(status == '待审核'){
  182. return 'dsh'
  183. }
  184. if(status == '待整改'){
  185. return 'dzg'
  186. }
  187. if(status == '整改完成'){
  188. return 'ywc'
  189. }
  190. if(status == '已过期'){
  191. return 'ygq'
  192. }
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss" >
  198. page{
  199. height: 100%;
  200. }
  201. .back-content {
  202. background-color: #eee;
  203. height: 100%;
  204. display: flex;
  205. flex-direction: column;
  206. .content{
  207. flex: 1;
  208. overflow-y: scroll;
  209. }
  210. // 轮播图
  211. .top-ad-swiper{
  212. height: 340upx;
  213. }
  214. .noPic{
  215. width: 750upx;
  216. height: 400upx;
  217. font-size: 38upx;
  218. text-align: center;
  219. line-height: 400upx;
  220. color: #666;
  221. }
  222. // 详情内容
  223. .back-text{
  224. background: #ffffff;
  225. padding: 10upx 20upx;
  226. margin-bottom: 20upx;
  227. border-radius: 6upx;
  228. box-shadow: 1px 1px 3px #EEEEEE;
  229. .text-item{
  230. display: flex;
  231. align-items: center;
  232. padding: 10upx 10upx;
  233. font-size: 28upx;
  234. justify-content: space-between;
  235. .margin-left{
  236. margin-left: 30upx;
  237. }
  238. .time{
  239. color: #888;
  240. font-size: 26upx;
  241. margin-left: 10upx;
  242. }
  243. > view{
  244. &:first-child{
  245. flex: 1;
  246. width: 200upx;
  247. }
  248. }
  249. .desc{
  250. word-break: break-word;
  251. width: 80%;
  252. text-align: right;
  253. }
  254. }
  255. }
  256. // 步骤条
  257. .step-content {
  258. padding: 0 20upx;
  259. background-color: #fff;
  260. }
  261. // 底部按钮
  262. .footer {
  263. background-color: #fff;
  264. // margin-top: 20upx;
  265. .check-pending{
  266. display: flex;
  267. .act-btn {
  268. width: 50%;
  269. }
  270. }
  271. .comment-input{
  272. width: 100%;
  273. padding: 20upx;
  274. .input-cont{
  275. width: 100%;
  276. background-color: #f4f4f4;
  277. border-radius: 10upx;
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. padding: 0 20upx;
  282. textarea{
  283. padding: 20upx;
  284. height: 100%;
  285. flex: 1;
  286. }
  287. .active{
  288. background-color: #fff;
  289. margin: 20upx 20upx 20upx 0;
  290. }
  291. .input-btn{
  292. padding: 20upx;
  293. height: 60upx;
  294. }
  295. }
  296. view{
  297. margin-top: 20upx;
  298. }
  299. }
  300. .dsh{
  301. color: red;
  302. }
  303. .dzg{
  304. color: #007AFF;
  305. }
  306. .ywc {
  307. color: #10c71e;
  308. }
  309. }
  310. .ygq {
  311. color: #999;
  312. }
  313. }
  314. </style>