InspectDetail.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  1. <template>
  2. <div class="app-container">
  3. <!-- 工具栏 -->
  4. <el-row :gutter="10">
  5. <el-col :span="1.5" class="mb20">
  6. <el-button
  7. type="primary"
  8. :loading="submitLoading"
  9. size="mini"
  10. icon="el-icon-finished"
  11. :disabled="
  12. apiStatus === 1 ||
  13. apiStatus === 2 ||
  14. choiceStatus ||
  15. disableApproval
  16. "
  17. @click="handleTesting"
  18. >{{ apiStatus === -1 ? "送审" : "批核" }}</el-button
  19. >
  20. <el-button
  21. type="primary"
  22. size="mini"
  23. icon="el-icon-check"
  24. :loading="saveLoading"
  25. :disabled="apiStatus !== -1"
  26. @click="handleSave()"
  27. >保存</el-button
  28. >
  29. <el-button
  30. v-hasPermi="['wms:material-item:update']"
  31. size="mini"
  32. type="primary"
  33. icon="el-icon-refresh"
  34. :disabled="apiStatus !== 0 || resetInspect"
  35. :loading="reLoading"
  36. @click="handleResetInspection"
  37. >重新检验</el-button
  38. >
  39. <el-button
  40. type="primary"
  41. icon="el-icon-printer"
  42. :loading="printLoading"
  43. :disabled="apiStatus === -1 || apiStatus === 0"
  44. size="mini"
  45. @click="handlePrint"
  46. >检验单打印</el-button
  47. >
  48. <el-button
  49. type="primary"
  50. icon="el-icon-thumb"
  51. :loading="submitLoading"
  52. :disabled="apiStatus !== -1 || ifModify > 0"
  53. size="mini"
  54. @click="handleApply"
  55. >申请修改检验标准</el-button
  56. >
  57. </el-col>
  58. <el-col :span="1.5">
  59. <el-button
  60. type="primary"
  61. icon="el-icon-magic-stick"
  62. :loading="printLoading"
  63. :disabled="apiStatus !== -1"
  64. size="mini"
  65. @click="handleAllInspect"
  66. >一键检验</el-button
  67. >
  68. </el-col>
  69. <el-col :span="1.5">
  70. <el-button
  71. v-hasPermi="['wms:ipqc-actual-file:query']"
  72. type="primary"
  73. size="mini"
  74. icon="el-icon-upload2"
  75. :loading="printLoading"
  76. @click="handleUploadFile"
  77. >{{ apiStatus == -1 ? "上传附件" : "查看附件" }}</el-button
  78. >
  79. </el-col>
  80. <!-- <el-col :span="1.5">
  81. <el-button
  82. v-hasPermi="['wms:delivery-notice-master:query']"
  83. type="primary"
  84. size="mini"
  85. icon="el-icon-view"
  86. :loading="supplierLoading"
  87. @click="handleViewSupplierFile"
  88. >供应商附件</el-button
  89. >
  90. </el-col> -->
  91. <el-col :span="1.5">
  92. <el-button
  93. type="primary"
  94. size="mini"
  95. icon="el-icon-view"
  96. :loading="supplierLoading"
  97. @click="handleViewSupplierFile"
  98. >供应商附件</el-button
  99. >
  100. </el-col>
  101. </el-row>
  102. <!-- 搜索工作栏 -->
  103. <el-form
  104. v-show="showSearch"
  105. ref="queryForm"
  106. :model="formParams"
  107. size="small"
  108. label-width="98px"
  109. disabled
  110. >
  111. <!-- <el-descriptions
  112. class="margin-top mb10"
  113. :column="3"
  114. style="width: 100%;"
  115. border
  116. >
  117. <el-descriptions-item label="IQC编号">{{ formParams.materialLots }}</el-descriptions-item>
  118. <el-descriptions-item label="物料编码">{{ formParams.materialNo }}</el-descriptions-item>
  119. <el-descriptions-item label="物料名称">{{ formParams.materialName }}</el-descriptions-item>
  120. <el-descriptions-item label="来料数量">{{ formParams.receiptQty }} ({{ $route.query.unitCode }})</el-descriptions-item>
  121. <el-descriptions-item label="供应商">{{ formParams.supplierName }}</el-descriptions-item>
  122. <el-descriptions-item label="规格">{{ formParams.size }}</el-descriptions-item>
  123. <el-descriptions-item label="检验标准版本">{{ formParams.version || '草稿' }}</el-descriptions-item>
  124. <el-descriptions-item label="审核时间">{{ formParams.auditTimeStr }}</el-descriptions-item>
  125. <el-descriptions-item label="保质期">{{ formParams.validTillStr }}</el-descriptions-item>
  126. <el-descriptions-item label="送货批次">{{ formParams.deliverBatch }}</el-descriptions-item>
  127. <el-descriptions-item v-if="currentRows.length > 0 && (currentRows[0].checkCategory === '5' || currentRows[0].tool === '3')">
  128. <VueQr
  129. :text="formParams.materialLots+','+currentRows[0].id"
  130. :binarize="true"
  131. :size="65"
  132. :margin="5"
  133. />
  134. </el-descriptions-item>
  135. </el-descriptions> -->
  136. <el-row :gutter="20">
  137. <el-col :span="8">
  138. <el-form-item label="IQC编号" prop="materialLots">
  139. <el-input
  140. v-model="formParams.materialLots"
  141. placeholder="请输入IQC编号"
  142. clearable
  143. @keyup.enter.native="handleQuery"
  144. />
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="8">
  148. <el-form-item label="物料编码" prop="materialNo">
  149. <el-input
  150. v-model="formParams.materialNo"
  151. placeholder="请输入物料编码"
  152. clearable
  153. @keyup.enter.native="handleQuery"
  154. />
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="8">
  158. <el-form-item label="物料名称" prop="materialName">
  159. <el-input
  160. v-model="formParams.materialName"
  161. placeholder="请输入物料名称"
  162. clearable
  163. @keyup.enter.native="handleQuery"
  164. />
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="8">
  168. <el-form-item label="来料数量" prop="receiptQty">
  169. <el-input
  170. v-model="formParams.receiptQty"
  171. placeholder="请输入来料数量"
  172. clearable
  173. @keyup.enter.native="handleQuery"
  174. >
  175. <template slot="append">{{ $route.query.unitCode }}</template>
  176. </el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="8">
  180. <el-form-item label="供应商" prop="supplierName">
  181. <el-input
  182. v-model="formParams.supplierName"
  183. placeholder="请输入供应商"
  184. clearable
  185. @keyup.enter.native="handleQuery"
  186. />
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="8">
  190. <el-form-item label="规格" prop="size">
  191. <el-input
  192. v-model="formParams.size"
  193. placeholder="请输入规格"
  194. clearable
  195. @keyup.enter.native="handleQuery"
  196. />
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="8">
  200. <el-form-item label="检验标准版本" prop="version">
  201. <el-input
  202. v-model="formParams.version"
  203. placeholder="草稿"
  204. clearable
  205. @keyup.enter.native="handleQuery"
  206. />
  207. </el-form-item>
  208. </el-col>
  209. <el-col :span="8">
  210. <el-form-item label="审核时间" prop="auditTimeStr">
  211. <el-input
  212. v-model="formParams.auditTimeStr"
  213. placeholder="请输入审核时间"
  214. clearable
  215. @keyup.enter.native="handleQuery"
  216. />
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="8">
  220. <el-form-item label="保质期" prop="validTillStr">
  221. <el-input
  222. v-model="formParams.validTillStr"
  223. placeholder="请输入保质期"
  224. clearable
  225. @keyup.enter.native="handleQuery"
  226. />
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="8">
  230. <el-form-item label="送货批次" prop="deliverBatch">
  231. <el-input
  232. v-model="formParams.deliverBatch"
  233. placeholder="请输入送货批次"
  234. clearable
  235. @keyup.enter.native="handleQuery"
  236. />
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="8">
  240. <el-form-item label="生产日期" prop="produceDate">
  241. <el-input
  242. v-model="formParams.produceDate"
  243. placeholder="请输入送货批次"
  244. clearable
  245. @keyup.enter.native="handleQuery"
  246. />
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="8">
  250. <el-form-item
  251. v-if="
  252. currentRows.length > 0 &&
  253. (currentRows[0].checkCategory === '5' ||
  254. currentRows[0].tool === '3')
  255. "
  256. >
  257. <VueQr
  258. :text="formParams.materialLots + ',' + currentRows[0].id"
  259. :binarize="true"
  260. :size="65"
  261. :margin="5"
  262. />
  263. </el-form-item>
  264. </el-col>
  265. </el-row>
  266. </el-form>
  267. <!-- 表格 -->
  268. <el-tabs v-model="activeName" @tab-click="handleClick">
  269. <el-tab-pane label="检验详情" name="inspectDetails" lazy>
  270. <!-- 明细体 -->
  271. <el-table
  272. ref="table"
  273. v-loading="loading"
  274. :data="list"
  275. border
  276. size="mini"
  277. max-height="400"
  278. :span-method="arraySpanMethod"
  279. :cell-class-name="delLine"
  280. @selection-change="tableSelected"
  281. >
  282. <el-table-column type="selection" width="40" fixed="left" />
  283. <el-table-column
  284. label="检查内容"
  285. align="center"
  286. prop="checkCategoryStr"
  287. />
  288. <el-table-column
  289. label="检验项名称"
  290. align="center"
  291. prop="inspectionName"
  292. width="130"
  293. show-overflow-tooltip
  294. />
  295. <el-table-column
  296. label="检查规格/标准"
  297. align="center"
  298. width="120"
  299. prop="standard"
  300. show-overflow-tooltip
  301. />
  302. <el-table-column label="检查工具" align="center" prop="tool">
  303. <template slot-scope="scope">
  304. <el-button
  305. v-if="scope.row.tool === '4'"
  306. type="text"
  307. @click="handleToPeelingForce(scope.row)"
  308. >
  309. {{ scope.row.toolName }}
  310. </el-button>
  311. <span v-else>{{ scope.row.toolName }}</span>
  312. </template>
  313. </el-table-column>
  314. <el-table-column
  315. label="检查数量"
  316. align="center"
  317. prop="checkQuantity"
  318. show-overflow-tooltip
  319. />
  320. <el-table-column
  321. label="检查记录(数据)"
  322. align="center"
  323. prop="checkQuantity"
  324. >
  325. <el-table-column label="NO.1" align="center" prop="actual1">
  326. <template slot-scope="scope">
  327. <span v-if="scope.row.inspectionModel === 1">{{
  328. scope.row.measuredResults
  329. }}</span>
  330. <el-input
  331. v-else
  332. v-model="scope.row.actual1"
  333. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  334. :disabled="apiStatus !== -1"
  335. @blur="handleQualified(scope.row)"
  336. @focus="handleQuadraticelement(scope.row, scope.column)"
  337. />
  338. </template>
  339. </el-table-column>
  340. <el-table-column label="NO.2" align="center" prop="actual2">
  341. <template slot-scope="scope">
  342. <el-input
  343. v-model="scope.row.actual2"
  344. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  345. :disabled="apiStatus !== -1"
  346. @blur="handleQualified(scope.row)"
  347. @focus="handleQuadraticelement(scope.row, scope.column)"
  348. />
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="NO.3" align="center" prop="actual3">
  352. <template slot-scope="scope">
  353. <el-input
  354. v-model="scope.row.actual3"
  355. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  356. :disabled="apiStatus !== -1"
  357. @blur="handleQualified(scope.row)"
  358. @focus="handleQuadraticelement(scope.row, scope.column)"
  359. />
  360. </template>
  361. </el-table-column>
  362. <el-table-column label="NO.4" align="center" prop="actual4">
  363. <template slot-scope="scope">
  364. <el-input
  365. v-model="scope.row.actual4"
  366. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  367. :disabled="apiStatus !== -1"
  368. @blur="handleQualified(scope.row)"
  369. @focus="handleQuadraticelement(scope.row, scope.column)"
  370. />
  371. </template>
  372. </el-table-column>
  373. <el-table-column label="NO.5" align="center" prop="actual5">
  374. <template slot-scope="scope">
  375. <el-input
  376. v-model="scope.row.actual5"
  377. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  378. :disabled="apiStatus !== -1"
  379. @blur="handleQualified(scope.row)"
  380. @focus="handleQuadraticelement(scope.row, scope.column)"
  381. />
  382. </template>
  383. </el-table-column>
  384. </el-table-column>
  385. <el-table-column
  386. label="判定"
  387. align="center"
  388. prop="singleResultNum"
  389. width="140"
  390. >
  391. <template slot-scope="scope">
  392. <el-radio-group
  393. v-model="scope.row.singleResultNum"
  394. :disabled="
  395. apiStatus !== -1 || scope.row.inspectionNo === 'IQCEXPERIOD'
  396. "
  397. >
  398. <el-radio :label="1">OK</el-radio>
  399. <el-radio :label="0">NG</el-radio>
  400. </el-radio-group>
  401. </template>
  402. </el-table-column>
  403. <el-table-column
  404. label="不良项(不良代码)"
  405. align="center"
  406. prop="badName"
  407. width="130"
  408. >
  409. <template slot-scope="scope">
  410. <BadcodeSelect
  411. :key="`badCode+${scope.$index}`"
  412. v-model="scope.row.badName"
  413. clearable
  414. :disabled="
  415. apiStatus !== -1 || scope.row.inspectionNo === 'IQCEXPERIOD'
  416. "
  417. @change="badCodeChange(scope.row, scope.row.badName)"
  418. />
  419. </template>
  420. </el-table-column>
  421. <el-table-column
  422. label="实测结果"
  423. align="center"
  424. prop="measuredResults"
  425. width="130"
  426. >
  427. <template slot-scope="scope">
  428. <el-input
  429. v-show="scope.row.inspectionModel === 1"
  430. v-model="scope.row.measuredResults"
  431. :disabled="
  432. apiStatus !== -1 || scope.row.inspectionNo === 'IQCEXPERIOD'
  433. "
  434. placeholder="请输入实测结果"
  435. />
  436. </template>
  437. </el-table-column>
  438. </el-table>
  439. <!-- 表尾 -->
  440. <el-form
  441. v-show="apiStatus !== -1"
  442. ref="queryForm"
  443. :model="adjustForm"
  444. size="small"
  445. label-width="88px"
  446. class="mt20"
  447. >
  448. <el-row :gutter="20">
  449. <el-col :span="8">
  450. <el-form-item label="合格" prop="noPassType">
  451. <el-radio
  452. v-model="adjustForm.noPassType"
  453. :disabled="apiStatus === 1 || apiStatus === 2"
  454. label="0"
  455. @change="noPassChange"
  456. >合格</el-radio
  457. >
  458. </el-form-item>
  459. </el-col>
  460. <el-col v-if="adjustForm.noPassType !== '0'" :span="8">
  461. <el-form-item
  462. v-if="adjustForm.noPassType !== '0'"
  463. label="原因说明"
  464. prop="manage"
  465. >
  466. <el-input
  467. v-model="adjustForm.manage"
  468. placeholder="请输入原因说明"
  469. @change="noPassChange"
  470. />
  471. </el-form-item>
  472. </el-col>
  473. <el-col :span="adjustForm.noPassType !== '0' ? 8 : 12">
  474. <el-form-item label="检验员" prop="inspector">
  475. <el-input
  476. v-model="adjustForm.inspector"
  477. placeholder="请输入检验员"
  478. disabled
  479. />
  480. </el-form-item>
  481. </el-col>
  482. </el-row>
  483. <el-row :gutter="20">
  484. <el-col :span="12">
  485. <el-form-item label="不合格" prop="noPassType">
  486. <el-radio-group
  487. v-model="adjustForm.noPassType"
  488. @change="noPassChange"
  489. >
  490. <el-radio
  491. :disabled="apiStatus === 1 || apiStatus === 2"
  492. label="1"
  493. >特采</el-radio
  494. >
  495. <el-radio
  496. :disabled="apiStatus === 1 || apiStatus === 2"
  497. label="2"
  498. >挑选</el-radio
  499. >
  500. <el-radio
  501. :disabled="apiStatus === 1 || apiStatus === 2"
  502. label="3"
  503. >退货</el-radio
  504. >
  505. <el-radio
  506. :disabled="apiStatus === 1 || apiStatus === 2"
  507. label="4"
  508. >报废</el-radio
  509. >
  510. </el-radio-group>
  511. </el-form-item>
  512. </el-col>
  513. <el-col :span="12">
  514. <el-form-item label="审核员" prop="auditor">
  515. <el-input
  516. v-model="adjustForm.auditor"
  517. placeholder="请输入审核员"
  518. disabled
  519. />
  520. </el-form-item>
  521. </el-col>
  522. </el-row>
  523. </el-form>
  524. <!-- 挑选入库 -->
  525. <el-table
  526. v-show="adjustForm.noPassType === '2'"
  527. v-loading="loading"
  528. :data="choiceList"
  529. border
  530. size="mini"
  531. >
  532. <el-table-column
  533. label="标签码"
  534. align="center"
  535. prop="qrCode"
  536. width="150"
  537. show-overflow-tooltip
  538. />
  539. <el-table-column label="登记数量" align="center" prop="receiptQty" />
  540. <el-table-column label="合格数量" align="center" prop="qty" />
  541. <el-table-column label="不良数量" align="center" prop="badQty">
  542. <template slot-scope="scope">
  543. <el-input
  544. v-model="scope.row.badQty"
  545. oninput="value=value.replace(/[^0-9]{0,1}(\d*(?:\.\d{0,8})?).*$/g, '$1')"
  546. :disabled="apiStatus === 1 || apiStatus === 2"
  547. @change="badQtyInputChange"
  548. />
  549. </template>
  550. </el-table-column>
  551. </el-table>
  552. </el-tab-pane>
  553. <el-tab-pane label="审批任务" name="approvalTask" lazy>
  554. <ApprovalTask
  555. v-if="
  556. formParams.bpmInstanceId !== null &&
  557. formParams.bpmInstanceId !== undefined
  558. "
  559. ref="approvalTask"
  560. :active-name="activeName"
  561. :query-paramspro="formParams"
  562. />
  563. <div v-else class="isNotApproval">暂未开启工作流</div>
  564. </el-tab-pane>
  565. </el-tabs>
  566. <!-- 检验结果 -->
  567. <EditInspectItem ref="editInspectItem" @complete="getList" />
  568. <!-- 修改检验标准 -->
  569. <UpdateInspection
  570. ref="updateInspection"
  571. @updateCase="getList"
  572. @addComplete="getList"
  573. />
  574. <!-- 单据打印 -->
  575. <IssuePrinit ref="issuePrinit" />
  576. <!-- 文件上传 -->
  577. <InspectFileUpload
  578. ref="inspectFileUpload"
  579. :process-no="$route.query.processNo"
  580. @uploadComplete="getHeadList"
  581. />
  582. <!-- 剥离力 -->
  583. <PeelingForce ref="peelingForce" />
  584. <!-- 二次元 -->
  585. <QuadraticElement ref="quadraticElement" />
  586. </div>
  587. </template>
  588. <script>
  589. // finishMaterialItem
  590. import {
  591. getMaterialItemPage,
  592. finishMaterialItem,
  593. } from "@/api/wms/quality/inspectionCase";
  594. import {
  595. getiqcInspectionHead,
  596. getIqcInspectionDetail_2,
  597. getIqcInspectionDetail_1,
  598. } from "@/api/wms/quality/inspectionReport";
  599. import { ifChangeMasterAdditional } from "@/api/wms/quality/inspectStandardApproval";
  600. import {
  601. updateReinspection,
  602. getURL,
  603. updateAllForPCInspect,
  604. updateRowForPCIsQualified,
  605. getSupplierFileByMaterialLots,
  606. } from "@/api/wms/quality/iqcInspectionExecute";
  607. import BadcodeSelect from "../../components/BadCodeSelect.vue";
  608. import { updateAuditStatus } from "@/api/wms/quality/inspectionResultApproval";
  609. // 挑选入库
  610. import {
  611. getLabelPrintDataDetail,
  612. updateBatchChoice,
  613. } from "@/api/wms/incoming/register";
  614. // 文件上传
  615. import InspectFileUpload from "./InspectFileUpload.vue";
  616. // 审批任务
  617. import ApprovalTask from "./ApprovalTask.vue";
  618. import EditInspectItem from "./EditInspectItem.vue";
  619. import UpdateInspection from "./UpdateInspection.vue";
  620. import IssuePrinit from "./IssuePrinit.vue";
  621. import { parseTime } from "@/utils/ruoyi";
  622. import { mapState } from "vuex";
  623. // 审批流获取id接口
  624. import { getModelPage } from "@/api/bpm/model";
  625. // 开启审批流
  626. // import { createProcessInstance } from '@/api/bpm/processInstance'
  627. // 剥离力
  628. import PeelingForce from "./PeelingForce.vue";
  629. // 打印参数
  630. const AccessTokenKey = "ACCESS_TOKEN";
  631. // VUEQr
  632. import VueQr from "vue-qr";
  633. import QuotationTrendVue from "@/views/dashboard/QuotationTrend.vue";
  634. import QuadraticElement from "./QuadraticElement.vue";
  635. export default {
  636. components: {
  637. EditInspectItem,
  638. UpdateInspection,
  639. IssuePrinit,
  640. InspectFileUpload,
  641. ApprovalTask,
  642. BadcodeSelect,
  643. PeelingForce,
  644. VueQr,
  645. QuadraticElement,
  646. },
  647. data() {
  648. return {
  649. visible: false,
  650. // 遮罩
  651. finishOpen: false,
  652. open: false,
  653. loading: false,
  654. submitLoading: false,
  655. // 完成的loading
  656. buttonLoading: false,
  657. // 供应商附件遮罩层
  658. supplierLoading: false,
  659. activeName: "inspectDetails",
  660. // 挑选
  661. choiceStatus: false,
  662. finishChoice: false,
  663. saveLoading: false,
  664. disableApproval: false,
  665. reLoading: false,
  666. showSearch: true,
  667. // 方案id\additionalId
  668. wmsMaterialAdditionalId: "",
  669. wmsMaterialItemMasterId: "",
  670. // 非计量型禁用实测按钮
  671. // 总条数
  672. total: 0,
  673. // 品质检验执行主列表
  674. list: [],
  675. // 挑选查询列表
  676. choiceList: [],
  677. // 表体list
  678. list1: [],
  679. list2: [],
  680. valueList: [],
  681. // 是否允许修改检验标准
  682. ifModify: "",
  683. // 根据状态判断是否新增
  684. updateInspectStatus: "",
  685. // 版本
  686. version: "",
  687. // 根据审核状态判断调哪个接口
  688. apiStatus: "",
  689. formParams: {
  690. checkName: "",
  691. },
  692. // 批核结果参数
  693. adjustForm: {
  694. noPassType: "",
  695. manage: null,
  696. },
  697. // 单据打印参数
  698. tokens: "",
  699. baseUrl: "",
  700. reportId: "",
  701. printLoading: false,
  702. resetInspect: false,
  703. // 审批流
  704. processMessage: {},
  705. // 流程详细Id
  706. processDetailId: "",
  707. // 选中的
  708. currentRows: [],
  709. // 查询参数
  710. queryParams: {
  711. id: null,
  712. inspectionRegisterId: null,
  713. inspectionNo: null,
  714. inspectionResult: null,
  715. badNo: null,
  716. createTime: [],
  717. materialLots: null,
  718. materialNo: null,
  719. processNo: null,
  720. },
  721. // 校验规则
  722. rules: {
  723. noPassType: [
  724. {
  725. required: true,
  726. message: "请选择检验结果",
  727. trigger: "blur",
  728. },
  729. ],
  730. },
  731. // 挑选参数
  732. choiceParams: {
  733. materialLots: null,
  734. },
  735. };
  736. },
  737. computed: {
  738. ...mapState({
  739. routeLists: (state) => state.permission.addRoutes,
  740. }),
  741. },
  742. created() {
  743. this.getProcessIds();
  744. const {
  745. materialLots,
  746. materialNo,
  747. materialName,
  748. processNo,
  749. auditStatus,
  750. type,
  751. id,
  752. } = this.$route.query;
  753. this.queryParams.materialLots = materialLots;
  754. this.queryParams.id = id;
  755. this.queryParams.materialNo = materialNo;
  756. this.queryParams.processNo = processNo;
  757. this.apiStatus = parseInt(auditStatus);
  758. this.queryParams.name = materialName;
  759. this.queryParams.type = type;
  760. this.handleQuery();
  761. this.getHeadList();
  762. this.tokens = localStorage.getItem(AccessTokenKey);
  763. this.baseUrl = process.env.VUE_APP_REPORT_API;
  764. },
  765. methods: {
  766. /** 查询列表 */
  767. async getList() {
  768. this.loading = true;
  769. // 打印单据report Id
  770. this.reportId = this.$route.meta.reportId;
  771. try {
  772. // 执行查询
  773. this.formParams.auditTime = parseTime(this.formParams.auditTime);
  774. // 参数
  775. const params = {
  776. materialLots: this.queryParams.materialLots,
  777. showVoid: false,
  778. processNo: "PURCHASE",
  779. };
  780. // 表头表体列表
  781. const raw1 = await getIqcInspectionDetail_2(params);
  782. const raw2 = await getIqcInspectionDetail_1(params);
  783. // 添加安全检查,确保data数组存在
  784. const data1 = raw1.data || [];
  785. const data2 = raw2.data || [];
  786. const list = [...data2, ...data1];
  787. // page查询
  788. const rawData = await getMaterialItemPage(this.queryParams);
  789. // 添加安全检查,防止rawData.data为undefined
  790. const rawDataContent = rawData.data || {};
  791. this.ifModify = rawDataContent.ifModify;
  792. this.$refs.updateInspection.queryObj = rawDataContent.masterData || {};
  793. // 添加安全检查,确保list数组存在
  794. const rawValueList = rawDataContent.list || [];
  795. // 添加安全检查,确保maxMaterialAdditional对象存在
  796. const maxAdditional = rawDataContent.maxMaterialAdditional || {};
  797. this.wmsMaterialAdditionalId = maxAdditional.id || "";
  798. this.wmsMaterialItemMasterId =
  799. maxAdditional.wmsMaterialItemMasterId || "";
  800. this.updateInspectStatus = maxAdditional.status || "";
  801. const valueList = rawValueList.map((item) => {
  802. const { maxValue, minValue, standValue, id, badId } = item;
  803. return {
  804. id,
  805. maxValue,
  806. minValue,
  807. standValue,
  808. badId,
  809. };
  810. });
  811. // 合并
  812. this.list = list.reduce((acc, cur) => {
  813. const { id } = cur;
  814. const item = valueList.find((i) => i.id === id) || {};
  815. const { maxValue, minValue, standValue, badId } = item;
  816. const data = { ...{ maxValue, minValue, standValue, badId }, ...cur };
  817. if (data.tool === "拉力机") {
  818. this.handleQualified(data);
  819. }
  820. acc.push(data);
  821. return acc;
  822. }, []);
  823. // 审批重回QC录入
  824. const isShow = this.list.every(
  825. (show) =>
  826. show.singleResultNum !== null && show.singleResultNum !== undefined
  827. );
  828. if (!isShow) {
  829. this.disableApproval = true;
  830. } else {
  831. this.disableApproval = false;
  832. }
  833. } catch (error) {
  834. console.log(error);
  835. } finally {
  836. this.loading = false;
  837. }
  838. },
  839. // 挑选列表
  840. async getChoiceList() {
  841. this.loading = true;
  842. // 执行查询
  843. try {
  844. const { data } = await getLabelPrintDataDetail(this.choiceParams);
  845. // 添加安全检查,确保data对象存在
  846. const choiceData = data || {};
  847. this.choiceList = choiceData.list || [];
  848. this.total = choiceData.total || 0;
  849. } catch (error) {
  850. console.log(error);
  851. } finally {
  852. this.loading = false;
  853. }
  854. },
  855. // 获取iqc报告表头
  856. getHeadList() {
  857. const params = {
  858. key: this.queryParams.materialLots,
  859. processNo: "PURCHASE",
  860. };
  861. getiqcInspectionHead(params).then((res) => {
  862. // 添加安全检查,确保res.data存在且为数组
  863. const headData = res.data || [];
  864. this.formParams = headData[0] || {};
  865. const { title, noPassType, inspector, manage, produceDate } =
  866. this.formParams;
  867. this.formParams.checkName = title;
  868. this.formParams.produceDate = parseTime(produceDate);
  869. this.adjustForm.noPassType =
  870. noPassType === null ? this.adjustForm.noPassType : noPassType;
  871. this.adjustForm.inspector = inspector;
  872. this.adjustForm.manage = manage;
  873. if (this.adjustForm.noPassType === "2") {
  874. const { materialLots } = this.queryParams;
  875. this.choiceParams.materialLots = materialLots;
  876. this.getChoiceList();
  877. }
  878. if (
  879. this.formParams.bpmInstanceId !== null &&
  880. this.formParams !== undefined
  881. ) {
  882. this.resetInspect = true;
  883. } else {
  884. this.resetInspect = false;
  885. }
  886. });
  887. },
  888. /** 取消按钮 */
  889. cancel() {
  890. this.open = false;
  891. },
  892. // 重置
  893. reset() {
  894. this.form = {
  895. manage: undefined,
  896. };
  897. },
  898. /** 搜索按钮操作 */
  899. handleQuery() {
  900. // this.queryParams.pageNo = 1
  901. this.getList();
  902. },
  903. // 选择批核结果
  904. async noPassChange(v) {
  905. // v === '2' --》挑选入库
  906. if (v === "2") {
  907. const { materialLots } = this.queryParams;
  908. this.choiceParams.materialLots = materialLots;
  909. await this.getChoiceList();
  910. const isEmpty = this.choiceList.some(
  911. (item) =>
  912. item.badQty === null ||
  913. item.badQty === undefined ||
  914. item.badQty === ""
  915. );
  916. // 只允许挑选一次,挑选完批核按钮高亮
  917. if (isEmpty) {
  918. this.choiceStatus = true;
  919. this.finishChoice = false;
  920. } else {
  921. this.choiceStatus = false;
  922. this.finishChoice = true;
  923. }
  924. this.handleFinishChoice();
  925. } else {
  926. this.handleFinishChoice();
  927. }
  928. },
  929. // 送审
  930. handleTesting() {
  931. // 开启工作流
  932. if (
  933. this.formParams.bpmInstanceId !== null &&
  934. this.formParams.bpmInstanceId !== undefined
  935. ) {
  936. this.activeName = "approvalTask";
  937. } else {
  938. // 普通审批流
  939. // apiStatus === -1 为待检验 操作 送审
  940. if (this.apiStatus === -1) {
  941. this.$modal
  942. .confirm("您正在送审操作,是否继续?")
  943. .then(async () => {
  944. // // 开启审批流
  945. if (
  946. this.processMessage !== null &&
  947. Object.keys(this.processMessage).length > 0
  948. ) {
  949. this.submitLoading = QuotationTrendVue;
  950. const params = {
  951. materialNo: this.queryParams.materialNo,
  952. materialLots: this.queryParams.materialLots,
  953. version: this.formParams.version,
  954. processNo: this.formParams.processNo,
  955. bpmInstanceId: this.processDetailId.data,
  956. };
  957. finishMaterialItem(params)
  958. .then((res) => {
  959. this.handleSave();
  960. this.$modal.msgSuccess("送审完成~");
  961. this.$emit("complete");
  962. this.getList();
  963. this.visible = false;
  964. this.open = false;
  965. this.finishOpen = false;
  966. this.submitLoading = false;
  967. // 关闭当前窗口
  968. this.$tab.closeOpenPage();
  969. // this.$router.go(-1)
  970. this.$router.push({
  971. path: "/quality/iqcInspection/inspectionExecute",
  972. query: { id: res.data },
  973. });
  974. this.reset();
  975. })
  976. .finally(() => {
  977. this.submitLoading = false;
  978. this.saveLoading = false;
  979. });
  980. } else {
  981. const params = {
  982. materialNo: this.queryParams.materialNo,
  983. materialLots: this.queryParams.materialLots,
  984. version: this.formParams.version,
  985. processNo: this.formParams.processNo,
  986. };
  987. this.submitLoading = true;
  988. finishMaterialItem(params)
  989. .then((res) => {
  990. this.handleSave();
  991. this.$modal.msgSuccess("送审完成~");
  992. this.$emit("complete");
  993. this.visible = false;
  994. this.open = false;
  995. this.finishOpen = false;
  996. // 关闭当前窗口
  997. this.$tab.closeOpenPage();
  998. this.$router.go(-1);
  999. this.reset();
  1000. })
  1001. .finally(() => {
  1002. this.submitLoading = false;
  1003. this.saveLoading = false;
  1004. });
  1005. }
  1006. })
  1007. .catch((err) => {
  1008. console.log(err);
  1009. // this.$modal.msg('您已取消操作')
  1010. });
  1011. } else if (this.apiStatus === 0) {
  1012. // apiStatus === 0 为待审核 操作批核
  1013. const params = {
  1014. noPassType: this.adjustForm.noPassType,
  1015. id: this.queryParams.id,
  1016. materialNo: this.queryParams.materialNo,
  1017. materialLots: this.queryParams.materialLots,
  1018. processNo: this.formParams.processNo,
  1019. };
  1020. updateAuditStatus(params)
  1021. .then((res) => {
  1022. this.$modal.msgSuccess("批核完成!");
  1023. this.$emit("complete");
  1024. this.visible = false;
  1025. this.open = false;
  1026. // 关闭当前窗口
  1027. this.$tab.closeOpenPage();
  1028. this.$router.go(-1);
  1029. this.reset();
  1030. this.submitLoading = false;
  1031. this.finishOpen = false;
  1032. this.queryParams.materialLots = undefined;
  1033. this.queryParams.materialNo = undefined;
  1034. this.queryParams.id = undefined;
  1035. })
  1036. .finally(() => {
  1037. this.submitLoading = false;
  1038. this.queryParams.materialLots = undefined;
  1039. this.queryParams.materialNo = undefined;
  1040. this.queryParams.id = undefined;
  1041. });
  1042. }
  1043. }
  1044. },
  1045. // 重新检验
  1046. handleResetInspection() {
  1047. this.$modal
  1048. .confirm("您正在执行重新检验操作,该操作会导致数据全部清空,是否继续?")
  1049. .then(() => {
  1050. const params = {
  1051. id: this.queryParams.id,
  1052. materialNo: this.queryParams.materialNo,
  1053. materialLots: this.queryParams.materialLots,
  1054. type: this.queryParams.type,
  1055. processNo: this.formParams.processNo,
  1056. };
  1057. this.reLoading = true;
  1058. updateReinspection(params).then((res) => {
  1059. this.$modal.msgSuccess("操作成功");
  1060. this.$emit("resetComplete");
  1061. this.visible = false;
  1062. this.getList();
  1063. this.reLoading = false;
  1064. // 关闭当前窗口
  1065. this.$tab.closeOpenPage();
  1066. this.$router.go(-1);
  1067. });
  1068. })
  1069. .catch(() => {
  1070. this.$modal.msg("您已取消操作");
  1071. })
  1072. .finally(() => {
  1073. this.reLoading = false;
  1074. });
  1075. },
  1076. // 申请修改
  1077. handleApply() {
  1078. // this.$refs.updateInspection.queryParams = this.formParams
  1079. const { materialNo, materialName } = this.formParams;
  1080. this.$refs.updateInspection.queryParams.name = materialName;
  1081. this.$refs.updateInspection.queryParams.materialNo = materialNo;
  1082. if (this.formParams.checkName !== null) {
  1083. this.$refs.updateInspection.queryObj.name = this.formParams.checkName;
  1084. }
  1085. this.$refs.updateInspection.queryParams.wmsMaterialAdditionalId =
  1086. this.wmsMaterialAdditionalId;
  1087. this.$refs.updateInspection.queryParams.wmsMaterialItemMasterId =
  1088. this.wmsMaterialItemMasterId;
  1089. this.$refs.updateInspection.iqcInspectShow = true;
  1090. this.$refs.updateInspection.queryParams.processNo = "PURCHASE";
  1091. this.$refs.updateInspection.queryParams.type = 0;
  1092. this.$refs.updateInspection.processNameShow = true;
  1093. // page返回的status为0 检验标准详情按钮则为保存, 否则按钮为新增
  1094. if (this.updateInspectStatus !== 0) {
  1095. this.$refs.updateInspection.btnText = "add";
  1096. this.$refs.updateInspection.commitDisable = true;
  1097. this.$refs.updateInspection.refreshDisable = true;
  1098. } else {
  1099. this.$refs.updateInspection.btnText = "save";
  1100. this.$refs.updateInspection.commitDisable = false;
  1101. this.$refs.updateInspection.selectDisable = true;
  1102. this.$refs.updateInspection.wmsMaterialAdditionalId =
  1103. this.wmsMaterialAdditionalId;
  1104. const changeParams = {
  1105. id: this.wmsMaterialAdditionalId,
  1106. code: this.formParams.materialNo,
  1107. };
  1108. // 判断方案是否为最新,不是最新则提示用户刷新
  1109. ifChangeMasterAdditional(changeParams).then((res) => {
  1110. if (res.data === false) {
  1111. this.$refs.updateInspection.refreshDisable = true;
  1112. } else {
  1113. this.$modal.notifyWarning(
  1114. "该方案或已被他人修改,如您需要最新方案,请点击刷新按钮获取!"
  1115. );
  1116. this.$refs.updateInspection.refreshDisable = false;
  1117. }
  1118. });
  1119. }
  1120. this.$refs.updateInspection.visible = true;
  1121. },
  1122. // 弹窗关闭
  1123. dialogClose() {
  1124. this.formParams = {};
  1125. this.list = [];
  1126. this.adjustForm.noPassType = "0";
  1127. },
  1128. // 表格列合并
  1129. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  1130. const { inspectionModel } = row;
  1131. // 合并列
  1132. if (inspectionModel === 1) {
  1133. if (columnIndex === 6) {
  1134. return [1, 5];
  1135. } else if (
  1136. columnIndex === 7 ||
  1137. columnIndex === 8 ||
  1138. columnIndex === 9 ||
  1139. columnIndex === 10
  1140. ) {
  1141. return [0, 0];
  1142. }
  1143. }
  1144. },
  1145. // 检验单打印
  1146. handlePrint() {
  1147. const materialLots = this.formParams.materialLots || "";
  1148. const processNo = this.formParams.processNo;
  1149. const src = `${this.baseUrl}/jmreport/view/${this.reportId}?token=${this.tokens}&materialLots=${materialLots}&processNo=${processNo}&key=${this.queryParams.materialLots}`;
  1150. this.$refs.issuePrinit.dialogVisible = true;
  1151. this.$refs.issuePrinit.src = src;
  1152. },
  1153. // 作废的数据添加删除线
  1154. delLine({ row, column }) {
  1155. const { voidOrNot } = row;
  1156. if (voidOrNot === "1") {
  1157. return "del_line";
  1158. }
  1159. },
  1160. // 挑选完成
  1161. async handleFinishChoice() {
  1162. if (this.adjustForm.noPassType === "2") {
  1163. const isEmpty = this.choiceList.some(
  1164. (item) =>
  1165. item.badQty === undefined ||
  1166. item.badQty === "" ||
  1167. item.badQty === null
  1168. );
  1169. if (isEmpty) {
  1170. this.$modal.msgWarning("不良数量不能为空,请先填写不良数量!");
  1171. return;
  1172. }
  1173. }
  1174. this.buttonLoading = true;
  1175. const choiceLists = this.choiceList.map((item) => {
  1176. const { id, badQty } = item;
  1177. return {
  1178. id,
  1179. badQty,
  1180. };
  1181. });
  1182. const batchParams = {
  1183. id: this.formParams.id,
  1184. processNo: "PURCHASE",
  1185. noPassType: this.adjustForm.noPassType,
  1186. updateReqVOList: choiceLists,
  1187. manage: this.adjustForm.manage,
  1188. };
  1189. updateBatchChoice(batchParams)
  1190. .then(() => {
  1191. this.$modal.msgSuccess("操作成功!");
  1192. const { materialLots } = this.queryParams;
  1193. this.choiceParams.materialLots = materialLots;
  1194. this.getChoiceList();
  1195. this.getList();
  1196. this.$emit("choiceComplete");
  1197. this.choiceStatus = false;
  1198. this.buttonLoading = false;
  1199. })
  1200. .finally(() => {
  1201. this.buttonLoading = false;
  1202. });
  1203. },
  1204. // 合并一键通过
  1205. handleAllInspect() {
  1206. if (this.currentRows.length <= 0) {
  1207. this.$modal.msgWarning("请选择您要检验的数据项!");
  1208. return;
  1209. }
  1210. this.$refs.editInspectItem.form.id = this.currentRows[0].id;
  1211. this.$refs.editInspectItem.inspectionModel = 0;
  1212. this.$refs.editInspectItem.allInspectShow = false;
  1213. this.$refs.editInspectItem.title = "一键检验结果";
  1214. this.$refs.editInspectItem.visible = true;
  1215. this.$refs.editInspectItem.selectRows = this.currentRows;
  1216. this.$refs.editInspectItem.materialLots =
  1217. this.formParams.materialLots || "";
  1218. },
  1219. // 选中的
  1220. tableSelected(val) {
  1221. this.currentRows = val;
  1222. },
  1223. // 上传文件/查看附件
  1224. async handleUploadFile() {
  1225. this.$refs.inspectFileUpload.wmsIncomingReceiptInspectionId =
  1226. this.formParams.id;
  1227. const params = {
  1228. id: this.formParams.id,
  1229. processNo: this.$route.query.processNo || null,
  1230. };
  1231. // await getURL(params).then(res => {
  1232. // this.$refs.inspectFileUpload.fileList = res.data
  1233. // })
  1234. const { data } = await getURL(params);
  1235. this.$refs.inspectFileUpload.fileList = data;
  1236. this.$refs.inspectFileUpload.isUploadShow = this.apiStatus;
  1237. this.$refs.inspectFileUpload.visible = true;
  1238. },
  1239. // 获取开启审批流的id
  1240. getProcessIds() {
  1241. const params = {
  1242. pageNo: 1,
  1243. pageSize: 10,
  1244. key: this.$route.meta.bpmnModelId,
  1245. };
  1246. getModelPage(params).then((res) => {
  1247. const { processDefinition } = res.data.list[0];
  1248. if (processDefinition) {
  1249. if (
  1250. Object.keys(processDefinition).length > 0 &&
  1251. processDefinition !== null &&
  1252. this.$route.meta.bpmnModelId !== ""
  1253. ) {
  1254. this.processMessage = processDefinition;
  1255. }
  1256. }
  1257. });
  1258. },
  1259. // tab点击切换
  1260. handleClick(tab, event) {
  1261. this.activeName = tab.name;
  1262. },
  1263. badCodeChange(row, v) {
  1264. row.badId = v;
  1265. },
  1266. // 保存
  1267. async handleSave() {
  1268. const saveList = this.list.map((item) => {
  1269. item.actualList = [];
  1270. item.completed = "0";
  1271. item.materialLots = this.queryParams.materialLots;
  1272. item.processNo = this.queryParams.processNo;
  1273. const {
  1274. id,
  1275. singleResultNum: singleResult,
  1276. measuredResults,
  1277. inspectionModel,
  1278. materialLots,
  1279. processNo,
  1280. badId,
  1281. actual1,
  1282. actual2,
  1283. actual3,
  1284. actual4,
  1285. actual5,
  1286. completed,
  1287. actualList: actualListForPC,
  1288. } = item;
  1289. // 确保将null值转换为空字符串
  1290. const convertToEmptyString = (value) =>
  1291. value === null || value === undefined ? "" : value;
  1292. actualListForPC.push(
  1293. convertToEmptyString(actual1),
  1294. convertToEmptyString(actual2),
  1295. convertToEmptyString(actual3),
  1296. convertToEmptyString(actual4),
  1297. convertToEmptyString(actual5)
  1298. );
  1299. return {
  1300. id,
  1301. singleResult,
  1302. inspectionModel,
  1303. badId,
  1304. completed,
  1305. actualListForPC,
  1306. materialLots,
  1307. processNo,
  1308. measuredResults,
  1309. };
  1310. });
  1311. this.saveLoading = true;
  1312. await updateAllForPCInspect(saveList);
  1313. this.$modal.msgSuccess("保存成功!");
  1314. this.getList();
  1315. this.saveLoading = false;
  1316. },
  1317. // 根据输入的检查数据判断是否合格
  1318. handleQualified(row) {
  1319. const { id, actual1, actual2, actual3, actual4, actual5 } = row;
  1320. const qualifyList = [];
  1321. // 确保将null值转换为空字符串
  1322. const convertToEmptyString = (value) =>
  1323. value === null || value === undefined ? "" : value;
  1324. qualifyList.push(
  1325. convertToEmptyString(actual1),
  1326. convertToEmptyString(actual2),
  1327. convertToEmptyString(actual3),
  1328. convertToEmptyString(actual4),
  1329. convertToEmptyString(actual5)
  1330. );
  1331. const params = {
  1332. id,
  1333. actualListForPC: qualifyList,
  1334. };
  1335. updateRowForPCIsQualified(params).then((res) => {
  1336. row.singleResultNum = res.data;
  1337. });
  1338. },
  1339. // 查看剥离力
  1340. handleToPeelingForce(row) {
  1341. const { id } = row;
  1342. this.$refs.peelingForce.queryParams.resultId = id;
  1343. this.$refs.peelingForce.queryParams.materialLots =
  1344. this.formParams.materialLots;
  1345. this.$refs.peelingForce.sn = this.formParams.materialLots;
  1346. this.$refs.peelingForce.open = true;
  1347. },
  1348. // 挑选不良数量
  1349. badQtyInputChange(v) {
  1350. const isChoiceComplete = this.choiceList.every(
  1351. (item) =>
  1352. item.badQty !== undefined &&
  1353. item.badQty !== null &&
  1354. item.badQty !== ""
  1355. );
  1356. if (isChoiceComplete) {
  1357. this.handleFinishChoice();
  1358. } else {
  1359. this.$modal.msgWarning("不良数量不能为空,请检查是否全部填写完成!");
  1360. }
  1361. },
  1362. // 查看供应商附件
  1363. handleViewSupplierFile() {
  1364. const { materialLots } = this.queryParams;
  1365. const params = {
  1366. materialLots,
  1367. };
  1368. getSupplierFileByMaterialLots(params).then((res) => {
  1369. // 添加安全检查,确保res.data存在
  1370. this.$refs.inspectFileUpload.fileList = res.data || [];
  1371. this.$refs.inspectFileUpload.isUploadShow = 9;
  1372. this.$refs.inspectFileUpload.visible = true;
  1373. });
  1374. },
  1375. // 查看二次元
  1376. handleQuadraticelement(row, column) {
  1377. if (row.tool === "3") {
  1378. const { property } = column;
  1379. const { id } = row;
  1380. const index =
  1381. property === "actual1"
  1382. ? 0
  1383. : property === "actual2"
  1384. ? 1
  1385. : property === "actual3"
  1386. ? 2
  1387. : property === "actual4"
  1388. ? 3
  1389. : property === "actual5"
  1390. ? 4
  1391. : null;
  1392. this.$refs.quadraticElement.queryParams.materialItemResultId = id;
  1393. this.$refs.quadraticElement.queryParams.index = index;
  1394. this.$refs.quadraticElement.open = true;
  1395. }
  1396. },
  1397. },
  1398. };
  1399. </script>
  1400. <style scoped>
  1401. .stander {
  1402. position: relative;
  1403. }
  1404. .standVal {
  1405. position: absolute;
  1406. top: 10px;
  1407. left: -10px;
  1408. }
  1409. .max {
  1410. height: 24px;
  1411. }
  1412. .line {
  1413. display: block;
  1414. height: 10px;
  1415. margin-top: -14px;
  1416. }
  1417. .el-table /deep/ .del_line {
  1418. text-decoration: line-through !important;
  1419. }
  1420. .isNotApproval {
  1421. font-size: 18px;
  1422. text-align: center;
  1423. margin: 200px auto;
  1424. }
  1425. </style>