index.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625
  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. import { parameterGetByCode } from "@/api/mainData/index.js";
  428. export default {
  429. components: {
  430. workOrderBom,
  431. deviceBom,
  432. modelBom,
  433. jobBom,
  434. singleJobBom,
  435. palletBom,
  436. oneJobBom,
  437. semiProductJobBom,
  438. semiProductJobBomPL,
  439. byProductBom,
  440. turnoverBom,
  441. aridRegion,
  442. paramBom,
  443. packingBom,
  444. packingTgBom,
  445. revolvingDiskBom,
  446. SearchPopup,
  447. oneJobQualityBom,
  448. oneJobQualityBomPL,
  449. batchJobBom,
  450. workInProgressList,
  451. },
  452. data() {
  453. return {
  454. title: "",
  455. taskType: 1,
  456. isLoad: true,
  457. categoryId: "",
  458. objData: {
  459. formedNumLast: 0,
  460. product: [],
  461. equipmentList: [],
  462. modelList: [],
  463. turnover: [],
  464. productRecycleList: [],
  465. aridRegionList: [],
  466. palletList: [],
  467. workReportInfo: {},
  468. executorTime: "",
  469. notFormedList: [], // 报工-不合格
  470. },
  471. searchShow: false,
  472. switchOrder: false,
  473. warehouseList: [],
  474. formData: {
  475. warehouseId: "",
  476. },
  477. penalizeIndex: null,
  478. paramDetailList: [],
  479. remainingTime: 0,
  480. id: null,
  481. taskId: null,
  482. clientEnvironmentId:
  483. uni.getStorageSync("userInfo") &&
  484. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  485. operateBtn: true,
  486. isOutsource: 0,
  487. titleText: "",
  488. };
  489. },
  490. onLoad(options) {
  491. console.log(options, "optionsoptions");
  492. this.info = options.info;
  493. this.title = options.taskName ? options.taskName + "-报工" : "报工";
  494. this.taskType = options.taskType;
  495. this.id = options.id;
  496. this.taskId = options.taskId;
  497. this.isOutsource = options.isOutsource;
  498. this.categoryId = options.categoryId;
  499. this.singleReport = options.singleReport; // 单个报工 1是单 2多
  500. this.getList();
  501. },
  502. onShow() {
  503. uni.$off("setSelectList");
  504. uni.$on("setSelectList", (selectList, id) => {
  505. let turnover = [];
  506. let equipmentList = []; // 生产设备
  507. let isEquipment = this.objData.equipmentList.length > 0 ? true : false; // 判断是否有设置
  508. selectList.forEach((f) => {
  509. if (f.rootCategoryLevelId == 4) {
  510. // 生产设备
  511. if (isEquipment) {
  512. equipmentList = this.objData.equipmentList;
  513. } else {
  514. equipmentList = equipmentList.concat(f);
  515. }
  516. }
  517. if (f.rootCategoryLevelId == 7) {
  518. // 周转车
  519. turnover = turnover.concat(f);
  520. }
  521. });
  522. this.$set(this.objData, "equipmentList", equipmentList);
  523. this.$set(this.objData, "turnover", turnover);
  524. this.$forceUpdate();
  525. });
  526. },
  527. methods: {
  528. weightEmit(formedWeight, notFormedWeight) {
  529. this.$refs.jobReftg.fWeightInput(formedWeight, notFormedWeight);
  530. this.$nextTick(() => {
  531. this.$set(this.objData.workReportInfo, "formedWeight", formedWeight);
  532. this.$set(
  533. this.objData.workReportInfo,
  534. "notFormedWeight",
  535. notFormedWeight,
  536. );
  537. });
  538. this.$forceUpdate();
  539. },
  540. // 相机扫码
  541. HandlScanCode() {
  542. uni.scanCode({
  543. success: (res) => {
  544. this.scanItAllData(res.result);
  545. },
  546. });
  547. },
  548. scanItAllData(result) {
  549. scanLedger(result).then((res) => {
  550. if (res[0].rootCategoryLevelId == 4) {
  551. // 设备
  552. let isFals = this.objData.equipmentList.some((m) => m.code == result);
  553. if (isFals) {
  554. uni.showToast({
  555. title: "设备已存在",
  556. icon: "none",
  557. });
  558. return false;
  559. }
  560. this.objData.equipmentList.push(res[0]);
  561. this.$forceUpdate();
  562. }
  563. if (res.length >= 1 && res[0].rootCategoryLevelId == 5) {
  564. // 磨具
  565. if (this.objData.modelList.length == 0) {
  566. this.objData.modelList = res;
  567. this.$forceUpdate();
  568. } else {
  569. if (this.objData.modelList[0].instanceId != res[0].instanceId) {
  570. uni.showToast({
  571. title: "模具不匹配",
  572. icon: "none",
  573. });
  574. } else {
  575. uni.showToast({
  576. title: "设备匹配成功",
  577. icon: "none",
  578. });
  579. }
  580. }
  581. } else if (res.length == 1 && res[0].rootCategoryLevelId == 7) {
  582. // 周转车
  583. let isFals = this.objData.turnover.some((m) => m.code == result);
  584. if (isFals) {
  585. uni.showToast({
  586. title: "周转车已存在",
  587. icon: "none",
  588. });
  589. return false;
  590. }
  591. this.objData.turnover.push(res[0]);
  592. this.$forceUpdate();
  593. }
  594. });
  595. },
  596. handleScan(id, type) {
  597. uni.scanCode({
  598. success: (res) => {
  599. this.scanData(res.result, type, id);
  600. },
  601. });
  602. },
  603. scanData(result, type, id) {
  604. if (type == "wordOrder") {
  605. getByCodeReport(result, this.taskId).then((res) => {
  606. this.objData = res;
  607. if (!this.objData.hasOwnProperty("turnover")) {
  608. this.objData["turnover"] = [];
  609. }
  610. if (!this.objData.hasOwnProperty("aridRegionList")) {
  611. this.objData["aridRegionList"] = [];
  612. }
  613. });
  614. } else if (type == "turnover") {
  615. let isFals = this.objData.turnover.some((m) => m.code == result);
  616. if (isFals) {
  617. uni.showToast({
  618. title: "周转车已存在",
  619. icon: "none",
  620. });
  621. return false;
  622. }
  623. getByCodeReport(result, this.taskId).then((res) => {
  624. this.objData.turnover[id] = res;
  625. });
  626. }
  627. },
  628. formedNumFn(num) {
  629. console.log(999, num);
  630. this.$refs.jobRef.setFormedNum(num);
  631. },
  632. async getList() {
  633. this.isLoad = false;
  634. let URL = this.isOutsource == 0 ? getByIdReport : outSourceGetByIdReport;
  635. console.log(URL, "URLURLURL");
  636. await URL(this.id, this.taskId)
  637. .then((res) => {
  638. // currentTaskDiagram 有是否可以报工
  639. this.objData = res;
  640. console.log(22, res);
  641. if (!this.objData.hasOwnProperty("turnover")) {
  642. this.objData["turnover"] = [];
  643. }
  644. if (!this.objData.hasOwnProperty("aridRegionList")) {
  645. this.objData["aridRegionList"] = [];
  646. }
  647. if (!this.objData.hasOwnProperty("instanceList")) {
  648. this.objData["instanceList"] = [];
  649. }
  650. if (!this.objData.hasOwnProperty("palletList")) {
  651. this.objData["palletList"] = [];
  652. }
  653. if (!this.objData.hasOwnProperty("revolvingDiskList")) {
  654. this.objData["revolvingDiskList"] = [];
  655. }
  656. // this.taskType = res.currentTaskDiagram.type
  657. if (this.objData.palletList.length > 0) {
  658. this.objData.palletList = this.objData.palletList.map((m) => {
  659. return {
  660. hideKc: true, // 不显示库存
  661. quantity: m.feedQuantity,
  662. ...m,
  663. };
  664. });
  665. } else {
  666. // this.objData.palletList = [{
  667. // categoryLevelId: '',
  668. // categoryLevelName: '',
  669. // categoryId: '',
  670. // rootCategoryLevelId: '',
  671. // code: '',
  672. // name: '',
  673. // specification: '',
  674. // brandNum: '',
  675. // modelType: '',
  676. // quantity: '',
  677. // unit: '',
  678. // }]
  679. }
  680. if (
  681. (this.taskType == 6 || this.isOutsource == 1) &&
  682. this.clientEnvironmentId == 3
  683. ) {
  684. this.objData.semiProductList = this.objData.pickOutInList;
  685. }
  686. if (this.taskType == 4 && this.clientEnvironmentId == 3) {
  687. this.objData.semiProductList = this.objData.pickOutInList;
  688. }
  689. // if (this.taskId == 6 || this.isOutsource == 1) {
  690. // this.objData.product = this.objData.pickOutInList;
  691. // }
  692. if (
  693. (this.taskType == 6 || this.taskType == 4) &&
  694. this.objData.singleReport == 1 &&
  695. this.clientEnvironmentId != 3
  696. ) {
  697. if (
  698. this.objData.pickOutInList &&
  699. this.objData.pickOutInList.length != 0
  700. ) {
  701. this.objData.semiProductList = this.objData.pickOutInList;
  702. this.objData.pickOutInList = [];
  703. }
  704. }
  705. if (
  706. (this.taskType == 6 || this.taskType == 4) &&
  707. this.objData.singleReport == 0 &&
  708. this.clientEnvironmentId != 3
  709. ) {
  710. if (
  711. this.objData.pickOutInList &&
  712. this.objData.pickOutInList.length != 0
  713. ) {
  714. this.objData.product = this.objData.pickOutInList;
  715. this.objData.pickOutInList = [];
  716. }
  717. }
  718. if (
  719. this.objData.singleReport == 1 &&
  720. this.objData.currentTaskDiagram.type != 2 &&
  721. this.objData.currentTaskDiagram.type != 3 &&
  722. this.objData.currentTaskDiagram.type != 6
  723. ) {
  724. this.objData.semiProductList.map((item) => {
  725. item.extInfo.taskId = "";
  726. item.extInfo.taskName = "";
  727. });
  728. }
  729. if (
  730. this.objData.singleReport == 0 &&
  731. this.objData.currentTaskDiagram.type != 2 &&
  732. this.objData.currentTaskDiagram.type != 3 &&
  733. this.objData.currentTaskDiagram.type != 6
  734. ) {
  735. this.objData.product.map((item) => {
  736. item.extInfo.taskId = "";
  737. item.extInfo.taskName = "";
  738. });
  739. }
  740. if (
  741. this.clientEnvironmentId == 3 &&
  742. this.objData.singleReport == 0 &&
  743. this.taskType != 6
  744. ) {
  745. this.objData.semiProductList.map((a) => {
  746. a.extInfo.batchReportInfo = [
  747. {
  748. allFeedQuantity: "",
  749. allReportWeight: "",
  750. taskId: "",
  751. taskName: "",
  752. },
  753. ];
  754. a.extInfo.notBatchReportInfo = [
  755. {
  756. allFeedQuantity: "",
  757. allReportWeight: "",
  758. notType: "",
  759. taskId: "",
  760. taskName: "",
  761. notReason: "",
  762. },
  763. ];
  764. return {
  765. a,
  766. };
  767. });
  768. this.objData.semiProductList = this.objData.semiProductList;
  769. }
  770. this.objData.workReportInfo = {
  771. formingNum: null,
  772. formingWeight: null,
  773. formedNum: null,
  774. formedWeight: null,
  775. taskId: this.taskId,
  776. executorTime: "",
  777. lossNum: null,
  778. lossWeight: null,
  779. executorStartTime: null,
  780. reportTime: "",
  781. workTime: "",
  782. };
  783. this.objData.notFormedList = [
  784. {
  785. notFormedNum: null,
  786. notFormedWeight: null,
  787. weightUnit: res.weightUnit,
  788. unit: res.unit,
  789. warehouseId: null, // 处置 仓库id
  790. },
  791. ];
  792. this.objData.semiProductList = this.objData.semiProductList.map(
  793. (item) => {
  794. if (this.taskType != 6) {
  795. if (item["extInfo"]?.reportWeight) {
  796. item["extInfo"].reportWeight = "";
  797. }
  798. }
  799. item.confirm = 0;
  800. console.log(item, "item");
  801. return item;
  802. },
  803. );
  804. this.objData.product = this.objData.product.map((item) => {
  805. if (this.taskType != 6) {
  806. if (item["extInfo"]?.reportWeight) {
  807. item["extInfo"].reportWeight = "";
  808. }
  809. }
  810. item.confirm = 0;
  811. console.log(item, "item");
  812. return item;
  813. });
  814. if (this.objData.semiProductList.length > 0) {
  815. // 预制体报工
  816. this.objData.workReportInfo.formedNum =
  817. this.objData.semiProductList.length;
  818. let numCot = 0;
  819. if (this.objData.semiProductList.length > 0) {
  820. this.objData.semiProductList.map((fitem) => {
  821. numCot = numCot + fitem.feedQuantity || 1;
  822. });
  823. this.objData.workReportInfo.formedNum = numCot;
  824. }
  825. } else if (this.objData.product.length > 0) {
  826. const number = this.objData.product.reduce((acc, pro) => {
  827. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  828. }, 0);
  829. this.objData.workReportInfo.formedNum = number;
  830. }
  831. this.objData.workReportInfo.formingNum = res.formingNum;
  832. this.objData.workReportInfo.formingWeight = res.formingWeight;
  833. this.objData.workReportInfo.unit = res.unit;
  834. this.objData.workReportInfo.weightUnit = res.weightUnit;
  835. this.objData.workReportInfo.workOrderId = res.workOrderId;
  836. this.paramDetailList = res.paramDetailList;
  837. console.log(this.objData, "this.objDatathis.objDatathis.objData");
  838. // this.paramDetailList = res.paramDetailList.map((m) => {
  839. // if (m.extInfo.textType == 5) {
  840. // this.remainingTime = m.extInfo.remainingTime;
  841. // }
  842. // return {
  843. // ...m.extInfo,
  844. // };
  845. // });
  846. })
  847. .finally(() => {
  848. this.isLoad = true;
  849. if (this.taskType == 1) {
  850. this.getCacheFn();
  851. }
  852. });
  853. },
  854. scrolltolower() {},
  855. handAdd() {
  856. const storageKey = Date.now() + "";
  857. uni.setStorageSync(storageKey, this.objData || {});
  858. uni.navigateTo({
  859. url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job&taskId=${this.taskId}`,
  860. });
  861. },
  862. penalize(index) {
  863. if (index || index == 0) {
  864. console.log(index, "----");
  865. this.penalizeIndex = index;
  866. this.formData.warehouseId =
  867. this.objData.productRecycleList[this.penalizeIndex].warehouseId || "";
  868. } else {
  869. this.penalizeIndex = null;
  870. this.formData.warehouseId =
  871. this.objData.notFormedList[0].warehouseId || "";
  872. console.log(this.formData.warehouseId, "+++++");
  873. }
  874. this.$forceUpdate();
  875. if (this.warehouseList.length == 0) {
  876. getWarehouseList().then((res) => {
  877. this.warehouseList = res;
  878. this.searchShow = true;
  879. });
  880. } else {
  881. this.searchShow = true;
  882. }
  883. },
  884. inputChange(e) {
  885. console.log(e);
  886. },
  887. searchCancel() {
  888. this.searchShow = false;
  889. },
  890. popupOk() {
  891. if (this.penalizeIndex == null) {
  892. this.$set(
  893. this.objData.notFormedList[0],
  894. "warehouseId",
  895. this.formData.warehouseId || null,
  896. );
  897. } else {
  898. this.objData.productRecycleList[this.penalizeIndex].warehouseId =
  899. this.formData.warehouseId;
  900. }
  901. this.$forceUpdate();
  902. this.searchShow = false;
  903. },
  904. modeNum(num) {
  905. console.log(num, "------------", this.objData.modelList.length);
  906. if (this.objData.modelList.length == 0) {
  907. return false;
  908. }
  909. console.log(num);
  910. this.$refs.modelRef.setNum(num);
  911. },
  912. async save(type) {
  913. // 验证判断条件
  914. this.$isJobExls(1, this.objData);
  915. // return;
  916. if (!(this.clientEnvironmentId == 3 || this.objData.singleReport !== 1)) {
  917. if (this.objData.semiProductList.length) {
  918. let arr = this.objData.semiProductList.filter(
  919. (v) => v.selected == true,
  920. );
  921. this.objData.semiProductList = arr;
  922. if (!arr.length) {
  923. return uni.showToast({
  924. title: "请选择报工数量",
  925. icon: "none",
  926. });
  927. }
  928. }
  929. }
  930. await parameterGetByCode({
  931. code: "work_hour",
  932. }).then((res) => {
  933. if (res.value == "1") {
  934. if (!this.objData.workReportInfo["executorStartTime"]) {
  935. uni.showToast({
  936. title: `请先选择报工时间`,
  937. icon: "none",
  938. });
  939. return false;
  940. }
  941. }
  942. });
  943. uni.showLoading({
  944. title: "加载中",
  945. });
  946. if (
  947. !this.objData.workReportInfo["formedNum"] &&
  948. this.objData.workReportInfo["formedNum"] != 0
  949. ) {
  950. uni.showToast({
  951. title: "请输入合格品数量",
  952. icon: "none",
  953. });
  954. return false;
  955. }
  956. // 预制体
  957. if (this.clientEnvironmentId == 3 || this.objData.singleReport !== 1) {
  958. if (
  959. this.objData.semiProductList.length > 0 &&
  960. this.taskType != 4 &&
  961. this.objData.singleReport == 1 &&
  962. type == 2
  963. ) {
  964. let bol;
  965. let _i;
  966. bol = this.objData.semiProductList.every((e, i) => {
  967. _i = i + 1;
  968. if (this.taskType == 6) {
  969. return e.extInfo.hasOwnProperty("taskId") && e.extInfo.taskId;
  970. } else {
  971. // if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
  972. // return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId && e.extInfo
  973. // .reportWeight
  974. // } else {
  975. // return e.extInfo.hasOwnProperty('notType') && e.extInfo.notType
  976. // }
  977. return (
  978. e.extInfo.hasOwnProperty("taskId") &&
  979. e.extInfo.taskId &&
  980. e.extInfo.reportWeight
  981. );
  982. }
  983. });
  984. if (!bol) {
  985. uni.showToast({
  986. title: `请完善第${_i}处置方式`,
  987. icon: "none",
  988. });
  989. return false;
  990. }
  991. }
  992. }
  993. if (
  994. this.objData.productRecycleList.length > 0 &&
  995. this.clientEnvironmentId != 2
  996. ) {
  997. const isRecycle = await this.checkRecycle();
  998. if (!isRecycle) {
  999. return false;
  1000. }
  1001. }
  1002. if (this.taskType == 4 && this.clientEnvironmentId != 3) {
  1003. const isPack = await this.checkPack();
  1004. if (!isPack) {
  1005. return false;
  1006. }
  1007. }
  1008. //
  1009. // console.log(this.objData.currentTaskDiagram.isFirstTask,'22222');
  1010. // if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask 1是 判断是否首工序
  1011. // const isFirstTask = await this.checkFirstTask()
  1012. // if (!isFirstTask) {
  1013. // return false
  1014. // }
  1015. // }
  1016. if (this.taskType == 1) {
  1017. const isCache = await this.checkCache(type);
  1018. if (!isCache) {
  1019. return false;
  1020. }
  1021. }
  1022. if (
  1023. this.clientEnvironmentId == 3 &&
  1024. type == 2 &&
  1025. this.taskType == 6 &&
  1026. this.objData.singleReport == 0
  1027. ) {
  1028. this.objData.semiProductList = [];
  1029. }
  1030. if (this.clientEnvironmentId == 3 && this.taskType == 1) {
  1031. if (
  1032. this.objData &&
  1033. this.objData.executorTime &&
  1034. this.objData.executorTime != undefined
  1035. ) {
  1036. // 正则表达式1:匹配 yyyy-MM-dd 格式
  1037. const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
  1038. if (dateRegex.test(this.objData.executorTime.trimRight())) {
  1039. this.objData.workReportInfo["executorTime"] =
  1040. this.objData.executorTime + " 00:00:00";
  1041. } else {
  1042. this.objData.workReportInfo["executorTime"] =
  1043. this.objData.executorTime;
  1044. }
  1045. } else {
  1046. uni.showToast({
  1047. title: `请先选择实际报工时间`,
  1048. icon: "none",
  1049. });
  1050. return false;
  1051. }
  1052. }
  1053. if (this.objData.semiProductList.length > 0) {
  1054. this.objData.semiProductList.map((ditem) => {
  1055. let wdid = ditem.deviceId ? ditem.deviceId.split("/") : "";
  1056. ditem.deviceId = wdid ? wdid[0] : "";
  1057. if (ditem.extInfo.batchReportInfo) {
  1058. ditem.extInfo.batchReportInfo.map((baItem) => {
  1059. let idvalue = baItem.deviceId ? baItem.deviceId.split("/") : "";
  1060. baItem.deviceId = idvalue ? idvalue[0] : "";
  1061. });
  1062. }
  1063. if (ditem.extInfo.notBatchReportInfo) {
  1064. ditem.extInfo.notBatchReportInfo.map((noItem) => {
  1065. let idvalue = noItem.deviceId ? noItem.deviceId.split("/") : "";
  1066. noItem.deviceId = idvalue ? idvalue[0] : "";
  1067. });
  1068. }
  1069. });
  1070. }
  1071. // console.log(this.objData, "this.objData");
  1072. // console.log(this.objData.equipmentList);
  1073. if (
  1074. this.objData.product.length != 0 &&
  1075. this.objData.equipmentList.length != 0
  1076. ) {
  1077. this.objData.product.forEach((item) => {
  1078. if (item.deviceId) {
  1079. this.objData.equipmentList.forEach((el) => {
  1080. if (item.deviceId == el.instanceId) {
  1081. item.deviceName = el.name;
  1082. }
  1083. });
  1084. }
  1085. });
  1086. }
  1087. // console.log(this.objData, "savesavesaveobjDataobjDataobjData");
  1088. let newList = [];
  1089. newList.push({
  1090. currentTaskDiagram: this.objData.currentTaskDiagram,
  1091. workOrderId: this.objData.workOrderId,
  1092. });
  1093. await checkReportNumber(newList).then((res) => {
  1094. if (res.length != 0) {
  1095. this.checkJobBook(res);
  1096. }
  1097. });
  1098. },
  1099. checkJobBook(list) {
  1100. for (let item of list) {
  1101. if (item.reportFormed != "0") {
  1102. this.titleText = `工单号${item.workOrderCode}已有报工,是否继续重复报工?`;
  1103. this.$refs.alertDialog.open();
  1104. } else {
  1105. this.jobBookReport();
  1106. }
  1107. }
  1108. },
  1109. dialogClose() {},
  1110. dialogConfirm() {
  1111. this.jobBookReport();
  1112. },
  1113. jobBookReport() {
  1114. jobSave(this.objData)
  1115. .then((res) => {
  1116. uni.hideLoading();
  1117. if (this.taskType == 4) {
  1118. uni.showModal({
  1119. title: "提示",
  1120. content: "打包完成是否去入库!",
  1121. confirmText: "确认", //这块是确定按钮的文字
  1122. success: (rr) => {
  1123. if (rr.confirm) {
  1124. uni.redirectTo({
  1125. url: `/pages/pda/warehousing/index?workOrderId=${this.id}&taskId=-1&workReportId=${res}&delta=-2`,
  1126. });
  1127. } else {
  1128. uni.navigateBack();
  1129. }
  1130. },
  1131. });
  1132. } else {
  1133. uni.navigateBack();
  1134. }
  1135. })
  1136. .finally(() => {
  1137. setTimeout(function () {
  1138. uni.hideLoading();
  1139. }, 3000);
  1140. });
  1141. },
  1142. checkRecycle() {
  1143. uni.hideLoading();
  1144. return new Promise((resolve) => {
  1145. uni.showModal({
  1146. title: "提示",
  1147. content: "是否跳过副产品回收处置!",
  1148. confirmText: "确认", //这块是确定按钮的文字
  1149. success: function (res) {
  1150. if (res.confirm) {
  1151. resolve(true);
  1152. } else {
  1153. resolve(false);
  1154. }
  1155. },
  1156. });
  1157. });
  1158. },
  1159. checkPack() {
  1160. uni.hideLoading();
  1161. return new Promise((resolve) => {
  1162. let packInfo = this.$refs.packRef.getData();
  1163. this.objData.packInfo = packInfo;
  1164. this.objData.taskType = this.taskType;
  1165. let formedNumLast = 0;
  1166. if (this.objData.singleReport == 1) {
  1167. formedNumLast = this.objData.semiProductList.reduce((acc, pro) => {
  1168. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  1169. }, 0);
  1170. } else if (this.objData.singleReport == 0) {
  1171. formedNumLast = this.objData.product.reduce((acc, pro) => {
  1172. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  1173. }, 0);
  1174. }
  1175. if (
  1176. formedNumLast !=
  1177. Number(this.objData.workReportInfo["formedNum"]) +
  1178. Number(this.objData.workReportInfo.notFormedNum)
  1179. ) {
  1180. uni.hideLoading();
  1181. uni.showModal({
  1182. title: "提示",
  1183. content: "合格品数量加不合格品数量不等于包装总数!",
  1184. confirmText: "确认", //这块是确定按钮的文字
  1185. success: function (res) {
  1186. if (res.confirm) {
  1187. resolve(true);
  1188. } else {
  1189. resolve(false);
  1190. }
  1191. },
  1192. });
  1193. } else {
  1194. resolve(true);
  1195. }
  1196. });
  1197. },
  1198. checkFirstTask() {
  1199. uni.hideLoading();
  1200. return new Promise((resolve) => {
  1201. if (
  1202. this.objData.formedNumLast !=
  1203. Number(this.objData.workReportInfo["formedNum"]) +
  1204. Number(this.objData.workReportInfo.notFormedNum)
  1205. ) {
  1206. uni.showModal({
  1207. title: "提示",
  1208. content: "合格品数量加不合格品数量不等于上道工序数量!",
  1209. confirmText: "确认", //这块是确定按钮的文字
  1210. success: function (res) {
  1211. if (res.confirm) {
  1212. resolve(true);
  1213. } else {
  1214. resolve(false);
  1215. }
  1216. },
  1217. });
  1218. } else {
  1219. resolve(true);
  1220. }
  1221. });
  1222. },
  1223. checkCache(type) {
  1224. uni.hideLoading();
  1225. return new Promise((resolve) => {
  1226. if (type == 1) {
  1227. saveCache(this.objData).then((rr) => {
  1228. uni.showToast({
  1229. title: `已经缓存`,
  1230. icon: "none",
  1231. });
  1232. });
  1233. resolve(false);
  1234. } else if (type == 2) {
  1235. resolve(true);
  1236. }
  1237. });
  1238. },
  1239. removeCacheFn() {
  1240. uni.showModal({
  1241. title: "缓存",
  1242. content: "是否清空缓存!",
  1243. confirmText: "确认", //这块是确定按钮的文字
  1244. success: (rr) => {
  1245. if (rr.confirm) {
  1246. let parma = {
  1247. workOrderIds: [this.id],
  1248. taskId: this.taskId,
  1249. type: 1,
  1250. };
  1251. removeCache(parma).then((res) => {
  1252. this.getList();
  1253. });
  1254. }
  1255. },
  1256. });
  1257. },
  1258. getCacheFn() {
  1259. let parma = {
  1260. workOrderId: this.id,
  1261. taskId: this.taskId,
  1262. type: 1,
  1263. };
  1264. getCache(parma).then((res) => {
  1265. if (
  1266. !res ||
  1267. res.length < 0 ||
  1268. Object.getOwnPropertyNames(res).length === 0
  1269. ) {
  1270. return false;
  1271. }
  1272. this.objData["product"] = res.extInfo.product;
  1273. this.objData["workReportInfo"] = res.extInfo.workReportInfo;
  1274. this.objData["notFormedList"] = res.extInfo.notFormedList;
  1275. this.objData["turnover"] = res.extInfo.turnover;
  1276. this.objData["productRecycleList"] = res.extInfo.productRecycleList;
  1277. this.objData["semiProductList"] = res.extInfo.semiProductList;
  1278. this.objData["modelList"] = res.extInfo.modelList;
  1279. });
  1280. },
  1281. //批量报工合格不合格重量统计
  1282. countNumPl(list, index) {
  1283. //合格总数
  1284. let formedNumCount = 0;
  1285. //合格总重量
  1286. let formedWeightCount = 0;
  1287. //不合格总数
  1288. let notFormedNumCount = 0;
  1289. //不合格总重量
  1290. let notFormedWeightCount = 0;
  1291. list.map((item) => {
  1292. //合格总数
  1293. item.extInfo.batchReportInfo.forEach((m) => {
  1294. formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
  1295. });
  1296. //合格总重量
  1297. item.extInfo.batchReportInfo.forEach((w) => {
  1298. formedWeightCount =
  1299. formedWeightCount + Number(w.allReportWeight || 0);
  1300. });
  1301. //不合格总数
  1302. item.extInfo.notBatchReportInfo.forEach((nf) => {
  1303. notFormedNumCount =
  1304. notFormedNumCount + Number(nf.allFeedQuantity || 0);
  1305. });
  1306. //不合格总重量
  1307. item.extInfo.notBatchReportInfo.forEach((nw) => {
  1308. notFormedWeightCount =
  1309. notFormedWeightCount + Number(nw.allReportWeight || 0);
  1310. });
  1311. });
  1312. this.$set(this.objData.workReportInfo, "formedNum", formedNumCount); //合格总数
  1313. this.$set(this.objData.workReportInfo, "formedWeight", formedWeightCount); //合格总重量
  1314. this.$set(this.objData.workReportInfo, "notFormedNum", notFormedNumCount); //不合格总数
  1315. this.$set(
  1316. this.objData.workReportInfo,
  1317. "notFormedWeight",
  1318. notFormedWeightCount,
  1319. ); //不合格总重量
  1320. // this.$refs.jobReftg.formedTotal(
  1321. // formedNumCount,
  1322. // formedWeightCount,
  1323. // notFormedNumCount,
  1324. // notFormedWeightCount
  1325. // );
  1326. // console.log("777777777777777", this.objData);
  1327. this.objData = this.deepCopy(this.objData);
  1328. this.$forceUpdate();
  1329. },
  1330. deepCopy(obj, hash = new WeakMap()) {
  1331. if (obj === null) return null;
  1332. if (obj instanceof Date) return new Date(obj);
  1333. if (obj instanceof RegExp) return new RegExp(obj);
  1334. if (typeof obj !== "object" && typeof obj !== "function") return obj;
  1335. if (hash.has(obj)) return hash.get(obj);
  1336. const result = Array.isArray(obj) ? [] : {};
  1337. hash.set(obj, result);
  1338. return Object.keys(obj).reduce((acc, key) => {
  1339. acc[key] = this.deepCopy(obj[key], hash);
  1340. return acc;
  1341. }, result);
  1342. },
  1343. },
  1344. beforeDestroy() {
  1345. uni.hideLoading();
  1346. },
  1347. };
  1348. </script>
  1349. <style lang="scss" scoped>
  1350. .content-box {
  1351. height: 100vh;
  1352. overflow: hidden;
  1353. display: flex;
  1354. flex-direction: column;
  1355. }
  1356. .list_box {
  1357. flex: 1;
  1358. overflow: hidden;
  1359. padding: 4rpx 0;
  1360. .u-list {
  1361. height: 100% !important;
  1362. }
  1363. .card_box {
  1364. padding: 16rpx 20rpx;
  1365. }
  1366. }
  1367. .bottom-wrapper {
  1368. width: 100%;
  1369. display: flex;
  1370. align-items: center;
  1371. justify-content: space-around;
  1372. .btn_box {
  1373. width: 50%;
  1374. height: 88rpx;
  1375. line-height: 88rpx;
  1376. background: $theme-color;
  1377. text-align: center;
  1378. font-size: 36rpx;
  1379. font-style: normal;
  1380. font-weight: 400;
  1381. color: #fff;
  1382. &:first-child {
  1383. border-right: 2rpx solid #fff;
  1384. }
  1385. }
  1386. }
  1387. .operate_box {
  1388. padding: 10rpx 160rpx;
  1389. /deep/ .u-button {
  1390. width: 160rpx;
  1391. }
  1392. }
  1393. .search_list {
  1394. min-height: 500rpx;
  1395. padding: 0 32rpx;
  1396. }
  1397. .search_list2 {
  1398. min-height: 120rpx;
  1399. padding: 0 32rpx;
  1400. }
  1401. .flex_btn {
  1402. position: fixed;
  1403. right: 0;
  1404. bottom: 160rpx;
  1405. width: 40rpx;
  1406. height: 50rpx;
  1407. line-height: 66rpx;
  1408. border-radius: 22rpx 0 0 22rpx;
  1409. background: $theme-color;
  1410. text-align: center;
  1411. font-size: 22rpx;
  1412. font-style: normal;
  1413. font-weight: 400;
  1414. color: #fff;
  1415. opacity: 0.6;
  1416. .jiantou {
  1417. width: 30rpx;
  1418. height: 30rpx;
  1419. }
  1420. }
  1421. .flex_btn2 {
  1422. position: fixed;
  1423. right: 0;
  1424. bottom: 160rpx;
  1425. width: 126rpx;
  1426. min-height: 140rpx;
  1427. line-height: 62rpx;
  1428. border-radius: 22rpx 0 0 22rpx;
  1429. background: $theme-color;
  1430. text-align: center;
  1431. font-size: 22rpx;
  1432. font-style: normal;
  1433. font-weight: 400;
  1434. color: #fff;
  1435. opacity: 0.7;
  1436. .close_box {
  1437. height: 50rpx;
  1438. line-height: 50rpx;
  1439. width: 126rpx;
  1440. text-align: left;
  1441. .close {
  1442. width: 40rpx;
  1443. height: 40rpx;
  1444. padding: 6rpx 10rpx;
  1445. }
  1446. }
  1447. }
  1448. </style>