detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <div class="patrol_config_detail" v-loading="detailsLoading">
  3. <div class="main_content">
  4. <!-- 基本信息 -->
  5. <div class="base_info">
  6. <HeaderTitle title="基本信息" size="16px"
  7. ><el-button type="primary" @click="$router.go(-1)"
  8. >返回</el-button
  9. ></HeaderTitle
  10. >
  11. <el-row class="base_info_content">
  12. <el-col :span="6">
  13. <span>计划单号:</span>
  14. <span>{{ detailsForm.code }}</span>
  15. </el-col>
  16. <el-col :span="6">
  17. <span>巡点检名称:</span>
  18. <span>{{ detailsForm.name }}</span>
  19. </el-col>
  20. <el-col :span="6">
  21. <span>部门:</span>
  22. <span>{{ detailsForm.planConfigVOList[0].groupName }}</span>
  23. </el-col>
  24. <el-col :span="6">
  25. <span>负责人:</span>
  26. <span>{{ detailsForm.planConfigVOList[0].approvalUserName }}</span>
  27. </el-col>
  28. <el-col :span="6">
  29. <span>计划完成时长:</span>
  30. <span>{{ detailsForm.duration }}分钟</span>
  31. </el-col>
  32. <el-col :span="6">
  33. <span>创建时间:</span>
  34. <span>{{ detailsForm.createTime }}</span>
  35. </el-col>
  36. <el-col :span="6">
  37. <span>审核人:</span>
  38. <span>{{
  39. detailsForm.planConfigVOList[0].execute
  40. .map((item) => item.userName)
  41. .join(',')
  42. }}</span>
  43. </el-col>
  44. <el-col :span="24">
  45. <span>备注:</span>
  46. <span>{{ detailsForm.remark }}</span>
  47. </el-col>
  48. </el-row>
  49. </div>
  50. <el-tabs v-model="tabsValue" type="card">
  51. <el-tab-pane
  52. v-for="(item, ruleIdListIndex) in ruleIdList"
  53. :key="item.ruleId"
  54. :label="item.name"
  55. :name="item.ruleId"
  56. >
  57. <div class="el-tab_box">
  58. <div class="equipmentList_box">
  59. <header-title title="设备列表"> </header-title>
  60. <el-table :data="item.equipmentList" border>
  61. <el-table-column label="序号" type="index" width="50">
  62. </el-table-column>
  63. <el-table-column label="设备名称" align="center" prop="name">
  64. <template slot-scope="{ row, $index }">
  65. <template>
  66. {{ row.name }}
  67. </template>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="编号" align="center" prop="codeNumber">
  71. <template slot-scope="{ row, $index }">
  72. <template>
  73. {{ row.codeNumber }}
  74. </template>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="固资编码" align="center" prop="fixCode">
  78. <template slot-scope="{ row, $index }">
  79. <template>
  80. {{ row.fixCode }}
  81. </template>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. </div>
  86. <div class="ruleMatters_box">
  87. <header-title title="规则事项"> </header-title>
  88. <el-table :data="item.ruleItems" border>
  89. <el-table-column label="序号" width="50">
  90. <template slot-scope="scope">
  91. <span>{{ scope.$index + 1 }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="事项" prop="name" width="100">
  95. <template slot-scope="scope">
  96. <div>
  97. <span>{{ scope.row.name }}</span>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="内容" prop="content" width="300">
  102. <template slot-scope="scope">
  103. <div>
  104. <span>{{ scope.row.content }}</span>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="操作指导" prop="operationGuide">
  109. <template slot-scope="scope">
  110. <div class="operationGuide_box">
  111. <div class="left_content">
  112. <template v-if="scope.row.operationGuide">
  113. <div
  114. v-for="(item, index) in scope.row.operationGuide
  115. .toolList"
  116. :key="item.id"
  117. >{{ index + 1 }}.{{ item.name }}</div
  118. >
  119. </template>
  120. </div>
  121. <div class="line"></div>
  122. <div class="right_content">
  123. <template v-if="scope.row.operationGuide">
  124. <div
  125. v-for="(item, index) in scope.row.operationGuide
  126. .procedureList"
  127. :key="item.id"
  128. >{{ index + 1 }}.{{ item.content }}</div
  129. >
  130. </template>
  131. </div>
  132. </div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="标准" prop="norm" width="100">
  136. <template slot-scope="scope">
  137. <div>
  138. <span>{{ scope.row.norm }}</span>
  139. </div>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. </div>
  144. </div>
  145. </el-tab-pane>
  146. </el-tabs>
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import { getInfoById } from '@/api/ruleManagement/plan';
  152. import { getDetail } from '@/api/ruleManagement/matter';
  153. export default {
  154. name: 'patrolConfigDetail',
  155. data() {
  156. return {
  157. ruleIdList: [],
  158. tabsValue: '',
  159. detailsLoading: false,
  160. detailsForm: {
  161. planConfigVOList: [{}]
  162. }
  163. };
  164. },
  165. mounted() {
  166. console.log('-----------------');
  167. this.getDetailsData(this.$route.query.id);
  168. },
  169. computed: {},
  170. methods: {
  171. // 获取详情数据
  172. async getDetailsData(id) {
  173. this.detailsLoading = true;
  174. getInfoById(id)
  175. .then((res) => {
  176. this.detailsLoading = false;
  177. console.log('====res', res);
  178. this.detailsForm = res;
  179. this.ruleIdList = res.planConfigVOList.map((item) => {
  180. return {
  181. ruleId: item.ruleId,
  182. name: item.ruleName,
  183. code: item.code,
  184. categoryId: item.categoryId,
  185. equipmentList: item.deviceInfo.map((item) => {
  186. return {
  187. name: item.name,
  188. id: item.id,
  189. fixCode: item.fixCode,
  190. codeNumber: item.codeNumber
  191. };
  192. }),
  193. ruleItems: item.ruleMatters
  194. };
  195. });
  196. this.tabsValue = this.ruleIdList[0].ruleId;
  197. // let arr = [];
  198. // res.execute.map((item) => {
  199. // arr.push(item.userName);
  200. // });
  201. // this.$set(this.detailsForm, 'executorName', arr.join(','));
  202. })
  203. .catch(() => {
  204. this.detailsLoading = false;
  205. });
  206. }
  207. }
  208. };
  209. </script>
  210. <style lang="scss" scoped>
  211. .mt-20 {
  212. margin-top: 20px;
  213. }
  214. ::v-deep .el-tab_box {
  215. display: flex;
  216. flex-direction: column;
  217. margin-top: 10px;
  218. width: 100%;
  219. .equipmentList_box {
  220. flex: 1;
  221. height: 100%;
  222. margin-right: 10px;
  223. display: flex;
  224. flex-direction: column;
  225. .divider {
  226. flex: 0 0 50px;
  227. .title {
  228. height: 35px;
  229. }
  230. }
  231. .el-table {
  232. overflow: auto;
  233. }
  234. }
  235. .ruleMatters_box {
  236. flex: 3;
  237. height: 100%;
  238. display: flex;
  239. flex-direction: column;
  240. .divider {
  241. flex: 0 0 50px;
  242. .title {
  243. height: 35px;
  244. }
  245. }
  246. .el-table {
  247. overflow: auto;
  248. .operationGuide_box {
  249. width: 100%;
  250. display: flex;
  251. position: relative;
  252. .left_content {
  253. flex: 0 0 300px;
  254. padding: 10px;
  255. margin-right: 10px;
  256. overflow-y: auto;
  257. }
  258. .line {
  259. position: absolute;
  260. top: -10px;
  261. left: 300px;
  262. bottom: -10px;
  263. height: 110%;
  264. width: 1px;
  265. background-color: #ededed;
  266. }
  267. .right_content {
  268. flex: 1;
  269. padding: 10px;
  270. overflow-y: auto;
  271. }
  272. }
  273. }
  274. }
  275. }
  276. .patrol_config_detail {
  277. padding: 5px 0;
  278. .detail_title {
  279. display: flex;
  280. height: 40px;
  281. align-items: center;
  282. justify-content: space-between;
  283. > span {
  284. background-color: #fff;
  285. line-height: 40px;
  286. width: 90px;
  287. text-align: center;
  288. border-top: 4px solid #157a2c;
  289. }
  290. }
  291. .main_content {
  292. background-color: #fff;
  293. padding: 20px 40px;
  294. .base_info {
  295. .base_info_title {
  296. border-bottom: 1px solid #1890ff;
  297. padding-bottom: 3px;
  298. margin-bottom: 20px;
  299. > span {
  300. display: inline-block;
  301. line-height: 16px;
  302. border-left: 6px solid #1890ff;
  303. padding-left: 6px;
  304. }
  305. }
  306. .base_info_content {
  307. padding: 0 60px;
  308. font-size: 14px;
  309. ::v-deep .el-col {
  310. margin-bottom: 20px;
  311. > span:first-child {
  312. font-weight: 700;
  313. }
  314. }
  315. }
  316. }
  317. .patrol_equipment_info {
  318. .patrol_equipment_info_title {
  319. border-bottom: 1px solid #1890ff;
  320. padding-bottom: 3px;
  321. margin-bottom: 20px;
  322. > span {
  323. display: inline-block;
  324. line-height: 16px;
  325. border-left: 6px solid #1890ff;
  326. padding-left: 6px;
  327. }
  328. }
  329. .patrol_equipment_info_content {
  330. padding: 0 30px;
  331. .equipment_item {
  332. border: 1px solid #ccc;
  333. font-size: 14px;
  334. padding: 15px;
  335. margin-bottom: 30px;
  336. .equipment_info {
  337. display: flex;
  338. flex-wrap: wrap;
  339. border: 1px solid #ddd;
  340. .item_info {
  341. width: 33.33%;
  342. height: 24px;
  343. line-height: 24px;
  344. display: flex;
  345. .item_label {
  346. width: 90px;
  347. text-align: center;
  348. background-color: #f2f2f2;
  349. font-weight: 700;
  350. }
  351. .item_value {
  352. border-bottom: 1px solid #f2f2f2;
  353. flex: 1;
  354. padding-left: 5px;
  355. }
  356. &:last-child {
  357. width: 100%;
  358. .item_value {
  359. border: 0;
  360. }
  361. }
  362. }
  363. }
  364. > p {
  365. margin-top: 20px;
  366. color: #797979;
  367. }
  368. .matter_info {
  369. ::v-deep .el-table {
  370. th.el-table__cell {
  371. background-color: #f2f2f2;
  372. padding: 0;
  373. }
  374. td.el-table__cell {
  375. padding: 0;
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. </style>