index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. <template>
  2. <div>
  3. <div class="top_fixed">
  4. <div style="display: flex;align-items: center;margin-right: 10px;" v-if="List.length>1">
  5. <div class="rx-bc">
  6. <div class="name">批量报工时间:</div>
  7. </div>
  8. <el-date-picker v-model="executorTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  9. placeholder="选择日期" @change="handleCreate">
  10. </el-date-picker>
  11. </div>
  12. <el-button type="primary" size="mini" @click="save(2, 'all')">一键报工</el-button>
  13. <el-button type="primary" size="mini" @click="removeCacheFn('all')">清空缓存</el-button>
  14. <el-button v-if="taskObj.type == 1" type="primary" size="mini" @click="save(1, 'all')">缓存</el-button>
  15. </div>
  16. <div class="job_box">
  17. <div v-for="(item, index) in List" :key="index" class="card_box" v-if="isLoad">
  18. <div class="title_box rx-bc">
  19. <div class="name">工单信息 </div>
  20. <div class="rx-bc">
  21. <el-button type="text" size="mini" @click="openPicking(item.workOrderId, item)">手动添加</el-button>
  22. <el-button type="text" size="mini" @click="removeCacheFn(item.workOrderId)">清空缓存</el-button>
  23. <el-button v-if="taskObj.type == 1" type="text" size="mini" @click="save(1, index)">缓存</el-button>
  24. </div>
  25. </div>
  26. <!-- // 工单信息 -->
  27. <workOrderBom :item="item"></workOrderBom>
  28. <!-- 报工时间 -->
  29. <div>
  30. <div class="title_box rx-bc">
  31. <div class="name">报工时间</div>
  32. </div>
  33. <el-date-picker v-model="item.workReportInfo.executorTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  34. placeholder="选择日期">
  35. </el-date-picker>
  36. </div>
  37. <paramBom v-if="item.paramDetailList.length != 0" :list="item.paramDetailList"></paramBom>
  38. <!-- //报工信息 -->
  39. <div v-if="item.singleReport !== 1">
  40. <jobBom :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList"></jobBom>
  41. </div>
  42. <div v-else>
  43. <jobDdBom :item='item' ref='jobRef' :notFormed='item.notFormedList' :warehouseList="warehouseList"></jobDdBom>
  44. </div>
  45. <!-- :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList" @modeNum='modeNum'-->
  46. <deviceBom v-if="item.equipmentList.length != 0" :list="item.equipmentList"></deviceBom>
  47. <modelBom v-if="item.modelList.length != 0" :list="item.modelList" pattern="job" ref="modelRef"></modelBom>
  48. <palletBom v-if="item.palletList.length != 0" :list="item.palletList"></palletBom>
  49. <revolvingDiskBom v-if="item.revolvingDiskList.length > 0" pattern="job" :list="objData.revolvingDiskList">
  50. </revolvingDiskBom>
  51. <!-- 单件 报告信息 -->
  52. <semiProductJobBom :singleReport="item.singleReport" v-if="
  53. item.semiProductList &&
  54. item.semiProductList.length != 0 &&
  55. taskObj.type != 4 &&
  56. item.singleReport == 1
  57. " :item="item" :list="item.semiProductList" :equipmentList="item.equipmentList"></semiProductJobBom>
  58. <!-- <checkbox :tableData="item.semiProductList" ></checkbox> -->
  59. <!-- :itemData="item" @tableDataFn="tableDataFn" -->
  60. <!-- 批量 -->
  61. <semiProductJobBomPL :singleReport="item.singleReport" v-if="
  62. item.semiProductList &&
  63. item.semiProductList.length != 0 &&
  64. taskObj.type != 4 &&
  65. taskObj.type != 6 &&
  66. item.singleReport == 0
  67. " :item="item" :list="item.semiProductList" :equipmentList="item.equipmentList" @countNumPl="countNumPl" :index="index"></semiProductJobBomPL>
  68. <!-- <semiProductJobBom v-if="
  69. item.pickOutInList &&
  70. item.pickOutInList.length != 0 &&
  71. taskObj.type == 6 &&
  72. item.singleReport == 1
  73. " :item="item" :list="item.pickOutInList">
  74. </semiProductJobBom> -->
  75. <!-- 物料清单 -->
  76. <semiProductBom
  77. v-if="item.semiProductList.length != 0&&
  78. item.singleReport == 0&&
  79. clientEnvironmentId!=3"
  80. :list="item.semiProductList"
  81. :equipmentList="item.equipmentList"
  82. :workInfo="item"
  83. ></semiProductBom>
  84. <oneJobQualityBomPL v-if="
  85. item.semiProductList &&
  86. item.semiProductList.length != 0 &&
  87. taskObj.type == 6 &&
  88. item.singleReport == 0&&
  89. clientEnvironmentId==3
  90. " :item="item" :list="item.semiProductList">
  91. </oneJobQualityBomPL>
  92. <byProductBom v-if="item.productRecycleList.length != 0" :list="item.productRecycleList">
  93. </byProductBom>
  94. <turnoverBom v-if="item.turnover.length != 0" :list="item.turnover" :wordItem="item" pattern="job">
  95. </turnoverBom>
  96. <aridRegion v-if="item.aridRegionList.length != 0" :list="item.aridRegionList" :isType="true"></aridRegion>
  97. <!-- 这里是包装分组 -->
  98. <div
  99. v-if="clientEnvironmentId != 2 && item && item.currentTaskDiagram.type == 4 && clientEnvironmentId != 3 && item.singleReport !== 1">
  100. <packagingGrouping ref="packagingGroupingRef" :objData="item" :workOrderId="item.workOrderId"
  101. :taskId="item.currentTaskDiagram.taskId">
  102. </packagingGrouping>
  103. </div>
  104. <div v-if="item.currentTaskDiagram.type == 4">
  105. <semiProductJobBom :singleReport="item.singleReport" :item="item"
  106. :list="item.currentTaskDiagram.type == 4 ? item.pickOutInList : item.semiProductList"
  107. :equipmentList="item.equipmentList"></semiProductJobBom>
  108. </div>
  109. <!-- <packingBom :taskId='taskObj.id' :workOrderId="item.workOrderId" :objData="item" ref="packRef"
  110. v-if='taskObj.type == 4 && clientEnvironmentId != 3 && item'></packingBom> -->
  111. <!-- <packingTgBom v-if="
  112. item.pickOutInList &&
  113. item.pickOutInList.length != 0 &&
  114. taskObj.type == 4 &&
  115. clientEnvironmentId == 3
  116. " :list="item.pickOutInList" :item="item"></packingTgBom> -->
  117. </div>
  118. </div>
  119. <pickingList isType="job" ref="pickingListRef" @allSelection="allSelection"></pickingList>
  120. </div>
  121. </template>
  122. <script>
  123. import { listByIdsReport } from '@/api/produce/job';
  124. import { getWarehouseList } from '@/api/produce/index';
  125. import {
  126. jobSave,
  127. saveCache,
  128. getCache,
  129. removeCache
  130. } from '@/api/produce/workOrder';
  131. import pickingList from '../picking/pickingList.vue';
  132. import packagingGrouping from "./components/packagingGrouping.vue";
  133. import workOrderBom from '../feeding/components/workOrderBom.vue';
  134. import paramBom from '../feeding/components/paramBom.vue';
  135. import jobBom from './components/jobBom.vue';
  136. import deviceBom from '../feeding/components/deviceBom.vue';
  137. import modelBom from '../feeding/components/modelBom.vue';
  138. import palletBom from './components/palletBom.vue';
  139. import revolvingDiskBom from '../feeding/components/revolvingDiskBom.vue';
  140. import oneJobQualityBom from './components/oneJobQualityBom.vue';
  141. import oneJobQualityBomPL from './components/oneJobQualityBomPL.vue';
  142. import jobDdBom from './components/jobDdBom.vue';
  143. import semiProductJobBom from './components/semiProductJobBom.vue';
  144. import semiProductJobBomPL from './components/semiProductJobBomPL.vue';
  145. import semiProductJobBomQT from './components/semiProductJobBomQT.vue';
  146. import semiProductBom from '../feeding/components/semiProductBom';
  147. import byProductBom from './components/byProductBom.vue';
  148. import turnoverBom from './components/turnoverBom.vue';
  149. import aridRegion from '../feeding/components/aridRegion.vue';
  150. import packingBom from './components/packingBom.vue';
  151. import packingTgBom from './components/packingTgBom';
  152. import { timestampToDateTime } from '@/utils/index.js';
  153. export default {
  154. components: {
  155. pickingList,
  156. packagingGrouping,
  157. workOrderBom,
  158. paramBom,
  159. jobBom,
  160. deviceBom,
  161. modelBom,
  162. palletBom,
  163. revolvingDiskBom,
  164. oneJobQualityBom,
  165. oneJobQualityBomPL,
  166. semiProductJobBomQT,
  167. semiProductJobBom,
  168. semiProductJobBomPL,
  169. byProductBom,
  170. turnoverBom,
  171. aridRegion,
  172. packingBom,
  173. jobDdBom,
  174. packingTgBom,
  175. semiProductBom
  176. },
  177. props: {
  178. workListIds: {
  179. type: Array,
  180. default() {
  181. return [];
  182. }
  183. },
  184. reportNeedFeed:{
  185. }
  186. },
  187. data() {
  188. return {
  189. List: [],
  190. idsList: [],
  191. isLoad: false,
  192. executorTime:'',
  193. warehouseList: [],
  194. loading: null,
  195. };
  196. },
  197. computed: {
  198. taskObj() {
  199. return this.$store.state.user.taskObj;
  200. },
  201. clientEnvironmentId() {
  202. return this.$store.state.user.info.clientEnvironmentId;
  203. }
  204. },
  205. watch: {
  206. workListIds: {
  207. handler(val) {
  208. this.getList(val);
  209. },
  210. deep: true,
  211. immediate: true
  212. }
  213. },
  214. created() {
  215. this.getWarehouseListFn();
  216. },
  217. methods: {
  218. checkPack() {
  219. this.$refs.packagingGroupingRef[0].getData();
  220. },
  221. handleCreate(e){
  222. if(e){
  223. const list = JSON.parse(JSON.stringify(this.List));
  224. console.log(list);
  225. list.map(item=>{
  226. item.executorTime =e;
  227. })
  228. this.$set(this, 'List', list);
  229. }
  230. },
  231. getList(ids) {
  232. this.idsList = ids || [];
  233. let param = {
  234. ids: ids,
  235. taskId: this.taskObj.id,
  236. type: 0
  237. };
  238. this.isLoad = false;
  239. listByIdsReport(param)
  240. .then((res) => {
  241. this.List = res.map((obj) => {
  242. if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
  243. obj['turnover'] = [];
  244. }
  245. if (
  246. !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
  247. ) {
  248. obj['aridRegionList'] = [];
  249. }
  250. if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
  251. obj['instanceList'] = [];
  252. }
  253. if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
  254. obj['palletList'] = [];
  255. }
  256. if (
  257. !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
  258. ) {
  259. obj['revolvingDiskList'] = [];
  260. }
  261. if (obj.palletList.length > 0) {
  262. obj.palletList = obj.palletList.map((m) => {
  263. return {
  264. hideKc: true, // 不显示库存
  265. quantity: m.feedQuantity,
  266. ...m
  267. };
  268. });
  269. }
  270. console.log('agasgasgs',this.taskObj.type)
  271. if ((this.taskObj.type == 6 && obj.singleReport ==1)|| (this.clientEnvironmentId == 3 && obj.singleReport ==0 && this.taskObj.type == 6)) {
  272. obj.semiProductList = obj.pickOutInList;
  273. obj.pickOutInList=[]
  274. console.log('赋值了')
  275. }
  276. if (
  277. this.clientEnvironmentId == 3 &&
  278. obj.singleReport == 0 &&
  279. this.taskObj.type != 6
  280. ) {
  281. obj.semiProductList.map((a) => {
  282. a.extInfo.batchReportInfo = [
  283. {
  284. allFeedQuantity: '',
  285. allReportWeight: '',
  286. taskId: '',
  287. taskName: ''
  288. }
  289. ];
  290. a.extInfo.notBatchReportInfo = [
  291. {
  292. allFeedQuantity: '',
  293. notType: '',
  294. taskId: '',
  295. taskName: '',
  296. notReason: ''
  297. }
  298. ];
  299. return {
  300. a
  301. };
  302. });
  303. obj.semiProductList = JSON.parse(
  304. JSON.stringify(obj.semiProductList)
  305. );
  306. }
  307. obj.semiProductList = obj.semiProductList.map(item => {
  308. if(this.taskObj.type != 6){
  309. if (item['extInfo']?.reportWeight) {
  310. item['extInfo'].reportWeight = ''
  311. }
  312. }
  313. console.log(item, 'item')
  314. return item
  315. })
  316. obj.workReportInfo = {
  317. executorTime: null,
  318. formingNum: null,
  319. formingWeight: null,
  320. formedNum: null,
  321. formedWeight: null,
  322. taskId: this.taskObj.id
  323. };
  324. obj.notFormedList = [
  325. {
  326. notFormedNum: null,
  327. notFormedWeight: null,
  328. weightUnit: obj.weightUnit,
  329. unit: obj.unit,
  330. warehouseId: null // 处置 仓库id
  331. }
  332. ];
  333. if (obj.semiProductList.length > 0) {
  334. // 预制体报工
  335. obj.workReportInfo.formedNum = obj.semiProductList.length;
  336. let numCot=0
  337. if(obj.semiProductList.length>0){
  338. obj.semiProductList.map((fitem)=>{
  339. numCot= numCot + fitem.feedQuantity || 1
  340. })
  341. obj.workReportInfo.formedNum = numCot
  342. }
  343. }
  344. obj.workReportInfo.formingNum = obj.formingNum;
  345. obj.workReportInfo.formingWeight = obj.formingWeight;
  346. obj.workReportInfo.unit = obj.unit;
  347. obj.workReportInfo.weightUnit = obj.weightUnit;
  348. obj.workReportInfo.workOrderId = obj.workOrderId;
  349. obj.workReportInfo.executorTime = obj.executorTime
  350. obj.paramDetailList.map((m) => {
  351. if (m.extInfo.textType == 5) {
  352. m.remainingTime = m.extInfo.remainingTime;
  353. }
  354. return {
  355. ...m.extInfo
  356. };
  357. });
  358. console.log(obj, 444);
  359. return {
  360. ...obj
  361. };
  362. });
  363. })
  364. .finally(() => {
  365. this.isLoad = true;
  366. if (this.taskObj.type == 1) {
  367. this.getCacheFn();
  368. }
  369. });
  370. },
  371. openPicking(id, item) {
  372. this.$refs.pickingListRef.open(id, item);
  373. },
  374. allSelection(id, selectList) {
  375. this.List.forEach((m) => {
  376. if (m.workOrderId == id) {
  377. let turnover = [];
  378. let equipmentList = []; // 生产设备
  379. selectList.forEach((f) => {
  380. if (f.rootCategoryLevelId == 4) {
  381. equipmentList = equipmentList.concat(f);
  382. }
  383. if (f.rootCategoryLevelId == 7) {
  384. turnover = turnover.concat(f);
  385. }
  386. });
  387. this.$set(m, 'equipmentList', equipmentList);
  388. this.$set(m, 'turnover', turnover);
  389. this.$forceUpdate();
  390. }
  391. });
  392. },
  393. async save(type) {
  394. console.log('11111',this.List)
  395. this.loading = this.$loading({
  396. lock: true,
  397. text: '加载中',
  398. background: 'rgba(0, 0, 0, 0.7)'
  399. });
  400. let arr = this.List.filter((L) => L.workReportInfo.executorTime)
  401. if (!arr.length) {
  402. this.loading.close();
  403. return this.$message.warning('请选择执行时间');
  404. }
  405. // if(this.taskObj.type !=6){
  406. // if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
  407. // this.loading.close();
  408. // return this.$message.warning('请先投料再报工');
  409. // }
  410. // }
  411. let bol2;
  412. bol2 = this.List.every((e) => {
  413. return (
  414. e.workReportInfo['formedNum'] && e.workReportInfo['formedNum'] != 0
  415. );
  416. });
  417. if (!bol2) {
  418. this.$message.warning('请输入合格品数量');
  419. this.loading.close();
  420. return false;
  421. }
  422. // 预制体
  423. let wId;
  424. let bol = true;
  425. let _i;
  426. this.List.forEach((L) => {
  427. if (
  428. L.semiProductList.length > 0 &&
  429. this.taskObj.type != 4 &&
  430. L.singleReport == 1
  431. ) {
  432. bol = L.semiProductList.every((e, i) => {
  433. _i = i + 1;
  434. wId = L.code;
  435. if (this.taskObj.type == 6) {
  436. return (
  437. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  438. e.extInfo.taskId
  439. );
  440. } else {
  441. if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  442. return (
  443. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  444. e.extInfo.taskId &&
  445. e.extInfo.reportWeight
  446. );
  447. } else {
  448. return (
  449. Object.prototype.hasOwnProperty.call(e.extInfo, 'notType') &&
  450. e.extInfo.notType
  451. );
  452. }
  453. }
  454. });
  455. }
  456. });
  457. // if (!bol) {
  458. // this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
  459. // this.loading.close();
  460. // return false;
  461. // }
  462. if (this.clientEnvironmentId != 2) {
  463. let succ = this.List.some((L) => {
  464. return L.productRecycleList.length > 0;
  465. });
  466. if (succ) {
  467. const isRecycle = await this.checkRecycle();
  468. if (!isRecycle) {
  469. return false;
  470. }
  471. }
  472. }
  473. console.log(this.item, '9999999999');
  474. if (this.taskObj.type == 4 && this.clientEnvironmentId != 3 && this.clientEnvironmentId != 2 && this.List[0].singleReport !== 1) {
  475. this.checkPack();
  476. // if (!isPack) {
  477. // return false
  478. // }
  479. }
  480. console.log('4444444444',this.List)
  481. if (this.taskObj.type == 1) {
  482. const isCache = await this.checkCache(type);
  483. if (!isCache) {
  484. return false;
  485. }
  486. }
  487. if (
  488. this.clientEnvironmentId == 3 &&
  489. type == 2 &&
  490. this.taskObj.type == 6
  491. ) {
  492. this.List.forEach((L) => {
  493. if (L.singleReport == 0) {
  494. L.semiProductList = [];
  495. }
  496. });
  497. console.log('ashsaoghaoghoasg')
  498. }
  499. let isSemiProduct=false
  500. this.List.map((semi)=>{
  501. if(semi.semiProductList.length==0 && semi.singleReport==1 && semi.currentTaskDiagram.isFirstTask==1&&this.clientEnvironmentId!=3){
  502. isSemiProduct=true
  503. this.loading.close();
  504. setTimeout(() => {
  505. this.$message.warning({
  506. message: '请工单编号:' +semi.code+ '先创建在制品',
  507. key: semi.code // 使用当前时间作为key,确保唯一性
  508. });
  509. },500)
  510. }else{
  511. semi.semiProductList.map((ditem)=>{
  512. if(ditem.extInfo.batchReportInfo){
  513. ditem.extInfo.batchReportInfo.map((baItem)=>{
  514. let idvalue=baItem.deviceId?baItem.deviceId.split('/'):''
  515. baItem.deviceId=idvalue?idvalue[0]:''
  516. })
  517. }
  518. if(ditem.extInfo.notBatchReportInfo){
  519. ditem.extInfo.notBatchReportInfo.map((noItem)=>{
  520. let idvalue=noItem.deviceId?noItem.deviceId.split('/'):''
  521. noItem.deviceId=idvalue?idvalue[0]:''
  522. })
  523. }
  524. })
  525. }
  526. })
  527. if(isSemiProduct){
  528. this.loading.close();
  529. return
  530. }
  531. console.log(this.List, 'this.List');
  532. jobSave(this.List)
  533. .then((res) => {
  534. this.loading.close();
  535. this.$message.success('报工成功');
  536. this.getList(this.idsList);
  537. })
  538. .catch(() => {
  539. this.loading.close();
  540. })
  541. .finally(() => {
  542. setTimeout(function () {
  543. // this.loading.close();
  544. }, 3000);
  545. });
  546. },
  547. checkRecycle() {
  548. this.loading.close();
  549. return new Promise((resolve) => {
  550. this.$confirm('是否跳过副产品回收处置!', '提示', {
  551. confirmButtonText: '确定',
  552. cancelButtonText: '取消',
  553. type: 'warning'
  554. })
  555. .then(() => {
  556. resolve(true);
  557. })
  558. .catch(() => {
  559. resolve(false);
  560. });
  561. });
  562. },
  563. checkCache(type) {
  564. return new Promise((resolve) => {
  565. if (type == 1) {
  566. saveCache(this.List).then((rr) => {
  567. this.$message.success('缓存成功');
  568. this.loading.close();
  569. });
  570. resolve(false);
  571. } else if (type == 2) {
  572. resolve(true);
  573. }
  574. });
  575. },
  576. getCacheFn() {
  577. let parma = {
  578. workOrderIds: this.idsList,
  579. taskId: this.taskObj.id,
  580. type: 1
  581. };
  582. getCache(parma).then((res) => {
  583. this.List.forEach((f,index)=>{
  584. res.forEach((o)=>{
  585. if(f.workOrderId==o.workOrderId){
  586. f['product'] = o.extInfo.product
  587. f['workReportInfo'] = o.extInfo.workReportInfo
  588. f['notFormedList'] = o.extInfo.notFormedList
  589. f['turnover'] = o.extInfo.turnover
  590. f['productRecycleList'] = o.extInfo.productRecycleList
  591. f['semiProductList'] = o.extInfo.semiProductList
  592. f['modelList'] = o.extInfo.modelList
  593. // this.$set(this.List[index].workReportInfo,'executorTime',timestampToDateTime(o.extInfo.workReportInfo.executorTime))
  594. this.$forceUpdate();
  595. }
  596. })
  597. })
  598. });
  599. },
  600. removeCacheFn(type) {
  601. this.$confirm('是否清空缓存', '缓存')
  602. .then(() => {
  603. let parma = {
  604. workOrderIds: type == 'all' ? this.idsList : [type],
  605. taskId: this.taskObj.id,
  606. type: 1
  607. };
  608. removeCache(parma).then((res) => {
  609. this.$message.success('已经清空缓存');
  610. this.getList(this.idsList);
  611. });
  612. })
  613. .catch(() => { });
  614. },
  615. getWarehouseListFn() {
  616. getWarehouseList().then((res) => {
  617. this.warehouseList = res.data;
  618. });
  619. },
  620. //批量报工合格不合格重量统计
  621. countNumPl(list,index){
  622. console.log('11111122222333',list)
  623. //合格总数
  624. let formedNumCount=0
  625. //合格总重量
  626. let formedWeightCount=0
  627. //不合格总数
  628. let notFormedNumCount=0
  629. //不合格总重量
  630. let notFormedWeightCount=0
  631. list.map((item=>{
  632. //合格总数
  633. item.extInfo.batchReportInfo.forEach((m) => {
  634. formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
  635. });
  636. //合格总重量
  637. item.extInfo.batchReportInfo.forEach((w) => {
  638. formedWeightCount = formedWeightCount + Number(w.allReportWeight || 0);
  639. });
  640. //不合格总数
  641. item.extInfo.notBatchReportInfo.forEach((nf) => {
  642. notFormedNumCount = notFormedNumCount + Number(nf.allFeedQuantity || 0);
  643. });
  644. //不合格总重量
  645. item.extInfo.notBatchReportInfo.forEach((nw) => {
  646. notFormedWeightCount = notFormedWeightCount + Number(nw.allReportWeight || 0);
  647. });
  648. }))
  649. this.$set(this.List[index].workReportInfo,'formedNum',formedNumCount);//合格总数
  650. this.$set(this.List[index].workReportInfo,'formedWeight',formedWeightCount);//合格总重量
  651. this.$set(this.List[index].workReportInfo,'notFormedNum',notFormedNumCount);//不合格总数
  652. this.$set(this.List[index].workReportInfo,'notFormedWeight',notFormedWeightCount);//不合格总重量
  653. }
  654. }
  655. };
  656. </script>
  657. <style scoped lang="scss">
  658. .top_fixed {
  659. width: 100%;
  660. height: 40px;
  661. background: #fff;
  662. display: flex;
  663. align-items: center;
  664. justify-content: flex-end;
  665. }
  666. .title_box {
  667. padding: 10px 0;
  668. .name {
  669. font-size: 14px;
  670. font-style: normal;
  671. font-weight: 400;
  672. color: #157a2c;
  673. padding-left: 5px;
  674. position: relative;
  675. &:before {
  676. position: absolute;
  677. content: '';
  678. left: 0px;
  679. top: 0px;
  680. bottom: 0px;
  681. width: 2px;
  682. height: 14px;
  683. background: #157a2c;
  684. margin: auto;
  685. }
  686. }
  687. }
  688. .job_box {
  689. margin-top: 6px;
  690. width: 100%;
  691. height: calc(100vh - 70px - 50px - 80px - 60px);
  692. overflow-y: scroll;
  693. overflow-x: hidden;
  694. }
  695. .card_box {
  696. background: #fff;
  697. padding: 8px;
  698. border-radius: 2px;
  699. }
  700. </style>