足力健前端,vue版本

detail.vue 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div class="order_detail">
  3. <el-row :gutter="20">
  4. <el-col :md="24" class="order_detail_body">
  5. <el-card shadow="hover">
  6. <el-col :md="3">
  7. <div class="round_img">
  8. <img :src="avatar" alt="头像">
  9. </div>
  10. </el-col>
  11. <el-col :md="21">
  12. <h1 class="title"><svg-icon class="title_icon" icon-class="hongqi" />工单编号:{{ ordercode }}</h1>
  13. <!-- <p class="title_sub"><span class="green">{{ name }}</span> {{ createtime }}</p> -->
  14. <p class="title_sub"><span class="green">{{ name }}</span> 河南阜外华中心血管病医院 {{ createtime }}</p>
  15. <p class="title_sub">催单次数:<span class="red">10</span>次 | 工单状态: <span class="done">已完成</span></p>
  16. </el-col>
  17. <el-col :md="24" class="order_detail_content">
  18. <el-col :md="6" class="order_detail_item">
  19. 客户电话:{{ phone }}
  20. </el-col>
  21. <el-col :md="6" class="order_detail_item">
  22. 客户性别:{{ sex }}
  23. </el-col>
  24. <el-col :md="6" class="order_detail_item">
  25. 工单来源:{{ sourcename }}
  26. </el-col>
  27. <el-col :md="6" class="order_detail_item">
  28. 工单类型:{{ sourcetype }}
  29. </el-col>
  30. <el-col :md="6" class="order_detail_item">
  31. 地址:{{ address }}
  32. </el-col>
  33. <el-col :md="6" class="order_detail_item">
  34. 创建人:{{ createuser }}
  35. </el-col>
  36. <el-col :md="24" class="order_detail_item">
  37. 工单内容:
  38. <div class="order_content" v-html="content"/>
  39. </el-col>
  40. <el-col v-if="fileList.length > 0" :md="24" class="order_detail_item">
  41. <p>附件:<span class="yellow">(可以下载查看)</span></p>
  42. <el-col v-for="(item, index) in fileList" :md="3" :key="index">
  43. <el-card class="order_file">
  44. <span class="img_mask">
  45. <a :href="item.fileurl" download="filename" title="点击下载">
  46. <i class="el-icon-download"/>
  47. </a>
  48. </span>
  49. <img v-if="item.filesmallurl" :src="item.filesmallurl" :large="item.fileurl" :preview-text="item.filename" preview="0" height="68" width="80%">
  50. <i v-else class="el-icon-document file_icon"/>
  51. <p :title="item.filename"> {{ item.filename }} </p>
  52. </el-card>
  53. </el-col>
  54. </el-col>
  55. <el-col :md="6">
  56. <i class="el-icon-time"/>
  57. 已持续 <span class="red">20</span> 小时 <span class="red">20</span> 分 <span class="red">20</span> 秒
  58. </el-col>
  59. <el-col :md="6" :offset="12">
  60. <el-button type="primary" size="mini" plain>催单</el-button>
  61. <el-button type="primary" size="mini" plain>转派</el-button>
  62. <el-button type="primary" size="mini" plain>完成</el-button>
  63. </el-col>
  64. </el-col>
  65. </el-card>
  66. </el-col>
  67. <el-col :md="12">
  68. <el-card shadow="hover">
  69. <div slot="header" class="clearfix">
  70. <span>工单动态</span>
  71. </div>
  72. <div class="order_steps">
  73. <el-steps :active="0" :space="100" direction="vertical" process-status="success">
  74. <el-step title="已完成" description="2018-10-23 10:30:20 这是一段很长很长很长的描述性文字"/>
  75. <el-step title="已转派" description="2018-10-23 10:30:20 这是一段很长很长很长的描述性文字"/>
  76. <el-step title="已创建" description="2018-10-23 10:30:20 这是一段很长很长很长的描述性文字"/>
  77. </el-steps>
  78. </div>
  79. </el-card>
  80. </el-col>
  81. <el-col :md="12">
  82. <el-card shadow="hover" class="order_record">
  83. <el-tabs v-model="activeName" @tab-click="handleClick">
  84. <el-tab-pane label="催单记录(2)" name="first">
  85. <div class="tab_body">
  86. 催单记录
  87. </div>
  88. </el-tab-pane>
  89. <el-tab-pane label="录音记录(3)" name="second">
  90. <div class="tab_body">
  91. 录音记录
  92. </div>
  93. </el-tab-pane>
  94. </el-tabs>
  95. </el-card>
  96. </el-col>
  97. </el-row>
  98. </div>
  99. </template>
  100. <script>
  101. import { getOrder } from '@/api/order/orderSearch'
  102. import { mapGetters } from 'vuex'
  103. import { filterContent } from '@/utils'
  104. export default {
  105. name: 'Detail',
  106. props: {
  107. rowid: {
  108. type: String,
  109. default: ''
  110. },
  111. layerid: {
  112. type: String,
  113. default: ''
  114. }
  115. },
  116. data() {
  117. return {
  118. activeName: 'first',
  119. ordercode: '', // 工单编号
  120. name: '', // 姓名
  121. phone: '', // 电话
  122. sex: '', // 性别
  123. address: '', // 地址
  124. sourcename: '', // 工单来源
  125. sourcetype: '', // 工单类型
  126. content: '', // 工单内容
  127. createtime: '', // 创建时间
  128. createuser: '', // 创建人
  129. fileList: [] // 附件
  130. }
  131. },
  132. computed: {
  133. ...mapGetters([
  134. 'avatar'
  135. ])
  136. },
  137. created() {
  138. if (this.rowid) {
  139. this.getDetail(this.rowid)
  140. }
  141. },
  142. methods: {
  143. handleClick(tab, event) {
  144. console.log(tab, event)
  145. },
  146. // 详情
  147. getDetail(rid) {
  148. getOrder(rid).then(response => {
  149. if (response.state.toLowerCase() === 'success') {
  150. const res = response.data.model
  151. this.ordercode = res.ordercode // 工单编号
  152. this.name = res.name // 姓名
  153. this.phone = res.phone // 电话
  154. this.sex = res.sex // 性别
  155. res.provincename = res.provincename === null ? '' : res.provincename
  156. res.cityname = res.cityname === null ? '' : res.cityname
  157. res.address = res.address === null ? '' : res.address
  158. this.address = res.provincename + res.cityname + res.address // 地址
  159. this.sourcename = res.sourcename // 工单来源
  160. this.sourcetype = res.typename // 工单类型
  161. this.content = filterContent.content(res.content) // 工单内容
  162. this.createtime = res.createtime // 创建时间
  163. this.createuser = res.createuser + '-' + res.createusername // 创建人
  164. // 附件
  165. if (res.files) {
  166. this.fileList = res.files
  167. }
  168. }
  169. })
  170. }
  171. }
  172. }
  173. </script>
  174. <style rel="stylesheet/scss" lang="scss">
  175. .order_detail{
  176. .el-col{
  177. margin-bottom: 20px;
  178. }
  179. .el-icon-time{
  180. color: #d81e06;
  181. }
  182. .el-card__header{
  183. padding-top: 14px;
  184. padding-bottom: 14px;
  185. background-color: #F5F5F6;
  186. }
  187. .order_file{
  188. .el-card__body{
  189. padding: 22px 0 0 0;
  190. text-align: center;
  191. }
  192. }
  193. .order_steps{
  194. .el-step__icon-inner{
  195. display: none;
  196. }
  197. }
  198. .order_record {
  199. .el-card__body{
  200. padding: 0;
  201. }
  202. .el-tabs__header{
  203. padding: 0px 20px;
  204. background-color: #F5F5F6;
  205. .el-tabs__item{
  206. font-size: 16px;
  207. height: 47px;
  208. line-height: 47px;
  209. }
  210. }
  211. }
  212. }
  213. </style>
  214. <style rel="stylesheet/scss" lang="scss" scoped>
  215. .order_detail{
  216. .order_detail_body{
  217. margin-bottom: 20px;
  218. .round_img{
  219. width: 90px;
  220. height: 90px;
  221. border-radius: 50%;
  222. overflow: hidden;
  223. margin: 14px;
  224. img{
  225. width: 100%;
  226. height: 100%;
  227. }
  228. }
  229. .title{
  230. font-size: 20px;
  231. .title_icon{
  232. color: #d81e06;
  233. font-size: 16px;
  234. margin-right: 20px;
  235. }
  236. }
  237. .title_sub{
  238. font-size: 14px;
  239. color: #666666;
  240. }
  241. .order_detail_content{
  242. background-color: #F5F5F6;
  243. padding-top: 20px;
  244. color: #4c4c4c;
  245. font-size: 14px;
  246. .order_detail_item{
  247. margin-bottom: 10px;
  248. .order_content{
  249. margin-top: 10px;
  250. }
  251. .order_file {
  252. position: relative;
  253. cursor: pointer;
  254. .img_mask {
  255. display: none;
  256. position: absolute;
  257. left: 0px;
  258. top: 0px;
  259. background-color: rgba(0, 0, 0, 0.3);
  260. width: 100%;
  261. height: 22px;
  262. text-align: right;
  263. z-index: 1;
  264. i {
  265. font-size: 20px;
  266. line-height: 22px;
  267. display: inline-block;
  268. margin-right: 15px;
  269. color: #fff;
  270. }
  271. }
  272. p {
  273. margin-top: 5px;
  274. padding-left: 14px;
  275. padding-right: 14px;
  276. white-space: nowrap;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. }
  280. .file_icon{
  281. height: 68px;
  282. line-height: 68px;
  283. font-size: 68px;
  284. color: #409EFF;
  285. }
  286. }
  287. .order_file:hover .img_mask {
  288. display: block;
  289. }
  290. }
  291. }
  292. }
  293. .green {
  294. color: #00c1de;
  295. }
  296. .done {
  297. color: #198120;
  298. }
  299. .red {
  300. color: #d81e06;
  301. }
  302. .yellow{
  303. color: #e6a23c;
  304. }
  305. .order_steps{
  306. // height: 240px;
  307. .el-step__icon-inner{
  308. display: none;
  309. }
  310. }
  311. .tab_body{
  312. padding: 0 20px 20px 20px;
  313. }
  314. }
  315. </style>