index.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548
  1. <template>
  2. <div>
  3. <div class="top_fixed">
  4. <div
  5. style="display: flex; align-items: center; margin-right: 10px"
  6. v-if="List.length > 1"
  7. >
  8. <div class="rx-bc">
  9. <div class="name">批量报工时间:</div>
  10. </div>
  11. <el-date-picker
  12. v-model="executorTime"
  13. type="datetime"
  14. value-format="yyyy-MM-dd HH:mm:ss"
  15. placeholder="选择日期"
  16. @change="handleCreate"
  17. >
  18. </el-date-picker>
  19. </div>
  20. <el-button
  21. type="primary"
  22. size="mini"
  23. :loading="loadingBtn"
  24. @click="save(2, 'all')"
  25. >一键报工</el-button
  26. >
  27. <el-button type="primary" size="mini" @click="removeCacheFn('all')"
  28. >清空缓存</el-button
  29. >
  30. <el-button
  31. v-if="taskObj.type == 1"
  32. type="primary"
  33. size="mini"
  34. @click="save(1, 'all')"
  35. >缓存</el-button
  36. >
  37. </div>
  38. <div class="job_box">
  39. <div
  40. v-for="(item, index) in List"
  41. :key="index"
  42. class="card_box"
  43. v-if="isLoad"
  44. >
  45. <div class="title_box rx-bc" v-if="!taskObj.isOrderListData">
  46. <div class="name">工单信息 </div>
  47. <div class="rx-bc">
  48. <el-button
  49. type="text"
  50. size="mini"
  51. @click="openPicking(item.workOrderId, item)"
  52. >手动添加</el-button
  53. >
  54. <el-button
  55. type="text"
  56. size="mini"
  57. @click="removeCacheFn(item.workOrderId)"
  58. >清空缓存</el-button
  59. >
  60. <el-button
  61. v-if="taskObj.type == 1"
  62. type="text"
  63. size="mini"
  64. @click="save(1, index)"
  65. >缓存</el-button
  66. >
  67. </div>
  68. </div>
  69. <!-- // 工单信息 -->
  70. <workOrderBom
  71. :item="item"
  72. v-if="!taskObj.isOrderListData"
  73. ></workOrderBom>
  74. <!-- 报工时间 -->
  75. <div>
  76. <div class="title_box rx-bc">
  77. <div class="name">报工时间</div>
  78. </div>
  79. <el-date-picker
  80. v-model="item.workReportInfo.executorTime"
  81. type="datetime"
  82. value-format="yyyy-MM-dd HH:mm:ss"
  83. placeholder="选择日期"
  84. >
  85. </el-date-picker>
  86. </div>
  87. <paramBom
  88. v-if="item.paramDetailList.length != 0"
  89. :list="item.paramDetailList"
  90. ></paramBom>
  91. <!-- //报工信息 -->
  92. <div v-if="item.singleReport == 0">
  93. <jobBom
  94. :item="item"
  95. ref="jobBomRef"
  96. :notFormed="item.notFormedList"
  97. :warehouseList="warehouseList"
  98. ></jobBom>
  99. </div>
  100. <div v-if="item.singleReport == 1">
  101. <jobDdBom
  102. :item="item"
  103. ref="jobRef"
  104. :notFormed="item.notFormedList"
  105. :warehouseList="warehouseList"
  106. ></jobDdBom>
  107. </div>
  108. <!-- :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList" @modeNum='modeNum'-->
  109. <deviceBom
  110. v-if="item.equipmentList.length != 0"
  111. :list="item.equipmentList"
  112. ></deviceBom>
  113. <modelBom
  114. v-if="item.modelList.length != 0"
  115. :list="item.modelList"
  116. pattern="job"
  117. ref="modelRef"
  118. :item="item"
  119. ></modelBom>
  120. <palletBom
  121. v-if="item.palletList.length != 0"
  122. :list="item.palletList"
  123. ></palletBom>
  124. <revolvingDiskBom
  125. v-if="item.revolvingDiskList.length > 0"
  126. pattern="job"
  127. :list="objData.revolvingDiskList"
  128. >
  129. </revolvingDiskBom>
  130. <!-- 单件 报告信息 -->
  131. <semiProductJobBom
  132. :singleReport="item.singleReport"
  133. v-if="
  134. item.semiProductList &&
  135. item.semiProductList.length != 0 &&
  136. item.singleReport == 1
  137. "
  138. :item="item"
  139. :list="item.semiProductList"
  140. :equipmentList="item.equipmentList"
  141. :isChoose="isChoose"
  142. @chooseData="chooseData"
  143. :isEngrave="isEngrave"
  144. :isDisposal="isDisposal"
  145. ></semiProductJobBom>
  146. <!-- 通用批量报工 -->
  147. <batchSemiProductJobBom
  148. :singleReport="item.singleReport"
  149. v-if="
  150. item.product &&
  151. item.product.length != 0 &&
  152. item.singleReport == 0 &&
  153. clientEnvironmentId != 3 &&
  154. clientEnvironmentId != 2
  155. "
  156. :item="item"
  157. :list="item.product"
  158. :equipmentList="item.equipmentList"
  159. :isChoose="isChoose"
  160. :isEngrave="isEngrave"
  161. :isDisposal="isDisposal"
  162. @chooseData="chooseData"
  163. ></batchSemiProductJobBom>
  164. <!-- <checkbox :tableData="item.semiProductList" ></checkbox> -->
  165. <!-- :itemData="item" @tableDataFn="tableDataFn" -->
  166. <!-- 碳谷批量报工 -->
  167. <semiProductJobBomPL
  168. :singleReport="item.singleReport"
  169. v-if="
  170. item.semiProductList &&
  171. item.semiProductList.length != 0 &&
  172. taskObj.type != 4 &&
  173. taskObj.type != 6 &&
  174. item.singleReport == 0 &&
  175. clientEnvironmentId == 3
  176. "
  177. :item="item"
  178. :list="item.semiProductList"
  179. :equipmentList="item.equipmentList"
  180. @countNumPl="countNumPl"
  181. :isChoose="isChoose"
  182. :isEngrave="isEngrave"
  183. :isDisposal="isDisposal"
  184. :index="index"
  185. ></semiProductJobBomPL>
  186. <!-- <semiProductJobBom v-if="
  187. item.pickOutInList &&
  188. item.pickOutInList.length != 0 &&
  189. taskObj.type == 6 &&
  190. item.singleReport == 1
  191. " :item="item" :list="item.pickOutInList">
  192. </semiProductJobBom> -->
  193. <!-- 物料清单 -->
  194. <!-- <semiProductBom
  195. v-if="
  196. item.semiProductList.length != 0 &&
  197. item.singleReport == 0 &&
  198. clientEnvironmentId != 3
  199. "
  200. :list="item.semiProductList"
  201. :equipmentList="item.equipmentList"
  202. :workInfo="item"
  203. ></semiProductBom> -->
  204. <!-- 产品信息 -->
  205. <oneJobQualityBomPL
  206. v-if="
  207. item.semiProductList &&
  208. item.semiProductList.length != 0 &&
  209. taskObj.type == 6 &&
  210. item.singleReport == 0 &&
  211. clientEnvironmentId == 3
  212. "
  213. :item="item"
  214. :list="item.semiProductList"
  215. >
  216. </oneJobQualityBomPL>
  217. <byProductBom
  218. v-if="item.productRecycleList.length != 0"
  219. :list="item.productRecycleList"
  220. >
  221. </byProductBom>
  222. <turnoverBom
  223. v-if="item.turnover.length != 0"
  224. :list="item.turnover"
  225. :wordItem="item"
  226. pattern="job"
  227. >
  228. </turnoverBom>
  229. <aridRegion
  230. v-if="item.aridRegionList.length != 0"
  231. :list="item.aridRegionList"
  232. :isType="true"
  233. ></aridRegion>
  234. <!-- 这里是包装分组 -->
  235. <!-- <div
  236. v-if="
  237. item.currentTaskDiagram.type == 4 &&
  238. item.semiProductList.length != 0
  239. "
  240. >
  241. <semiProductJobBom
  242. :singleReport="item.singleReport"
  243. :item="item"
  244. :list="
  245. item.currentTaskDiagram.type == 4
  246. ? item.pickOutInList
  247. : item.semiProductList
  248. "
  249. :equipmentList="item.equipmentList"
  250. ></semiProductJobBom>
  251. </div>
  252. <div
  253. v-if="
  254. item.currentTaskDiagram.type == 4 && item.pickOutInList.length != 0
  255. "
  256. >
  257. <semiProductJobBom
  258. :singleReport="item.singleReport"
  259. :item="item"
  260. :list="
  261. item.currentTaskDiagram.type == 4
  262. ? item.pickOutInList
  263. : item.semiProductList
  264. "
  265. :equipmentList="item.equipmentList"
  266. ></semiProductJobBom>
  267. </div> -->
  268. <div
  269. v-if="
  270. clientEnvironmentId != 2 &&
  271. item &&
  272. item.currentTaskDiagram.type == 4 &&
  273. clientEnvironmentId != 3
  274. "
  275. >
  276. <!-- <packagingGrouping
  277. ref="packagingGroupingRef"
  278. :objData="item"
  279. :workOrderId="item.workOrderId"
  280. :taskId="item.currentTaskDiagram.taskId"
  281. >
  282. </packagingGrouping> -->
  283. <batchPackagingGrouping
  284. ref="packagingGroupingRef"
  285. :objData="item"
  286. :workOrderId="item.workOrderId"
  287. :taskId="item.currentTaskDiagram.taskId"
  288. >
  289. </batchPackagingGrouping>
  290. </div>
  291. <!-- <packingBom :taskId='taskObj.id' :workOrderId="item.workOrderId" :objData="item" ref="packRef"
  292. v-if='taskObj.type == 4 && clientEnvironmentId != 3 && item'></packingBom> -->
  293. <!-- <semiProductJobBom
  294. :singleReport="item.singleReport"
  295. v-if="
  296. item.semiProductList &&
  297. item.semiProductList.length != 0 &&
  298. item.singleReport == 1
  299. "
  300. :item="item"
  301. :list="item.semiProductList"
  302. :equipmentList="item.equipmentList"
  303. :isChoose="isChoose"
  304. @chooseData="chooseData"
  305. :isEngrave="isEngrave"
  306. :isDisposal="isDisposal"
  307. ></semiProductJobBom> -->
  308. <!-- <packingTgBom
  309. v-if="
  310. item.pickOutInList &&
  311. item.pickOutInList.length != 0 &&
  312. taskObj.type == 4 &&
  313. clientEnvironmentId == 3
  314. "
  315. :list="item.pickOutInList"
  316. :item="item"
  317. ></packingTgBom> -->
  318. <semiProductJobBom
  319. v-if="
  320. item.pickOutInList &&
  321. item.pickOutInList.length != 0 &&
  322. taskObj.type == 4 &&
  323. clientEnvironmentId == 3
  324. "
  325. :singleReport="item.singleReport"
  326. :list="item.semiProductList"
  327. :equipmentList="item.equipmentList"
  328. :item="item"
  329. @chooseData="chooseData"
  330. :isEngrave="isEngrave"
  331. :isDisposal="isDisposal"
  332. ></semiProductJobBom>
  333. </div>
  334. </div>
  335. <pickingList
  336. isType="job"
  337. ref="pickingListRef"
  338. @allSelection="allSelection"
  339. ></pickingList>
  340. </div>
  341. </template>
  342. <script>
  343. import { listByIdsReport } from '@/api/produce/job';
  344. import { getWarehouseList } from '@/api/produce/index';
  345. import {
  346. jobSave,
  347. saveCache,
  348. getCache,
  349. removeCache
  350. } from '@/api/produce/workOrder';
  351. import pickingList from '../picking/pickingList.vue';
  352. import packagingGrouping from './components/packagingGrouping.vue';
  353. import workOrderBom from '../feeding/components/workOrderBom.vue';
  354. import paramBom from '../feeding/components/paramBom.vue';
  355. import jobBom from './components/jobBom.vue';
  356. import deviceBom from '../feeding/components/deviceBom.vue';
  357. import modelBom from '../feeding/components/modelBom.vue';
  358. import palletBom from './components/palletBom.vue';
  359. import revolvingDiskBom from '../feeding/components/revolvingDiskBom.vue';
  360. import oneJobQualityBom from './components/oneJobQualityBom.vue';
  361. import oneJobQualityBomPL from './components/oneJobQualityBomPL.vue';
  362. import jobDdBom from './components/jobDdBom.vue';
  363. import semiProductJobBom from './components/semiProductJobBom.vue';
  364. // import semiProductJobBom from './components/newSemiProductJobBom.vue';
  365. import semiProductJobBomPL from './components/semiProductJobBomPL.vue';
  366. import semiProductJobBomQT from './components/semiProductJobBomQT.vue';
  367. import batchSemiProductJobBom from './components/batchSemiProductJobBom.vue';
  368. import batchPackagingGrouping from './components/batchPackagingGrouping.vue';
  369. import semiProductBom from '../feeding/components/semiProductBom';
  370. // import byProductBom from './components/byProductBom.vue';
  371. import byProductBom from './components/newByProductBom.vue';
  372. import turnoverBom from './components/turnoverBom.vue';
  373. import aridRegion from '../feeding/components/aridRegion.vue';
  374. import packingBom from './components/packingBom.vue';
  375. import packingTgBom from './components/packingTgBom';
  376. import { timestampToDateTime } from '@/utils/index.js';
  377. import { parameterGetByCode } from '@/api/system/dictionary-data';
  378. export default {
  379. components: {
  380. pickingList,
  381. packagingGrouping,
  382. workOrderBom,
  383. paramBom,
  384. jobBom,
  385. deviceBom,
  386. modelBom,
  387. palletBom,
  388. revolvingDiskBom,
  389. oneJobQualityBom,
  390. oneJobQualityBomPL,
  391. semiProductJobBomQT,
  392. semiProductJobBom,
  393. semiProductJobBomPL,
  394. byProductBom,
  395. turnoverBom,
  396. aridRegion,
  397. packingBom,
  398. jobDdBom,
  399. packingTgBom,
  400. semiProductBom,
  401. batchSemiProductJobBom,
  402. batchPackagingGrouping
  403. },
  404. props: {
  405. workListIds: {
  406. type: Array,
  407. default() {
  408. return [];
  409. }
  410. },
  411. reportNeedFeed: {}
  412. },
  413. data() {
  414. return {
  415. List: [],
  416. idsList: [],
  417. isLoad: false,
  418. executorTime: '',
  419. warehouseList: [],
  420. loading: null,
  421. loadingBtn: false,
  422. chooseListData: [],
  423. isChoose: false,
  424. isEngrave: false,
  425. isDisposal: false
  426. };
  427. },
  428. computed: {
  429. taskObj() {
  430. return this.$store.state.user.taskObj;
  431. },
  432. clientEnvironmentId() {
  433. return this.$store.state.user.info.clientEnvironmentId;
  434. }
  435. },
  436. watch: {
  437. workListIds: {
  438. handler(val) {
  439. this.getList(val);
  440. },
  441. deep: true,
  442. immediate: true
  443. }
  444. },
  445. created() {
  446. this.getWarehouseListFn();
  447. this.getChooseEngrave();
  448. },
  449. methods: {
  450. checkPack() {
  451. this.$refs.packagingGroupingRef[0].getData();
  452. },
  453. handleCreate(e) {
  454. if (e) {
  455. const list = JSON.parse(JSON.stringify(this.List));
  456. console.log(list);
  457. list.map((item) => {
  458. item.workReportInfo.executorTime = e;
  459. });
  460. this.$set(this, 'List', list);
  461. }
  462. },
  463. async getChooseEngrave() {
  464. await parameterGetByCode({
  465. code: 'choose_engrave'
  466. }).then((res) => {
  467. this.isChoose = res.value == '1' ? true : false;
  468. });
  469. await parameterGetByCode({
  470. code: 'batch_update_engrave'
  471. }).then((res) => {
  472. this.isEngrave = res.value == '1' ? true : false;
  473. });
  474. await parameterGetByCode({
  475. code: 'batch_disposal'
  476. }).then((res) => {
  477. this.isDisposal = res.value == '1' ? true : false;
  478. });
  479. },
  480. getList(ids) {
  481. this.idsList = ids || [];
  482. if (this.taskObj.id != -2) {
  483. let param = {
  484. ids: ids,
  485. taskId: this.taskObj.id,
  486. type: 0
  487. };
  488. this.isLoad = false;
  489. listByIdsReport(param)
  490. .then((res) => {
  491. this.List = res.map((obj) => {
  492. if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
  493. obj['turnover'] = [];
  494. }
  495. if (
  496. !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
  497. ) {
  498. obj['aridRegionList'] = [];
  499. }
  500. if (
  501. !Object.prototype.hasOwnProperty.call(obj, 'instanceList')
  502. ) {
  503. obj['instanceList'] = [];
  504. }
  505. if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
  506. obj['palletList'] = [];
  507. }
  508. if (
  509. !Object.prototype.hasOwnProperty.call(
  510. obj,
  511. 'revolvingDiskList'
  512. )
  513. ) {
  514. obj['revolvingDiskList'] = [];
  515. }
  516. if (obj.palletList.length > 0) {
  517. obj.palletList = obj.palletList.map((m) => {
  518. return {
  519. hideKc: true, // 不显示库存
  520. quantity: m.feedQuantity,
  521. ...m
  522. };
  523. });
  524. }
  525. // console.log(this.taskObj.type, 'this.taskObj.type');
  526. if (
  527. (this.taskObj.type == 6 && obj.singleReport == 1) ||
  528. (this.clientEnvironmentId == 3 &&
  529. obj.singleReport == 0 &&
  530. this.taskObj.type == 6)
  531. ) {
  532. obj.semiProductList = obj.pickOutInList;
  533. obj.pickOutInList = [];
  534. console.log('赋值了');
  535. } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
  536. obj.product = obj.pickOutInList;
  537. obj.pickOutInList = [];
  538. } else if (
  539. this.taskObj.type == 4 &&
  540. obj.singleReport == 0 &&
  541. this.clientEnvironmentId != 3 &&
  542. this.clientEnvironmentId != 2
  543. ) {
  544. if (obj.pickOutInList && obj.pickOutInList.length != 0) {
  545. obj.product = obj.pickOutInList;
  546. obj.pickOutInList = [];
  547. }
  548. } else if (
  549. this.taskObj.type == 4 &&
  550. obj.singleReport == 1 &&
  551. this.clientEnvironmentId != 2
  552. ) {
  553. if (obj.pickOutInList && obj.pickOutInList.length != 0) {
  554. obj.semiProductList = obj.pickOutInList;
  555. obj.pickOutInList = [];
  556. }
  557. }
  558. if (
  559. obj.singleReport == 1 &&
  560. obj.currentTaskDiagram.type != 2 &&
  561. obj.currentTaskDiagram.type != 3 &&
  562. obj.currentTaskDiagram.type != 6
  563. ) {
  564. obj.semiProductList.map((item) => {
  565. item.extInfo.taskId = '';
  566. item.extInfo.taskName = '';
  567. });
  568. }
  569. if (
  570. obj.singleReport == 0 &&
  571. obj.currentTaskDiagram.type != 2 &&
  572. obj.currentTaskDiagram.type != 3 &&
  573. obj.currentTaskDiagram.type != 6
  574. ) {
  575. obj.product.map((item) => {
  576. item.extInfo.taskId = '';
  577. item.extInfo.taskName = '';
  578. });
  579. }
  580. if (
  581. this.clientEnvironmentId == 3 &&
  582. obj.singleReport == 0 &&
  583. this.taskObj.type != 6
  584. ) {
  585. obj.semiProductList.map((a) => {
  586. a.extInfo.batchReportInfo = [
  587. {
  588. allFeedQuantity: '',
  589. allReportWeight: '',
  590. taskId: '',
  591. taskName: ''
  592. }
  593. ];
  594. a.extInfo.notBatchReportInfo = [
  595. {
  596. allFeedQuantity: '',
  597. notType: '',
  598. taskId: '',
  599. taskName: '',
  600. notReason: ''
  601. }
  602. ];
  603. return {
  604. a
  605. };
  606. });
  607. obj.semiProductList = JSON.parse(
  608. JSON.stringify(obj.semiProductList)
  609. );
  610. }
  611. obj.semiProductList = obj.semiProductList.map((item) => {
  612. if (this.taskObj.type != 6) {
  613. if (item['extInfo']?.reportWeight) {
  614. item['extInfo'].reportWeight = '';
  615. }
  616. }
  617. item.confirm = 0;
  618. console.log(item, 'item');
  619. return item;
  620. });
  621. obj.product = obj.product.map((item) => {
  622. if (this.taskObj.type != 6) {
  623. if (item['extInfo']?.reportWeight) {
  624. item['extInfo'].reportWeight = '';
  625. }
  626. }
  627. item.confirm = 0;
  628. console.log(item, 'item');
  629. return item;
  630. });
  631. obj.workReportInfo = {
  632. executorTime: null,
  633. formingNum: null,
  634. formingWeight: null,
  635. formedNum: null,
  636. formedWeight: null,
  637. taskId: this.taskObj.id,
  638. notFormedNum: null,
  639. notFormedWeigh: null
  640. };
  641. obj.notFormedList = [
  642. {
  643. notFormedNum: null,
  644. notFormedWeight: null,
  645. weightUnit: obj.weightUnit,
  646. unit: obj.unit,
  647. warehouseId: null // 处置 仓库id
  648. }
  649. ];
  650. if (obj.semiProductList.length > 0) {
  651. // 预制体报工
  652. obj.workReportInfo.formedNum = obj.semiProductList.length;
  653. let numCot = 0;
  654. if (obj.semiProductList.length > 0) {
  655. obj.semiProductList.map((fitem) => {
  656. numCot = numCot + fitem.feedQuantity || 1;
  657. });
  658. obj.workReportInfo.formedNum = numCot;
  659. }
  660. } else if (obj.product.length > 0) {
  661. const number = obj.product.reduce((acc, pro) => {
  662. return pro.feedQuantity
  663. ? acc + Number(pro.feedQuantity)
  664. : acc;
  665. }, 0);
  666. obj.workReportInfo.formedNum = number;
  667. }
  668. obj.workReportInfo.formingNum = obj.formingNum;
  669. obj.workReportInfo.formingWeight = obj.formingWeight;
  670. obj.workReportInfo.unit = obj.unit;
  671. obj.workReportInfo.weightUnit = obj.weightUnit;
  672. obj.workReportInfo.workOrderId = obj.workOrderId;
  673. obj.workReportInfo.executorTime = obj.executorTime;
  674. obj.paramDetailList.map((m) => {
  675. if (m.extInfo.textType == 5) {
  676. m.remainingTime = m.extInfo.remainingTime;
  677. }
  678. return {
  679. ...m.extInfo
  680. };
  681. });
  682. console.log(obj, 4445555);
  683. if (this.taskObj.type == 4) {
  684. let numVal = 0;
  685. obj.pickOutInList.map((item) => {
  686. numVal = numVal + item.feedQuantity;
  687. });
  688. obj.workReportInfo.formedNum = numVal;
  689. }
  690. return {
  691. ...obj
  692. };
  693. });
  694. })
  695. .finally(() => {
  696. this.isLoad = true;
  697. if (this.taskObj.type == 1) {
  698. this.getCacheFn();
  699. }
  700. });
  701. }
  702. },
  703. openPicking(id, item) {
  704. this.$refs.pickingListRef.open(id, item);
  705. },
  706. allSelection(id, selectList) {
  707. console.log(id, selectList, 'allSelection');
  708. this.List.forEach((m) => {
  709. if (m.workOrderId == id) {
  710. let turnover = [];
  711. let equipmentList = []; // 生产设备
  712. selectList.forEach((f) => {
  713. if (f.rootCategoryLevelId == 4) {
  714. equipmentList = equipmentList.concat(f);
  715. }
  716. if (f.rootCategoryLevelId == 7) {
  717. turnover = turnover.concat(f);
  718. }
  719. });
  720. this.$set(m, 'equipmentList', equipmentList);
  721. this.$set(m, 'turnover', turnover);
  722. this.$forceUpdate();
  723. }
  724. });
  725. },
  726. chooseData(dataList) {
  727. this.chooseListData = this.deepCopy(dataList);
  728. // if (this.chooseListData.length > 0) {
  729. // this.chooseListData.forEach((item) => {
  730. // item.confirm = 1;
  731. // });
  732. // } else {
  733. // this.List.forEach((item) => {
  734. // item.semiProductList.forEach((fitem) => {
  735. // fitem.confirm = 0;
  736. // });
  737. // });
  738. // }
  739. },
  740. deepCopy(obj, hash = new WeakMap()) {
  741. if (obj === null) return null;
  742. if (obj instanceof Date) return new Date(obj);
  743. if (obj instanceof RegExp) return new RegExp(obj);
  744. if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
  745. if (hash.has(obj)) return hash.get(obj); // 处理循环引用
  746. const result = Array.isArray(obj) ? [] : {};
  747. hash.set(obj, result); // 存储原始对象和其副本的映射关系
  748. return Object.keys(obj).reduce((acc, key) => {
  749. acc[key] = this.deepCopy(obj[key], hash);
  750. return acc;
  751. }, result);
  752. },
  753. async save(type) {
  754. const required = await parameterGetByCode({
  755. code: 'mes_report_engrave_required'
  756. }).then((res) => {
  757. return res;
  758. });
  759. console.log(required, 'required');
  760. let confirmList = [];
  761. // const confirmList = this.List[0].semiProductList.filter(
  762. // (item) => item.confirm == 1
  763. // );
  764. this.List.forEach((item) => {
  765. item.semiProductList.forEach((it) => {
  766. if (it.confirm == 1) {
  767. confirmList.push(it);
  768. }
  769. });
  770. });
  771. if (required.value == '1' && this.List[0].singleReport == 1) {
  772. // if (this.chooseListData.length > 0) {
  773. // this.checkChooseData(this.chooseListData, type, 'choose');
  774. // return;
  775. // } else {
  776. // this.checkChooseData(this.List, type, 'all');
  777. // return;
  778. // }
  779. console.log(this.List, 'this.List');
  780. if (confirmList.length > 0) {
  781. for (let i = 0; i < confirmList.length; i++) {
  782. // if (
  783. // !confirmList[i].extInfo.engrave &&
  784. // confirmList[i].confirm == 1
  785. // ) {
  786. // this.$message.warning('请输入刻码!');
  787. // return;
  788. // }
  789. if (confirmList[i].confirm == 1) {
  790. if (!confirmList[i].extInfo.engrave) {
  791. this.$message.warning('请输入刻码!');
  792. return;
  793. }
  794. }
  795. }
  796. } else {
  797. if (this.List.length > 0) {
  798. console.log(this.List);
  799. for (let i = 0; i < this.List[0].semiProductList.length; i++) {
  800. // if (!this.List[0].semiProductList[i].extInfo.engrave) {
  801. // this.$message.warning('请输入刻码!');
  802. // return;
  803. // }
  804. if (this.List[0].semiProductList[i].confirm == 1) {
  805. if (!this.List[0].semiProductList[i].extInfo.engrave) {
  806. this.$message.warning('请输入刻码!');
  807. return;
  808. }
  809. }
  810. }
  811. // this.List.forEach((item) => {
  812. // for (let i = 0; i < item.semiProductList.length; i++) {
  813. // if (!item.semiProductList[i].extInfo.engrave) {
  814. // this.$message.warning('请输入刻码!');
  815. // return;
  816. // }
  817. // }
  818. // });
  819. // for (let i = 0; i < this.List.length; i++) {
  820. // for(let j = 0; i < this.List[i].semiProductList.length; j++) {
  821. // }
  822. // // for (let j = 0; this.List[i].semiProductList.length; j++) {
  823. // // console.log(
  824. // // this.List[i].semiProductList[j],
  825. // // 'this.List[i].semiProductList[j]'
  826. // // );
  827. // // if (!this.List[i].semiProductList[j].extInfo.engrave) {
  828. // // this.$message.warning('请输入刻码!');
  829. // // return;
  830. // // }
  831. // // }
  832. // }
  833. }
  834. }
  835. }
  836. console.log('11111', this.List);
  837. this.loading = this.$loading({
  838. lock: true,
  839. text: '加载中',
  840. background: 'rgba(0, 0, 0, 0.7)'
  841. });
  842. let arr = this.List.filter((L) => L.workReportInfo.executorTime);
  843. if (!arr.length) {
  844. this.loading.close();
  845. return this.$message.warning('请选择执行时间');
  846. }
  847. // if(this.taskObj.type !=6){
  848. // if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
  849. // this.loading.close();
  850. // return this.$message.warning('请先投料再报工');
  851. // }
  852. // }
  853. let bol2;
  854. bol2 = this.List.every((e) => {
  855. return (
  856. // e.workReportInfo['formedNum'] && e.workReportInfo['formedNum'] != 0
  857. e.workReportInfo['formedNum'] != ''
  858. );
  859. });
  860. // if (!bol2) {
  861. // this.$message.warning('请输入合格品数量');
  862. // this.loading.close();
  863. // return false;
  864. // }
  865. // 预制体
  866. let wId;
  867. let bol = true;
  868. let _i;
  869. this.List.forEach((L) => {
  870. if (
  871. L.semiProductList.length > 0 &&
  872. this.taskObj.type != 4 &&
  873. L.singleReport == 1
  874. ) {
  875. bol = L.semiProductList.every((e, i) => {
  876. _i = i + 1;
  877. wId = L.code;
  878. if (this.taskObj.type == 6) {
  879. return (
  880. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  881. e.extInfo.taskId
  882. );
  883. } else {
  884. if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  885. return (
  886. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  887. e.extInfo.taskId &&
  888. e.extInfo.reportWeight
  889. );
  890. } else {
  891. return (
  892. Object.prototype.hasOwnProperty.call(
  893. e.extInfo,
  894. 'notType'
  895. ) && e.extInfo.notType
  896. );
  897. }
  898. }
  899. });
  900. }
  901. if (L.workReportInfo.batchNo) {
  902. L.workReportInfo.batchNo = L.batchNo + L.workReportInfo.batchNo;
  903. }
  904. });
  905. // if (!bol) {
  906. // this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
  907. // this.loading.close();
  908. // return false;
  909. // }
  910. if (this.clientEnvironmentId != 2) {
  911. let succ = this.List.some((L) => {
  912. return L.productRecycleList.length > 0;
  913. });
  914. if (succ) {
  915. const isRecycle = await this.checkRecycle();
  916. if (!isRecycle) {
  917. return false;
  918. }
  919. }
  920. }
  921. console.log(this.item, '9999999999');
  922. if (
  923. this.taskObj.type == 4 &&
  924. this.clientEnvironmentId != 3 &&
  925. this.clientEnvironmentId != 2
  926. ) {
  927. this.checkPack();
  928. // if (!isPack) {
  929. // return false
  930. // }
  931. }
  932. console.log('4444444444', this.List);
  933. if (this.taskObj.type == 1) {
  934. const isCache = await this.checkCache(type);
  935. if (!isCache) {
  936. return false;
  937. }
  938. }
  939. if (
  940. this.clientEnvironmentId == 3 &&
  941. type == 2 &&
  942. this.taskObj.type == 6
  943. ) {
  944. this.List.forEach((L) => {
  945. if (L.singleReport == 0) {
  946. L.semiProductList = [];
  947. }
  948. });
  949. console.log('ashsaoghaoghoasg');
  950. }
  951. let isSemiProduct = false;
  952. this.List.map((semi) => {
  953. if (
  954. semi.semiProductList.length == 0 &&
  955. semi.singleReport == 1 &&
  956. semi.currentTaskDiagram.isFirstTask == 1 &&
  957. this.clientEnvironmentId != 3
  958. ) {
  959. isSemiProduct = true;
  960. this.loading.close();
  961. setTimeout(() => {
  962. this.$message.warning({
  963. message: '请工单编号:' + semi.code + '先创建在制品',
  964. key: semi.code // 使用当前时间作为key,确保唯一性
  965. });
  966. }, 500);
  967. }
  968. if (semi.semiProductList.length == 0 && semi.singleReport == 0) {
  969. semi.semiProductList.map((ditem) => {
  970. if (ditem.extInfo.batchReportInfo) {
  971. ditem.extInfo.batchReportInfo.map((baItem) => {
  972. let idvalue = baItem.deviceId
  973. ? baItem.deviceId.split('/')
  974. : '';
  975. baItem.deviceId = idvalue ? idvalue[0] : '';
  976. });
  977. }
  978. if (ditem.extInfo.notBatchReportInfo) {
  979. ditem.extInfo.notBatchReportInfo.map((noItem) => {
  980. let idvalue = noItem.deviceId
  981. ? noItem.deviceId.split('/')
  982. : '';
  983. noItem.deviceId = idvalue ? idvalue[0] : '';
  984. });
  985. }
  986. });
  987. }
  988. });
  989. if (isSemiProduct) {
  990. this.loading.close();
  991. return;
  992. }
  993. console.log(this.List, 'this.List');
  994. // this.List[0].product = this.List[0].semiProductList;
  995. this.loadingBtn = true;
  996. jobSave(this.List)
  997. .then((res) => {
  998. this.loadingBtn = false;
  999. this.loading.close();
  1000. this.$message.success('报工成功');
  1001. this.getList(this.idsList);
  1002. this.$emit('jobSuccess', 'Success');
  1003. })
  1004. .catch(() => {
  1005. this.loadingBtn = false;
  1006. this.loading.close();
  1007. });
  1008. // .finally(() => {
  1009. // setTimeout(function () {
  1010. // this.loading.close();
  1011. // }, 3000);
  1012. // });
  1013. },
  1014. async checkChooseData(dataList, type, chooseType) {
  1015. if (chooseType == 'choose') {
  1016. for (let i = 0; i < dataList.length; i++) {
  1017. if (!dataList[i].extInfo.engrave) {
  1018. this.$message.warning('请输入刻码!');
  1019. return;
  1020. }
  1021. }
  1022. } else {
  1023. for (let i = 0; i < dataList.length; i++) {
  1024. if (dataList[i].semiProductList.length > 0) {
  1025. for (let j = 0; j < dataList[i].semiProductList.length; j++) {
  1026. if (!dataList[i].semiProductList[j].extInfo.engrave) {
  1027. this.$message.warning('请输入刻码!');
  1028. return;
  1029. }
  1030. }
  1031. }
  1032. }
  1033. if (chooseType == 'choose') {
  1034. dataList.forEach((item) => {
  1035. this.List.forEach((it) => {
  1036. it.semiProductList.forEach((fitem) => {
  1037. if (fitem.extInfo.id == item.extInfo.id) {
  1038. fitem.extInfo.engrave = item.extInfo.engrave;
  1039. fitem.extInfo.confirm = item.extInfo.confirm;
  1040. }
  1041. });
  1042. });
  1043. });
  1044. }
  1045. // for (let i = 0; i < this.List[0].semiProductList.length; i++) {
  1046. // if (!this.List[0].semiProductList[i].extInfo.engrave) {
  1047. // this.$message.warning('请输入刻码!');
  1048. // return;
  1049. // }
  1050. // }
  1051. }
  1052. // for (let i = 0; i < dataList.length; i++) {
  1053. // if (!dataList[i].extInfo.engrave) {
  1054. // this.$message.warning('请输入刻码!');
  1055. // return;
  1056. // }
  1057. // }
  1058. // this.List[0].semiProductList = dataList;
  1059. console.log('465646546', this.List);
  1060. this.loading = this.$loading({
  1061. lock: true,
  1062. text: '加载中',
  1063. background: 'rgba(0, 0, 0, 0.7)'
  1064. });
  1065. let arr = this.List.filter((L) => L.workReportInfo.executorTime);
  1066. if (!arr.length) {
  1067. this.loading.close();
  1068. return this.$message.warning('请选择执行时间');
  1069. }
  1070. // if(this.taskObj.type !=6){
  1071. // if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
  1072. // this.loading.close();
  1073. // return this.$message.warning('请先投料再报工');
  1074. // }
  1075. // }
  1076. let bol2;
  1077. bol2 = this.List.every((e) => {
  1078. return (
  1079. // e.workReportInfo['formedNum'] && e.workReportInfo['formedNum'] != 0
  1080. e.workReportInfo['formedNum'] != ''
  1081. );
  1082. });
  1083. // if (!bol2) {
  1084. // this.$message.warning('请输入合格品数量');
  1085. // this.loading.close();
  1086. // return false;
  1087. // }
  1088. // 预制体
  1089. let wId;
  1090. let bol = true;
  1091. let _i;
  1092. this.List.forEach((L) => {
  1093. if (
  1094. L.semiProductList.length > 0 &&
  1095. this.taskObj.type != 4 &&
  1096. L.singleReport == 1
  1097. ) {
  1098. bol = L.semiProductList.every((e, i) => {
  1099. _i = i + 1;
  1100. wId = L.code;
  1101. if (this.taskObj.type == 6) {
  1102. return (
  1103. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  1104. e.extInfo.taskId
  1105. );
  1106. } else {
  1107. if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  1108. return (
  1109. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  1110. e.extInfo.taskId &&
  1111. e.extInfo.reportWeight
  1112. );
  1113. } else {
  1114. return (
  1115. Object.prototype.hasOwnProperty.call(
  1116. e.extInfo,
  1117. 'notType'
  1118. ) && e.extInfo.notType
  1119. );
  1120. }
  1121. }
  1122. });
  1123. }
  1124. });
  1125. // if (!bol) {
  1126. // this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
  1127. // this.loading.close();
  1128. // return false;
  1129. // }
  1130. if (this.clientEnvironmentId != 2) {
  1131. let succ = this.List.some((L) => {
  1132. return L.productRecycleList.length > 0;
  1133. });
  1134. if (succ) {
  1135. const isRecycle = await this.checkRecycle();
  1136. if (!isRecycle) {
  1137. return false;
  1138. }
  1139. }
  1140. }
  1141. console.log(this.item, '9999999999');
  1142. if (
  1143. this.taskObj.type == 4 &&
  1144. this.clientEnvironmentId != 3 &&
  1145. this.clientEnvironmentId != 2 &&
  1146. this.List[0].singleReport !== 1
  1147. ) {
  1148. this.checkPack();
  1149. // if (!isPack) {
  1150. // return false
  1151. // }
  1152. }
  1153. console.log('4444444444', this.List);
  1154. if (this.taskObj.type == 1) {
  1155. const isCache = await this.checkCache(type);
  1156. if (!isCache) {
  1157. return false;
  1158. }
  1159. }
  1160. if (
  1161. this.clientEnvironmentId == 3 &&
  1162. type == 2 &&
  1163. this.taskObj.type == 6
  1164. ) {
  1165. this.List.forEach((L) => {
  1166. if (L.singleReport == 0) {
  1167. L.semiProductList = [];
  1168. }
  1169. });
  1170. console.log('ashsaoghaoghoasg');
  1171. }
  1172. let isSemiProduct = false;
  1173. this.List.map((semi) => {
  1174. if (
  1175. semi.semiProductList.length == 0 &&
  1176. semi.singleReport == 1 &&
  1177. semi.currentTaskDiagram.isFirstTask == 1 &&
  1178. this.clientEnvironmentId != 3
  1179. ) {
  1180. isSemiProduct = true;
  1181. this.loading.close();
  1182. setTimeout(() => {
  1183. this.$message.warning({
  1184. message: '请工单编号:' + semi.code + '先创建在制品',
  1185. key: semi.code // 使用当前时间作为key,确保唯一性
  1186. });
  1187. }, 500);
  1188. }
  1189. if (semi.semiProductList.length == 0 && semi.singleReport == 0) {
  1190. semi.semiProductList.map((ditem) => {
  1191. if (ditem.extInfo.batchReportInfo) {
  1192. ditem.extInfo.batchReportInfo.map((baItem) => {
  1193. let idvalue = baItem.deviceId
  1194. ? baItem.deviceId.split('/')
  1195. : '';
  1196. baItem.deviceId = idvalue ? idvalue[0] : '';
  1197. });
  1198. }
  1199. if (ditem.extInfo.notBatchReportInfo) {
  1200. ditem.extInfo.notBatchReportInfo.map((noItem) => {
  1201. let idvalue = noItem.deviceId
  1202. ? noItem.deviceId.split('/')
  1203. : '';
  1204. noItem.deviceId = idvalue ? idvalue[0] : '';
  1205. });
  1206. }
  1207. });
  1208. }
  1209. });
  1210. if (isSemiProduct) {
  1211. this.loading.close();
  1212. return;
  1213. }
  1214. console.log(this.List, 'this.List');
  1215. // this.loadingBtn = true;
  1216. // jobSave(this.List)
  1217. // .then((res) => {
  1218. // this.loadingBtn = false;
  1219. // this.loading.close();
  1220. // this.$message.success('报工成功');
  1221. // this.getList(this.idsList);
  1222. // })
  1223. // .catch(() => {
  1224. // this.loadingBtn = false;
  1225. // this.loading.close();
  1226. // })
  1227. // .finally(() => {
  1228. // setTimeout(function () {
  1229. // // this.loading.close();
  1230. // }, 3000);
  1231. // });
  1232. },
  1233. checkRecycle() {
  1234. this.loading.close();
  1235. return new Promise((resolve) => {
  1236. this.$confirm('是否跳过副产品回收处置!', '提示', {
  1237. confirmButtonText: '确定',
  1238. cancelButtonText: '取消',
  1239. type: 'warning'
  1240. })
  1241. .then(() => {
  1242. resolve(true);
  1243. })
  1244. .catch(() => {
  1245. resolve(false);
  1246. });
  1247. });
  1248. },
  1249. checkCache(type) {
  1250. return new Promise((resolve) => {
  1251. if (type == 1) {
  1252. saveCache(this.List).then((rr) => {
  1253. this.$message.success('缓存成功');
  1254. this.loading.close();
  1255. });
  1256. resolve(false);
  1257. } else if (type == 2) {
  1258. resolve(true);
  1259. }
  1260. });
  1261. },
  1262. getCacheFn() {
  1263. let parma = {
  1264. workOrderIds: this.idsList,
  1265. taskId: this.taskObj.id,
  1266. type: 1
  1267. };
  1268. getCache(parma).then((res) => {
  1269. this.List.forEach((f, index) => {
  1270. res.forEach((o) => {
  1271. if (f.workOrderId == o.workOrderId) {
  1272. f['product'] = o.extInfo.product;
  1273. f['workReportInfo'] = o.extInfo.workReportInfo;
  1274. f['notFormedList'] = o.extInfo.notFormedList;
  1275. f['turnover'] = o.extInfo.turnover;
  1276. f['productRecycleList'] = o.extInfo.productRecycleList;
  1277. f['semiProductList'] = o.extInfo.semiProductList;
  1278. f['modelList'] = o.extInfo.modelList;
  1279. // this.$set(this.List[index].workReportInfo,'executorTime',timestampToDateTime(o.extInfo.workReportInfo.executorTime))
  1280. this.$forceUpdate();
  1281. }
  1282. });
  1283. });
  1284. });
  1285. },
  1286. removeCacheFn(type) {
  1287. this.$confirm('是否清空缓存', '缓存')
  1288. .then(() => {
  1289. let parma = {
  1290. workOrderIds: type == 'all' ? this.idsList : [type],
  1291. taskId: this.taskObj.id,
  1292. type: 1
  1293. };
  1294. removeCache(parma).then((res) => {
  1295. this.$message.success('已经清空缓存');
  1296. this.getList(this.idsList);
  1297. });
  1298. })
  1299. .catch(() => {});
  1300. },
  1301. getWarehouseListFn() {
  1302. getWarehouseList().then((res) => {
  1303. this.warehouseList = res.data;
  1304. });
  1305. },
  1306. //批量报工合格不合格重量统计
  1307. countNumPl(list, index) {
  1308. console.log('11111122222333', list);
  1309. //合格总数
  1310. let formedNumCount = 0;
  1311. //合格总重量
  1312. let formedWeightCount = 0;
  1313. //不合格总数
  1314. let notFormedNumCount = 0;
  1315. //不合格总重量
  1316. let notFormedWeightCount = 0;
  1317. list.map((item) => {
  1318. //合格总数
  1319. item.extInfo.batchReportInfo.forEach((m) => {
  1320. formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
  1321. });
  1322. //合格总重量
  1323. item.extInfo.batchReportInfo.forEach((w) => {
  1324. formedWeightCount =
  1325. formedWeightCount + Number(w.allReportWeight || 0);
  1326. });
  1327. //不合格总数
  1328. item.extInfo.notBatchReportInfo.forEach((nf) => {
  1329. notFormedNumCount =
  1330. notFormedNumCount + Number(nf.allFeedQuantity || 0);
  1331. });
  1332. //不合格总重量
  1333. item.extInfo.notBatchReportInfo.forEach((nw) => {
  1334. notFormedWeightCount =
  1335. notFormedWeightCount + Number(nw.allReportWeight || 0);
  1336. });
  1337. });
  1338. this.$set(this.List[index].workReportInfo, 'formedNum', formedNumCount); //合格总数
  1339. this.$set(
  1340. this.List[index].workReportInfo,
  1341. 'formedWeight',
  1342. formedWeightCount
  1343. ); //合格总重量
  1344. this.$set(
  1345. this.List[index].workReportInfo,
  1346. 'notFormedNum',
  1347. notFormedNumCount
  1348. ); //不合格总数
  1349. this.$set(
  1350. this.List[index].workReportInfo,
  1351. 'notFormedWeight',
  1352. notFormedWeightCount
  1353. ); //不合格总重量
  1354. }
  1355. }
  1356. };
  1357. </script>
  1358. <style scoped lang="scss">
  1359. .top_fixed {
  1360. width: 100%;
  1361. height: 40px;
  1362. background: #fff;
  1363. display: flex;
  1364. align-items: center;
  1365. justify-content: flex-end;
  1366. }
  1367. .title_box {
  1368. padding: 10px 0;
  1369. .name {
  1370. font-size: 14px;
  1371. font-style: normal;
  1372. font-weight: 400;
  1373. color: #157a2c;
  1374. padding-left: 5px;
  1375. position: relative;
  1376. &:before {
  1377. position: absolute;
  1378. content: '';
  1379. left: 0px;
  1380. top: 0px;
  1381. bottom: 0px;
  1382. width: 2px;
  1383. height: 14px;
  1384. background: #157a2c;
  1385. margin: auto;
  1386. }
  1387. }
  1388. }
  1389. .job_box {
  1390. // margin-top: 6px;
  1391. width: 100%;
  1392. height: calc(100vh - 70px - 50px - 80px - 60px);
  1393. overflow-y: scroll;
  1394. overflow-x: hidden;
  1395. }
  1396. .card_box {
  1397. background: #fff;
  1398. padding: 8px;
  1399. border-radius: 2px;
  1400. }
  1401. </style>