backlogDetail.vue 7.4 KB

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