index.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633
  1. <template>
  2. <!-- 报工页面 -->
  3. <view class="content-box">
  4. <uni-nav-bar
  5. fixed="true"
  6. statusBar="true"
  7. left-icon="back"
  8. :title="title"
  9. background-color="#F7F9FA"
  10. color="#000"
  11. @clickLeft="back"
  12. right-icon="scan"
  13. @clickRight="HandlScanCode"
  14. >
  15. </uni-nav-bar>
  16. <view class="list_box">
  17. <u-list @scrolltolower="scrolltolower">
  18. <view class="card_box">
  19. <!-- 工单信息 objData 报告信息-->
  20. <workOrderBom
  21. :item="objData"
  22. v-if="Object.keys(objData.workReportInfo).length != 0"
  23. pType="job"
  24. :taskType="taskType"
  25. @handleScan="handleScan"
  26. :isReportWork="true"
  27. >
  28. </workOrderBom>
  29. <paramBom
  30. v-if="paramDetailList.length != 0"
  31. :list="paramDetailList"
  32. ></paramBom>
  33. <!-- 设备信息 -->
  34. <deviceBom
  35. v-if="objData.equipmentList.length != 0"
  36. :list="objData.equipmentList"
  37. :ishuoWei="false"
  38. :wordItem="objData"
  39. :isDetails="true"
  40. >
  41. </deviceBom>
  42. <modelBom
  43. v-if="objData.modelList.length != 0"
  44. :list="objData.modelList"
  45. pattern="job"
  46. ref="modelRef"
  47. >
  48. </modelBom>
  49. <!-- 1报工信息 -->
  50. <!-- <view v-if="clientEnvironmentId == 3">
  51. <view v-if="objData.singleReport !== 1">
  52. <jobBom
  53. v-if="isLoad"
  54. :item="objData"
  55. ref="jobReftg"
  56. :notFormed="objData.notFormedList"
  57. @penalize="penalize"
  58. @modeNum="modeNum"
  59. ></jobBom>
  60. </view>
  61. </view> -->
  62. <!-- <view>3333</view> -->
  63. <!-- <view v-if=""></view> -->
  64. <!-- 单独报工报工信息 -->
  65. <!-- single -->
  66. <singleJobBom
  67. v-if="objData.singleReport == 1"
  68. :item="objData"
  69. ref="jobRef"
  70. :notFormed="objData.notFormedList"
  71. @penalize="penalize"
  72. @modeNum="modeNum"
  73. ></singleJobBom>
  74. <!-- 批量报工 -->
  75. <batchJobBom
  76. v-else-if="
  77. objData.currentTaskDiagram &&
  78. objData.currentTaskDiagram.type &&
  79. objData.singleReport == 0 &&
  80. clientEnvironmentId != 3
  81. "
  82. :item="objData"
  83. ref="jobRef"
  84. :notFormed="objData.notFormedList"
  85. :currentTask="objData.currentTaskDiagram"
  86. @penalize="penalize"
  87. @modeNum="modeNum"
  88. ></batchJobBom>
  89. <!-- <batchJobBom
  90. v-if="
  91. objData.currentTaskDiagram &&
  92. objData.currentTaskDiagram.type &&
  93. objData.singleReport == 0
  94. "
  95. :item="objData"
  96. ref="jobRef"
  97. :notFormed="objData.notFormedList"
  98. :currentTask="objData.currentTaskDiagram"
  99. @penalize="penalize"
  100. @modeNum="modeNum"
  101. ></batchJobBom> -->
  102. <palletBom
  103. v-if="objData.palletList.length != 0"
  104. :palletList="objData.palletList"
  105. ></palletBom>
  106. <revolvingDiskBom
  107. v-if="isLoad && objData.revolvingDiskList.length > 0"
  108. pattern="job"
  109. :revolvingDiskList="objData.revolvingDiskList"
  110. ></revolvingDiskBom>
  111. <!-- <oneJobBom
  112. v-if='objData.instanceList && objData.instanceList.length != 0 && taskType != 4 && taskType != 6'
  113. :item='objData' :list='objData.instanceList'>
  114. </oneJobBom> -->
  115. <!-- -->
  116. <!-- 报工信息 列表 -->
  117. <!-- <view v-if="clientEnvironmentId != 3 && objData.singleReport == 1">
  118. <semiProductJobBom
  119. v-if="
  120. objData.semiProductList &&
  121. objData.semiProductList.length != 0 &&
  122. taskType != 4 &&
  123. taskType != 6 &&
  124. objData.singleReport == 1
  125. "
  126. :item="objData"
  127. :list="objData.semiProductList"
  128. :equipmentList="objData.equipmentList"
  129. @weightEmit="weightEmit"
  130. >
  131. </semiProductJobBom>
  132. </view> -->
  133. <!-- <view v-if="this.objData.singleReport">
  134. </view> -->
  135. <semiProductJobBomPL
  136. v-if="
  137. objData.semiProductList &&
  138. objData.semiProductList.length != 0 &&
  139. taskType != 4 &&
  140. taskType != 6 &&
  141. objData.singleReport == 0 &&
  142. clientEnvironmentId == 3
  143. "
  144. :item="objData"
  145. :list="objData.semiProductList"
  146. ref="jobReftg"
  147. :equipmentList="objData.equipmentList"
  148. @countNumPl="countNumPl"
  149. >
  150. </semiProductJobBomPL>
  151. <!-- <oneJobQualityBom
  152. v-if="
  153. objData.semiProductList &&
  154. objData.semiProductList.length != 0 &&
  155. taskType == 6 &&
  156. clientEnvironmentId == 3 &&
  157. objData.singleReport == 1
  158. "
  159. :item="objData"
  160. :list="objData.semiProductList"
  161. @weightEmit="weightEmit"
  162. ></oneJobQualityBom> -->
  163. <oneJobQualityBomPL
  164. v-if="
  165. objData.semiProductList &&
  166. objData.semiProductList.length != 0 &&
  167. taskType == 6 &&
  168. clientEnvironmentId == 3 &&
  169. objData.singleReport == 0
  170. "
  171. :item="objData"
  172. :list="objData.semiProductList"
  173. ></oneJobQualityBomPL>
  174. <!-- 副产品 -->
  175. <byProductBom
  176. v-if="objData.productRecycleList.length != 0"
  177. :list="objData.productRecycleList"
  178. @penalize="penalize"
  179. >
  180. </byProductBom>
  181. <!-- 周转车 -->
  182. <turnoverBom
  183. v-if="objData.turnover.length != 0"
  184. :list="objData.turnover"
  185. :itemValue="objData"
  186. :wordItem="objData"
  187. pattern="job"
  188. @handleScan="handleScan"
  189. @formedNumFn="formedNumFn"
  190. >
  191. </turnoverBom>
  192. <!-- // 区域扫码 -->
  193. <aridRegion
  194. v-if="objData.aridRegionList.length != 0"
  195. :list="objData.aridRegionList"
  196. :remainingTime="remainingTime"
  197. @handleScan="handleScan"
  198. :isType="true"
  199. ></aridRegion>
  200. <!-- //包装扫码 -->
  201. <!-- <view v-if="clientEnvironmentId != 2 && objData.singleReport !== 1">
  202. <packingBom
  203. :taskId="taskId"
  204. :workOrderId="id"
  205. :objData="objData"
  206. ref="packRef"
  207. v-if="taskType == 4 && clientEnvironmentId != 3 && objData"
  208. :categoryId="categoryId"
  209. >
  210. </packingBom>
  211. </view> -->
  212. <!-- 通用包装 -->
  213. <view v-if="clientEnvironmentId != 3">
  214. <packingBom
  215. :taskId="taskId"
  216. :workOrderId="id"
  217. :objData="objData"
  218. ref="packRef"
  219. v-if="taskType == 4 && clientEnvironmentId != 3 && objData"
  220. :categoryId="categoryId"
  221. >
  222. </packingBom>
  223. </view>
  224. <div
  225. v-if="
  226. objData &&
  227. taskType == 4 &&
  228. clientEnvironmentId == 3 &&
  229. objData.singleReport == 0
  230. "
  231. >
  232. <packingBom
  233. :taskId="taskId"
  234. :workOrderId="id"
  235. :objData="objData"
  236. ref="packRef"
  237. v-if="taskType == 4 && objData"
  238. :categoryId="categoryId"
  239. >
  240. </packingBom>
  241. </div>
  242. <!-- 碳谷 包装扫码 -->
  243. <!-- <packingTgBom
  244. v-if="
  245. objData.pickOutInList &&
  246. objData.pickOutInList.length != 0 &&
  247. taskType == 4 &&
  248. clientEnvironmentId == 3
  249. "
  250. :list="objData.pickOutInList"
  251. :objData="objData"
  252. :item="objData"
  253. ></packingTgBom> -->
  254. <view class="operate_box rx-sc">
  255. <u-button
  256. size="small"
  257. class="u-reset-button"
  258. type="success"
  259. @click="handAdd"
  260. >手动添加</u-button
  261. >
  262. </view>
  263. <view style="height: 100rpx"></view>
  264. </view>
  265. </u-list>
  266. </view>
  267. <view :class="[operateBtn ? 'flex_btn' : 'flex_btn2']">
  268. <image
  269. v-if="operateBtn"
  270. class="jiantou"
  271. src="../../../../static/rightJt.png"
  272. @click="operateBtn = false"
  273. >
  274. </image>
  275. <view class="close_box" @click="operateBtn = true">
  276. <image
  277. v-if="!operateBtn"
  278. class="close"
  279. src="../../../../static/close.png"
  280. ></image>
  281. </view>
  282. <view v-if="!operateBtn" @click="removeCacheFn()">清空缓存</view>
  283. <view v-if="!operateBtn" @click="switchOrder = true">切换工单</view>
  284. </view>
  285. <view class="bottom-wrapper">
  286. <view class="btn_box" @click="save(1)">缓存</view>
  287. <view class="btn_box" @click="save(2)">一键报工</view>
  288. </view>
  289. <SearchPopup mode="bottom" v-if="searchShow">
  290. <template v-slot:list>
  291. <view class="search_list">
  292. <u-form
  293. labelPosition="left"
  294. :model="formData"
  295. labelWidth="180"
  296. labelAlign="left"
  297. class="baseForm"
  298. >
  299. <u-form-item
  300. label="仓库:"
  301. class="required-form"
  302. borderBottom
  303. prop="warehouseId"
  304. >
  305. <zxz-uni-data-select
  306. :localdata="warehouseList"
  307. v-model="formData.warehouseId"
  308. dataValue="id"
  309. dataKey="name"
  310. filterable
  311. format="{name}"
  312. ></zxz-uni-data-select>
  313. </u-form-item>
  314. </u-form>
  315. </view>
  316. </template>
  317. <template v-slot:operate>
  318. <view class="operate_box rx-bc">
  319. <u-button size="small" class="u-reset-button" @click="searchCancel">
  320. 取消
  321. </u-button>
  322. <u-button
  323. type="success"
  324. size="small"
  325. class="u-reset-button"
  326. @click="popupOk"
  327. >
  328. 确定
  329. </u-button>
  330. </view>
  331. </template>
  332. </SearchPopup>
  333. <SearchPopup mode="center" v-if="switchOrder">
  334. <template v-slot:list>
  335. <view class="search_list2">
  336. <u-form
  337. labelPosition="left"
  338. :model="formData"
  339. labelWidth="180"
  340. labelAlign="left"
  341. class="baseForm"
  342. >
  343. <u-form-item
  344. label="工单:"
  345. class="required-form"
  346. borderBottom
  347. prop="warehouseId"
  348. >
  349. <zxz-uni-data-select
  350. :localdata="warehouseList"
  351. v-model="formData.warehouseId"
  352. dataValue="id"
  353. dataKey="name"
  354. filterable
  355. format="{name}"
  356. ></zxz-uni-data-select>
  357. </u-form-item>
  358. </u-form>
  359. </view>
  360. </template>
  361. <template v-slot:operate>
  362. <view class="operate_box rx-bc">
  363. <u-button
  364. size="small"
  365. class="u-reset-button"
  366. @click="switchOrder = false"
  367. >
  368. 取消
  369. </u-button>
  370. <u-button type="success" size="small" class="u-reset-button">
  371. 确定
  372. </u-button>
  373. </view>
  374. </template>
  375. </SearchPopup>
  376. <view>
  377. <uni-popup ref="alertDialog" type="dialog">
  378. <uni-popup-dialog
  379. type="warning"
  380. cancelText="取消"
  381. confirmText="确定"
  382. title="提示"
  383. :content="titleText"
  384. @confirm="dialogConfirm"
  385. @close="dialogClose"
  386. ></uni-popup-dialog>
  387. </uni-popup>
  388. </view>
  389. </view>
  390. </template>
  391. <script>
  392. import {
  393. getByIdReport,
  394. outSourceGetByIdReport,
  395. getByCodeReport,
  396. jobSave,
  397. checkReportNumber,
  398. } from "@/api/pda/jobBooking.js";
  399. import {
  400. scanLedger,
  401. getWarehouseList,
  402. saveCache,
  403. getCache,
  404. removeCache,
  405. } from "@/api/pda/workOrder.js";
  406. import workOrderBom from "../../feeding/components/workOrderBom.vue";
  407. import deviceBom from "../../feeding/components/deviceBom.vue";
  408. import modelBom from "../../feeding/components/modelBom.vue";
  409. import jobBom from "../components/jobBom.vue";
  410. import singleJobBom from "../components/singleJobBom.vue";
  411. import palletBom from "../components/palletBom.vue";
  412. import oneJobBom from "../components/oneJobBom.vue";
  413. import semiProductJobBom from "../components/semiProductJobBom.vue";
  414. import semiProductJobBomPL from "../components/semiProductJobBomPL.vue";
  415. import byProductBom from "../components/byProductBom";
  416. import turnoverBom from "../components/turnoverBom.vue";
  417. import aridRegion from "../../feeding/components/aridRegion.vue";
  418. import paramBom from "../../feeding/components/paramBom.vue";
  419. import packingBom from "../components/packingBom.vue";
  420. import packingTgBom from "../components/packingTgBom";
  421. import revolvingDiskBom from "../../feeding/components/revolvingDiskBom.vue";
  422. import SearchPopup from "../../components/searchPopup.vue";
  423. import oneJobQualityBom from "../components/oneJobQualityBom.vue";
  424. import oneJobQualityBomPL from "../components/oneJobQualityBomPL.vue";
  425. import batchJobBom from "../components/batchJobBom.vue";
  426. import workInProgressList from "../components/workInProgressList.vue";
  427. export default {
  428. components: {
  429. workOrderBom,
  430. deviceBom,
  431. modelBom,
  432. jobBom,
  433. singleJobBom,
  434. palletBom,
  435. oneJobBom,
  436. semiProductJobBom,
  437. semiProductJobBomPL,
  438. byProductBom,
  439. turnoverBom,
  440. aridRegion,
  441. paramBom,
  442. packingBom,
  443. packingTgBom,
  444. revolvingDiskBom,
  445. SearchPopup,
  446. oneJobQualityBom,
  447. oneJobQualityBomPL,
  448. batchJobBom,
  449. workInProgressList,
  450. },
  451. data() {
  452. return {
  453. title: "",
  454. taskType: 1,
  455. isLoad: true,
  456. categoryId: "",
  457. objData: {
  458. formedNumLast: 0,
  459. product: [],
  460. equipmentList: [],
  461. modelList: [],
  462. turnover: [],
  463. productRecycleList: [],
  464. aridRegionList: [],
  465. palletList: [],
  466. workReportInfo: {},
  467. executorTime: "",
  468. notFormedList: [], // 报工-不合格
  469. },
  470. searchShow: false,
  471. switchOrder: false,
  472. warehouseList: [],
  473. formData: {
  474. warehouseId: "",
  475. },
  476. penalizeIndex: null,
  477. paramDetailList: [],
  478. remainingTime: 0,
  479. id: null,
  480. taskId: null,
  481. clientEnvironmentId:
  482. uni.getStorageSync("userInfo") &&
  483. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  484. operateBtn: true,
  485. isOutsource: 0,
  486. titleText: "",
  487. };
  488. },
  489. onLoad(options) {
  490. console.log(options, "optionsoptions");
  491. this.info = options.info;
  492. this.title = options.taskName ? options.taskName + "-报工" : "报工";
  493. this.taskType = options.taskType;
  494. this.id = options.id;
  495. this.taskId = options.taskId;
  496. this.isOutsource = options.isOutsource;
  497. this.categoryId = options.categoryId;
  498. this.singleReport = options.singleReport; // 单个报工 1是单 2多
  499. this.getList();
  500. },
  501. onShow() {
  502. uni.$off("setSelectList");
  503. uni.$on("setSelectList", (selectList, id) => {
  504. let turnover = [];
  505. let equipmentList = []; // 生产设备
  506. let isEquipment = this.objData.equipmentList.length > 0 ? true : false; // 判断是否有设置
  507. selectList.forEach((f) => {
  508. if (f.rootCategoryLevelId == 4) {
  509. // 生产设备
  510. if (isEquipment) {
  511. equipmentList = this.objData.equipmentList;
  512. } else {
  513. equipmentList = equipmentList.concat(f);
  514. }
  515. }
  516. if (f.rootCategoryLevelId == 7) {
  517. // 周转车
  518. turnover = turnover.concat(f);
  519. }
  520. });
  521. this.$set(this.objData, "equipmentList", equipmentList);
  522. this.$set(this.objData, "turnover", turnover);
  523. this.$forceUpdate();
  524. });
  525. },
  526. methods: {
  527. weightEmit(formedWeight, notFormedWeight) {
  528. this.$refs.jobReftg.fWeightInput(formedWeight, notFormedWeight);
  529. this.$nextTick(() => {
  530. this.$set(this.objData.workReportInfo, "formedWeight", formedWeight);
  531. this.$set(
  532. this.objData.workReportInfo,
  533. "notFormedWeight",
  534. notFormedWeight
  535. );
  536. });
  537. this.$forceUpdate();
  538. },
  539. // 相机扫码
  540. HandlScanCode() {
  541. uni.scanCode({
  542. success: (res) => {
  543. this.scanItAllData(res.result);
  544. },
  545. });
  546. },
  547. scanItAllData(result) {
  548. scanLedger(result).then((res) => {
  549. if (res[0].rootCategoryLevelId == 4) {
  550. // 设备
  551. let isFals = this.objData.equipmentList.some((m) => m.code == result);
  552. if (isFals) {
  553. uni.showToast({
  554. title: "设备已存在",
  555. icon: "none",
  556. });
  557. return false;
  558. }
  559. this.objData.equipmentList.push(res[0]);
  560. this.$forceUpdate();
  561. }
  562. if (res.length >= 1 && res[0].rootCategoryLevelId == 5) {
  563. // 磨具
  564. if (this.objData.modelList.length == 0) {
  565. this.objData.modelList = res;
  566. this.$forceUpdate();
  567. } else {
  568. if (this.objData.modelList[0].instanceId != res[0].instanceId) {
  569. uni.showToast({
  570. title: "模具不匹配",
  571. icon: "none",
  572. });
  573. } else {
  574. uni.showToast({
  575. title: "设备匹配成功",
  576. icon: "none",
  577. });
  578. }
  579. }
  580. } else if (res.length == 1 && res[0].rootCategoryLevelId == 7) {
  581. // 周转车
  582. let isFals = this.objData.turnover.some((m) => m.code == result);
  583. if (isFals) {
  584. uni.showToast({
  585. title: "周转车已存在",
  586. icon: "none",
  587. });
  588. return false;
  589. }
  590. this.objData.turnover.push(res[0]);
  591. this.$forceUpdate();
  592. }
  593. });
  594. },
  595. handleScan(id, type) {
  596. uni.scanCode({
  597. success: (res) => {
  598. this.scanData(res.result, type, id);
  599. },
  600. });
  601. },
  602. scanData(result, type, id) {
  603. if (type == "wordOrder") {
  604. getByCodeReport(result, this.taskId).then((res) => {
  605. this.objData = res;
  606. if (!this.objData.hasOwnProperty("turnover")) {
  607. this.objData["turnover"] = [];
  608. }
  609. if (!this.objData.hasOwnProperty("aridRegionList")) {
  610. this.objData["aridRegionList"] = [];
  611. }
  612. });
  613. } else if (type == "turnover") {
  614. let isFals = this.objData.turnover.some((m) => m.code == result);
  615. if (isFals) {
  616. uni.showToast({
  617. title: "周转车已存在",
  618. icon: "none",
  619. });
  620. return false;
  621. }
  622. getByCodeReport(result, this.taskId).then((res) => {
  623. this.objData.turnover[id] = res;
  624. });
  625. }
  626. },
  627. formedNumFn(num) {
  628. console.log(999, num);
  629. this.$refs.jobRef.setFormedNum(num);
  630. },
  631. async getList() {
  632. this.isLoad = false;
  633. let URL = this.isOutsource == 0 ? getByIdReport : outSourceGetByIdReport;
  634. console.log(URL, "URLURLURL");
  635. await URL(this.id, this.taskId)
  636. .then((res) => {
  637. // currentTaskDiagram 有是否可以报工
  638. this.objData = res;
  639. console.log(22, res);
  640. if (!this.objData.hasOwnProperty("turnover")) {
  641. this.objData["turnover"] = [];
  642. }
  643. if (!this.objData.hasOwnProperty("aridRegionList")) {
  644. this.objData["aridRegionList"] = [];
  645. }
  646. if (!this.objData.hasOwnProperty("instanceList")) {
  647. this.objData["instanceList"] = [];
  648. }
  649. if (!this.objData.hasOwnProperty("palletList")) {
  650. this.objData["palletList"] = [];
  651. }
  652. if (!this.objData.hasOwnProperty("revolvingDiskList")) {
  653. this.objData["revolvingDiskList"] = [];
  654. }
  655. // this.taskType = res.currentTaskDiagram.type
  656. if (this.objData.palletList.length > 0) {
  657. this.objData.palletList = this.objData.palletList.map((m) => {
  658. return {
  659. hideKc: true, // 不显示库存
  660. quantity: m.feedQuantity,
  661. ...m,
  662. };
  663. });
  664. } else {
  665. // this.objData.palletList = [{
  666. // categoryLevelId: '',
  667. // categoryLevelName: '',
  668. // categoryId: '',
  669. // rootCategoryLevelId: '',
  670. // code: '',
  671. // name: '',
  672. // specification: '',
  673. // brandNum: '',
  674. // modelType: '',
  675. // quantity: '',
  676. // unit: '',
  677. // }]
  678. }
  679. if (
  680. (this.taskType == 6 || this.isOutsource == 1) &&
  681. this.clientEnvironmentId == 3
  682. ) {
  683. this.objData.semiProductList = this.objData.pickOutInList;
  684. }
  685. if (this.taskType == 4 && this.clientEnvironmentId == 3) {
  686. this.objData.semiProductList = this.objData.pickOutInList;
  687. }
  688. // if (this.taskId == 6 || this.isOutsource == 1) {
  689. // this.objData.product = this.objData.pickOutInList;
  690. // }
  691. if (
  692. (this.taskType == 6 || this.taskType == 4) &&
  693. this.objData.singleReport == 1 &&
  694. this.clientEnvironmentId != 3
  695. ) {
  696. if (
  697. this.objData.pickOutInList &&
  698. this.objData.pickOutInList.length != 0
  699. ) {
  700. this.objData.semiProductList = this.objData.pickOutInList;
  701. this.objData.pickOutInList = [];
  702. }
  703. }
  704. if (
  705. (this.taskType == 6 || this.taskType == 4) &&
  706. this.objData.singleReport == 0 &&
  707. this.clientEnvironmentId != 3
  708. ) {
  709. if (
  710. this.objData.pickOutInList &&
  711. this.objData.pickOutInList.length != 0
  712. ) {
  713. this.objData.product = this.objData.pickOutInList;
  714. this.objData.pickOutInList = [];
  715. }
  716. }
  717. if (
  718. this.objData.singleReport == 1 &&
  719. this.objData.currentTaskDiagram.type != 2 &&
  720. this.objData.currentTaskDiagram.type != 3 &&
  721. this.objData.currentTaskDiagram.type != 6
  722. ) {
  723. this.objData.semiProductList.map((item) => {
  724. item.extInfo.taskId = "";
  725. item.extInfo.taskName = "";
  726. });
  727. }
  728. if (
  729. this.objData.singleReport == 0 &&
  730. this.objData.currentTaskDiagram.type != 2 &&
  731. this.objData.currentTaskDiagram.type != 3 &&
  732. this.objData.currentTaskDiagram.type != 6
  733. ) {
  734. this.objData.product.map((item) => {
  735. item.extInfo.taskId = "";
  736. item.extInfo.taskName = "";
  737. });
  738. }
  739. if (
  740. this.clientEnvironmentId == 3 &&
  741. this.objData.singleReport == 0 &&
  742. this.taskType != 6
  743. ) {
  744. this.objData.semiProductList.map((a) => {
  745. a.extInfo.batchReportInfo = [
  746. {
  747. allFeedQuantity: "",
  748. allReportWeight: "",
  749. taskId: "",
  750. taskName: "",
  751. },
  752. ];
  753. a.extInfo.notBatchReportInfo = [
  754. {
  755. allFeedQuantity: "",
  756. allReportWeight: "",
  757. notType: "",
  758. taskId: "",
  759. taskName: "",
  760. notReason: "",
  761. },
  762. ];
  763. return {
  764. a,
  765. };
  766. });
  767. this.objData.semiProductList = this.objData.semiProductList;
  768. }
  769. this.objData.workReportInfo = {
  770. formingNum: null,
  771. formingWeight: null,
  772. formedNum: null,
  773. formedWeight: null,
  774. taskId: this.taskId,
  775. executorTime: "",
  776. lossNum: null,
  777. lossWeight: null,
  778. };
  779. this.objData.notFormedList = [
  780. {
  781. notFormedNum: null,
  782. notFormedWeight: null,
  783. weightUnit: res.weightUnit,
  784. unit: res.unit,
  785. warehouseId: null, // 处置 仓库id
  786. },
  787. ];
  788. this.objData.semiProductList = this.objData.semiProductList.map(
  789. (item) => {
  790. if (this.taskType != 6) {
  791. if (item["extInfo"]?.reportWeight) {
  792. item["extInfo"].reportWeight = "";
  793. }
  794. }
  795. item.confirm = 0;
  796. console.log(item, "item");
  797. return item;
  798. }
  799. );
  800. this.objData.product = this.objData.product.map((item) => {
  801. if (this.taskType != 6) {
  802. if (item["extInfo"]?.reportWeight) {
  803. item["extInfo"].reportWeight = "";
  804. }
  805. }
  806. item.confirm = 0;
  807. console.log(item, "item");
  808. return item;
  809. });
  810. if (this.objData.semiProductList.length > 0) {
  811. // 预制体报工
  812. this.objData.workReportInfo.formedNum =
  813. this.objData.semiProductList.length;
  814. let numCot = 0;
  815. if (this.objData.semiProductList.length > 0) {
  816. this.objData.semiProductList.map((fitem) => {
  817. numCot = numCot + fitem.feedQuantity || 1;
  818. });
  819. this.objData.workReportInfo.formedNum = numCot;
  820. }
  821. } else if (this.objData.product.length > 0) {
  822. const number = this.objData.product.reduce((acc, pro) => {
  823. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  824. }, 0);
  825. this.objData.workReportInfo.formedNum = number;
  826. }
  827. this.objData.workReportInfo.formingNum = res.formingNum;
  828. this.objData.workReportInfo.formingWeight = res.formingWeight;
  829. this.objData.workReportInfo.unit = res.unit;
  830. this.objData.workReportInfo.weightUnit = res.weightUnit;
  831. this.objData.workReportInfo.workOrderId = res.workOrderId;
  832. this.paramDetailList = res.paramDetailList;
  833. console.log(this.objData, "this.objDatathis.objDatathis.objData");
  834. // this.paramDetailList = res.paramDetailList.map((m) => {
  835. // if (m.extInfo.textType == 5) {
  836. // this.remainingTime = m.extInfo.remainingTime;
  837. // }
  838. // return {
  839. // ...m.extInfo,
  840. // };
  841. // });
  842. })
  843. .finally(() => {
  844. this.isLoad = true;
  845. if (this.taskType == 1) {
  846. this.getCacheFn();
  847. }
  848. });
  849. },
  850. scrolltolower() {},
  851. handAdd() {
  852. const storageKey = Date.now() + "";
  853. uni.setStorageSync(storageKey, this.objData || {});
  854. uni.navigateTo({
  855. url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job&taskId=${this.taskId}`,
  856. });
  857. },
  858. penalize(index) {
  859. if (index || index == 0) {
  860. console.log(index, "----");
  861. this.penalizeIndex = index;
  862. this.formData.warehouseId =
  863. this.objData.productRecycleList[this.penalizeIndex].warehouseId || "";
  864. } else {
  865. this.penalizeIndex = null;
  866. this.formData.warehouseId =
  867. this.objData.notFormedList[0].warehouseId || "";
  868. console.log(this.formData.warehouseId, "+++++");
  869. }
  870. this.$forceUpdate();
  871. if (this.warehouseList.length == 0) {
  872. getWarehouseList().then((res) => {
  873. this.warehouseList = res;
  874. this.searchShow = true;
  875. });
  876. } else {
  877. this.searchShow = true;
  878. }
  879. },
  880. inputChange(e) {
  881. console.log(e);
  882. },
  883. searchCancel() {
  884. this.searchShow = false;
  885. },
  886. popupOk() {
  887. if (this.penalizeIndex == null) {
  888. this.$set(
  889. this.objData.notFormedList[0],
  890. "warehouseId",
  891. this.formData.warehouseId || null
  892. );
  893. } else {
  894. this.objData.productRecycleList[this.penalizeIndex].warehouseId =
  895. this.formData.warehouseId;
  896. }
  897. this.$forceUpdate();
  898. this.searchShow = false;
  899. },
  900. modeNum(num) {
  901. console.log(num, "------------", this.objData.modelList.length);
  902. if (this.objData.modelList.length == 0) {
  903. return false;
  904. }
  905. console.log(num);
  906. this.$refs.modelRef.setNum(num);
  907. },
  908. async save(type) {
  909. // 验证判断条件
  910. this.$isJobExls(1, this.objData);
  911. console.log(this.objData, "this.objData");
  912. // return;
  913. // for (let i = 0; i < this.List.length; i++) {
  914. // if (
  915. // !this.List[i].executorTime &&
  916. // this.List[i].executorTime == undefined
  917. // ) {
  918. // uni.showToast({
  919. // title: `请先选择报工时间`,
  920. // icon: "none",
  921. // });
  922. // return;
  923. // }
  924. // }
  925. if (!(this.clientEnvironmentId == 3 || this.objData.singleReport !== 1)) {
  926. if (this.objData.semiProductList.length) {
  927. let arr = this.objData.semiProductList.filter(
  928. (v) => v.selected == true
  929. );
  930. this.objData.semiProductList = arr;
  931. if (!arr.length) {
  932. return uni.showToast({
  933. title: "请选择报工数量",
  934. icon: "none",
  935. });
  936. }
  937. // else{
  938. // let engraveList = arr.filter(v=> v.extInfo.engrave ==null);
  939. // if(engraveList.length){
  940. // return uni.showToast({
  941. // title: '请输入刻码',
  942. // icon: 'none'
  943. // })
  944. // }
  945. // }
  946. }
  947. }
  948. uni.showLoading({
  949. title: "加载中",
  950. });
  951. if (
  952. !this.objData.workReportInfo["formedNum"] &&
  953. this.objData.workReportInfo["formedNum"] != 0
  954. ) {
  955. uni.showToast({
  956. title: "请输入合格品数量",
  957. icon: "none",
  958. });
  959. return false;
  960. }
  961. // 预制体
  962. if (this.clientEnvironmentId == 3 || this.objData.singleReport !== 1) {
  963. if (
  964. this.objData.semiProductList.length > 0 &&
  965. this.taskType != 4 &&
  966. this.objData.singleReport == 1 &&
  967. type == 2
  968. ) {
  969. let bol;
  970. let _i;
  971. bol = this.objData.semiProductList.every((e, i) => {
  972. _i = i + 1;
  973. if (this.taskType == 6) {
  974. return e.extInfo.hasOwnProperty("taskId") && e.extInfo.taskId;
  975. } else {
  976. // if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  977. // return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId && e.extInfo
  978. // .reportWeight
  979. // } else {
  980. // return e.extInfo.hasOwnProperty('notType') && e.extInfo.notType
  981. // }
  982. return (
  983. e.extInfo.hasOwnProperty("taskId") &&
  984. e.extInfo.taskId &&
  985. e.extInfo.reportWeight
  986. );
  987. }
  988. });
  989. if (!bol) {
  990. uni.showToast({
  991. title: `请完善第${_i}处置方式`,
  992. icon: "none",
  993. });
  994. return false;
  995. }
  996. }
  997. }
  998. if (
  999. this.objData.productRecycleList.length > 0 &&
  1000. this.clientEnvironmentId != 2
  1001. ) {
  1002. const isRecycle = await this.checkRecycle();
  1003. if (!isRecycle) {
  1004. return false;
  1005. }
  1006. }
  1007. if (this.taskType == 4 && this.clientEnvironmentId != 3) {
  1008. const isPack = await this.checkPack();
  1009. if (!isPack) {
  1010. return false;
  1011. }
  1012. }
  1013. //
  1014. // console.log(this.objData.currentTaskDiagram.isFirstTask,'22222');
  1015. // if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask 1是 判断是否首工序
  1016. // const isFirstTask = await this.checkFirstTask()
  1017. // if (!isFirstTask) {
  1018. // return false
  1019. // }
  1020. // }
  1021. if (this.taskType == 1) {
  1022. const isCache = await this.checkCache(type);
  1023. if (!isCache) {
  1024. return false;
  1025. }
  1026. }
  1027. if (
  1028. this.clientEnvironmentId == 3 &&
  1029. type == 2 &&
  1030. this.taskType == 6 &&
  1031. this.objData.singleReport == 0
  1032. ) {
  1033. this.objData.semiProductList = [];
  1034. }
  1035. if (this.clientEnvironmentId == 3 && this.taskType == 1) {
  1036. if (
  1037. this.objData &&
  1038. this.objData.executorTime &&
  1039. this.objData.executorTime != undefined
  1040. ) {
  1041. // 正则表达式1:匹配 yyyy-MM-dd 格式
  1042. const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
  1043. if (dateRegex.test(this.objData.executorTime.trimRight())) {
  1044. this.objData.workReportInfo["executorTime"] =
  1045. this.objData.executorTime + " 00:00:00";
  1046. } else {
  1047. this.objData.workReportInfo["executorTime"] =
  1048. this.objData.executorTime;
  1049. }
  1050. } else {
  1051. uni.showToast({
  1052. title: `请先选择实际报工时间`,
  1053. icon: "none",
  1054. });
  1055. return false;
  1056. }
  1057. }
  1058. if (this.objData.semiProductList.length > 0) {
  1059. this.objData.semiProductList.map((ditem) => {
  1060. let wdid = ditem.deviceId ? ditem.deviceId.split("/") : "";
  1061. ditem.deviceId = wdid ? wdid[0] : "";
  1062. if (ditem.extInfo.batchReportInfo) {
  1063. ditem.extInfo.batchReportInfo.map((baItem) => {
  1064. let idvalue = baItem.deviceId ? baItem.deviceId.split("/") : "";
  1065. baItem.deviceId = idvalue ? idvalue[0] : "";
  1066. });
  1067. }
  1068. if (ditem.extInfo.notBatchReportInfo) {
  1069. ditem.extInfo.notBatchReportInfo.map((noItem) => {
  1070. let idvalue = noItem.deviceId ? noItem.deviceId.split("/") : "";
  1071. noItem.deviceId = idvalue ? idvalue[0] : "";
  1072. });
  1073. }
  1074. });
  1075. }
  1076. // console.log(this.objData, "this.objData");
  1077. // console.log(this.objData.equipmentList);
  1078. if (
  1079. this.objData.product.length != 0 &&
  1080. this.objData.equipmentList.length != 0
  1081. ) {
  1082. this.objData.product.forEach((item) => {
  1083. if (item.deviceId) {
  1084. this.objData.equipmentList.forEach((el) => {
  1085. if (item.deviceId == el.instanceId) {
  1086. item.deviceName = el.name;
  1087. }
  1088. });
  1089. }
  1090. });
  1091. }
  1092. // console.log(this.objData, "savesavesaveobjDataobjDataobjData");
  1093. let newList = [];
  1094. newList.push({
  1095. currentTaskDiagram: this.objData.currentTaskDiagram,
  1096. workOrderId: this.objData.workOrderId,
  1097. });
  1098. await checkReportNumber(newList).then((res) => {
  1099. if (res.length != 0) {
  1100. this.checkJobBook(res);
  1101. }
  1102. });
  1103. },
  1104. checkJobBook(list) {
  1105. for (let item of list) {
  1106. if (item.reportFormed != "0") {
  1107. this.titleText = `工单号${item.workOrderCode}已有报工,是否继续重复报工?`;
  1108. this.$refs.alertDialog.open();
  1109. } else {
  1110. this.jobBookReport();
  1111. }
  1112. }
  1113. },
  1114. dialogClose() {},
  1115. dialogConfirm() {
  1116. this.jobBookReport();
  1117. },
  1118. jobBookReport() {
  1119. jobSave(this.objData)
  1120. .then((res) => {
  1121. uni.hideLoading();
  1122. if (this.taskType == 4) {
  1123. uni.showModal({
  1124. title: "提示",
  1125. content: "打包完成是否去入库!",
  1126. confirmText: "确认", //这块是确定按钮的文字
  1127. success: (rr) => {
  1128. if (rr.confirm) {
  1129. uni.redirectTo({
  1130. url: `/pages/pda/warehousing/index?workOrderId=${this.id}&taskId=-1&workReportId=${res}&delta=-2`,
  1131. });
  1132. } else {
  1133. uni.navigateBack();
  1134. }
  1135. },
  1136. });
  1137. } else {
  1138. uni.navigateBack();
  1139. }
  1140. })
  1141. .finally(() => {
  1142. setTimeout(function () {
  1143. uni.hideLoading();
  1144. }, 3000);
  1145. });
  1146. },
  1147. checkRecycle() {
  1148. uni.hideLoading();
  1149. return new Promise((resolve) => {
  1150. uni.showModal({
  1151. title: "提示",
  1152. content: "是否跳过副产品回收处置!",
  1153. confirmText: "确认", //这块是确定按钮的文字
  1154. success: function (res) {
  1155. if (res.confirm) {
  1156. resolve(true);
  1157. } else {
  1158. resolve(false);
  1159. }
  1160. },
  1161. });
  1162. });
  1163. },
  1164. checkPack() {
  1165. uni.hideLoading();
  1166. return new Promise((resolve) => {
  1167. let packInfo = this.$refs.packRef.getData();
  1168. this.objData.packInfo = packInfo;
  1169. this.objData.taskType = this.taskType;
  1170. let formedNumLast = 0;
  1171. if (this.objData.singleReport == 1) {
  1172. formedNumLast = this.objData.semiProductList.reduce((acc, pro) => {
  1173. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  1174. }, 0);
  1175. } else if (this.objData.singleReport == 0) {
  1176. formedNumLast = this.objData.product.reduce((acc, pro) => {
  1177. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  1178. }, 0);
  1179. }
  1180. if (
  1181. formedNumLast !=
  1182. Number(this.objData.workReportInfo["formedNum"]) +
  1183. Number(this.objData.workReportInfo.notFormedNum)
  1184. ) {
  1185. uni.hideLoading();
  1186. uni.showModal({
  1187. title: "提示",
  1188. content: "合格品数量加不合格品数量不等于包装总数!",
  1189. confirmText: "确认", //这块是确定按钮的文字
  1190. success: function (res) {
  1191. if (res.confirm) {
  1192. resolve(true);
  1193. } else {
  1194. resolve(false);
  1195. }
  1196. },
  1197. });
  1198. } else {
  1199. resolve(true);
  1200. }
  1201. });
  1202. },
  1203. checkFirstTask() {
  1204. uni.hideLoading();
  1205. return new Promise((resolve) => {
  1206. if (
  1207. this.objData.formedNumLast !=
  1208. Number(this.objData.workReportInfo["formedNum"]) +
  1209. Number(this.objData.workReportInfo.notFormedNum)
  1210. ) {
  1211. uni.showModal({
  1212. title: "提示",
  1213. content: "合格品数量加不合格品数量不等于上道工序数量!",
  1214. confirmText: "确认", //这块是确定按钮的文字
  1215. success: function (res) {
  1216. if (res.confirm) {
  1217. resolve(true);
  1218. } else {
  1219. resolve(false);
  1220. }
  1221. },
  1222. });
  1223. } else {
  1224. resolve(true);
  1225. }
  1226. });
  1227. },
  1228. checkCache(type) {
  1229. uni.hideLoading();
  1230. return new Promise((resolve) => {
  1231. if (type == 1) {
  1232. saveCache(this.objData).then((rr) => {
  1233. uni.showToast({
  1234. title: `已经缓存`,
  1235. icon: "none",
  1236. });
  1237. });
  1238. resolve(false);
  1239. } else if (type == 2) {
  1240. resolve(true);
  1241. }
  1242. });
  1243. },
  1244. removeCacheFn() {
  1245. uni.showModal({
  1246. title: "缓存",
  1247. content: "是否清空缓存!",
  1248. confirmText: "确认", //这块是确定按钮的文字
  1249. success: (rr) => {
  1250. if (rr.confirm) {
  1251. let parma = {
  1252. workOrderIds: [this.id],
  1253. taskId: this.taskId,
  1254. type: 1,
  1255. };
  1256. removeCache(parma).then((res) => {
  1257. this.getList();
  1258. });
  1259. }
  1260. },
  1261. });
  1262. },
  1263. getCacheFn() {
  1264. let parma = {
  1265. workOrderId: this.id,
  1266. taskId: this.taskId,
  1267. type: 1,
  1268. };
  1269. getCache(parma).then((res) => {
  1270. if (
  1271. !res ||
  1272. res.length < 0 ||
  1273. Object.getOwnPropertyNames(res).length === 0
  1274. ) {
  1275. return false;
  1276. }
  1277. this.objData["product"] = res.extInfo.product;
  1278. this.objData["workReportInfo"] = res.extInfo.workReportInfo;
  1279. this.objData["notFormedList"] = res.extInfo.notFormedList;
  1280. this.objData["turnover"] = res.extInfo.turnover;
  1281. this.objData["productRecycleList"] = res.extInfo.productRecycleList;
  1282. this.objData["semiProductList"] = res.extInfo.semiProductList;
  1283. this.objData["modelList"] = res.extInfo.modelList;
  1284. });
  1285. },
  1286. //批量报工合格不合格重量统计
  1287. countNumPl(list, index) {
  1288. //合格总数
  1289. let formedNumCount = 0;
  1290. //合格总重量
  1291. let formedWeightCount = 0;
  1292. //不合格总数
  1293. let notFormedNumCount = 0;
  1294. //不合格总重量
  1295. let notFormedWeightCount = 0;
  1296. list.map((item) => {
  1297. //合格总数
  1298. item.extInfo.batchReportInfo.forEach((m) => {
  1299. formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
  1300. });
  1301. //合格总重量
  1302. item.extInfo.batchReportInfo.forEach((w) => {
  1303. formedWeightCount =
  1304. formedWeightCount + Number(w.allReportWeight || 0);
  1305. });
  1306. //不合格总数
  1307. item.extInfo.notBatchReportInfo.forEach((nf) => {
  1308. notFormedNumCount =
  1309. notFormedNumCount + Number(nf.allFeedQuantity || 0);
  1310. });
  1311. //不合格总重量
  1312. item.extInfo.notBatchReportInfo.forEach((nw) => {
  1313. notFormedWeightCount =
  1314. notFormedWeightCount + Number(nw.allReportWeight || 0);
  1315. });
  1316. });
  1317. this.$set(this.objData.workReportInfo, "formedNum", formedNumCount); //合格总数
  1318. this.$set(this.objData.workReportInfo, "formedWeight", formedWeightCount); //合格总重量
  1319. this.$set(this.objData.workReportInfo, "notFormedNum", notFormedNumCount); //不合格总数
  1320. this.$set(
  1321. this.objData.workReportInfo,
  1322. "notFormedWeight",
  1323. notFormedWeightCount
  1324. ); //不合格总重量
  1325. // this.$refs.jobReftg.formedTotal(
  1326. // formedNumCount,
  1327. // formedWeightCount,
  1328. // notFormedNumCount,
  1329. // notFormedWeightCount
  1330. // );
  1331. // console.log("777777777777777", this.objData);
  1332. this.objData = this.deepCopy(this.objData);
  1333. this.$forceUpdate();
  1334. },
  1335. deepCopy(obj, hash = new WeakMap()) {
  1336. if (obj === null) return null;
  1337. if (obj instanceof Date) return new Date(obj);
  1338. if (obj instanceof RegExp) return new RegExp(obj);
  1339. if (typeof obj !== "object" && typeof obj !== "function") return obj;
  1340. if (hash.has(obj)) return hash.get(obj);
  1341. const result = Array.isArray(obj) ? [] : {};
  1342. hash.set(obj, result);
  1343. return Object.keys(obj).reduce((acc, key) => {
  1344. acc[key] = this.deepCopy(obj[key], hash);
  1345. return acc;
  1346. }, result);
  1347. },
  1348. },
  1349. beforeDestroy() {
  1350. uni.hideLoading();
  1351. },
  1352. };
  1353. </script>
  1354. <style lang="scss" scoped>
  1355. .content-box {
  1356. height: 100vh;
  1357. overflow: hidden;
  1358. display: flex;
  1359. flex-direction: column;
  1360. }
  1361. .list_box {
  1362. flex: 1;
  1363. overflow: hidden;
  1364. padding: 4rpx 0;
  1365. .u-list {
  1366. height: 100% !important;
  1367. }
  1368. .card_box {
  1369. padding: 16rpx 20rpx;
  1370. }
  1371. }
  1372. .bottom-wrapper {
  1373. width: 100%;
  1374. display: flex;
  1375. align-items: center;
  1376. justify-content: space-around;
  1377. .btn_box {
  1378. width: 50%;
  1379. height: 88rpx;
  1380. line-height: 88rpx;
  1381. background: $theme-color;
  1382. text-align: center;
  1383. font-size: 36rpx;
  1384. font-style: normal;
  1385. font-weight: 400;
  1386. color: #fff;
  1387. &:first-child {
  1388. border-right: 2rpx solid #fff;
  1389. }
  1390. }
  1391. }
  1392. .operate_box {
  1393. padding: 10rpx 160rpx;
  1394. /deep/ .u-button {
  1395. width: 160rpx;
  1396. }
  1397. }
  1398. .search_list {
  1399. min-height: 500rpx;
  1400. padding: 0 32rpx;
  1401. }
  1402. .search_list2 {
  1403. min-height: 120rpx;
  1404. padding: 0 32rpx;
  1405. }
  1406. .flex_btn {
  1407. position: fixed;
  1408. right: 0;
  1409. bottom: 160rpx;
  1410. width: 40rpx;
  1411. height: 50rpx;
  1412. line-height: 66rpx;
  1413. border-radius: 22rpx 0 0 22rpx;
  1414. background: $theme-color;
  1415. text-align: center;
  1416. font-size: 22rpx;
  1417. font-style: normal;
  1418. font-weight: 400;
  1419. color: #fff;
  1420. opacity: 0.6;
  1421. .jiantou {
  1422. width: 30rpx;
  1423. height: 30rpx;
  1424. }
  1425. }
  1426. .flex_btn2 {
  1427. position: fixed;
  1428. right: 0;
  1429. bottom: 160rpx;
  1430. width: 126rpx;
  1431. min-height: 140rpx;
  1432. line-height: 62rpx;
  1433. border-radius: 22rpx 0 0 22rpx;
  1434. background: $theme-color;
  1435. text-align: center;
  1436. font-size: 22rpx;
  1437. font-style: normal;
  1438. font-weight: 400;
  1439. color: #fff;
  1440. opacity: 0.7;
  1441. .close_box {
  1442. height: 50rpx;
  1443. line-height: 50rpx;
  1444. width: 126rpx;
  1445. text-align: left;
  1446. .close {
  1447. width: 40rpx;
  1448. height: 40rpx;
  1449. padding: 6rpx 10rpx;
  1450. }
  1451. }
  1452. }
  1453. </style>