detailMixins.js 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328
  1. const qualityResultList = { 1: '合格', 2: '不合格', 3: '让步接收' };
  2. const disposalStatustList = { 0: '待处置', 1: '处置中', 2: '处置完成' };
  3. import { inspectionProjectStatus } from '@/enum/dict.js';
  4. export default {
  5. data() {
  6. return {
  7. keyArr: [
  8. 'lossNumber',
  9. 'lossNumberUnqualified',
  10. 'retainedSampleQuantity',
  11. 'retainedSampleUnqualified'
  12. ],
  13. infoList: [
  14. {
  15. label: '编码',
  16. prop: 'code',
  17. span: 6
  18. },
  19. {
  20. label: '产品名称',
  21. prop: 'productName',
  22. span: 6
  23. },
  24. {
  25. label: '产品编码',
  26. prop: 'productCode',
  27. span: 6
  28. },
  29. {
  30. label: '批次号',
  31. prop: 'batchNo',
  32. span: 6
  33. },
  34. {
  35. label: '规格',
  36. prop: 'specification',
  37. span: 6
  38. },
  39. {
  40. label: '型号',
  41. prop: 'modelType',
  42. span: 6
  43. },
  44. {
  45. label: '牌号',
  46. prop: 'brandNo',
  47. span: 6
  48. },
  49. {
  50. label: '计量类型',
  51. prop: 'inspectionStandardsName',
  52. span: 6
  53. },
  54. {
  55. label: '接收人',
  56. prop: 'qualityName',
  57. span: 6
  58. },
  59. {
  60. label: '检测时间',
  61. prop: 'qualityTime',
  62. span: 6
  63. },
  64. {
  65. label: '工时(h)',
  66. prop: 'hours',
  67. span: 6
  68. },
  69. {
  70. label: '合格率',
  71. prop: 'qualificationRate',
  72. span: 6
  73. },
  74. {
  75. label: '不合格率',
  76. prop: 'noQualificationRate',
  77. span: 6
  78. },
  79. {
  80. label: '检验方式',
  81. prop: 'qualityModeName',
  82. span: 6
  83. },
  84. {
  85. label: '检测结果',
  86. prop: 'qualityResultsName',
  87. span: 6
  88. },
  89. {
  90. label: '总重量',
  91. prop: 'totalWeight',
  92. span: 6
  93. },
  94. {
  95. label: '总数量',
  96. prop: 'total',
  97. span: 6
  98. },
  99. {
  100. label: '记录方法',
  101. prop: 'recordingMethod',
  102. span: 6
  103. },
  104. {
  105. minWidth: 140,
  106. prop: 'lossNumber',
  107. slot: 'lossNumber',
  108. align: 'center',
  109. label: '损耗数(合格品)',
  110. showOverflowTooltip: true
  111. },
  112. {
  113. minWidth: 150,
  114. prop: 'lossNumberUnqualified',
  115. slot: 'lossNumberUnqualified',
  116. align: 'center',
  117. label: '损耗数(不合格品)',
  118. showOverflowTooltip: true
  119. },
  120. {
  121. minWidth: 140,
  122. prop: 'retainedSampleQuantity',
  123. slot: 'retainedSampleQuantity',
  124. align: 'center',
  125. label: '留样数(合格品)',
  126. showOverflowTooltip: true
  127. },
  128. {
  129. minWidth: 150,
  130. prop: 'retainedSampleUnqualified',
  131. slot: 'retainedSampleUnqualified',
  132. align: 'center',
  133. label: '留样数(不合格品)',
  134. showOverflowTooltip: true
  135. },
  136. {
  137. prop: 'executeJobName',
  138. label: '执行班组'
  139. },
  140. {
  141. prop: 'executeUserName',
  142. label: '执行人'
  143. },
  144. {
  145. prop: 'executeDeptName',
  146. label: '执行部门'
  147. },
  148. {
  149. prop: 'groupName',
  150. label: '接收人部门'
  151. },
  152. {
  153. prop: 'qualityType',
  154. label: '类型'
  155. },
  156. ],
  157. disposeTypeMap: {
  158. 1: '返工',
  159. 2: '返修',
  160. 3: '报废',
  161. 4: '降级使用',
  162. 5: '让步接收',
  163. 6: '留样',
  164. 7: '消耗',
  165. 8: '回用/归批',
  166. 9: '转试销',
  167. 10: '退货'
  168. },
  169. tableColumns1: [
  170. {
  171. columnKey: 'index',
  172. label: '序号',
  173. type: 'index',
  174. width: 55,
  175. align: 'center',
  176. fixed: 'left'
  177. },
  178. {
  179. label: '编码',
  180. prop: 'categoryCode',
  181. width: 150,
  182. align: 'center',
  183. showOverflowTooltip: true
  184. },
  185. {
  186. label: '名称',
  187. prop: 'categoryName',
  188. width: '150',
  189. align: 'center',
  190. width: 120,
  191. showOverflowTooltip: true
  192. },
  193. {
  194. label: '批次号',
  195. prop: 'batchNo',
  196. align: 'center',
  197. width: 120,
  198. showOverflowTooltip: true
  199. },
  200. {
  201. label: '发货条码',
  202. prop: 'barcodes',
  203. align: 'center',
  204. showOverflowTooltip: true
  205. },
  206. {
  207. label: '包装编码',
  208. prop: 'packageNo',
  209. align: 'center',
  210. width: 120,
  211. showOverflowTooltip: true
  212. },
  213. { label: '包装数量', prop: 'packingQuantity', align: 'center' },
  214. { label: '包装单位', prop: 'packingUnit', align: 'center' },
  215. { label: '计量数量', prop: 'measureQuantity', align: 'center' },
  216. { label: '计量单位', prop: 'measureUnit', align: 'center' },
  217. {
  218. label: '物料代号',
  219. prop: 'materielDesignation',
  220. align: 'center',
  221. showOverflowTooltip: true
  222. },
  223. {
  224. label: '客户代号',
  225. prop: 'clientCode',
  226. align: 'center',
  227. showOverflowTooltip: true
  228. },
  229. {
  230. label: '供应商名称',
  231. prop: 'supplierName',
  232. align: 'center',
  233. width: 120,
  234. showOverflowTooltip: true
  235. },
  236. {
  237. label: '供应商代号',
  238. prop: 'supplierCode',
  239. align: 'center',
  240. width: '120',
  241. showOverflowTooltip: true
  242. },
  243. { label: '刻码', prop: 'engrave', align: 'center' },
  244. {
  245. label: '机型',
  246. prop: 'modelKey',
  247. align: 'center',
  248. showOverflowTooltip: true
  249. },
  250. {
  251. label: '颜色',
  252. prop: 'colorKey',
  253. align: 'center',
  254. showOverflowTooltip: true
  255. },
  256. { label: '重量', prop: 'weight', align: 'center' },
  257. { label: '重量单位', prop: 'weightUnit', align: 'center' },
  258. {
  259. label: '仓库',
  260. prop: 'warehouseName',
  261. align: 'center',
  262. width: 120,
  263. showOverflowTooltip: true
  264. },
  265. { label: '货区', prop: 'areaName', align: 'center' },
  266. { label: '货架', prop: 'goodsShelfName', align: 'center' },
  267. { label: '货位', prop: 'goodsAllocationName', align: 'center' },
  268. {
  269. label: '生产日期',
  270. prop: 'productionDate',
  271. align: 'center',
  272. width: 120,
  273. showOverflowTooltip: true
  274. },
  275. {
  276. label: '采购日期',
  277. prop: 'purchaseDate',
  278. align: 'center',
  279. width: 120,
  280. showOverflowTooltip: true
  281. }
  282. ],
  283. tableColumns4: [
  284. {
  285. type: 'index',
  286. columnKey: 'index',
  287. align: 'center',
  288. label: '序号',
  289. width: 55,
  290. showOverflowTooltip: true
  291. },
  292. {
  293. label: '样品编码',
  294. prop: 'sampleCode',
  295. minWidth: '150',
  296. align: 'center',
  297. showOverflowTooltip: true
  298. },
  299. {
  300. label: '物品编码',
  301. prop: 'categoryCode',
  302. minWidth: '150',
  303. align: 'center',
  304. showOverflowTooltip: true
  305. },
  306. {
  307. label: '物品名称',
  308. prop: 'categoryName',
  309. minWidth: '180',
  310. align: 'center',
  311. showOverflowTooltip: true
  312. },
  313. {
  314. prop: 'batchNo',
  315. label: '批次号',
  316. align: 'center',
  317. minWidth: '120',
  318. showOverflowTooltip: true
  319. },
  320. {
  321. label: '规格',
  322. prop: 'specification',
  323. width: '120',
  324. align: 'center',
  325. showOverflowTooltip: true
  326. },
  327. {
  328. label: '牌号',
  329. prop: 'brandNum',
  330. width: '120',
  331. align: 'center',
  332. showOverflowTooltip: true
  333. },
  334. {
  335. prop: 'modelType',
  336. label: '型号',
  337. align: 'center',
  338. width: '120',
  339. showOverflowTooltip: true
  340. },
  341. {
  342. label: '机型',
  343. prop: 'modelKey',
  344. align: 'center',
  345. showOverflowTooltip: true
  346. },
  347. {
  348. label: '颜色',
  349. prop: 'colorKey',
  350. align: 'center',
  351. showOverflowTooltip: true
  352. },
  353. {
  354. prop: 'measureQuantity',
  355. label: '计量数量',
  356. align: 'center',
  357. width: '120',
  358. showOverflowTooltip: true
  359. },
  360. {
  361. prop: 'measureUnit',
  362. label: '计量单位',
  363. align: 'center',
  364. width: '120',
  365. showOverflowTooltip: true
  366. },
  367. {
  368. prop: 'weight',
  369. label: '重量',
  370. align: 'center',
  371. width: '120',
  372. showOverflowTooltip: true
  373. },
  374. {
  375. prop: 'weightUnit',
  376. label: '重量单位',
  377. align: 'center',
  378. width: '120',
  379. showOverflowTooltip: true
  380. },
  381. {
  382. prop: 'disposalStatus',
  383. label: '处置状态',
  384. align: 'center',
  385. width: '120',
  386. showOverflowTooltip: true,
  387. formatter: (row, column, cellValue) => {
  388. return disposalStatustList[cellValue ? cellValue : 0];
  389. }
  390. },
  391. {
  392. prop: 'disposeType',
  393. label: '处置类型',
  394. align: 'center',
  395. width: '120',
  396. showOverflowTooltip: true,
  397. formatter: (row, column, cellValue) => {
  398. return this.disposeTypeMap[cellValue];
  399. }
  400. },
  401. {
  402. prop: 'qualityResults',
  403. label: '检测结果',
  404. align: 'center',
  405. width: '120',
  406. showOverflowTooltip: true,
  407. formatter: (row, column, cellValue) => {
  408. return qualityResultList[cellValue];
  409. }
  410. }
  411. ],
  412. tableColumns5: [
  413. {
  414. columnKey: 'index',
  415. label: '序号',
  416. type: 'index',
  417. width: 55,
  418. align: 'center',
  419. showOverflowTooltip: true,
  420. fixed: 'left'
  421. },
  422. {
  423. label: '样品编码',
  424. prop: 'sampleCode',
  425. width: '150',
  426. align: 'center',
  427. showOverflowTooltip: true
  428. },
  429. {
  430. prop: 'categoryCode',
  431. label: '物品编码',
  432. width: '150',
  433. align: 'center',
  434. showOverflowTooltip: true
  435. },
  436. {
  437. prop: 'categoryName',
  438. label: '物品名称',
  439. width: '150',
  440. align: 'center',
  441. showOverflowTooltip: true
  442. },
  443. {
  444. label: '规格',
  445. prop: 'specification',
  446. width: '120',
  447. align: 'center',
  448. showOverflowTooltip: true
  449. },
  450. {
  451. prop: 'brandNum',
  452. label: '牌号',
  453. align: 'center'
  454. },
  455. {
  456. prop: 'modelType',
  457. label: '型号',
  458. align: 'center',
  459. width: '120',
  460. showOverflowTooltip: true
  461. },
  462. {
  463. label: '机型',
  464. prop: 'modelKey',
  465. align: 'center',
  466. showOverflowTooltip: true
  467. },
  468. {
  469. label: '颜色',
  470. prop: 'colorKey',
  471. align: 'center',
  472. showOverflowTooltip: true
  473. },
  474. {
  475. prop: 'batchNo',
  476. label: '批次号',
  477. align: 'center',
  478. width: '120',
  479. showOverflowTooltip: true
  480. },
  481. {
  482. prop: 'weight',
  483. label: '重量',
  484. align: 'center',
  485. width: '120',
  486. showOverflowTooltip: true
  487. },
  488. {
  489. prop: 'weightUnit',
  490. label: '重量单位',
  491. align: 'center',
  492. width: '120',
  493. showOverflowTooltip: true
  494. },
  495. {
  496. prop: 'engrave',
  497. label: '刻码',
  498. align: 'center'
  499. },
  500. { label: '计量数量', prop: 'measureQuantity', align: 'center' },
  501. { label: '计量单位', prop: 'measureUnit', align: 'center' },
  502. {
  503. prop: 'produceRoutingName',
  504. label: '工艺路线',
  505. align: 'center'
  506. },
  507. {
  508. prop: 'produceTaskName',
  509. label: '工序',
  510. align: 'center'
  511. },
  512. {
  513. prop: 'unqualifiedReason',
  514. label: '原因',
  515. align: 'center'
  516. },
  517. {
  518. prop: 'disposeTime',
  519. label: '处置时间',
  520. align: 'center',
  521. width: '180',
  522. showOverflowTooltip: true
  523. },
  524. {
  525. prop: 'disposalStatus',
  526. label: '处置状态',
  527. align: 'center',
  528. width: '120',
  529. showOverflowTooltip: true,
  530. formatter: (row, column, cellValue) => {
  531. return disposalStatustList[cellValue ? cellValue : 0];
  532. }
  533. },
  534. {
  535. prop: 'disposeType',
  536. label: '处置类型',
  537. align: 'center',
  538. width: '120',
  539. showOverflowTooltip: true,
  540. formatter: (_row) => {
  541. return this.disposeTypeMap[_row.disposeType];
  542. }
  543. }
  544. ],
  545. entrustColumns: [
  546. {
  547. columnKey: 'index',
  548. label: '序号',
  549. type: 'index',
  550. width: 55,
  551. align: 'center',
  552. showOverflowTooltip: true,
  553. fixed: 'left'
  554. },
  555. {
  556. prop: 'code',
  557. label: '请托单号',
  558. showOverflowTooltip: true,
  559. align: 'center',
  560. minWidth: 130
  561. },
  562. {
  563. prop: 'name',
  564. label: '任务名称',
  565. showOverflowTooltip: true,
  566. align: 'center',
  567. minWidth: 110
  568. },
  569. {
  570. prop: 'sampleQuantity',
  571. label: '样品数',
  572. showOverflowTooltip: true,
  573. align: 'center',
  574. formatter: (row) => {
  575. if (row.sampleQuantity) {
  576. return (
  577. row.sampleQuantity + this.sourceData2[0]?.measureUnit || ''
  578. );
  579. }
  580. },
  581. minWidth: 110
  582. },
  583. {
  584. prop: 'sampleQualifiedNumber',
  585. label: '样品合格数',
  586. showOverflowTooltip: true,
  587. align: 'center',
  588. formatter: (row) => {
  589. if (row.sampleQualifiedNumber) {
  590. return (
  591. row.sampleQualifiedNumber + this.sourceData2[0]?.measureUnit ||
  592. ''
  593. );
  594. }
  595. },
  596. minWidth: 110
  597. },
  598. {
  599. prop: 'sampleNoQualifiedNumber',
  600. label: '样品不合格数',
  601. showOverflowTooltip: true,
  602. align: 'center',
  603. formatter: (row) => {
  604. if (row.sampleNoQualifiedNumber) {
  605. return (
  606. row.sampleNoQualifiedNumber +
  607. this.sourceData2[0]?.measureUnit || ''
  608. );
  609. }
  610. },
  611. minWidth: 110
  612. },
  613. {
  614. prop: 'lossNumber',
  615. label: '损耗数(合格品)',
  616. showOverflowTooltip: true,
  617. align: 'center',
  618. formatter: (row) => {
  619. if (row.lossNumber) {
  620. return row.lossNumber + this.sourceData2[0]?.measureUnit || '';
  621. }
  622. },
  623. minWidth: 110
  624. },
  625. {
  626. prop: 'lossNumberUnqualified',
  627. label: '损耗数(不合格品)',
  628. showOverflowTooltip: true,
  629. align: 'center',
  630. formatter: (row) => {
  631. if (row.lossNumberUnqualified) {
  632. return (
  633. row.lossNumberUnqualified + this.sourceData2[0]?.measureUnit ||
  634. ''
  635. );
  636. }
  637. },
  638. minWidth: 110
  639. },
  640. {
  641. prop: 'retainedSampleQuantity',
  642. label: '留样数(合格品)',
  643. showOverflowTooltip: true,
  644. align: 'center',
  645. formatter: (row) => {
  646. if (row.retainedSampleQuantity) {
  647. return (
  648. row.retainedSampleQuantity + this.sourceData2[0]?.measureUnit ||
  649. ''
  650. );
  651. }
  652. },
  653. minWidth: 110
  654. },
  655. {
  656. prop: 'retainedSampleUnqualified',
  657. label: '留样数(不合格品)',
  658. formatter: (row) => {
  659. if (row.retainedSampleUnqualified) {
  660. return (
  661. row.retainedSampleUnqualified +
  662. this.sourceData2[0]?.measureUnit || ''
  663. );
  664. }
  665. },
  666. showOverflowTooltip: true,
  667. align: 'center',
  668. minWidth: 110
  669. },
  670. {
  671. prop: 'status',
  672. minWidth: 110,
  673. label: '状态',
  674. align: 'center',
  675. formatter: (row) => {
  676. return row.status == 0
  677. ? '待收样'
  678. : row.status == 1
  679. ? '未报工'
  680. : '已报工';
  681. },
  682. showOverflowTooltip: true
  683. }
  684. ],
  685. taskColumns: [
  686. {
  687. columnKey: 'index',
  688. label: '序号',
  689. type: 'index',
  690. width: 55,
  691. align: 'center',
  692. showOverflowTooltip: true,
  693. fixed: 'left'
  694. },
  695. {
  696. prop: 'code',
  697. label: '检测任务单号',
  698. showOverflowTooltip: true,
  699. align: 'center',
  700. minWidth: 130
  701. },
  702. {
  703. prop: 'name',
  704. label: '任务名称',
  705. showOverflowTooltip: true,
  706. align: 'center',
  707. minWidth: 110
  708. },
  709. {
  710. prop: 'sampleQuantity',
  711. label: '样品数',
  712. showOverflowTooltip: true,
  713. align: 'center',
  714. formatter: (row) => {
  715. if (row.sampleQuantity) {
  716. return (
  717. row.sampleQuantity + this.sourceData2[0]?.measureUnit || ''
  718. );
  719. }
  720. },
  721. minWidth: 110
  722. },
  723. {
  724. prop: 'sampleQualifiedNumber',
  725. label: '样品合格数',
  726. showOverflowTooltip: true,
  727. align: 'center',
  728. formatter: (row) => {
  729. if (row.sampleQualifiedNumber) {
  730. return (
  731. row.sampleQualifiedNumber + this.sourceData2[0]?.measureUnit ||
  732. ''
  733. );
  734. }
  735. },
  736. minWidth: 110
  737. },
  738. {
  739. prop: 'sampleNoQualifiedNumber',
  740. label: '样品不合格数',
  741. showOverflowTooltip: true,
  742. align: 'center',
  743. formatter: (row) => {
  744. if (row.sampleNoQualifiedNumber) {
  745. return (
  746. row.sampleNoQualifiedNumber +
  747. this.sourceData2[0]?.measureUnit || ''
  748. );
  749. }
  750. },
  751. minWidth: 110
  752. },
  753. {
  754. prop: 'lossNumber',
  755. label: '损耗数(合格品)',
  756. showOverflowTooltip: true,
  757. align: 'center',
  758. formatter: (row) => {
  759. if (row.lossNumber) {
  760. return row.lossNumber + this.sourceData2[0]?.measureUnit || '';
  761. }
  762. },
  763. minWidth: 110
  764. },
  765. {
  766. prop: 'lossNumberUnqualified',
  767. label: '损耗数(不合格品)',
  768. showOverflowTooltip: true,
  769. align: 'center',
  770. formatter: (row) => {
  771. if (row.lossNumberUnqualified) {
  772. return (
  773. row.lossNumberUnqualified + this.sourceData2[0]?.measureUnit ||
  774. ''
  775. );
  776. }
  777. },
  778. minWidth: 110
  779. },
  780. {
  781. prop: 'retainedSampleQuantity',
  782. label: '留样数(合格品)',
  783. showOverflowTooltip: true,
  784. align: 'center',
  785. formatter: (row) => {
  786. if (row.retainedSampleQuantity) {
  787. return (
  788. row.retainedSampleQuantity + this.sourceData2[0]?.measureUnit ||
  789. ''
  790. );
  791. }
  792. },
  793. minWidth: 110
  794. },
  795. {
  796. prop: 'retainedSampleUnqualified',
  797. label: '留样数(不合格品)',
  798. formatter: (row) => {
  799. if (row.retainedSampleUnqualified) {
  800. return (
  801. row.retainedSampleUnqualified +
  802. this.sourceData2[0]?.measureUnit || ''
  803. );
  804. }
  805. },
  806. showOverflowTooltip: true,
  807. align: 'center',
  808. minWidth: 110
  809. },
  810. {
  811. prop: 'status',
  812. minWidth: 110,
  813. label: '状态',
  814. align: 'center',
  815. formatter: (row) => {
  816. return row.status == 0
  817. ? '待收样'
  818. : row.status == 1
  819. ? '未报工'
  820. : '已报工';
  821. },
  822. showOverflowTooltip: true
  823. }
  824. ]
  825. };
  826. },
  827. computed: {
  828. tableColumns2() {
  829. return [
  830. {
  831. columnKey: 'index',
  832. label: '序号',
  833. type: 'index',
  834. width: 55,
  835. align: 'center',
  836. fixed: 'left'
  837. },
  838. {
  839. label: '样品编码',
  840. prop: 'sampleCode',
  841. width: '200',
  842. align: 'center',
  843. fixed: 'left',
  844. showOverflowTooltip: true
  845. },
  846. {
  847. label: '编码',
  848. prop: 'categoryCode',
  849. align: 'center',
  850. slot: 'categoryCode',
  851. fixed: 'left',
  852. width: '150',
  853. showOverflowTooltip: true
  854. },
  855. {
  856. label: '名称',
  857. prop: 'categoryName',
  858. align: 'center',
  859. width: '150',
  860. showOverflowTooltip: true
  861. },
  862. {
  863. label: '批次号',
  864. prop: 'batchNo',
  865. align: 'center',
  866. showOverflowTooltip: true
  867. },
  868. {
  869. label: '发货条码',
  870. prop: 'barcodes',
  871. align: 'center',
  872. showOverflowTooltip: true
  873. },
  874. {
  875. label: '包装编码',
  876. prop: 'packageNo',
  877. align: 'center',
  878. width: '170',
  879. showOverflowTooltip: true
  880. },
  881. { label: '包装数量', prop: 'packingQuantity', align: 'center' },
  882. { label: '包装单位', prop: 'packingUnit', align: 'center' },
  883. { label: '计量数量', prop: 'measureQuantity', align: 'center' },
  884. { label: '计量单位', prop: 'measureUnit', align: 'center' },
  885. {
  886. label: '供应商名称',
  887. prop: 'supplierName',
  888. align: 'center',
  889. width: '120',
  890. showOverflowTooltip: true
  891. },
  892. {
  893. label: '供应商代号',
  894. prop: 'supplierCode',
  895. align: 'center',
  896. width: '120',
  897. showOverflowTooltip: true
  898. },
  899. {
  900. label: '物料代号',
  901. prop: 'materielDesignation',
  902. align: 'center',
  903. slot: 'materielDesignation',
  904. width: '120',
  905. showOverflowTooltip: true
  906. },
  907. {
  908. label: '客户代号',
  909. prop: 'clientCode',
  910. align: 'center',
  911. slot: 'clientCode',
  912. width: '120',
  913. showOverflowTooltip: true
  914. },
  915. {
  916. label: '刻码',
  917. prop: 'engrave',
  918. align: 'center',
  919. slot: 'engrave',
  920. width: '120',
  921. showOverflowTooltip: true
  922. },
  923. {
  924. label: '机型',
  925. prop: 'modelKey',
  926. align: 'center',
  927. showOverflowTooltip: true
  928. },
  929. {
  930. label: '颜色',
  931. prop: 'colorKey',
  932. align: 'center',
  933. showOverflowTooltip: true
  934. },
  935. {
  936. label: '重量',
  937. prop: 'weight',
  938. align: 'center',
  939. slot: 'weight',
  940. width: '120'
  941. },
  942. {
  943. label: '重量单位',
  944. prop: 'weightUnit',
  945. align: 'center',
  946. width: 100
  947. },
  948. {
  949. label: '仓库',
  950. prop: 'warehouseName',
  951. align: 'center',
  952. width: 150,
  953. showOverflowTooltip: true
  954. },
  955. {
  956. label: '货区',
  957. prop: 'areaName',
  958. align: 'center',
  959. showOverflowTooltip: true
  960. },
  961. { label: '货架', prop: 'goodsShelfName', align: 'center' },
  962. { label: '货位', prop: 'goodsAllocationName', align: 'center' },
  963. {
  964. label: '生产日期',
  965. prop: 'productionDate',
  966. align: 'center',
  967. width: 150,
  968. showOverflowTooltip: true
  969. },
  970. {
  971. label: '采购日期',
  972. prop: 'purchaseDate',
  973. align: 'center',
  974. width: 150,
  975. showOverflowTooltip: true
  976. },
  977. {
  978. label: '处置状态',
  979. prop: 'disposeType',
  980. align: 'center',
  981. formatter: (_row) => {
  982. return this.disposeTypeMap[_row.disposeType] || '';
  983. }
  984. },
  985. {
  986. label: '处置时间',
  987. prop: 'disposeTime',
  988. align: 'center',
  989. showOverflowTooltip: true,
  990. width: 150
  991. },
  992. {
  993. prop: 'badTypeName',
  994. label: '不良类型',
  995. width: '180',
  996. align: 'center',
  997. show: this.form.recordingMethod != 1
  998. },
  999. {
  1000. prop: 'badNameName',
  1001. label: '不良名称',
  1002. width: '180',
  1003. align: 'center',
  1004. show: this.form.recordingMethod != 1
  1005. },
  1006. {
  1007. label: '状态',
  1008. prop: 'status',
  1009. align: 'center',
  1010. show: this.form.recordingMethod != 1,
  1011. formatter: (row) => {
  1012. return inspectionProjectStatus.find(
  1013. (item) => item.value == row.status
  1014. )?.label;
  1015. }
  1016. }
  1017. ];
  1018. },
  1019. tableColumns3() {
  1020. return [
  1021. {
  1022. columnKey: 'index',
  1023. label: '序号',
  1024. type: 'index',
  1025. width: 55,
  1026. align: 'center',
  1027. fixed: 'left'
  1028. },
  1029. {
  1030. label: '检测方案编码',
  1031. prop: 'qualitySchemeTemplateCode',
  1032. align: 'center',
  1033. showOverflowTooltip: true
  1034. },
  1035. {
  1036. label: '检测方案名称',
  1037. prop: 'qualitySchemeTemplateName',
  1038. align: 'center',
  1039. showOverflowTooltip: true
  1040. },
  1041. {
  1042. label: '检测类型',
  1043. prop: 'categoryLevelClassName',
  1044. align: 'center',
  1045. showOverflowTooltip: true
  1046. },
  1047. {
  1048. label: '检测项编码',
  1049. prop: 'inspectionCode',
  1050. align: 'center',
  1051. showOverflowTooltip: true
  1052. },
  1053. {
  1054. label: '检测项名称',
  1055. prop: 'inspectionName',
  1056. align: 'center',
  1057. showOverflowTooltip: true
  1058. },
  1059. {
  1060. label: '工艺参数',
  1061. prop: 'defaultValue',
  1062. align: 'center',
  1063. showOverflowTooltip: true,
  1064. slot: 'defaultValue'
  1065. },
  1066. {
  1067. label: '执行方法',
  1068. prop: 'executionMethod',
  1069. align: 'center',
  1070. showOverflowTooltip: true,
  1071. show: this.form.recordingMethod == 1,
  1072. formatter: (row) => {
  1073. return row.executionMethod == 1 ? '常规检验' : '实验';
  1074. }
  1075. },
  1076. {
  1077. minWidth: 200,
  1078. prop: 'qualityResultContent',
  1079. align: 'center',
  1080. headerSlot: 'isRequired',
  1081. label: '检测内容',
  1082. showOverflowTooltip: true
  1083. },
  1084. {
  1085. minWidth: 120,
  1086. prop: 'sampleQuantity',
  1087. align: 'center',
  1088. label: '样品数',
  1089. formatter: (row) => {
  1090. if (row.sampleQuantity) {
  1091. return (
  1092. row.sampleQuantity + this.sourceData2[0]?.measureUnit || ''
  1093. );
  1094. }
  1095. },
  1096. showOverflowTooltip: true
  1097. },
  1098. {
  1099. minWidth: 120,
  1100. prop: 'qualifiedQuantity',
  1101. align: 'center',
  1102. label: '合格数',
  1103. formatter: (row) => {
  1104. if (row.qualifiedQuantity) {
  1105. return (
  1106. row.qualifiedQuantity + this.sourceData2[0]?.measureUnit || ''
  1107. );
  1108. }
  1109. },
  1110. showOverflowTooltip: true
  1111. },
  1112. {
  1113. minWidth: 130,
  1114. prop: 'noQualifiedQuantity',
  1115. align: 'center',
  1116. label: '不合格数',
  1117. formatter: (row) => {
  1118. if (row.noQualifiedQuantity) {
  1119. return (
  1120. row.noQualifiedQuantity + this.sourceData2[0]?.measureUnit || ''
  1121. );
  1122. }
  1123. },
  1124. showOverflowTooltip: true
  1125. },
  1126. {
  1127. minWidth: 140,
  1128. prop: 'lossNumber',
  1129. align: 'center',
  1130. label: '损耗数(合格品)',
  1131. formatter: (row) => {
  1132. if (row.lossNumber) {
  1133. return row.lossNumber + this.sourceData2[0]?.measureUnit || '';
  1134. }
  1135. },
  1136. showOverflowTooltip: true
  1137. },
  1138. {
  1139. minWidth: 150,
  1140. prop: 'lossNumberUnqualified',
  1141. align: 'center',
  1142. label: '损耗数(不合格品)',
  1143. formatter: (row) => {
  1144. if (row.lossNumberUnqualified) {
  1145. return (
  1146. row.lossNumberUnqualified + this.sourceData2[0]?.measureUnit ||
  1147. ''
  1148. );
  1149. }
  1150. },
  1151. showOverflowTooltip: true
  1152. },
  1153. {
  1154. minWidth: 140,
  1155. prop: 'retainedSampleQuantity',
  1156. align: 'center',
  1157. label: '留样数(合格品)',
  1158. formatter: (row) => {
  1159. if (row.retainedSampleQuantity) {
  1160. return (
  1161. row.retainedSampleQuantity + this.sourceData2[0]?.measureUnit ||
  1162. ''
  1163. );
  1164. }
  1165. },
  1166. showOverflowTooltip: true
  1167. },
  1168. {
  1169. minWidth: 150,
  1170. prop: 'retainedSampleUnqualified',
  1171. align: 'center',
  1172. label: '留样数(不合格品)',
  1173. formatter: (row) => {
  1174. if (row.retainedSampleUnqualified) {
  1175. return (
  1176. row.retainedSampleUnqualified +
  1177. this.sourceData2[0]?.measureUnit || ''
  1178. );
  1179. }
  1180. },
  1181. showOverflowTooltip: true
  1182. },
  1183. {
  1184. minWidth: 150,
  1185. prop: 'experimentCode',
  1186. slot: 'experimentCode',
  1187. align: 'center',
  1188. label: '实验编号',
  1189. showOverflowTooltip: true
  1190. },
  1191. {
  1192. label: '检测状态',
  1193. prop: 'status',
  1194. align: 'center',
  1195. showOverflowTooltip: true,
  1196. show: this.form.recordingMethod == 1,
  1197. formatter: (row) => {
  1198. return inspectionProjectStatus.find(
  1199. (item) => item.value == row.status
  1200. )?.label;
  1201. }
  1202. },
  1203. {
  1204. label: '检测结果',
  1205. prop: 'qualityResults',
  1206. align: 'center',
  1207. show: this.form.recordingMethod == 1,
  1208. showOverflowTooltip: true,
  1209. formatter: (row, column, cellValue) => {
  1210. return qualityResultList[cellValue];
  1211. }
  1212. }
  1213. ];
  1214. }
  1215. },
  1216. methods: {
  1217. //样品数操作
  1218. isSampleQuantity(item, index) {
  1219. // this.resetData(item, index, ['qualifiedQuantity', 'noQualifiedQuantity']);
  1220. if (Number(item.sampleQuantity) > this.getSampleQuantityCount) {
  1221. this.$message.error('样品数量不能大于当前检测剩余样品数');
  1222. this.$set(
  1223. this.tableData[index],
  1224. 'sampleQuantity',
  1225. this.getSampleQuantityCount
  1226. );
  1227. }
  1228. this.$set(
  1229. this.tableData[index],
  1230. 'qualifiedQuantity',
  1231. item.sampleQuantity
  1232. );
  1233. this.isQualifiedQuantity(item, index, 'qualifiedQuantity');
  1234. },
  1235. //合格/不合格数操作
  1236. isQualifiedQuantity(item, index, key) {
  1237. if (Number(item[key]) > Number(item.sampleQuantity)) {
  1238. this.$message.error(
  1239. (key == 'qualifiedQuantity' ? '合格' : '不合格') +
  1240. '数量不能大于样品数'
  1241. );
  1242. this.$set(this.tableData[index], key, item.sampleQuantity);
  1243. }
  1244. this.$set(
  1245. this.tableData[index],
  1246. key == 'qualifiedQuantity'
  1247. ? 'noQualifiedQuantity'
  1248. : 'qualifiedQuantity',
  1249. item.sampleQuantity - item[key]
  1250. );
  1251. this.resetData(item, index);
  1252. },
  1253. //留样、损耗逻辑
  1254. setNumber(item, index, key, title, keyName) {
  1255. let keyObj = {
  1256. key: key == keyName ? 'qualifiedQuantity' : 'noQualifiedQuantity',
  1257. title: key == keyName ? '合格数' : '不合格数',
  1258. title1: title == '留样' ? '损耗' : '留样',
  1259. numTotal:
  1260. key == keyName
  1261. ? Number(item.lossNumber) + Number(item.retainedSampleQuantity)
  1262. : Number(item.lossNumberUnqualified) +
  1263. Number(item.retainedSampleUnqualified)
  1264. };
  1265. if (Number(item[key]) > Number(item[keyObj.key])) {
  1266. this.$message.error(
  1267. title + keyObj.title + '不能大于样品' + keyObj.title
  1268. );
  1269. this.$set(this.tableData[index], key, 0);
  1270. }
  1271. if (keyObj.numTotal > item[keyObj.key]) {
  1272. this.$message.error(
  1273. title +
  1274. keyObj.title +
  1275. '与' +
  1276. keyObj.title1 +
  1277. keyObj.title +
  1278. '之和' +
  1279. '不能大于样品' +
  1280. keyObj.title
  1281. );
  1282. this.$set(this.tableData[index], key, 0);
  1283. }
  1284. if (item[key] - (this.curretNum || 0) > this.getSampleQuantityCount) {
  1285. this.$message.error(
  1286. title + keyObj.title + '不能大于当前检测剩余样品数'
  1287. );
  1288. this.$set(this.tableData[index], key, 0);
  1289. }
  1290. this.curretNum = this.tableData[index][key];
  1291. this.initData();
  1292. },
  1293. //重置数据
  1294. resetData(item, index, addResetData = []) {
  1295. [...this.keyArr, ...addResetData].forEach((key) => {
  1296. this.$set(this.tableData[index], key, 0);
  1297. });
  1298. this.initData();
  1299. },
  1300. initData() {
  1301. this.keyArr.forEach((key) => {
  1302. this.$set(this.form, key, 0);
  1303. });
  1304. this.tableData.forEach((item, index) => {
  1305. this.keyArr.forEach((key) => {
  1306. this.form[key] = this.form[key] * 100;
  1307. this.form[key] += Number(item[key] * 100) || 0;
  1308. this.form[key] = this.form[key] / 100;
  1309. });
  1310. });
  1311. }
  1312. }
  1313. };