detailDialog.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <div class="page">
  3. <el-form label-width="130px">
  4. <div class="content-detail">
  5. <div class="basic-details">
  6. <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
  7. <el-row>
  8. <el-col :span="12">
  9. <el-col :span="12">
  10. <el-form-item label="计划单号">
  11. <span> {{ infoData.code }} </span>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="12">
  15. <el-form-item label="来源计划配置单号">
  16. <span> {{ infoData.planConfigCode }} </span>
  17. </el-form-item>
  18. </el-col>
  19. <!-- <el-col :span="12">
  20. <el-form-item label="名称">
  21. <span> {{ infoData.planName }} </span>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="12">
  25. <el-form-item label="部门">
  26. <span>
  27. {{ infoData.executeGroupName }}
  28. </span>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="12">
  32. <el-form-item label="人员">
  33. <span>
  34. {{ infoData.executeUserName }}
  35. </span>
  36. </el-form-item>
  37. </el-col> -->
  38. <el-col :span="12">
  39. <el-form-item label="计划完成时长">
  40. <span v-if="infoData.duration >= 0"
  41. >{{ infoData.duration }}分钟</span
  42. >
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="12">
  46. <el-form-item label="周期">
  47. <span v-if="infoData.ruleInfo">
  48. {{ infoData.ruleInfo.cycleValue
  49. }}{{
  50. getDictValue('巡点检周期', infoData.ruleInfo.cycleType)
  51. }}
  52. </span>
  53. </el-form-item>
  54. </el-col>
  55. <!-- <el-col :span="12">
  56. <el-form-item label="设备分类">
  57. <span> {{ infoData.categoryLevelName }} </span>
  58. </el-form-item>
  59. </el-col> -->
  60. <el-col :span="12">
  61. <el-form-item label="规则名称">
  62. <span>
  63. {{ infoData.name }}
  64. </span>
  65. </el-form-item>
  66. </el-col>
  67. <!-- <el-col :span="12">
  68. <el-form-item label="创建部门">
  69. <span> {{ infoData.createGroupName }} </span>
  70. </el-form-item>
  71. </el-col> -->
  72. <el-col :span="12">
  73. <el-form-item label="创建人">
  74. <span> {{ infoData.createUserName }} </span>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="12">
  78. <el-form-item label="创建时间">
  79. <span> {{ infoData.createTime }} </span>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="24">
  83. <el-form-item label="备注">
  84. <span> {{ infoData.remark }} </span>
  85. </el-form-item>
  86. </el-col>
  87. </el-col>
  88. </el-row>
  89. </div>
  90. <div class="maintain_equipment_info">
  91. <HeaderTitle title="量具设备" size="16px"></HeaderTitle>
  92. <div class="maintain_equipment_info_content">
  93. <el-table :height="300" :data="infoData.planDeviceList" border>
  94. <el-table-column label="设备编码" prop="name">
  95. <template slot-scope="scope">
  96. <div>
  97. <span>{{ scope.row.substance.code }}</span>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="设备编号" prop="norm">
  102. <template slot-scope="scope">
  103. <div>
  104. <span>{{ scope.row.substance.codeNumber }}</span>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="设备名称" prop="content">
  109. <template slot-scope="scope">
  110. <div>
  111. <span>{{ scope.row.substance.name }}</span>
  112. </div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="设备型号" prop="norm">
  116. <template slot-scope="scope">
  117. <div>
  118. <span>{{ scope.row.substance.model }}</span>
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="是否遗失" prop="isLose">
  123. <template slot-scope="scope">
  124. <el-select
  125. v-if="taskDefinitionKey === 'user_submit'"
  126. v-model="scope.row.isLose"
  127. placeholder="请选择"
  128. >
  129. <el-option
  130. v-for="item in option"
  131. :label="item.label"
  132. :value="item.value"
  133. :key="item.value"
  134. >
  135. </el-option>
  136. </el-select>
  137. <span v-else>{{
  138. scope.row.isLose != null
  139. ? option.filter(
  140. (item) => item.value == scope.row.isLose
  141. )[0].label
  142. : ''
  143. }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="质检" prop="qualityStatus">
  147. <template slot-scope="scope">
  148. <el-select
  149. v-if="
  150. (taskDefinitionKey === 'leader_check' &&
  151. infoData.logList.length == 1) ||
  152. taskDefinitionKey === 'user_receive'
  153. "
  154. v-model="scope.row.qualityStatus"
  155. placeholder="请选择"
  156. >
  157. <el-option
  158. v-for="item in statusOption"
  159. :label="item.label"
  160. :value="item.value"
  161. :key="item.value"
  162. >
  163. </el-option>
  164. </el-select>
  165. <span v-else>{{
  166. scope.row.qualityStatus != null
  167. ? statusOption.filter(
  168. (item) => item.value == scope.row.qualityStatus
  169. )[0].label
  170. : ''
  171. }}</span>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. <!-- <div
  176. class="equipment_item"
  177. v-for="item in infoData.planDeviceList"
  178. :key="item.id"
  179. >
  180. <div class="equipment_info" v-if="item.substance">
  181. <div class="item_info">
  182. <span class="item_label">设备编码</span>
  183. <span class="item_value">{{ item.substance.code }}</span>
  184. </div>
  185. <div class="item_info">
  186. <span class="item_label">设备名称</span>
  187. <span class="item_value">{{ item.substance.name }}</span>
  188. </div>
  189. <div class="item_info">
  190. <span class="item_label">设备型号</span>
  191. <span class="item_value">{{ item.substance.model }}</span>
  192. </div>
  193. <div class="item_info">
  194. <span class="item_label">设备位置</span>
  195. <span class="item_value">{{
  196. item.substance.positionNames
  197. }}</span>
  198. </div>
  199. <div
  200. class="item_info"
  201. v-if="
  202. taskDefinitionKey === 'leader_check' &&
  203. infoData.logList.length == 1
  204. "
  205. >
  206. <span class="item_label">质检</span>
  207. <span class="item_value">
  208. <el-select v-model="item.status" placeholder="请选择">
  209. <el-option
  210. v-for="item in statusOption"
  211. :label="item.label"
  212. :value="item.value"
  213. :key="item.value"
  214. >
  215. </el-option>
  216. </el-select>
  217. </span>
  218. </div>
  219. </div>
  220. </div> -->
  221. </div>
  222. </div>
  223. <div class="ruleMatters_box">
  224. <HeaderTitle title="操作事项" size="16px"></HeaderTitle>
  225. <el-table
  226. :height="300"
  227. :data="infoData.planDeviceList[0].workItems"
  228. border
  229. >
  230. <el-table-column label="序号" width="50">
  231. <template slot-scope="scope">
  232. <span>{{ scope.$index + 1 }}</span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="事项" prop="name" width="100">
  236. <template slot-scope="scope">
  237. <div>
  238. <span>{{ scope.row.name }}</span>
  239. </div>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="内容" prop="content" width="300">
  243. <template slot-scope="scope">
  244. <div>
  245. <span>{{ scope.row.content }}</span>
  246. </div>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="操作指导" prop="operationGuide">
  250. <template slot-scope="scope">
  251. <div class="operationGuide_box">
  252. <div class="left_content">
  253. <template v-if="scope.row.operationGuide">
  254. <div
  255. v-for="(item, index) in scope.row.operationGuide
  256. .toolList"
  257. :key="item.id"
  258. >{{ index + 1 }}.{{ item.name }}</div
  259. >
  260. </template>
  261. </div>
  262. <div class="line"></div>
  263. <div class="right_content">
  264. <template v-if="scope.row.operationGuide">
  265. <div
  266. v-for="(item, index) in scope.row.operationGuide
  267. .procedureList"
  268. :key="item.id"
  269. >{{ index + 1 }}.{{ item.content }}</div
  270. >
  271. </template>
  272. </div>
  273. </div>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="标准" prop="norm" width="100">
  277. <template slot-scope="scope">
  278. <div>
  279. <span>{{ scope.row.norm }}</span>
  280. </div>
  281. </template>
  282. </el-table-column>
  283. <el-table-column label="状态" prop="status" width="100">
  284. <template slot-scope="scope">
  285. <div>
  286. <span>{{ options[scope.row.status] }}</span>
  287. </div>
  288. </template>
  289. </el-table-column>
  290. <el-table-column label="结果" prop="result" width="200">
  291. </el-table-column>
  292. </el-table>
  293. </div>
  294. </div>
  295. </el-form>
  296. </div>
  297. </template>
  298. <script>
  299. import { EventBus } from './eventBus';
  300. import dictMixins from '@/mixins/dictMixins';
  301. import {
  302. processById,
  303. getList
  304. } from '@/api/bpm/components/inspectionManage/index.js';
  305. export default {
  306. name: 'measuringToolInspection_detailDialog',
  307. mixins: [dictMixins],
  308. props: {
  309. businessId: {
  310. default: ''
  311. },
  312. taskId: {
  313. default: ''
  314. },
  315. taskDefinitionKey: {
  316. default: ''
  317. }
  318. },
  319. data() {
  320. return {
  321. infoData: {
  322. planDeviceList: [
  323. {
  324. substance: {},
  325. workItems: []
  326. }
  327. ]
  328. },
  329. option: [
  330. {
  331. value: 0,
  332. label: '否'
  333. },
  334. {
  335. value: 1,
  336. label: '是'
  337. }
  338. ],
  339. statusOption: [
  340. {
  341. value: 0,
  342. label: '正常'
  343. },
  344. {
  345. value: 1,
  346. label: '异常'
  347. }
  348. ],
  349. options: {
  350. 0: '正常',
  351. '-1': '缺陷'
  352. },
  353. type: {
  354. 1: '使用人',
  355. 2: '班组',
  356. 3: '负责人'
  357. }
  358. };
  359. },
  360. async created() {
  361. this.requestDict('巡点检周期');
  362. let type = '';
  363. switch (this.taskDefinitionKey) {
  364. case 'user_submit':
  365. type = 1;
  366. break;
  367. case 'team_leader_receive':
  368. type = 2;
  369. break;
  370. case 'team_leader_submit':
  371. type = 2;
  372. break;
  373. case 'leader_receive':
  374. type = 3;
  375. break;
  376. case 'leader_send':
  377. type = 3;
  378. break;
  379. case 'team_leader_receive1':
  380. type = 2;
  381. break;
  382. case 'team_leader_send':
  383. type = 2;
  384. break;
  385. case 'user_receive':
  386. type = 1;
  387. break;
  388. }
  389. processById({ id: this.businessId, type }).then(async (data) => {
  390. console.log(data);
  391. // 查询日志
  392. let res = await getList({
  393. planId: data.planId,
  394. node: this.taskDefinitionKey
  395. });
  396. console.log(res);
  397. data.logList = res.data;
  398. this.infoData = data;
  399. if (this.taskDefinitionKey == 'leader_check') {
  400. this.infoData.planDeviceList = this.infoData.planDeviceList.map(
  401. (item) => {
  402. return {
  403. ...item,
  404. qualityStatus: 0
  405. };
  406. }
  407. );
  408. }
  409. EventBus.$emit('getData', this.infoData);
  410. });
  411. },
  412. methods: {
  413. async getTableValue() {
  414. return this.infoData;
  415. }
  416. }
  417. };
  418. </script>
  419. <style lang="scss" scoped>
  420. ::v-deep .el-form-item--medium .el-form-item__label {
  421. color: #6e6e6e;
  422. font-size: 14px;
  423. font-weight: bold;
  424. }
  425. .maintain_equipment_info {
  426. margin-bottom: 20px;
  427. .maintain_equipment_info_title {
  428. border-bottom: 1px solid #1890ff;
  429. padding-bottom: 3px;
  430. margin-bottom: 20px;
  431. > span {
  432. display: inline-block;
  433. line-height: 16px;
  434. border-left: 6px solid #1890ff;
  435. padding-left: 6px;
  436. }
  437. }
  438. .maintain_equipment_info_content {
  439. padding: 0 30px;
  440. .equipment_item {
  441. font-size: 14px;
  442. padding: 15px;
  443. margin-bottom: 30px;
  444. .equipment_info {
  445. display: flex;
  446. flex-wrap: wrap;
  447. border: 1px solid #ddd;
  448. .item_info {
  449. width: 33.33%;
  450. height: 44px;
  451. line-height: 44px;
  452. display: flex;
  453. .item_label {
  454. width: 90px;
  455. text-align: center;
  456. background-color: #f2f2f2;
  457. font-weight: 700;
  458. }
  459. .item_value {
  460. border-bottom: 1px solid #f2f2f2;
  461. flex: 1;
  462. padding-left: 5px;
  463. }
  464. // &:last-child {
  465. // width: 100%;
  466. // .item_value {
  467. // border: 0;
  468. // }
  469. // }
  470. }
  471. }
  472. > p {
  473. margin-top: 20px;
  474. color: #797979;
  475. }
  476. .matter_info {
  477. ::v-deep .el-table {
  478. th.el-table__cell {
  479. background-color: #f2f2f2;
  480. padding: 0;
  481. }
  482. td.el-table__cell {
  483. padding: 0;
  484. }
  485. }
  486. }
  487. }
  488. }
  489. }
  490. .ruleMatters_box {
  491. height: 100%;
  492. display: flex;
  493. flex-direction: column;
  494. .divider {
  495. flex: 0 0 50px;
  496. .title {
  497. height: 35px;
  498. }
  499. }
  500. .el-table {
  501. overflow: auto;
  502. .operationGuide_box {
  503. width: 100%;
  504. display: flex;
  505. position: relative;
  506. .left_content {
  507. flex: 0 0 150px;
  508. padding: 10px;
  509. margin-right: 10px;
  510. overflow-y: auto;
  511. }
  512. .line {
  513. position: absolute;
  514. top: -10px;
  515. left: 150px;
  516. bottom: -10px;
  517. height: 110%;
  518. width: 1px;
  519. background-color: #ededed;
  520. }
  521. .right_content {
  522. flex: 1;
  523. padding: 10px;
  524. overflow-y: auto;
  525. }
  526. }
  527. }
  528. }
  529. </style>