detail.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <div class="record-detail">
  3. <nav-bar></nav-bar>
  4. <div class="page-container">
  5. <div class="card">
  6. <van-panel title="XXX设备">
  7. <div class="tag-box">
  8. <div v-for="(v,i) in tagList"
  9. class="tag-item"
  10. :style="{backgroundColor:getColor(v.state),borderColor:getColor(v.state)}"
  11. @click="clickTag" :key="i">
  12. {{v.name+i}}
  13. </div>
  14. </div>
  15. <ul class="legend">
  16. <li v-for="v in legend" :key="v.type">
  17. <span :style="{background:v.color}"></span>
  18. {{v.type}}
  19. </li>
  20. </ul>
  21. </van-panel>
  22. </div>
  23. <!-- 基本信息 -->
  24. <div class="card">
  25. <van-panel >
  26. <template #header>
  27. <span></span>
  28. </template>
  29. <div class="panel-box">
  30. <van-cell title="组织机构" :value="selectedUser.userName"></van-cell>
  31. <van-cell title="监控主机" :value="getDictLabel(selectedUser.type,'out_in_type')"></van-cell>
  32. <van-cell title="通道号" :value="selectedUser.idCard"></van-cell>
  33. <van-cell title="计划存储天数" :value="selectedUser.idCard"></van-cell>
  34. <van-cell title="上报日期" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM')"></van-cell>
  35. <van-cell title="检查日期" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM')"></van-cell>
  36. <van-cell title="计划时间" >
  37. <template #label>
  38. <van-cell title="1" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  39. <van-cell title="2" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  40. <van-cell title="3" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  41. </template>
  42. </van-cell>
  43. <van-cell title="丢失时间" >
  44. <template #label>
  45. <van-cell title="1" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  46. <van-cell title="2" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  47. <van-cell title="3" :value="dayjs(selectedUser.arrivalTime).format('YYYY-DD-MM HH:mm')"></van-cell>
  48. </template>
  49. </van-cell>
  50. </div>
  51. <div class="big-btn-box" >
  52. <van-button type="info" size="large" @click="onSubmit">生成运维单</van-button>
  53. </div>
  54. </van-panel>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import DateCell from "@/components/dateCell/index.vue";
  61. import Uploader from "@/components/upload/gxuploader.vue";
  62. import {formatDate} from "@/filters/filter";
  63. import {mapGetters} from "vuex";
  64. import {imgUrl} from "@/utils";
  65. import { ImagePreview } from 'vant'
  66. import {userDetails, userDepart} from './api'
  67. import dayjs from 'dayjs'
  68. export default {
  69. components: {Uploader, DateCell},
  70. data(){
  71. return {
  72. legend:[
  73. {
  74. type:'正常',
  75. color:'#009240',
  76. },
  77. {
  78. type:'运维',
  79. color:'#FFA500',
  80. },
  81. {
  82. type:'异常',
  83. color:'#D7000F',
  84. }
  85. ],
  86. tagList:[
  87. {
  88. name:'通道',
  89. state:1,
  90. },
  91. {
  92. name:'通道',
  93. state:3,
  94. },
  95. {
  96. name:'通道',
  97. state:2,
  98. },
  99. {
  100. name:'通道',
  101. state:1,
  102. },
  103. {
  104. name:'通道',
  105. state:3,
  106. },
  107. {
  108. name:'通道',
  109. state:2,
  110. },
  111. {
  112. name:'通道',
  113. state:1,
  114. },
  115. {
  116. name:'通道',
  117. state:3,
  118. },
  119. {
  120. name:'通道',
  121. state:2,
  122. },
  123. {
  124. name:'通道',
  125. state:1,
  126. },
  127. {
  128. name:'通道',
  129. state:3,
  130. },
  131. {
  132. name:'通道',
  133. state:2,
  134. },
  135. {
  136. name:'通道',
  137. state:1,
  138. },
  139. {
  140. name:'通道',
  141. state:3,
  142. },
  143. {
  144. name:'通道',
  145. state:2,
  146. },
  147. ],
  148. maxData:new Date(),
  149. minDate:null,
  150. visitId:null,
  151. userList:[],
  152. selectedUser:{},
  153. prop:{
  154. label:'userName',
  155. value:'id'
  156. },
  157. formData:{
  158. arrivalTime:null,
  159. departureTime:null,
  160. },
  161. dicts:['out_in_approve_status','out_in_type','letter_id_type']
  162. }
  163. },
  164. computed:{
  165. ...mapGetters(['orgId','id','dictionary']),
  166. },
  167. created(){
  168. this.visitId = this.$route.query.id;
  169. this.getUserInfo();
  170. },
  171. methods:{
  172. imgUrl,formatDate,
  173. getColor(s){
  174. if(s ===1){
  175. return '#009240';
  176. }
  177. if(s ===2){
  178. return '#D7000F';
  179. }
  180. if(s===3){
  181. return '#FFA500';
  182. }
  183. },
  184. clickTag(){
  185. },
  186. onSubmit(){
  187. this.$router.replace({
  188. name:'addOrder',
  189. path:'/addOrder',
  190. });
  191. },
  192. getUserInfo(){
  193. userDetails(this.visitId).then(res=>{
  194. let checkImage = res.data.checkImage.split(',');
  195. let imgFile = res.data.imgFile.split(',');
  196. let letterFile = [];
  197. if(res.data.letterFile && res.data.letterFile.length > 0){
  198. letterFile = res.data.letterFile.map(v=>{
  199. return JSON.parse(v)
  200. })
  201. }
  202. this.selectedUser = res.data;
  203. this.selectedUser.checkImage = checkImage;
  204. this.selectedUser.imgFile = imgFile;
  205. this.selectedUser.letterFile = letterFile;
  206. //设置最小时间
  207. let minDate = this.selectedUser.arrivalTime;
  208. this.minDate = new Date(minDate);
  209. })
  210. },
  211. previewFile(file){
  212. this.openFilePreview(file);
  213. },
  214. preView(val) {
  215. if(Array.isArray(val)){
  216. let arr = val.map(v=>{
  217. return imgUrl(v);
  218. })
  219. ImagePreview(arr);
  220. }else {
  221. ImagePreview([imgUrl(val)]);
  222. }
  223. },
  224. }
  225. }
  226. </script>
  227. <style lang="scss">
  228. .record-detail{
  229. .van-card{
  230. padding: 20px;
  231. }
  232. .card-cell-box{
  233. width: 70%;
  234. .van-cell{
  235. padding: 10px;
  236. &::after{
  237. left:10px;
  238. right:10px;
  239. }
  240. }
  241. .van-cell__title{
  242. flex:.25;
  243. }
  244. .van-cell__value{
  245. flex:.75;
  246. }
  247. }
  248. }
  249. </style>
  250. <style scoped lang="scss">
  251. .record-detail{
  252. height: 100%;
  253. overflow: hidden;
  254. }
  255. .page-container{
  256. height: calc(100vh - 94px);
  257. overflow: auto;
  258. padding: 20px;
  259. }
  260. .tag-box{
  261. padding: 20px;
  262. display: grid;
  263. grid-template-columns: repeat(4, 1fr);
  264. .tag-item{
  265. width: 130px;
  266. height: 70px;
  267. font-size: 26px;
  268. display: flex;
  269. justify-content: center;
  270. align-items: center;
  271. margin: 10px 18px;
  272. background-color: #009dff;
  273. border:1px solid #009dff;
  274. color:#fff;
  275. padding:10px;
  276. border-radius: 10px;
  277. &:hover{
  278. color: #009dff;
  279. background-color:#fff!important;
  280. }
  281. }
  282. }
  283. .flex-box{
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. >span{
  288. margin: 0 20px;
  289. }
  290. }
  291. .card{
  292. margin-bottom: 20px;
  293. box-shadow: 0 10px 10px #eaeaea;
  294. }
  295. .card:last-child{
  296. margin-bottom: 0;
  297. }
  298. .panel-box{
  299. -padding:0 20px;
  300. }
  301. .panel-box-item{
  302. height: 36px;
  303. line-height: 36px;
  304. }
  305. .item-label{
  306. width: 100%;
  307. display: flex;
  308. justify-content: right;
  309. align-items: center;
  310. }
  311. .item-value{
  312. width: 100%;
  313. display: flex;
  314. justify-content: left;
  315. align-items: center;
  316. }
  317. .upload-box{
  318. padding: 20px 30px;
  319. display: flex;
  320. >span{
  321. display: inline-block;
  322. height: 160px;
  323. width: 200px;
  324. line-height: 160px;
  325. font-size: 28px;
  326. color:#999;
  327. >i{
  328. font-style: normal;
  329. color: #ee0a24;
  330. }
  331. }
  332. .required::before{
  333. content: '*';
  334. color: #ee0a24;
  335. position: absolute;
  336. left: 14px;
  337. }
  338. }
  339. .goods-card{
  340. width: 100%;
  341. display: flex;
  342. align-items: center;
  343. padding: 10px;
  344. background-color: #fff;
  345. .card-img-box{
  346. width: 200px;
  347. height: 200px;
  348. margin-right: 10px;
  349. >img{
  350. width: 100%;
  351. height: 100%;
  352. object-fit: cover;
  353. border-radius: 10px;
  354. }
  355. }
  356. }
  357. .big-btn-box{
  358. padding: 20px;
  359. }
  360. .file-box{
  361. width: 70%;
  362. display: flex;
  363. justify-content: flex-end;
  364. color:#008cd6;
  365. }
  366. .nfc-img {
  367. display: inline-block;
  368. width: 140px;
  369. height: 140px;
  370. margin: 0 10px;
  371. position: relative;
  372. > img {
  373. width: 100%;
  374. height: 100%;
  375. border: none;
  376. }
  377. > span {
  378. position: absolute;
  379. padding: 0 10px;
  380. bottom: 0;
  381. left: 0;
  382. display: block;
  383. width: 100%;
  384. background-color: rgba(0, 0, 0, 0.2);
  385. color: #eaeaea;
  386. font-size: 20px;
  387. overflow: hidden;
  388. text-overflow: ellipsis;
  389. white-space: nowrap;
  390. line-height: 30px;
  391. height: 30px;
  392. }
  393. }
  394. </style>