evaluate.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <div class="bgColor">
  3. <div class="rapirMessage">
  4. <div class="label">
  5. 报修信息
  6. </div>
  7. <div class="state">
  8. <div>报修编号:&nbsp;{{data.incident.incidentsign}}</div>
  9. <div :class="stateClassFn(data.state.name)">{{data.state.name}}</div>
  10. </div>
  11. <div class="description">
  12. <div>
  13. 报修内容:
  14. </div>
  15. <div>
  16. {{data.description||"暂无"}}
  17. </div>
  18. </div>
  19. <div class="ipt">
  20. <div>
  21. 报修图片:
  22. </div>
  23. <div class="imgs-container">
  24. <img :src="img" v-for="(img, index) in imgs" @click="handleImgsClick(index)" v-if="imgs.length">
  25. <span v-if="!imgs.length">暂无</span>
  26. </div>
  27. </div>
  28. <div class="faultLocation">
  29. <div>
  30. 报修地址:
  31. </div>
  32. <div>
  33. {{data.address}}
  34. </div>
  35. </div>
  36. </div>
  37. <div class="label">
  38. 报修评价
  39. </div>
  40. <div class="rate">
  41. <span class="pj">评价:</span><cube-rate v-model="rate"></cube-rate>
  42. </div>
  43. <div class="rateText">
  44. <cube-textarea v-model="rateText" placeholder="您可以从响应速度、解决情况、服务态度等方面,给我们作出相应的评价"></cube-textarea>
  45. </div>
  46. <div class="chehuiBox">
  47. </div>
  48. <div class="chehui">
  49. <div class="btn" @click="evaluate()">提&nbsp;交&nbsp;评&nbsp;价</div>
  50. </div>
  51. <promp-ting :conents="promptingConent" :status="promptingStatus"></promp-ting>
  52. </div>
  53. </template>
  54. <script>
  55. import PrompTing from './../views/prompting.vue'
  56. export default {
  57. data(){
  58. return{
  59. data:"",
  60. imgs:[],
  61. rate:5,
  62. rateText:"暂无内容",
  63. rateData:0,
  64. promptingConent:"",
  65. promptingStatus:"",
  66. degreeDictionary:[]
  67. }
  68. },
  69. methods:{
  70. evaluate(){
  71. if(!this.rate){
  72. this.$createDialog({
  73. type: 'alert',
  74. title: '评分未选',
  75. content: '请选择评分',
  76. icon: 'cubeic-wrong'
  77. }).show()
  78. }
  79. // else if(this.rateText==""){
  80. // this.$createDialog({
  81. // type: 'alert',
  82. // title: '评价未填',
  83. // content: '请作出您的评价',
  84. // icon: 'cubeic-wrong'
  85. // }).show()
  86. // }
  87. else{
  88. var that=this;
  89. this.$http.post('service/apply/bpm/degree',{
  90. "id":that.data.id,
  91. "degree":this.rateData===0?this.degreeDictionary[0].id:this.rateData,
  92. "degreeRemark":this.rateText
  93. }).then(function(res){
  94. if(res.status==200){
  95. that.promptingConent="恭喜您,评价成功!";
  96. that.promptingStatus=true;
  97. $("#fade").fadeIn();
  98. setTimeout(function(){
  99. $("#fade").fadeOut();
  100. },2000);
  101. that.dialog = that.$createDialog({
  102. type: 'alert',
  103. title: '恭喜您,提交评价成功!',
  104. content: '点击返回事件列表',
  105. icon: 'cubeic-right',
  106. onConfirm: (e, promptValue) => {
  107. that.$router.push({path:'/main/incidentList'})
  108. }
  109. }).show()
  110. }else{
  111. that.promptingConent="对不起,评价失败,请稍后再试!";
  112. that.promptingStatus=false;
  113. $("#fade").fadeIn();
  114. setTimeout(function(){
  115. $("#fade").fadeOut();
  116. },2000);
  117. }
  118. })
  119. }
  120. },
  121. getDeggreDictionart(){
  122. var that=this;
  123. this.$http.post('service/common/common/getDictionary',{
  124. key: "incident_degree",
  125. type: "list"
  126. }).then(function(res){
  127. that.degreeDictionary=res.data
  128. })
  129. },
  130. getParams(){
  131. this.data=JSON.parse(this.$route.params.data)
  132. },
  133. stateClassFn(data){
  134. if(data=="未转换"){
  135. return "weishouli"
  136. }else if(data=="不受理"){
  137. return "bushouli"
  138. }else if(data=="处理中"){
  139. return "chulizhong"
  140. }else if(data=="待评价"){
  141. return "daipingjia"
  142. }else if(data=="已解决"){
  143. return "yijiejue"
  144. }else if(data=="已撤回"){
  145. return "yichehui"
  146. }else{
  147. return "yichehui"
  148. }
  149. },
  150. getImgsData(){
  151. var that=this;
  152. this.$http.get('service/common/common/listAttachment/wechatRequesterIncident/'+this.data.id,{
  153. // this.$http.get('service/common/common/listAttachment/wechatRequesterIncident/'+this.data.bxcode,{
  154. }).then(function(res){
  155. for(var i=0;i<res.data.data.length;i++){
  156. // that.imgs.push("http://localhost/service/common/common/downloadAttachment/"+res.data.data[i].token)
  157. // that.imgs.push("http://weixintest.ngser.dashitech.com/service/common/common/downloadAttachment/"+res.data.data[i].token)
  158. that.imgs.push("http://itsmpoc.dashitech.com/service/common/common/downloadAttachment/"+res.data.data[i].token)
  159. // that.imgs.push("http://192.168.3.95/service/common/common/downloadAttachment/"+res.data.data[i].token)
  160. }
  161. })
  162. },
  163. handleImgsClick(index) {
  164. this.initialIndex = index
  165. const params = {
  166. $props: {
  167. imgs: this.imgs,
  168. initialIndex: 'initialIndex',
  169. loop: false
  170. },
  171. $events: {
  172. change: (i) => {
  173. this.initialIndex = i
  174. }
  175. }
  176. }
  177. this.$createImagePreview({ ...params }).show()
  178. },
  179. },
  180. created(){
  181. this.getParams(),
  182. this.getImgsData(),
  183. this.getDeggreDictionart()
  184. },
  185. mounted(){
  186. },
  187. components: {
  188. PrompTing
  189. },
  190. watch:{
  191. rate:{
  192. handler:function(val){
  193. console.log(this.degreeDictionary);
  194. if(val==0){
  195. this.rateData=this.degreeDictionary[0].id
  196. }else if(val==1){
  197. this.rateData=this.degreeDictionary[4].id
  198. }else if(val==2){
  199. this.rateData=this.degreeDictionary[3].id
  200. }else if(val==3){
  201. this.rateData=this.degreeDictionary[2].id
  202. }else if(val==4){
  203. this.rateData=this.degreeDictionary[1].id
  204. }else if(val==5){
  205. this.rateData=this.degreeDictionary[0].id
  206. }
  207. },
  208. deep:true
  209. }
  210. }
  211. }
  212. </script>
  213. <style scoped>
  214. .bgColor{
  215. background-color: white
  216. }
  217. .label{
  218. background-color: rgb(238, 238, 238);
  219. height: .6rem;
  220. line-height: .6rem;
  221. padding-left: .24rem;
  222. font-size: .24rem;
  223. color: #666666
  224. }
  225. .state{
  226. display: flex;
  227. justify-content:space-between;
  228. align-items:center;
  229. padding: 0 .24rem;
  230. height: .88rem;
  231. border-top: .01rem rgb(223, 222, 222) solid;
  232. border-bottom: .01rem rgb(223, 222, 222) solid;
  233. }
  234. .state div:nth-child(1){
  235. font-size: .32rem;
  236. line-height: .45rem;
  237. color:#333333
  238. }
  239. .state div:nth-child(2){
  240. padding: .05rem .3rem;
  241. /* border: 0.01rem rgb(0,0,255) solid; */
  242. border-radius: 16px ;
  243. /* color: rgb(0,0,255) */
  244. }
  245. .description{
  246. display: flex;
  247. justify-content:space-between;
  248. padding: .24rem;
  249. border-bottom: .01rem rgb(223, 222, 222) solid;
  250. }
  251. .description div:nth-child(1){
  252. width: 20%;
  253. font-size: .32rem;
  254. color: #333333;
  255. line-height: .45rem
  256. }
  257. .description div:nth-child(2){
  258. width: 80%;
  259. font-size: .32rem;
  260. line-height: .45rem;
  261. color: #333333
  262. }
  263. .ipt{
  264. display: flex;
  265. justify-content:space-between;
  266. padding: .24rem;
  267. border-bottom: .01rem rgb(223, 222, 222) solid;
  268. }
  269. .ipt div:nth-child(1){
  270. width: 20%;
  271. font-size: .32rem;
  272. line-height: .45rem;
  273. color: #333333
  274. }
  275. .ipt div:nth-child(2){
  276. width: 80%;
  277. }
  278. .faultLocation{
  279. display: flex;
  280. justify-content:space-between;
  281. padding: .24rem;
  282. border-bottom: .01rem rgb(223, 222, 222) solid;
  283. }
  284. .faultLocation div:nth-child(1){
  285. width: 20%;
  286. font-size: .32rem;
  287. line-height: .45rem;
  288. color: #333333
  289. }
  290. .faultLocation div:nth-child(2){
  291. width: 80%;
  292. font-size: .32rem;
  293. line-height: .45rem;
  294. color: #333333
  295. }
  296. .imgs-container img{
  297. width: 1.5rem;
  298. height: 1.5rem;
  299. margin-left: .2rem
  300. }
  301. .imgs-container img:nth-child(1){
  302. margin-left: 0
  303. }
  304. .imgs-container span{
  305. font-size: .32rem;
  306. line-height: .45rem
  307. }
  308. .weishouli{
  309. color:#991f00;
  310. border: 0.01rem #991f00 solid;
  311. background-color: #f4e8e5
  312. }
  313. .bushouli{
  314. color:#666666;
  315. background-color: #eeeeee;
  316. border: 0.01rem #666666 solid;
  317. }
  318. .chulizhong{
  319. color:#003057;
  320. background-color: #e5eaee;
  321. border: 0.01rem #003057 solid;
  322. }
  323. .daipingjia{
  324. color:#825b00;
  325. background-color: #f2eee5;
  326. border: 0.01rem #825b00 solid;
  327. }
  328. .yijiejue{
  329. color:#40a19c;
  330. background-color: #ebf5f5;
  331. border: 0.01rem #40a19c solid;
  332. }
  333. .yichehui{
  334. color:#48a843;
  335. background-color: #ecf6ec;
  336. border: 0.01rem #48a843 solid;
  337. }
  338. .rate{
  339. height: .88rem;
  340. display: flex;
  341. align-items:center;
  342. padding: 0 .24rem;
  343. border-bottom: .01rem rgb(223, 222, 222) solid;
  344. }
  345. .rate .pj{
  346. font-size: .32rem;
  347. display: inline-block;
  348. margin-right: .2rem
  349. }
  350. .rateText{
  351. padding: .24rem
  352. }
  353. .chehuiBox{
  354. width: 100%;
  355. height: 1.3rem;
  356. }
  357. .chehui{
  358. height: 1.3rem;
  359. width: 100%;
  360. border-top: .01rem rgb(223, 222, 222) solid;
  361. background-color: rgb(248,248,248);
  362. position: fixed;
  363. left: 0;
  364. bottom: 0;
  365. display: flex;
  366. align-items:center;
  367. justify-content:center
  368. }
  369. .chehui .btn{
  370. width: 90%;
  371. height: 1rem;
  372. background-color: #005395;
  373. border-radius: 10px;
  374. line-height: 1rem;
  375. color: white;
  376. font-size: .36rem;
  377. text-align: center
  378. }
  379. </style>
  380. <style>
  381. .cube-textarea-wrapper{
  382. height: 60px!important;
  383. }
  384. </style>