backlogDetail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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.photoPath+'?x-oss-process=image/resize,h_200,w_375,m_lfit'"></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('SOLVE')" 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('AUDIT_NO')" class="act-btn" type="error">整改不通过</u-button>
  63. <u-button @click="handleSubmit('AUDIT_YES')" 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="isFocus = true" placeholder="请输入评论..."/>
  69. <u-button @click="handleSubmit('COMMENTS')" :disabled="!comment" 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. }
  89. },
  90. onLoad(option) {
  91. this.backlogId = option.id
  92. this.getData(option.id)
  93. this.getRecordData(option.id)
  94. },
  95. methods: {
  96. // 获取详情数据
  97. getData (id) {
  98. getBackLogDetail({id:id}).then(res=>{
  99. console.log(res,'rrrrrrrr')
  100. if(res.status==200){
  101. this.infoData = res.data
  102. } else {
  103. this.toashMsg(res.message)
  104. this.infoData = {}
  105. }
  106. })
  107. },
  108. // 获取进度数据
  109. getRecordData (id) {
  110. getBackLogRecord({id:id}).then(res=>{
  111. if(res.status==200){
  112. let arr = []
  113. res.data.map(item=>{
  114. const p = {}
  115. const k = '\xa0\xa0\xa0\xa0\xa0\xa0'
  116. p.name = item.handleTime + k + item.handleTypeDictValue + k + (item.handleDesc ? item.handleDesc : '')
  117. arr.push(p)
  118. })
  119. this.numList = arr
  120. } else {
  121. this.toashMsg(res.message)
  122. this.numList = []
  123. }
  124. })
  125. },
  126. // 提交处理
  127. //type: SOLVE("SOLVE", "整改问题"),AUDIT_YES("AUDIT_YES", "审核通过"),AUDIT_NO("AUDIT_NO", "审核不通过"),COMMENTS("COMMENTS", "发表评论");
  128. handleSubmit(type) {
  129. console.log(11111111111)
  130. const params = {
  131. backlogId: this.backlogId,
  132. handleDesc: this.comment,
  133. handleType: type
  134. }
  135. handleBackLog(params).then(res=>{
  136. this.toashMsg(res.message)
  137. if(res.status==200){
  138. if (type=='COMMENTS') {
  139. this.comment = ''
  140. this.isFocus = false
  141. this.getRecordData(this.backlogId)
  142. } else {
  143. setTimeout(()=>{
  144. uni.navigateBack()
  145. },300)
  146. }
  147. }
  148. })
  149. },
  150. // 状态颜色处理
  151. clsStatus(status){
  152. if(status == '待审核'){
  153. return 'dsh'
  154. }
  155. if(status == '待整改'){
  156. return 'dzg'
  157. }
  158. if(status == '整改完成'){
  159. return 'ywc'
  160. }
  161. if(status == '已过期'){
  162. return 'ygq'
  163. }
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .back-content {
  170. background-color: #eee;
  171. height: 100%;
  172. display: flex;
  173. flex-direction: column;
  174. // 轮播图
  175. .top-ad-swiper{
  176. height: 340upx;
  177. }
  178. .noPic{
  179. width: 750upx;
  180. height: 400upx;
  181. font-size: 38upx;
  182. text-align: center;
  183. line-height: 400upx;
  184. color: #666;
  185. }
  186. // 详情内容
  187. .back-text{
  188. background: #ffffff;
  189. padding: 10upx 20upx;
  190. margin-bottom: 20upx;
  191. border-radius: 6upx;
  192. box-shadow: 1px 1px 3px #EEEEEE;
  193. .text-item{
  194. display: flex;
  195. align-items: center;
  196. padding: 10upx 10upx;
  197. font-size: 28upx;
  198. justify-content: space-between;
  199. .margin-left{
  200. margin-left: 30upx;
  201. }
  202. .time{
  203. color: #888;
  204. font-size: 26upx;
  205. margin-left: 10upx;
  206. }
  207. > view{
  208. &:first-child{
  209. flex: 1;
  210. }
  211. }
  212. }
  213. }
  214. // 步骤条
  215. .step-content {
  216. padding: 0 20upx;
  217. background-color: #fff;
  218. flex: 1;
  219. overflow-y: scroll;
  220. }
  221. // 底部按钮
  222. .footer {
  223. background-color: #fff;
  224. // margin-top: 20upx;
  225. .check-pending{
  226. display: flex;
  227. .act-btn {
  228. width: 50%;
  229. }
  230. }
  231. .comment-input{
  232. width: 100%;
  233. padding: 20upx;
  234. .input-cont{
  235. width: 100%;
  236. background-color: #f4f4f4;
  237. border-radius: 10upx;
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. padding: 0 20upx;
  242. textarea{
  243. padding: 20upx;
  244. height: 100%;
  245. flex: 1;
  246. }
  247. .active{
  248. background-color: #fff;
  249. margin: 20upx 20upx 20upx 0;
  250. }
  251. .input-btn{
  252. padding: 20upx;
  253. height: 60upx;
  254. }
  255. }
  256. view{
  257. margin-top: 20upx;
  258. }
  259. }
  260. .dsh{
  261. color: red;
  262. }
  263. .dzg{
  264. color: #007AFF;
  265. }
  266. .ygq {
  267. color: #999;
  268. }
  269. .ywc {
  270. color: #10c71e;
  271. }
  272. }
  273. }
  274. </style>