detialsModal.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <template>
  2. <ele-modal
  3. :title="title"
  4. :visible.sync="visible"
  5. :close-on-click-modal="false"
  6. @close="handleClose"
  7. resizable
  8. maxable
  9. width="80%"
  10. >
  11. <div
  12. class="switch"
  13. v-if="
  14. details &&
  15. details.executeMethod == 2 &&
  16. details.approvalStatus != null &&
  17. details.approvalStatus != 0
  18. "
  19. :maxable="true"
  20. style="margin-bottom: 20px"
  21. >
  22. <div class="switch_left">
  23. <ul>
  24. <li
  25. v-for="item in tabOptions"
  26. :key="item.key"
  27. :class="{ active: activeComp == item.key }"
  28. @click="activeComp = item.key"
  29. >
  30. {{ item.name }}
  31. </li>
  32. </ul>
  33. </div>
  34. </div>
  35. <el-form
  36. v-if="details && activeComp == 'main'"
  37. ref="formRef"
  38. :model="form"
  39. :rules="rules"
  40. label-width="130px"
  41. v-loading="loading"
  42. >
  43. <header-title title="产品信息"></header-title>
  44. <el-row style="margin-bottom: 20px">
  45. <el-col :span="8">
  46. <el-form-item label="生产订单">
  47. <el-input :value="details.workOrderCode" disabled></el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="8">
  51. <el-form-item label="工序名称">
  52. <el-input :value="details.produceTaskName" disabled></el-input>
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. <el-row style="margin-bottom: 20px">
  57. <el-col :span="8">
  58. <el-form-item label="产品编码">
  59. <el-input :value="details.productCode" disabled></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8">
  63. <el-form-item label="产品名称">
  64. <el-input :value="details.productName" disabled></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item label="批次号">
  69. <el-input
  70. :value="details.batchNo"
  71. disabled
  72. ></el-input> </el-form-item
  73. ></el-col>
  74. </el-row>
  75. <el-row style="margin-bottom: 20px">
  76. <el-col :span="8">
  77. <el-form-item label="规格">
  78. <el-input :value="details.specification" disabled></el-input>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="型号">
  83. <el-input :value="details.productModel" disabled></el-input>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="8">
  87. <el-form-item label="要求生产数量">
  88. <el-input :value="details.formingNum" disabled></el-input>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. <header-title title="基本信息"></header-title>
  93. <!-- 记录规则 -->
  94. <template v-if="details.executeMethod == 2">
  95. <el-row style="margin-bottom: 20px">
  96. <el-col :span="8">
  97. <el-form-item label="记录规则名称">
  98. <el-input :value="details.ruleName" disabled></el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="8">
  102. <el-form-item label="记录规则分类">
  103. <DictSelection
  104. dictName="记录规则类型"
  105. clearable
  106. v-model="details.recordRulesClassify"
  107. disabled
  108. >
  109. </DictSelection>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="8">
  113. <el-form-item label="车间区域">
  114. <el-input
  115. :value="details.workshopArea"
  116. disabled
  117. ></el-input> </el-form-item
  118. ></el-col>
  119. </el-row>
  120. <el-row style="margin-bottom: 20px">
  121. <el-col :span="8">
  122. <el-form-item label="检查完成时间">
  123. <el-input
  124. :value="details.checkFinishTime"
  125. disabled
  126. ></el-input> </el-form-item
  127. ></el-col>
  128. <el-col :span="8">
  129. <el-form-item label="检查有效期">
  130. <el-input
  131. placeholder="请输入"
  132. v-model="details.checkValidity"
  133. type="text"
  134. disabled
  135. >
  136. <template slot="append">
  137. <div style="width: 40px; box-sizing: border-box">
  138. <el-form-item required>
  139. <DictSelection
  140. dictName="检查有效期单位"
  141. clearable
  142. v-model="details.checkValidityUnit"
  143. placeholder="单位"
  144. style="
  145. width: auto;
  146. box-sizing: border-box;
  147. height: 36px;
  148. "
  149. disabled
  150. >
  151. </DictSelection>
  152. </el-form-item>
  153. </div>
  154. </template>
  155. </el-input> </el-form-item
  156. ></el-col>
  157. <el-col :span="8">
  158. <el-form-item label="结论">
  159. <el-radio-group v-model="details.conclution" disabled>
  160. <el-radio :label="1">合格</el-radio>
  161. <el-radio :label="2">不合格</el-radio>
  162. </el-radio-group>
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. </template>
  167. <header-title
  168. v-if="details.executeMethod == 2"
  169. title="检查项目"
  170. ></header-title>
  171. <!-- 记录规则 -->
  172. <div v-if="details.executeMethod == 2">
  173. <el-table
  174. v-loading="loading"
  175. :data="details.details"
  176. style="width: 100%"
  177. >
  178. <el-table-column type="index" label="序号" width="50">
  179. </el-table-column>
  180. <el-table-column label="检查内容">
  181. <template slot-scope="scope">
  182. <div>
  183. {{ scope.row.paramValue }}
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="检查工具">
  188. <template slot-scope="scope">
  189. <div>
  190. {{ scope.row.toolNames }}
  191. </div>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="检查人">
  195. <template slot-scope="scope">
  196. <div style="display: flex; align-items: center; cursor: pointer">
  197. <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div>
  198. </div>
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="检查情况">
  202. <template slot-scope="scope">
  203. <div>
  204. <div>
  205. <el-radio-group v-model="scope.row.checkStatus" disabled>
  206. <el-radio :label="1">已检查</el-radio>
  207. <el-radio :label="0">未检查</el-radio>
  208. </el-radio-group>
  209. </div>
  210. </div>
  211. </template>
  212. </el-table-column>
  213. <el-table-column label="检查结果">
  214. <template slot-scope="scope">
  215. <div>
  216. <el-radio-group v-model="scope.row.checkResult" disabled>
  217. <el-radio :label="1">合格</el-radio>
  218. <el-radio :label="0">不合格</el-radio>
  219. </el-radio-group>
  220. </div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column label="异常描述">
  224. <template slot-scope="scope">
  225. <div>
  226. <el-input
  227. type="textarea"
  228. :rows="1"
  229. placeholder="请输入"
  230. v-model="scope.row.errorMsg"
  231. disabled
  232. >
  233. </el-input>
  234. </div>
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. </div>
  239. <!-- 事项规则 -->
  240. <div v-if="details.executeMethod == 1 && eamPlanInfo">
  241. <el-row style="margin-bottom: 20px">
  242. <el-col :span="8">
  243. <el-form-item label="计划配置单号">
  244. <el-input :value="eamPlanInfo.code" disabled></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="8">
  248. <el-form-item label="计划配置名称">
  249. <el-input :value="eamPlanInfo.name" disabled></el-input>
  250. </el-form-item>
  251. </el-col>
  252. <el-col :span="8">
  253. <el-form-item label="自动派单">
  254. <el-select
  255. v-model="eamPlanInfo.autoOrder"
  256. size="small"
  257. style="width: 100%"
  258. disabled
  259. >
  260. <el-option :value="1" label="是"></el-option>
  261. <el-option :value="0" label="否"></el-option>
  262. </el-select>
  263. </el-form-item>
  264. </el-col>
  265. <el-col :span="8">
  266. <el-form-item label="计划完成时长">
  267. <el-input :value="eamPlanInfo.duration" disabled
  268. ><template #suffix>分钟</template></el-input
  269. >
  270. </el-form-item>
  271. </el-col>
  272. <el-col :span="8">
  273. <el-form-item label="部门">
  274. <el-input :value="eamPlanInfo.groupName" disabled></el-input>
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="8">
  278. <el-form-item label="负责人" prop="executorId">
  279. <el-select
  280. v-model="eamPlanInfo.executorId"
  281. size="small"
  282. style="width: 100%"
  283. multiple
  284. filterable
  285. disabled
  286. >
  287. <el-option
  288. v-for="item in executorList"
  289. :key="item.id"
  290. :value="item.id"
  291. :label="item.name"
  292. ></el-option>
  293. </el-select>
  294. </el-form-item>
  295. </el-col>
  296. <el-col :span="8">
  297. <el-form-item label="审核人" prop="approvalUserId">
  298. <el-select
  299. v-model="eamPlanInfo.approvalUserId"
  300. size="small"
  301. clearable
  302. style="width: 100%"
  303. filterable
  304. disabled
  305. >
  306. <el-option
  307. v-for="item in uerList"
  308. :key="item.id"
  309. :value="item.id"
  310. :label="item.name"
  311. ></el-option>
  312. </el-select>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="8">
  316. <el-form-item label="紧急程度" prop="urgent">
  317. <DictSelection
  318. dictName="紧急程度"
  319. clearable
  320. v-model="eamPlanInfo.urgent"
  321. disabled
  322. >
  323. </DictSelection>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="24">
  327. <el-form-item label="备注" prop="remark">
  328. <el-input
  329. type="textarea"
  330. resize="none"
  331. v-model="eamPlanInfo.remark"
  332. :rows="2"
  333. placeholder="请详细说明"
  334. size="small"
  335. disabled
  336. ></el-input>
  337. </el-form-item>
  338. </el-col>
  339. </el-row>
  340. <el-tabs type="card">
  341. <el-tab-pane v-if="ruleInfo" :label="ruleInfo.name">
  342. <div class="el-tab_box">
  343. <div class="equipmentList_box">
  344. <header-title title="设备列表"> </header-title>
  345. <el-table :data="deviceList" border>
  346. <el-table-column label="序号" type="index" width="50">
  347. </el-table-column>
  348. <el-table-column label="设备名称" align="center" prop="name">
  349. <template slot-scope="{ row }">
  350. <template>
  351. {{ row.name }}
  352. </template>
  353. </template>
  354. </el-table-column>
  355. <el-table-column
  356. label="编号"
  357. align="center"
  358. prop="codeNumber"
  359. >
  360. <template slot-scope="{ row }">
  361. <template>
  362. {{ row.codeNumber }}
  363. </template>
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. label="固资编码"
  368. align="center"
  369. prop="fixCode"
  370. >
  371. <template slot-scope="{ row }">
  372. <template>
  373. {{ row.fixCode }}
  374. </template>
  375. </template>
  376. </el-table-column>
  377. </el-table>
  378. </div>
  379. <div class="ruleMatters_box">
  380. <header-title title="规则事项"> </header-title>
  381. <el-table v-if="ruleInfo" :data="ruleInfo.ruleItems" border>
  382. <el-table-column label="序号" width="50">
  383. <template slot-scope="scope">
  384. <span>{{ scope.$index + 1 }}</span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column
  388. label="零部件编码"
  389. prop="categoryCode"
  390. width="150"
  391. >
  392. <template slot-scope="scope">
  393. <div v-if="scope.row.isNew">
  394. <el-input
  395. v-model="scope.row.categoryCode"
  396. placeholder="请输入零部件编码"
  397. ></el-input>
  398. </div>
  399. <div v-else>
  400. <span>{{ scope.row.categoryCode }}</span>
  401. </div>
  402. </template>
  403. </el-table-column>
  404. <el-table-column label="零部件名称" prop="categoryName">
  405. <template slot-scope="scope">
  406. <div v-if="scope.row.isNew">
  407. <el-input
  408. v-model="scope.row.categoryName"
  409. placeholder="请输入零部件名称"
  410. ></el-input>
  411. </div>
  412. <div v-else>
  413. <span>{{ scope.row.categoryName }}</span>
  414. </div>
  415. </template>
  416. </el-table-column>
  417. <el-table-column label="事项" prop="name">
  418. <template slot-scope="scope">
  419. <div v-if="scope.row.isNew">
  420. <el-input
  421. v-model="scope.row.name"
  422. placeholder="请输入内容"
  423. ></el-input>
  424. </div>
  425. <div v-else>
  426. <span>{{ scope.row.name }}</span>
  427. </div>
  428. </template>
  429. </el-table-column>
  430. <el-table-column label="内容" prop="content">
  431. <template slot-scope="scope">
  432. <div v-if="scope.row.isNew">
  433. <el-input
  434. v-model="scope.row.content"
  435. placeholder="请输入内容"
  436. ></el-input>
  437. </div>
  438. <div v-else>
  439. <span>{{ scope.row.content }}</span>
  440. </div>
  441. </template>
  442. </el-table-column>
  443. <el-table-column label="操作指导" prop="operationGuide">
  444. <template slot-scope="scope">
  445. <div class="operationGuide_box">
  446. <div class="left_content">
  447. <template v-if="scope.row.operationGuide">
  448. <div
  449. v-for="(item, index) in scope.row.operationGuide
  450. .toolList"
  451. :key="item.id"
  452. >{{ index + 1 }}.{{ item.name }}</div
  453. >
  454. </template>
  455. </div>
  456. <div class="right_content">
  457. <template v-if="scope.row.operationGuide">
  458. <div
  459. v-for="(item, index) in scope.row.operationGuide
  460. .procedureList"
  461. :key="item.id"
  462. >{{ index + 1 }}.{{ item.content }}</div
  463. >
  464. </template>
  465. </div>
  466. </div>
  467. </template>
  468. </el-table-column>
  469. <el-table-column label="标准" prop="norm" width="100">
  470. <template slot-scope="scope">
  471. <div v-if="scope.row.isNew">
  472. <el-input
  473. v-model="scope.row.norm"
  474. placeholder="请输入内容"
  475. ></el-input>
  476. </div>
  477. <div v-else>
  478. <span>{{ scope.row.norm }}</span>
  479. </div>
  480. </template>
  481. </el-table-column>
  482. </el-table>
  483. </div>
  484. </div>
  485. </el-tab-pane>
  486. </el-tabs>
  487. <!-- -->
  488. </div>
  489. </el-form>
  490. <bpmDetail
  491. v-if="activeComp == 'bpm' && details && details.processInstanceId"
  492. :id="details.processInstanceId"
  493. >
  494. </bpmDetail>
  495. <!-- 底部审批 -->
  496. <el-row
  497. v-if="
  498. details &&
  499. visible &&
  500. details.processInstanceId &&
  501. details.approvalStatus == 1
  502. "
  503. :gutter="20"
  504. style="margin-top: 40px"
  505. >
  506. <bpmSubmit
  507. :id="details.processInstanceId"
  508. :taskId="currenNode ? currenNode.id : ''"
  509. :businessId="details.id"
  510. :taskDefinitionKey="currenNode ? currenNode.taskDefinitionKey : ''"
  511. @handleAudit="handleAudit"
  512. ></bpmSubmit>
  513. <bpmList
  514. :id="details.processInstanceId"
  515. @setCurrenNode="setCurrenNode"
  516. ></bpmList>
  517. </el-row>
  518. <template v-slot:footer>
  519. <el-button @click="handleClose">返回</el-button>
  520. </template>
  521. </ele-modal>
  522. </template>
  523. <script>
  524. import dictMixins from '@/mixins/dictMixins';
  525. import { getById } from '@/api/producetaskrecordrulesrecord/index.js';
  526. import { getById as maintenanceGetById } from '@/api/maintenance/patrol_maintenance.js';
  527. import { getUserPage } from '@/api/system/organization';
  528. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  529. import bpmSubmit from './bpmSubmit.vue';
  530. import bpmList from './bpmList.vue';
  531. export default {
  532. name: 'editModal',
  533. mixins: [dictMixins],
  534. components: {
  535. bpmDetail,
  536. bpmSubmit,
  537. bpmList
  538. },
  539. data() {
  540. const formBaseData = {};
  541. return {
  542. visible: false,
  543. title: '表单弹窗',
  544. formBaseData,
  545. form: JSON.parse(JSON.stringify(formBaseData)),
  546. rules: {},
  547. tabOptions: [
  548. { key: 'main', name: '记录表' },
  549. { key: 'bpm', name: '流程详情' }
  550. ],
  551. // 详情或者是审核
  552. type: 'detail',
  553. // 当前选项
  554. activeComp: 'main',
  555. details: null,
  556. loading: false,
  557. // 计划信息
  558. eamPlanInfo: null,
  559. // 事项规则相关数据
  560. // 负责人
  561. executorList: [],
  562. // 审核人
  563. uerList: [],
  564. deviceList: [],
  565. // ruleInfo
  566. ruleInfo: '',
  567. currenNode: null
  568. };
  569. },
  570. methods: {
  571. // 外部调用,打开弹窗
  572. open(data, type) {
  573. this.type = type;
  574. this.title = type == 'detail' ? '详情' : '审核';
  575. this.activeComp = 'main';
  576. console.log('当前行数据', data);
  577. this.getDatails(data.id);
  578. if (data.executeMethod == 1) {
  579. // 查询事项规则信息
  580. this.maintenanceGetById(data.eamPlanId);
  581. // 获取审核人列表数据
  582. this.getUserList();
  583. }
  584. this.visible = true;
  585. },
  586. // 关闭时清理表单
  587. handleClose() {
  588. this.currenNode = null;
  589. this.visible = false;
  590. },
  591. // 获取详情
  592. async getDatails(id) {
  593. try {
  594. this.loading = true;
  595. const data = await getById(id);
  596. console.log('data 详情数据', data);
  597. this.details = data;
  598. this.loading = false;
  599. } catch (error) {
  600. this.loading = false;
  601. }
  602. },
  603. showCheckUserNames(userList) {
  604. if (userList.length == 0) return '';
  605. return userList
  606. .map((i) => {
  607. return i.groupName + '-' + i.userName;
  608. })
  609. .join(',');
  610. },
  611. // 事项规则 详情
  612. async maintenanceGetById(id) {
  613. const { data } = await maintenanceGetById(id);
  614. console.log('事项规则 data', data);
  615. data.executorId = data.executorId.split(',');
  616. this.eamPlanInfo = data;
  617. this.getUserList({ groupId: data.groupId });
  618. this.ruleInfo = data.ruleInfo;
  619. this.ruleInfo.ruleItems = data.planDeviceList[0]?.workItems || [];
  620. this.deviceList = data.planDeviceList.map((item) => {
  621. return {
  622. name: item.substance.name,
  623. position: item.substance.position,
  624. id: item.substance.id,
  625. fixCode: item.substance.fixCode,
  626. codeNumber: item.substance.codeNumber
  627. };
  628. });
  629. },
  630. // 获取审核人列表、巡点检人员
  631. async getUserList(params) {
  632. try {
  633. let data = { pageNum: 1, size: -1 };
  634. // 如果传了参数就是获取巡点检人员数据
  635. if (params) {
  636. data = Object.assign(data, params);
  637. }
  638. const res = await getUserPage(data);
  639. if (params) {
  640. this.executorList = res.list;
  641. } else {
  642. this.uerList = res.list;
  643. }
  644. } catch (error) {}
  645. },
  646. // currenNode
  647. setCurrenNode(currenNode) {
  648. this.currenNode = currenNode;
  649. },
  650. // 审核通过刷新数据
  651. handleAudit() {
  652. this.getDatails(this.details.id);
  653. }
  654. }
  655. };
  656. </script>
  657. <style scoped lang="scss">
  658. .el-form-item .el-form-item {
  659. margin-bottom: 0 !important;
  660. }
  661. ::v-deep .el-tab_box {
  662. display: flex;
  663. margin-top: 10px;
  664. height: 300px;
  665. width: 100%;
  666. .equipmentList_box {
  667. flex: 1;
  668. height: 100%;
  669. margin-right: 10px;
  670. display: flex;
  671. flex-direction: column;
  672. .divider {
  673. flex: 0 0 50px;
  674. .title {
  675. height: 35px;
  676. }
  677. }
  678. .el-table {
  679. overflow: auto;
  680. }
  681. }
  682. .ruleMatters_box {
  683. flex: 3;
  684. height: 100%;
  685. display: flex;
  686. flex-direction: column;
  687. overflow: hidden;
  688. .divider {
  689. flex: 0 0 50px;
  690. .title {
  691. height: 35px;
  692. }
  693. }
  694. .el-table {
  695. overflow: auto;
  696. .operationGuide_box {
  697. width: 100%;
  698. height: 50px;
  699. display: flex;
  700. overflow: hidden;
  701. cursor: pointer;
  702. .left_content {
  703. flex: 0 0 200px;
  704. padding: 10px;
  705. box-sizing: border-box;
  706. border: 1px solid #c0c4cc;
  707. border-radius: 10px;
  708. margin-right: 10px;
  709. overflow-y: auto;
  710. }
  711. .right_content {
  712. flex: 1;
  713. padding: 10px;
  714. box-sizing: border-box;
  715. border: 1px solid #c0c4cc;
  716. border-radius: 10px;
  717. overflow-y: auto;
  718. }
  719. }
  720. }
  721. .el-table::before {
  722. display: none;
  723. }
  724. }
  725. }
  726. </style>