detailDialog.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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">
  92. <template
  93. v-if="
  94. taskDefinitionKey !== 'user_submit' ||
  95. taskDefinitionKey !== 'user_receive'
  96. "
  97. >
  98. <span class="normarl_num"
  99. >正常:{{
  100. infoData.planDeviceList?.length > 0
  101. ? infoData.planDeviceList.filter(
  102. (item) => item.teamLeaderResult == 1
  103. ).length
  104. : 0
  105. }}</span
  106. >
  107. <span class="unnormarl_num"
  108. >异常:{{
  109. infoData.planDeviceList?.length > 0
  110. ? infoData.planDeviceList.filter(
  111. (item) => item.teamLeaderResult == 2
  112. ).length
  113. : 0
  114. }}</span
  115. >
  116. <span class="lose_num"
  117. >丢失:{{
  118. infoData.planDeviceList?.length > 0
  119. ? infoData.planDeviceList.filter(
  120. (item) => item.teamLeaderResult == 3
  121. ).length
  122. : 0
  123. }}</span
  124. >
  125. </template>
  126. </HeaderTitle>
  127. <div class="maintain_equipment_info_content">
  128. <div class="confirmBtn">
  129. <el-button
  130. v-if="
  131. taskDefinitionKey === 'leader_receive' &&
  132. !infoData.planDeviceList[0].leaderVerifyTime
  133. "
  134. type="primary"
  135. @click="confirmReceive(1, 3)"
  136. >确定收到</el-button
  137. >
  138. <el-button
  139. v-if="
  140. taskDefinitionKey === 'team_leader_receive1' &&
  141. !infoData.planDeviceList[0].teamVerifyTime
  142. "
  143. @click="confirmReceive(2, 2)"
  144. type="primary"
  145. >确定收到</el-button
  146. >
  147. </div>
  148. <el-table :height="300" :data="infoData.planDeviceList" border>
  149. <el-table-column label="序号" type="index" width="50">
  150. </el-table-column>
  151. <el-table-column label="设备编码" prop="name">
  152. <template slot-scope="scope">
  153. <div>
  154. <span>{{ scope.row.substance.code }}</span>
  155. </div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="编号" prop="norm">
  159. <template slot-scope="scope">
  160. <div>
  161. <span>{{ scope.row.substance.extInfo.codeNumber }}</span>
  162. </div>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="设备名称" prop="content">
  166. <template slot-scope="scope">
  167. <div>
  168. <span>{{ scope.row.substance.name }}</span>
  169. </div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="设备型号" prop="norm">
  173. <template slot-scope="scope">
  174. <div>
  175. <span>{{ scope.row.substance.model }}</span>
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="质检" prop="qualityStatus">
  180. <template slot-scope="scope">
  181. <el-select
  182. v-if="
  183. (taskDefinitionKey === 'leader_check' &&
  184. infoData.logList.length == 1) ||
  185. taskDefinitionKey === 'user_receive'
  186. "
  187. v-model="scope.row.qualityStatus"
  188. placeholder="请选择"
  189. >
  190. <el-option
  191. v-for="item in statusOption"
  192. :label="item.label"
  193. :value="item.value"
  194. :key="item.value"
  195. >
  196. </el-option>
  197. </el-select>
  198. <span v-else>{{
  199. scope.row.qualityStatus != null
  200. ? statusOption.filter(
  201. (item) => item.value == scope.row.qualityStatus
  202. )[0].label
  203. : ''
  204. }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="是否遗失" prop="isLose">
  208. <template slot-scope="scope">
  209. <el-select
  210. v-if="taskDefinitionKey === 'user_submit'"
  211. v-model="scope.row.isLose"
  212. placeholder="请选择"
  213. >
  214. <el-option
  215. v-for="item in option"
  216. :label="item.label"
  217. :value="item.value"
  218. :key="item.value"
  219. >
  220. </el-option>
  221. </el-select>
  222. <span v-else>{{
  223. scope.row.isLose != null
  224. ? option.filter(
  225. (item) => item.value == scope.row.isLose
  226. )[0].label
  227. : ''
  228. }}</span>
  229. </template>
  230. </el-table-column>
  231. <template
  232. v-if="
  233. taskDefinitionKey !== 'user_submit' ||
  234. taskDefinitionKey !== 'user_receive'
  235. "
  236. >
  237. <el-table-column
  238. v-if="
  239. taskDefinitionKey !== 'user_submit' ||
  240. taskDefinitionKey !== 'user_receive'
  241. "
  242. label="上交时间"
  243. prop="handTime"
  244. ></el-table-column>
  245. <el-table-column
  246. label="负责人确认结果"
  247. width="260"
  248. prop="teamLeaderResult"
  249. >
  250. <template slot-scope="scope">
  251. <el-radio-group v-model="scope.row.teamLeaderResult">
  252. <el-radio :label="1">正常</el-radio>
  253. <el-radio :label="2">异常</el-radio>
  254. <el-radio :label="3">丢失</el-radio>
  255. </el-radio-group>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. label="负责人确认时间"
  260. prop="teamReceiptTime"
  261. ></el-table-column>
  262. <el-table-column
  263. label="量具管理员确认时间"
  264. prop="leaderVerifyTime"
  265. ></el-table-column>
  266. <el-table-column
  267. label="负责人确认收到时间"
  268. prop="teamVerifyTime"
  269. ></el-table-column>
  270. <el-table-column
  271. label="使用人收取量具时间"
  272. prop="harvestTime"
  273. ></el-table-column>
  274. <!-- <el-table-column label="操作" width="90">
  275. <template slot-scope="scope">
  276. <el-button
  277. v-if="!scope.row.teamReceiptTime"
  278. @click="configResult(scope.row)"
  279. type="primary"
  280. size="small"
  281. >确认</el-button
  282. >
  283. </template>
  284. </el-table-column> -->
  285. </template>
  286. </el-table>
  287. <!-- <div
  288. class="equipment_item"
  289. v-for="item in infoData.planDeviceList"
  290. :key="item.id"
  291. >
  292. <div class="equipment_info" v-if="item.substance">
  293. <div class="item_info">
  294. <span class="item_label">设备编码</span>
  295. <span class="item_value">{{ item.substance.code }}</span>
  296. </div>
  297. <div class="item_info">
  298. <span class="item_label">设备名称</span>
  299. <span class="item_value">{{ item.substance.name }}</span>
  300. </div>
  301. <div class="item_info">
  302. <span class="item_label">设备型号</span>
  303. <span class="item_value">{{ item.substance.model }}</span>
  304. </div>
  305. <div class="item_info">
  306. <span class="item_label">设备位置</span>
  307. <span class="item_value">{{
  308. item.substance.positionNames
  309. }}</span>
  310. </div>
  311. <div
  312. class="item_info"
  313. v-if="
  314. taskDefinitionKey === 'leader_check' &&
  315. infoData.logList.length == 1
  316. "
  317. >
  318. <span class="item_label">质检</span>
  319. <span class="item_value">
  320. <el-select v-model="item.status" placeholder="请选择">
  321. <el-option
  322. v-for="item in statusOption"
  323. :label="item.label"
  324. :value="item.value"
  325. :key="item.value"
  326. >
  327. </el-option>
  328. </el-select>
  329. </span>
  330. </div>
  331. </div>
  332. </div> -->
  333. </div>
  334. </div>
  335. <div class="ruleMatters_box">
  336. <HeaderTitle title="操作事项" size="16px"></HeaderTitle>
  337. <el-table
  338. :height="300"
  339. :data="infoData.planDeviceList[0].workItems"
  340. border
  341. >
  342. <el-table-column label="序号" width="50">
  343. <template slot-scope="scope">
  344. <span>{{ scope.$index + 1 }}</span>
  345. </template>
  346. </el-table-column>
  347. <el-table-column label="事项" prop="name" width="100">
  348. <template slot-scope="scope">
  349. <div>
  350. <span>{{ scope.row.name }}</span>
  351. </div>
  352. </template>
  353. </el-table-column>
  354. <el-table-column label="内容" prop="content" width="300">
  355. <template slot-scope="scope">
  356. <div>
  357. <span>{{ scope.row.content }}</span>
  358. </div>
  359. </template>
  360. </el-table-column>
  361. <el-table-column label="操作指导" prop="operationGuide">
  362. <template slot-scope="scope">
  363. <div class="operationGuide_box">
  364. <div class="left_content">
  365. <template v-if="scope.row.operationGuide">
  366. <div
  367. v-for="(item, index) in scope.row.operationGuide
  368. .toolList"
  369. :key="item.id"
  370. >{{ index + 1 }}.{{ item.name }}</div
  371. >
  372. </template>
  373. </div>
  374. <div class="line"></div>
  375. <div class="right_content">
  376. <template v-if="scope.row.operationGuide">
  377. <div
  378. v-for="(item, index) in scope.row.operationGuide
  379. .procedureList"
  380. :key="item.id"
  381. >{{ index + 1 }}.{{ item.content }}</div
  382. >
  383. </template>
  384. </div>
  385. </div>
  386. </template>
  387. </el-table-column>
  388. <el-table-column label="标准" prop="norm" width="100">
  389. <template slot-scope="scope">
  390. <div>
  391. <span>{{ scope.row.norm }}</span>
  392. </div>
  393. </template>
  394. </el-table-column>
  395. <el-table-column label="状态" prop="status" width="100">
  396. <template slot-scope="scope">
  397. <div>
  398. <span>{{ options[scope.row.status] }}</span>
  399. </div>
  400. </template>
  401. </el-table-column>
  402. <el-table-column label="结果" prop="result" width="200">
  403. </el-table-column>
  404. </el-table>
  405. </div>
  406. </div>
  407. </el-form>
  408. </div>
  409. </template>
  410. <script>
  411. import { EventBus } from './eventBus';
  412. import dictMixins from '@/mixins/dictMixins';
  413. import {
  414. processById,
  415. getList,
  416. adminVerify
  417. } from '@/api/bpm/components/inspectionManage/index.js';
  418. export default {
  419. name: 'measuringToolInspection_detailDialog',
  420. mixins: [dictMixins],
  421. props: {
  422. businessId: {
  423. default: ''
  424. },
  425. taskId: {
  426. default: ''
  427. },
  428. taskDefinitionKey: {
  429. default: ''
  430. }
  431. },
  432. data() {
  433. return {
  434. infoData: {
  435. planDeviceList: [
  436. {
  437. substance: {},
  438. workItems: []
  439. }
  440. ]
  441. },
  442. option: [
  443. {
  444. value: 0,
  445. label: '否'
  446. },
  447. {
  448. value: 1,
  449. label: '是'
  450. }
  451. ],
  452. statusOption: [
  453. {
  454. value: 0,
  455. label: '正常'
  456. },
  457. {
  458. value: 1,
  459. label: '异常'
  460. },
  461. {
  462. value: 2,
  463. label: '未收'
  464. }
  465. ],
  466. options: {
  467. 0: '正常',
  468. '-1': '缺陷'
  469. },
  470. type: {
  471. 1: '使用人',
  472. 2: '班组',
  473. 3: '负责人'
  474. }
  475. };
  476. },
  477. async created() {
  478. this.requestDict('巡点检周期');
  479. let type = '';
  480. switch (this.taskDefinitionKey) {
  481. case 'user_submit':
  482. type = 1;
  483. break;
  484. case 'team_leader_receive':
  485. type = 2;
  486. break;
  487. case 'team_leader_submit':
  488. type = 2;
  489. break;
  490. case 'leader_receive':
  491. type = 3;
  492. break;
  493. case 'leader_send':
  494. type = 3;
  495. break;
  496. case 'team_leader_receive1':
  497. type = 2;
  498. break;
  499. case 'team_leader_send':
  500. type = 2;
  501. break;
  502. case 'user_receive':
  503. type = 1;
  504. break;
  505. }
  506. processById({ id: this.businessId, type }).then(async (data) => {
  507. console.log(data);
  508. // 查询日志
  509. let res = await getList({
  510. planId: data.planId,
  511. node: this.taskDefinitionKey
  512. });
  513. console.log(res);
  514. data.logList = res.data;
  515. this.infoData = data;
  516. if (this.taskDefinitionKey == 'leader_check') {
  517. this.infoData.planDeviceList = this.infoData.planDeviceList.map(
  518. (item) => {
  519. return {
  520. ...item,
  521. qualityStatus: 0
  522. };
  523. }
  524. );
  525. }
  526. EventBus.$emit('getData', this.infoData);
  527. });
  528. },
  529. methods: {
  530. confirmReceive(confirmType, listType) {
  531. let params = this.infoData.planDeviceList.map((item) => {
  532. return {
  533. id: item.id,
  534. type: confirmType
  535. };
  536. });
  537. adminVerify(params).then(() => {
  538. processById({ id: this.businessId, type: listType }).then(
  539. async (data) => {
  540. this.infoData = data;
  541. this.$message.success('确认成功');
  542. }
  543. );
  544. });
  545. },
  546. async getTableValue() {
  547. return this.infoData;
  548. }
  549. }
  550. };
  551. </script>
  552. <style lang="scss" scoped>
  553. ::v-deep .el-form-item--medium .el-form-item__label {
  554. color: #6e6e6e;
  555. font-size: 14px;
  556. font-weight: bold;
  557. }
  558. .maintain_equipment_info {
  559. margin-bottom: 20px;
  560. .normarl_num {
  561. font-size: 14px !important;
  562. color: green;
  563. margin-right: 10px;
  564. }
  565. .unnormarl_num {
  566. font-size: 14px !important;
  567. color: red;
  568. margin-right: 10px;
  569. }
  570. .lose_num {
  571. font-size: 14px !important;
  572. color: orange;
  573. }
  574. .maintain_equipment_info_title {
  575. border-bottom: 1px solid #1890ff;
  576. padding-bottom: 3px;
  577. margin-bottom: 20px;
  578. > span {
  579. display: inline-block;
  580. line-height: 16px;
  581. border-left: 6px solid #1890ff;
  582. padding-left: 6px;
  583. }
  584. }
  585. .maintain_equipment_info_content {
  586. padding: 0 30px;
  587. .confirmBtn {
  588. display: flex;
  589. justify-content: flex-end;
  590. margin: 20px 0;
  591. }
  592. .equipment_item {
  593. font-size: 14px;
  594. padding: 15px;
  595. margin-bottom: 30px;
  596. .equipment_info {
  597. display: flex;
  598. flex-wrap: wrap;
  599. border: 1px solid #ddd;
  600. .item_info {
  601. width: 33.33%;
  602. height: 44px;
  603. line-height: 44px;
  604. display: flex;
  605. .item_label {
  606. width: 90px;
  607. text-align: center;
  608. background-color: #f2f2f2;
  609. font-weight: 700;
  610. }
  611. .item_value {
  612. border-bottom: 1px solid #f2f2f2;
  613. flex: 1;
  614. padding-left: 5px;
  615. }
  616. // &:last-child {
  617. // width: 100%;
  618. // .item_value {
  619. // border: 0;
  620. // }
  621. // }
  622. }
  623. }
  624. > p {
  625. margin-top: 20px;
  626. color: #797979;
  627. }
  628. .matter_info {
  629. ::v-deep .el-table {
  630. th.el-table__cell {
  631. background-color: #f2f2f2;
  632. padding: 0;
  633. }
  634. td.el-table__cell {
  635. padding: 0;
  636. }
  637. }
  638. }
  639. }
  640. }
  641. }
  642. .ruleMatters_box {
  643. height: 100%;
  644. display: flex;
  645. flex-direction: column;
  646. .divider {
  647. flex: 0 0 50px;
  648. .title {
  649. height: 35px;
  650. }
  651. }
  652. .el-table {
  653. overflow: auto;
  654. .operationGuide_box {
  655. width: 100%;
  656. display: flex;
  657. position: relative;
  658. .left_content {
  659. flex: 0 0 150px;
  660. padding: 10px;
  661. margin-right: 10px;
  662. overflow-y: auto;
  663. }
  664. .line {
  665. position: absolute;
  666. top: -10px;
  667. left: 150px;
  668. bottom: -10px;
  669. height: 110%;
  670. width: 1px;
  671. background-color: #ededed;
  672. }
  673. .right_content {
  674. flex: 1;
  675. padding: 10px;
  676. overflow-y: auto;
  677. }
  678. }
  679. }
  680. }
  681. </style>