InspectDetail.vue 49 KB

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