index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  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" ref="jobBomRef" :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. if ((this.taskObj.type == 6 && obj.singleReport ==1)|| (this.clientEnvironmentId == 3 && obj.singleReport ==0 && this.taskObj.type == 6)) {
  271. obj.semiProductList = obj.pickOutInList;
  272. obj.pickOutInList=[]
  273. console.log('赋值了')
  274. }
  275. if (
  276. this.clientEnvironmentId == 3 &&
  277. obj.singleReport == 0 &&
  278. this.taskObj.type != 6
  279. ) {
  280. obj.semiProductList.map((a) => {
  281. a.extInfo.batchReportInfo = [
  282. {
  283. allFeedQuantity: '',
  284. allReportWeight: '',
  285. taskId: '',
  286. taskName: ''
  287. }
  288. ];
  289. a.extInfo.notBatchReportInfo = [
  290. {
  291. allFeedQuantity: '',
  292. notType: '',
  293. taskId: '',
  294. taskName: '',
  295. notReason: ''
  296. }
  297. ];
  298. return {
  299. a
  300. };
  301. });
  302. obj.semiProductList = JSON.parse(
  303. JSON.stringify(obj.semiProductList)
  304. );
  305. }
  306. obj.semiProductList = obj.semiProductList.map(item => {
  307. if(this.taskObj.type != 6){
  308. if (item['extInfo']?.reportWeight) {
  309. item['extInfo'].reportWeight = ''
  310. }
  311. }
  312. console.log(item, 'item')
  313. return item
  314. })
  315. obj.workReportInfo = {
  316. executorTime: null,
  317. formingNum: null,
  318. formingWeight: null,
  319. formedNum: null,
  320. formedWeight: null,
  321. taskId: this.taskObj.id,
  322. notFormedNum:null,
  323. notFormedWeigh:null
  324. };
  325. obj.notFormedList = [
  326. {
  327. notFormedNum: null,
  328. notFormedWeight: null,
  329. weightUnit: obj.weightUnit,
  330. unit: obj.unit,
  331. warehouseId: null // 处置 仓库id
  332. }
  333. ];
  334. if (obj.semiProductList.length > 0) {
  335. // 预制体报工
  336. obj.workReportInfo.formedNum = obj.semiProductList.length;
  337. let numCot=0
  338. if(obj.semiProductList.length>0){
  339. obj.semiProductList.map((fitem)=>{
  340. numCot= numCot + fitem.feedQuantity || 1
  341. })
  342. obj.workReportInfo.formedNum = numCot
  343. }
  344. }
  345. obj.workReportInfo.formingNum = obj.formingNum;
  346. obj.workReportInfo.formingWeight = obj.formingWeight;
  347. obj.workReportInfo.unit = obj.unit;
  348. obj.workReportInfo.weightUnit = obj.weightUnit;
  349. obj.workReportInfo.workOrderId = obj.workOrderId;
  350. obj.workReportInfo.executorTime = obj.executorTime
  351. obj.paramDetailList.map((m) => {
  352. if (m.extInfo.textType == 5) {
  353. m.remainingTime = m.extInfo.remainingTime;
  354. }
  355. return {
  356. ...m.extInfo
  357. };
  358. });
  359. console.log(obj, 4445555);
  360. if(this.taskObj.type == 4 && obj.singleReport ==0){
  361. let numVal=0
  362. obj.pickOutInList.map(item=>{
  363. numVal=numVal+item.feedQuantity
  364. })
  365. obj.workReportInfo.formedNum = numVal
  366. }
  367. return {
  368. ...obj
  369. };
  370. });
  371. })
  372. .finally(() => {
  373. this.isLoad = true;
  374. if (this.taskObj.type == 1) {
  375. this.getCacheFn();
  376. }
  377. });
  378. },
  379. openPicking(id, item) {
  380. this.$refs.pickingListRef.open(id, item);
  381. },
  382. allSelection(id, selectList) {
  383. this.List.forEach((m) => {
  384. if (m.workOrderId == id) {
  385. let turnover = [];
  386. let equipmentList = []; // 生产设备
  387. selectList.forEach((f) => {
  388. if (f.rootCategoryLevelId == 4) {
  389. equipmentList = equipmentList.concat(f);
  390. }
  391. if (f.rootCategoryLevelId == 7) {
  392. turnover = turnover.concat(f);
  393. }
  394. });
  395. this.$set(m, 'equipmentList', equipmentList);
  396. this.$set(m, 'turnover', turnover);
  397. this.$forceUpdate();
  398. }
  399. });
  400. },
  401. async save(type) {
  402. console.log('11111',this.List)
  403. this.loading = this.$loading({
  404. lock: true,
  405. text: '加载中',
  406. background: 'rgba(0, 0, 0, 0.7)'
  407. });
  408. let arr = this.List.filter((L) => L.workReportInfo.executorTime)
  409. if (!arr.length) {
  410. this.loading.close();
  411. return this.$message.warning('请选择执行时间');
  412. }
  413. // if(this.taskObj.type !=6){
  414. // if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
  415. // this.loading.close();
  416. // return this.$message.warning('请先投料再报工');
  417. // }
  418. // }
  419. let bol2;
  420. bol2 = this.List.every((e) => {
  421. return (
  422. e.workReportInfo['formedNum'] && e.workReportInfo['formedNum'] != 0
  423. );
  424. });
  425. if (!bol2) {
  426. this.$message.warning('请输入合格品数量');
  427. this.loading.close();
  428. return false;
  429. }
  430. // 预制体
  431. let wId;
  432. let bol = true;
  433. let _i;
  434. this.List.forEach((L) => {
  435. if (
  436. L.semiProductList.length > 0 &&
  437. this.taskObj.type != 4 &&
  438. L.singleReport == 1
  439. ) {
  440. bol = L.semiProductList.every((e, i) => {
  441. _i = i + 1;
  442. wId = L.code;
  443. if (this.taskObj.type == 6) {
  444. return (
  445. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  446. e.extInfo.taskId
  447. );
  448. } else {
  449. if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  450. return (
  451. Object.prototype.hasOwnProperty.call(e.extInfo, 'taskId') &&
  452. e.extInfo.taskId &&
  453. e.extInfo.reportWeight
  454. );
  455. } else {
  456. return (
  457. Object.prototype.hasOwnProperty.call(e.extInfo, 'notType') &&
  458. e.extInfo.notType
  459. );
  460. }
  461. }
  462. });
  463. }
  464. });
  465. // if (!bol) {
  466. // this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
  467. // this.loading.close();
  468. // return false;
  469. // }
  470. if (this.clientEnvironmentId != 2) {
  471. let succ = this.List.some((L) => {
  472. return L.productRecycleList.length > 0;
  473. });
  474. if (succ) {
  475. const isRecycle = await this.checkRecycle();
  476. if (!isRecycle) {
  477. return false;
  478. }
  479. }
  480. }
  481. console.log(this.item, '9999999999');
  482. if (this.taskObj.type == 4 && this.clientEnvironmentId != 3 && this.clientEnvironmentId != 2 && this.List[0].singleReport !== 1) {
  483. this.checkPack();
  484. // if (!isPack) {
  485. // return false
  486. // }
  487. }
  488. console.log('4444444444',this.List)
  489. if (this.taskObj.type == 1) {
  490. const isCache = await this.checkCache(type);
  491. if (!isCache) {
  492. return false;
  493. }
  494. }
  495. if (
  496. this.clientEnvironmentId == 3 &&
  497. type == 2 &&
  498. this.taskObj.type == 6
  499. ) {
  500. this.List.forEach((L) => {
  501. if (L.singleReport == 0) {
  502. L.semiProductList = [];
  503. }
  504. });
  505. console.log('ashsaoghaoghoasg')
  506. }
  507. let isSemiProduct=false
  508. this.List.map((semi)=>{
  509. if(semi.semiProductList.length==0 && semi.singleReport==1 && semi.currentTaskDiagram.isFirstTask==1&&this.clientEnvironmentId!=3){
  510. isSemiProduct=true
  511. this.loading.close();
  512. setTimeout(() => {
  513. this.$message.warning({
  514. message: '请工单编号:' +semi.code+ '先创建在制品',
  515. key: semi.code // 使用当前时间作为key,确保唯一性
  516. });
  517. },500)
  518. }
  519. if(semi.semiProductList.length==0 && semi.singleReport==0){
  520. semi.semiProductList.map((ditem)=>{
  521. if(ditem.extInfo.batchReportInfo){
  522. ditem.extInfo.batchReportInfo.map((baItem)=>{
  523. let idvalue=baItem.deviceId?baItem.deviceId.split('/'):''
  524. baItem.deviceId=idvalue?idvalue[0]:''
  525. })
  526. }
  527. if(ditem.extInfo.notBatchReportInfo){
  528. ditem.extInfo.notBatchReportInfo.map((noItem)=>{
  529. let idvalue=noItem.deviceId?noItem.deviceId.split('/'):''
  530. noItem.deviceId=idvalue?idvalue[0]:''
  531. })
  532. }
  533. })
  534. }
  535. })
  536. if(isSemiProduct){
  537. this.loading.close();
  538. return
  539. }
  540. console.log(this.List, 'this.List');
  541. jobSave(this.List)
  542. .then((res) => {
  543. this.loading.close();
  544. this.$message.success('报工成功');
  545. this.getList(this.idsList);
  546. })
  547. .catch(() => {
  548. this.loading.close();
  549. })
  550. .finally(() => {
  551. setTimeout(function () {
  552. // this.loading.close();
  553. }, 3000);
  554. });
  555. },
  556. checkRecycle() {
  557. this.loading.close();
  558. return new Promise((resolve) => {
  559. this.$confirm('是否跳过副产品回收处置!', '提示', {
  560. confirmButtonText: '确定',
  561. cancelButtonText: '取消',
  562. type: 'warning'
  563. })
  564. .then(() => {
  565. resolve(true);
  566. })
  567. .catch(() => {
  568. resolve(false);
  569. });
  570. });
  571. },
  572. checkCache(type) {
  573. return new Promise((resolve) => {
  574. if (type == 1) {
  575. saveCache(this.List).then((rr) => {
  576. this.$message.success('缓存成功');
  577. this.loading.close();
  578. });
  579. resolve(false);
  580. } else if (type == 2) {
  581. resolve(true);
  582. }
  583. });
  584. },
  585. getCacheFn() {
  586. let parma = {
  587. workOrderIds: this.idsList,
  588. taskId: this.taskObj.id,
  589. type: 1
  590. };
  591. getCache(parma).then((res) => {
  592. this.List.forEach((f,index)=>{
  593. res.forEach((o)=>{
  594. if(f.workOrderId==o.workOrderId){
  595. f['product'] = o.extInfo.product
  596. f['workReportInfo'] = o.extInfo.workReportInfo
  597. f['notFormedList'] = o.extInfo.notFormedList
  598. f['turnover'] = o.extInfo.turnover
  599. f['productRecycleList'] = o.extInfo.productRecycleList
  600. f['semiProductList'] = o.extInfo.semiProductList
  601. f['modelList'] = o.extInfo.modelList
  602. // this.$set(this.List[index].workReportInfo,'executorTime',timestampToDateTime(o.extInfo.workReportInfo.executorTime))
  603. this.$forceUpdate();
  604. }
  605. })
  606. })
  607. });
  608. },
  609. removeCacheFn(type) {
  610. this.$confirm('是否清空缓存', '缓存')
  611. .then(() => {
  612. let parma = {
  613. workOrderIds: type == 'all' ? this.idsList : [type],
  614. taskId: this.taskObj.id,
  615. type: 1
  616. };
  617. removeCache(parma).then((res) => {
  618. this.$message.success('已经清空缓存');
  619. this.getList(this.idsList);
  620. });
  621. })
  622. .catch(() => { });
  623. },
  624. getWarehouseListFn() {
  625. getWarehouseList().then((res) => {
  626. this.warehouseList = res.data;
  627. });
  628. },
  629. //批量报工合格不合格重量统计
  630. countNumPl(list,index){
  631. console.log('11111122222333',list)
  632. //合格总数
  633. let formedNumCount=0
  634. //合格总重量
  635. let formedWeightCount=0
  636. //不合格总数
  637. let notFormedNumCount=0
  638. //不合格总重量
  639. let notFormedWeightCount=0
  640. list.map((item=>{
  641. //合格总数
  642. item.extInfo.batchReportInfo.forEach((m) => {
  643. formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
  644. });
  645. //合格总重量
  646. item.extInfo.batchReportInfo.forEach((w) => {
  647. formedWeightCount = formedWeightCount + Number(w.allReportWeight || 0);
  648. });
  649. //不合格总数
  650. item.extInfo.notBatchReportInfo.forEach((nf) => {
  651. notFormedNumCount = notFormedNumCount + Number(nf.allFeedQuantity || 0);
  652. });
  653. //不合格总重量
  654. item.extInfo.notBatchReportInfo.forEach((nw) => {
  655. notFormedWeightCount = notFormedWeightCount + Number(nw.allReportWeight || 0);
  656. });
  657. }))
  658. this.$set(this.List[index].workReportInfo,'formedNum',formedNumCount);//合格总数
  659. this.$set(this.List[index].workReportInfo,'formedWeight',formedWeightCount);//合格总重量
  660. this.$set(this.List[index].workReportInfo,'notFormedNum',notFormedNumCount);//不合格总数
  661. this.$set(this.List[index].workReportInfo,'notFormedWeight',notFormedWeightCount);//不合格总重量
  662. }
  663. }
  664. };
  665. </script>
  666. <style scoped lang="scss">
  667. .top_fixed {
  668. width: 100%;
  669. height: 40px;
  670. background: #fff;
  671. display: flex;
  672. align-items: center;
  673. justify-content: flex-end;
  674. }
  675. .title_box {
  676. padding: 10px 0;
  677. .name {
  678. font-size: 14px;
  679. font-style: normal;
  680. font-weight: 400;
  681. color: #157a2c;
  682. padding-left: 5px;
  683. position: relative;
  684. &:before {
  685. position: absolute;
  686. content: '';
  687. left: 0px;
  688. top: 0px;
  689. bottom: 0px;
  690. width: 2px;
  691. height: 14px;
  692. background: #157a2c;
  693. margin: auto;
  694. }
  695. }
  696. }
  697. .job_box {
  698. margin-top: 6px;
  699. width: 100%;
  700. height: calc(100vh - 70px - 50px - 80px - 60px);
  701. overflow-y: scroll;
  702. overflow-x: hidden;
  703. }
  704. .card_box {
  705. background: #fff;
  706. padding: 8px;
  707. border-radius: 2px;
  708. }
  709. </style>