experimentReport.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <template>
  2. <el-dialog
  3. title="实验报工"
  4. :visible.sync="visible"
  5. :before-close="handleClose"
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. append-to-body
  9. width="80%"
  10. :maxable="true"
  11. >
  12. <header-title title="基础信息"> </header-title>
  13. <el-form
  14. label-width="115px"
  15. :model="{}"
  16. :rules="[]"
  17. ref="formRef"
  18. :disabled="type == 'detail'"
  19. >
  20. <el-row>
  21. <el-col :span="8">
  22. <el-form-item label="质检项:" prop="inspectionName">
  23. {{ projectData.inspectionName }}</el-form-item
  24. >
  25. </el-col>
  26. <el-col :span="8">
  27. <el-form-item label="编码:" prop="inspectionCode">
  28. {{ projectData.inspectionCode }}
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="8">
  32. <el-form-item label="批次号:" prop="batchNo">
  33. {{ projectData.batchNo }}
  34. </el-form-item>
  35. </el-col></el-row
  36. >
  37. <header-title title=" 样品信息"> </header-title>
  38. <ele-pro-table
  39. :needPage="false"
  40. :columns="workColumns"
  41. :datasource="[projectData]"
  42. >
  43. <template v-slot:qualityResultContent="{ row }">
  44. <el-input
  45. v-model="row.qualityResultContent"
  46. placeholder="请输入内容"
  47. :disabled="type == 'detail'"
  48. @input="handleInput(row, row.qualityResultContent)"
  49. >
  50. <template slot="append" v-if="row.unitName">
  51. {{ row.unitName }}
  52. </template>
  53. </el-input>
  54. </template>
  55. <template v-slot:sampleQuantity="{ row, $index }">
  56. <el-input
  57. v-model="row.sampleQuantity"
  58. placeholder="请输入"
  59. type="number"
  60. >
  61. </el-input>
  62. </template>
  63. <template v-slot:qualifiedQuantity="{ row, $index }">
  64. <el-input
  65. v-model="row.qualifiedQuantity"
  66. placeholder="请输入"
  67. :disabled="type == 'detail'"
  68. type="number"
  69. >
  70. </el-input>
  71. </template>
  72. <template v-slot:noQualifiedQuantity="{ row, $index }">
  73. <el-input
  74. v-model="row.noQualifiedQuantity"
  75. placeholder="请输入"
  76. :disabled="type == 'detail'"
  77. type="number"
  78. >
  79. </el-input>
  80. </template>
  81. <template v-slot:lossNumber="{ row, $index }">
  82. <el-input
  83. v-model="row.lossNumber"
  84. placeholder="请输入"
  85. :disabled="type == 'detail'"
  86. type="number"
  87. >
  88. </el-input>
  89. </template>
  90. <template v-slot:lossNumberUnqualified="{ row, $index }">
  91. <el-input
  92. v-model="row.lossNumberUnqualified"
  93. placeholder="请输入"
  94. :disabled="type == 'detail'"
  95. type="number"
  96. >
  97. </el-input>
  98. </template>
  99. <template v-slot:retainedSampleQuantity="{ row, $index }">
  100. <el-input
  101. v-model="row.retainedSampleQuantity"
  102. placeholder="请输入"
  103. :disabled="type == 'detail'"
  104. type="number"
  105. >
  106. </el-input>
  107. </template>
  108. <template v-slot:retainedSampleUnqualified="{ row, $index }">
  109. <el-input
  110. v-model="row.retainedSampleUnqualified"
  111. placeholder="请输入"
  112. :disabled="type == 'detail'"
  113. type="number"
  114. >
  115. </el-input> </template
  116. ></ele-pro-table>
  117. <header-title title="实验数据"> </header-title>
  118. <el-row>
  119. <el-col :span="8">
  120. <el-form-item label="实验编号:" prop="industryType">
  121. <el-input
  122. v-model="form.retainedSampleUnqualified1"
  123. placeholder="请输入"
  124. :disabled="true"
  125. type="number"
  126. >
  127. </el-input>
  128. </el-form-item> </el-col
  129. ></el-row>
  130. <el-row>
  131. <el-col :span="8">
  132. <el-form-item label="实验时间:" prop="industryType">
  133. <el-date-picker
  134. v-model="form.retainedSampleUnqualified2"
  135. type="datetime"
  136. placeholder="选择日期时间"
  137. style="width: 100%"
  138. >
  139. </el-date-picker>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="8">
  143. <el-form-item label="执行标准:" prop="pcode">
  144. <el-input
  145. :value="
  146. getDictValue('质检标准类型', projectData.qualityStandardType)
  147. "
  148. placeholder="请输入"
  149. :disabled="true"
  150. >
  151. </el-input>
  152. </el-form-item>
  153. </el-col>
  154. </el-row>
  155. <header-title title="实验试/实验设备"> </header-title>
  156. <el-row>
  157. <el-col :span="8">
  158. <el-form-item label="实验室:" prop="industryType">
  159. <el-select
  160. v-model="form.retainedSampleUnqualified3"
  161. style="width: 100%"
  162. placeholder="请选择"
  163. >
  164. <el-option
  165. v-for="item in laboratoryList"
  166. :key="item.workshopId"
  167. :label="item.workshopName"
  168. :value="item.workshopId"
  169. >
  170. </el-option>
  171. </el-select>
  172. </el-form-item>
  173. </el-col>
  174. </el-row>
  175. <el-row v-for="(item, index) in laboratoryItemList">
  176. <el-col :span="24">
  177. <el-row>
  178. <el-col :span="8">
  179. <el-form-item
  180. :label="'实验设备' + (index + 1) + ':'"
  181. prop="industryType"
  182. >
  183. <el-select
  184. v-model="item.retainedSampleUnqualified4"
  185. style="width: calc(100% - 30px)"
  186. placeholder="请选择"
  187. >
  188. <el-option :label="'测试设备1'" :value="1"> </el-option>
  189. <el-option :label="'测试设备2'" :value="2"> </el-option>
  190. </el-select>
  191. <i
  192. class="el-icon-delete"
  193. style="
  194. color: #f56c6c;
  195. font-size: 16px;
  196. margin-left: 10px;
  197. cursor: pointer;
  198. "
  199. @click="delLaboratoryItemList(index)"
  200. ></i>
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. </el-col>
  205. <el-col :span="24">
  206. <el-row>
  207. <el-col :span="8">
  208. <el-form-item label="开始时间:" prop="industryType">
  209. <el-date-picker
  210. v-model="item.retainedSampleUnqualified5"
  211. type="datetime"
  212. placeholder="选择日期时间"
  213. style="width: 100%"
  214. >
  215. </el-date-picker
  216. ></el-form-item>
  217. </el-col>
  218. <el-col :span="8">
  219. <el-form-item label="结束时间:" prop="industryType">
  220. <el-date-picker
  221. v-model="item.retainedSampleUnqualified6"
  222. type="datetime"
  223. placeholder="选择日期时间"
  224. style="width: 100%"
  225. >
  226. </el-date-picker
  227. ></el-form-item>
  228. </el-col>
  229. </el-row>
  230. </el-col>
  231. <el-col :span="24">
  232. <el-row>
  233. <el-col :span="16">
  234. <el-form-item label="运行参数:" prop="industryType">
  235. <el-input
  236. v-model="item.retainedSampleUnqualified7"
  237. placeholder="请输入"
  238. >
  239. </el-input
  240. ></el-form-item>
  241. </el-col>
  242. </el-row>
  243. </el-col>
  244. </el-row>
  245. <el-row>
  246. <el-col :span="24">
  247. <el-form-item label=" " prop="industryType">
  248. <el-button type="primary" @click="addlLaboratoryItemList">
  249. 新增实验设备
  250. </el-button>
  251. </el-form-item>
  252. </el-col></el-row
  253. >
  254. <header-title title="实验过程"> </header-title>
  255. <el-button type="primary" size="small" @click="releaseRulesRefOpen(5)"
  256. >选择实验过程</el-button
  257. >
  258. <el-row>
  259. <el-col :span="24">
  260. <experimentationProcess
  261. ref="experimentationProcess1"
  262. ></experimentationProcess> </el-col
  263. ></el-row>
  264. <header-title title="工艺要求"> </header-title>
  265. <el-input
  266. type="textarea"
  267. :rows="1"
  268. placeholder="请输入内容"
  269. v-model="projectData.defaultValue"
  270. >
  271. </el-input>
  272. <el-row> <el-col :span="24"> </el-col></el-row>
  273. <header-title title="实验工具"> </header-title>
  274. <el-button type="primary" size="small" @click="handleAdd('unitList')"
  275. >选择实验工具</el-button
  276. >
  277. <ele-pro-table
  278. :needPage="false"
  279. :columns="unitColumns"
  280. :datasource="unitList"
  281. >
  282. <template v-slot:action="{ row, $index }">
  283. <el-popconfirm
  284. class="ele-action"
  285. title="确定要删除此条数据吗?"
  286. @confirm="remove($index, 'unitList')"
  287. >
  288. <template v-slot:reference>
  289. <el-link type="danger" :underline="false" icon="el-icon-delete">
  290. 删除
  291. </el-link>
  292. </template>
  293. </el-popconfirm>
  294. </template>
  295. </ele-pro-table>
  296. <header-title title="实验耗材"> </header-title>
  297. <el-button type="primary" size="small" @click="handleAdd('unitList1')"
  298. >选择实验耗材</el-button
  299. >
  300. <ele-pro-table
  301. :needPage="false"
  302. :columns="unitColumns1"
  303. :datasource="unitList1"
  304. >
  305. <template v-slot:remark="{ row, $index }">
  306. <el-input type="textarea" v-model="row.remark"></el-input>
  307. </template>
  308. <template v-slot:action="{ row, $index }">
  309. <el-popconfirm
  310. class="ele-action"
  311. title="确定要删除此条数据吗?"
  312. @confirm="remove($index, 'unitList1')"
  313. >
  314. <template v-slot:reference>
  315. <el-link type="danger" :underline="false" icon="el-icon-delete">
  316. 删除
  317. </el-link>
  318. </template>
  319. </el-popconfirm>
  320. </template>
  321. </ele-pro-table>
  322. <header-title title="实验记录"> </header-title>
  323. <el-button type="primary" size="small" @click="releaseRulesRefOpen(7)"
  324. >选择实验记录</el-button
  325. >
  326. <el-row>
  327. <el-col :span="24">
  328. <experimentationProcess
  329. ref="experimentationProcess3"
  330. ></experimentationProcess> </el-col
  331. ></el-row>
  332. <el-row>
  333. <el-col :span="16">
  334. <el-form-item label="实验结果:" prop="industryType">
  335. <el-input
  336. type="textarea"
  337. :rows="4"
  338. placeholder="请输入内容"
  339. v-model="projectData.textarea"
  340. >
  341. </el-input>
  342. </el-form-item>
  343. </el-col>
  344. </el-row>
  345. <el-row>
  346. <el-col :span="8">
  347. <el-form-item label="实验结论:" prop="industryType">
  348. <el-select
  349. v-model="projectData.retainedSampleUnqualified9"
  350. placeholder="请选择"
  351. >
  352. <el-option :label="'合格'" :value="1"> </el-option>
  353. <el-option :label="'不合格'" :value="2"> </el-option>
  354. </el-select>
  355. </el-form-item>
  356. </el-col>
  357. </el-row>
  358. <el-row>
  359. <el-col :span="24">
  360. <el-form-item label="实验图片:" prop="industryType"> </el-form-item>
  361. </el-col>
  362. </el-row>
  363. <el-row>
  364. <el-col :span="24">
  365. <el-form-item label="附件图片:" prop="industryType"> </el-form-item>
  366. </el-col>
  367. </el-row>
  368. </el-form>
  369. <template v-slot:footer>
  370. <el-button size="small" @click="handleClose">关闭</el-button>
  371. <el-button type="primary" size="small" @click="save">保存</el-button>
  372. <el-button type="primary" size="small" @click="submit">提交</el-button>
  373. </template>
  374. <releaseRules
  375. ref="releaseRulesRef"
  376. @success="releaseRulesSuccess"
  377. ></releaseRules>
  378. <ProductModal ref="productRefs" @chooseModal="chooseModal" />
  379. </el-dialog>
  380. </template>
  381. <script>
  382. import dictMixins from '@/mixins/dictMixins';
  383. import experimentationProcess from '@/components/templateDiv/experimentationProcess.vue';
  384. import releaseRules from '@/components/releaseRules/index.vue';
  385. import { getFactoryarea } from '@/api/aps/index.js';
  386. import ProductModal from '@/views/inspectionProject/components/ProductModal.vue';
  387. export default {
  388. components: { experimentationProcess, releaseRules, ProductModal },
  389. props: {},
  390. mixins: [dictMixins],
  391. data() {
  392. return {
  393. visible: false,
  394. projectData: {},
  395. unitListKey: '',
  396. form: {},
  397. laboratoryItemList: [{}],
  398. laboratoryList: [],
  399. unitList: [],
  400. unitList1: [],
  401. unitColumns: [
  402. {
  403. minWidth: 200,
  404. prop: 'name',
  405. align: 'center',
  406. label: '工具名称',
  407. showOverflowTooltip: true
  408. },
  409. {
  410. minWidth: 200,
  411. prop: 'modelType',
  412. align: 'center',
  413. label: '型号',
  414. showOverflowTooltip: true
  415. },
  416. {
  417. minWidth: 200,
  418. prop: 'code',
  419. align: 'center',
  420. label: '编号',
  421. showOverflowTooltip: true
  422. },
  423. {
  424. columnKey: 'action',
  425. label: '操作',
  426. align: 'center',
  427. width: 100,
  428. resizable: false,
  429. slot: 'action',
  430. fixed: 'right'
  431. }
  432. ],
  433. unitColumns1: [
  434. {
  435. minWidth: 200,
  436. prop: 'name',
  437. align: 'center',
  438. label: '耗材名称',
  439. showOverflowTooltip: true
  440. },
  441. {
  442. minWidth: 200,
  443. prop: 'code',
  444. align: 'center',
  445. label: '编号',
  446. showOverflowTooltip: true
  447. },
  448. {
  449. minWidth: 200,
  450. prop: 'batchNo',
  451. align: 'center',
  452. label: '批次号',
  453. showOverflowTooltip: true
  454. },
  455. {
  456. minWidth: 200,
  457. prop: 'specification',
  458. align: 'center',
  459. label: '浓度',
  460. showOverflowTooltip: true
  461. },
  462. {
  463. minWidth: 200,
  464. prop: 'batchNo',
  465. align: 'center',
  466. label: '来源',
  467. showOverflowTooltip: true
  468. },
  469. {
  470. minWidth: 300,
  471. prop: 'remark',
  472. slot: 'remark',
  473. align: 'center',
  474. label: '过程',
  475. showOverflowTooltip: true
  476. },
  477. {
  478. columnKey: 'action',
  479. label: '操作',
  480. align: 'center',
  481. width: 100,
  482. resizable: false,
  483. slot: 'action',
  484. fixed: 'right'
  485. }
  486. ],
  487. workColumns: [
  488. {
  489. minWidth: 120,
  490. prop: 'sampleQuantity',
  491. slot: 'sampleQuantity',
  492. align: 'center',
  493. label: '样品数',
  494. showOverflowTooltip: true
  495. },
  496. {
  497. minWidth: 120,
  498. prop: 'qualifiedQuantity',
  499. align: 'center',
  500. slot: 'qualifiedQuantity',
  501. label: '合格数',
  502. showOverflowTooltip: true
  503. },
  504. {
  505. minWidth: 130,
  506. prop: 'noQualifiedQuantity',
  507. slot: 'noQualifiedQuantity',
  508. align: 'center',
  509. label: '不合格数',
  510. showOverflowTooltip: true
  511. },
  512. {
  513. minWidth: 140,
  514. prop: 'lossNumber',
  515. slot: 'lossNumber',
  516. align: 'center',
  517. label: '损耗数(合格品)',
  518. showOverflowTooltip: true
  519. },
  520. {
  521. minWidth: 150,
  522. prop: 'lossNumberUnqualified',
  523. slot: 'lossNumberUnqualified',
  524. align: 'center',
  525. label: '损耗数(不合格品)',
  526. showOverflowTooltip: true
  527. },
  528. {
  529. minWidth: 140,
  530. prop: 'retainedSampleQuantity',
  531. slot: 'retainedSampleQuantity',
  532. align: 'center',
  533. label: '留样数(合格品)',
  534. showOverflowTooltip: true
  535. },
  536. {
  537. minWidth: 150,
  538. prop: 'retainedSampleUnqualified',
  539. slot: 'retainedSampleUnqualified',
  540. align: 'center',
  541. label: '留样数(不合格品)',
  542. showOverflowTooltip: true
  543. }
  544. ]
  545. };
  546. },
  547. watch: {},
  548. methods: {
  549. open(row) {
  550. this.projectData = row;
  551. this.getFactoryarea();
  552. this.visible = true;
  553. },
  554. handleAdd(type) {
  555. this.unitListKey = type;
  556. if (type == 'unitList') {
  557. this.$refs.productRefs.open(this.unitList);
  558. } else {
  559. this.$refs.productRefs.open(this.unitList1);
  560. }
  561. },
  562. remove(index, type) {
  563. if (type == 'unitList') {
  564. this.unitList.splice(index, 1);
  565. } else {
  566. this.unitList1.splice(index, 1);
  567. }
  568. },
  569. chooseModal(data) {
  570. if (this.unitListKey == 'unitList') {
  571. this.unitList = [...this.unitList, ...data];
  572. } else {
  573. this.unitList1 = [...this.unitList1, ...data];
  574. }
  575. },
  576. delLaboratoryItemList(index) {
  577. this.laboratoryItemList.splice(index, 1);
  578. },
  579. addlLaboratoryItemList(index) {
  580. this.laboratoryItemList.push({});
  581. },
  582. async getFactoryarea() {
  583. const data = await getFactoryarea({
  584. pageNum: 1,
  585. size: 1000,
  586. type: 3
  587. });
  588. this.laboratoryList = data.list;
  589. console.log(this.laboratoryList, 'data');
  590. },
  591. releaseRulesRefOpen(type) {
  592. this.releaseRulesType = type;
  593. this.$refs.releaseRulesRef.open(type);
  594. },
  595. releaseRulesSuccess(data) {
  596. if (this.releaseRulesType == 5) {
  597. this.$refs.experimentationProcess1.init(data.tempJson.tempJson);
  598. }
  599. if (this.releaseRulesType == 6) {
  600. this.$refs.experimentationProcess2.init(data.tempJson.tempJson);
  601. }
  602. if (this.releaseRulesType == 7) {
  603. this.$refs.experimentationProcess3.init(data.tempJson.tempJson);
  604. }
  605. },
  606. handleClose() {
  607. this.visible = false;
  608. }
  609. }
  610. };
  611. </script>
  612. <style lang="scss" scoped></style>