index.vue 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
  4. color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
  5. </uni-nav-bar>
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view class="card_box">
  9. <workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
  10. <paramBom v-if='paramDetailList.length != 0' :list='paramDetailList'></paramBom>
  11. <deviceBom v-if='objData.equipmentList.length != 0' :list='objData.equipmentList'></deviceBom>
  12. <modelBom v-if='objData.modelList.length != 0' :list='objData.modelList' pattern='job'
  13. ref='modelRef'>
  14. </modelBom>
  15. <jobBom v-if='isLoad' :item='objData' ref='jobRef' :notFormed='objData.notFormedList'
  16. @penalize='penalize' @modeNum='modeNum'></jobBom>
  17. <palletBom v-if="objData.palletList.length != 0" :palletList='objData.palletList'></palletBom>
  18. <revolvingDiskBom v-if="isLoad && objData.revolvingDiskList.length > 0" pattern='job'
  19. :revolvingDiskList="objData.revolvingDiskList"></revolvingDiskBom>
  20. <!-- <oneJobBom
  21. v-if='objData.instanceList && objData.instanceList.length != 0 && taskType != 4 && taskType != 6'
  22. :item='objData' :list='objData.instanceList'>
  23. </oneJobBom> -->
  24. <semiProductJobBom
  25. v-if='objData.semiProductList && objData.semiProductList.length != 0 && taskType != 4 && taskType != 6'
  26. :item='objData' :list='objData.semiProductList' :equipmentList="objData.equipmentList">
  27. </semiProductJobBom>
  28. <oneJobQualityBom
  29. v-if='objData.semiProductList && objData.semiProductList.length != 0 && taskType == 6 && clientEnvironmentId == 3'
  30. :item='objData' :list='objData.semiProductList'></oneJobQualityBom>
  31. <byProductBom v-if='objData.productRecycleList.length != 0' :list='objData.productRecycleList'
  32. @penalize='penalize'>
  33. </byProductBom>
  34. <turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData'
  35. pattern='job' @handleScan='handleScan' @formedNumFn='formedNumFn'>
  36. </turnoverBom>
  37. <aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList'
  38. :remainingTime='remainingTime' @handleScan='handleScan' :isType='true'></aridRegion>
  39. <packingBom :taskId='taskId' :workOrderId='id' :objData='objData' ref="packRef"
  40. v-if='taskType == 4 && clientEnvironmentId != 3 && objData'></packingBom>
  41. <packingTgBom
  42. v-if='objData.pickOutInList && objData.pickOutInList.length != 0 && taskType == 4 && clientEnvironmentId == 3'
  43. :list='objData.pickOutInList' :item='objData'></packingTgBom>
  44. <view class="operate_box rx-sc">
  45. <u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
  46. </view>
  47. <view style="height: 100rpx;"></view>
  48. </view>
  49. </u-list>
  50. </view>
  51. <view :class="[operateBtn ? 'flex_btn': 'flex_btn2']">
  52. <image v-if="operateBtn" class="jiantou" src="../../../../static/rightJt.png" @click="operateBtn = false">
  53. </image>
  54. <view class="close_box" @click="operateBtn = true">
  55. <image v-if="!operateBtn" class="close" src="../../../../static/close.png"></image>
  56. </view>
  57. <view v-if="!operateBtn" @click="removeCacheFn()">清空缓存</view>
  58. <view v-if="!operateBtn" @click="switchOrder = true">切换工单</view>
  59. </view>
  60. <view class="bottom-wrapper">
  61. <view class="btn_box" @click="save(1)">缓存</view>
  62. <view class="btn_box" @click="save(2)">一键报工</view>
  63. </view>
  64. <SearchPopup mode="bottom" v-if='searchShow'>
  65. <template v-slot:list>
  66. <view class="search_list">
  67. <u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
  68. <u-form-item label="仓库:" class="required-form" borderBottom prop="warehouseId">
  69. <zxz-uni-data-select :localdata="warehouseList" v-model="formData.warehouseId"
  70. dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  71. </u-form-item>
  72. </u-form>
  73. </view>
  74. </template>
  75. <template v-slot:operate>
  76. <view class="operate_box rx-bc">
  77. <u-button size="small" class="u-reset-button" @click="searchCancel">
  78. 取消
  79. </u-button>
  80. <u-button type="success" size="small" class="u-reset-button" @click="popupOk">
  81. 确定
  82. </u-button>
  83. </view>
  84. </template>
  85. </SearchPopup>
  86. <SearchPopup mode="center" v-if='switchOrder'>
  87. <template v-slot:list>
  88. <view class="search_list2">
  89. <u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
  90. <u-form-item label="工单:" class="required-form" borderBottom prop="warehouseId">
  91. <zxz-uni-data-select :localdata="warehouseList" v-model="formData.warehouseId"
  92. dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  93. </u-form-item>
  94. </u-form>
  95. </view>
  96. </template>
  97. <template v-slot:operate>
  98. <view class="operate_box rx-bc">
  99. <u-button size="small" class="u-reset-button" @click="switchOrder = false ">
  100. 取消
  101. </u-button>
  102. <u-button type="success" size="small" class="u-reset-button">
  103. 确定
  104. </u-button>
  105. </view>
  106. </template>
  107. </SearchPopup>
  108. </view>
  109. </template>
  110. <script>
  111. import {
  112. getByIdReport,
  113. getByCodeReport,
  114. jobSave
  115. } from '@/api/pda/jobBooking.js'
  116. import {
  117. scanLedger,
  118. getWarehouseList,
  119. saveCache,
  120. getCache,
  121. removeCache
  122. } from '@/api/pda/workOrder.js'
  123. import workOrderBom from '../../feeding/components/workOrderBom.vue'
  124. import deviceBom from '../../feeding/components/deviceBom.vue'
  125. import modelBom from '../../feeding/components/modelBom.vue'
  126. import jobBom from '../components/jobBom.vue'
  127. import palletBom from '../components/palletBom.vue'
  128. import oneJobBom from '../components/oneJobBom.vue'
  129. import semiProductJobBom from '../components/semiProductJobBom.vue'
  130. import byProductBom from '../components/byProductBom'
  131. import turnoverBom from '../components/turnoverBom.vue'
  132. import aridRegion from '../../feeding/components/aridRegion.vue'
  133. import paramBom from '../../feeding/components/paramBom.vue'
  134. import packingBom from '../components/packingBom.vue'
  135. import packingTgBom from '../components/packingTgBom'
  136. import revolvingDiskBom from '../../feeding/components/revolvingDiskBom.vue'
  137. import SearchPopup from '../../components/searchPopup.vue'
  138. import oneJobQualityBom from '../components/oneJobQualityBom.vue'
  139. export default {
  140. components: {
  141. workOrderBom,
  142. deviceBom,
  143. modelBom,
  144. jobBom,
  145. palletBom,
  146. oneJobBom,
  147. semiProductJobBom,
  148. byProductBom,
  149. turnoverBom,
  150. aridRegion,
  151. paramBom,
  152. packingBom,
  153. packingTgBom,
  154. revolvingDiskBom,
  155. SearchPopup,
  156. oneJobQualityBom
  157. },
  158. data() {
  159. return {
  160. title: '',
  161. taskType: 1,
  162. isLoad: true,
  163. objData: {
  164. equipmentList: [],
  165. modelList: [],
  166. turnover: [],
  167. productRecycleList: [],
  168. aridRegionList: [],
  169. palletList: [],
  170. workReportInfo: {
  171. },
  172. notFormedList: [], // 报工-不合格
  173. },
  174. searchShow: false,
  175. switchOrder: false,
  176. warehouseList: [],
  177. formData: {
  178. warehouseId: ''
  179. },
  180. penalizeIndex: null,
  181. paramDetailList: [],
  182. remainingTime: 0,
  183. id: null,
  184. taskId: null,
  185. clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
  186. .clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  187. operateBtn: true
  188. }
  189. },
  190. onLoad(options) {
  191. this.title = options.taskName ? options.taskName + '-报工' : '报工'
  192. this.taskType = options.taskType
  193. this.id = options.id
  194. this.taskId = options.taskId
  195. this.getList()
  196. },
  197. onShow() {
  198. uni.$off("setSelectList");
  199. uni.$on("setSelectList", (selectList, id) => {
  200. let turnover = []
  201. let equipmentList = [] // 生产设备
  202. let isEquipment = this.objData.equipmentList.length > 0 ? true : false // 判断是否有设置
  203. selectList.forEach(f => {
  204. if (f.rootCategoryLevelId == 4) { // 生产设备
  205. if (isEquipment) {
  206. equipmentList = this.objData.equipmentList
  207. } else {
  208. equipmentList = equipmentList.concat(f)
  209. }
  210. }
  211. if (f.rootCategoryLevelId == 7) { // 周转车
  212. turnover = turnover.concat(f)
  213. }
  214. })
  215. this.$set(this.objData, 'equipmentList', equipmentList)
  216. this.$set(this.objData, 'turnover', turnover)
  217. this.$forceUpdate()
  218. });
  219. },
  220. methods: {
  221. // 相机扫码
  222. HandlScanCode() {
  223. uni.scanCode({
  224. success: (res) => {
  225. this.scanItAllData(res.result)
  226. }
  227. })
  228. },
  229. scanItAllData(result) {
  230. scanLedger(result).then(res => {
  231. if (res[0].rootCategoryLevelId == 4) { // 设备
  232. let isFals = this.objData.equipmentList.some(m => m.code == result)
  233. if (isFals) {
  234. uni.showToast({
  235. title: '设备已存在',
  236. icon: 'none'
  237. })
  238. return false
  239. }
  240. this.objData.equipmentList.push(res[0])
  241. this.$forceUpdate()
  242. }
  243. if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 磨具
  244. if (this.objData.modelList.length == 0) {
  245. this.objData.modelList = res
  246. this.$forceUpdate()
  247. } else {
  248. if (this.objData.modelList[0].instanceId != res[0].instanceId) {
  249. uni.showToast({
  250. title: '模具不匹配',
  251. icon: 'none'
  252. })
  253. } else {
  254. uni.showToast({
  255. title: '设备匹配成功',
  256. icon: 'none'
  257. })
  258. }
  259. }
  260. } else if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
  261. let isFals = this.objData.turnover.some(m => m.code == result)
  262. if (isFals) {
  263. uni.showToast({
  264. title: '周转车已存在',
  265. icon: 'none'
  266. })
  267. return false
  268. }
  269. this.objData.turnover.push(res[0])
  270. this.$forceUpdate()
  271. }
  272. })
  273. },
  274. handleScan(id, type) {
  275. uni.scanCode({
  276. success: (res) => {
  277. this.scanData(res.result, type, id)
  278. }
  279. })
  280. },
  281. scanData(result, type, id) {
  282. if (type == 'wordOrder') {
  283. getByCodeReport(result, this.taskId).then(res => {
  284. this.objData = res
  285. if (!this.objData.hasOwnProperty('turnover')) {
  286. this.objData['turnover'] = []
  287. }
  288. if (!this.objData.hasOwnProperty('aridRegionList')) {
  289. this.objData['aridRegionList'] = []
  290. }
  291. })
  292. } else if (type == 'turnover') {
  293. let isFals = this.objData.turnover.some(m => m.code == result)
  294. if (isFals) {
  295. uni.showToast({
  296. title: '周转车已存在',
  297. icon: 'none'
  298. })
  299. return false
  300. }
  301. getByCodeReport(result, this.taskId).then(res => {
  302. this.objData.turnover[id] = res
  303. })
  304. }
  305. },
  306. formedNumFn(num) {
  307. this.$refs.jobRef.setFormedNum(num)
  308. },
  309. getList() {
  310. this.isLoad = false
  311. getByIdReport(this.id, this.taskId).then(res => {
  312. this.objData = res
  313. console.log(res)
  314. if (!this.objData.hasOwnProperty('turnover')) {
  315. this.objData['turnover'] = []
  316. }
  317. if (!this.objData.hasOwnProperty('aridRegionList')) {
  318. this.objData['aridRegionList'] = []
  319. }
  320. if (!this.objData.hasOwnProperty('instanceList')) {
  321. this.objData['instanceList'] = []
  322. }
  323. if (!this.objData.hasOwnProperty('palletList')) {
  324. this.objData['palletList'] = []
  325. }
  326. if (!this.objData.hasOwnProperty('revolvingDiskList')) {
  327. this.objData['revolvingDiskList'] = []
  328. }
  329. // this.taskType = res.currentTaskDiagram.type
  330. if (this.objData.palletList.length > 0) {
  331. this.objData.palletList = this.objData.palletList.map(m => {
  332. return {
  333. hideKc: true, // 不显示库存
  334. quantity: m.feedQuantity,
  335. ...m
  336. }
  337. })
  338. } else {
  339. // this.objData.palletList = [{
  340. // categoryLevelId: '',
  341. // categoryLevelName: '',
  342. // categoryId: '',
  343. // rootCategoryLevelId: '',
  344. // code: '',
  345. // name: '',
  346. // specification: '',
  347. // brandNum: '',
  348. // modelType: '',
  349. // quantity: '',
  350. // unit: '',
  351. // }]
  352. }
  353. if (this.taskType == 6 && this.clientEnvironmentId == 3) {
  354. this.objData.semiProductList = this.objData.pickOutInList
  355. }
  356. this.objData.workReportInfo = {
  357. formingNum: null,
  358. formingWeight: null,
  359. formedNum: null,
  360. formedWeight: null,
  361. taskId: this.taskId
  362. }
  363. this.objData.notFormedList = [{
  364. notFormedNum: null,
  365. notFormedWeight: null,
  366. weightUnit: res.weightUnit,
  367. unit: res.unit,
  368. warehouseId: null, // 处置 仓库id
  369. }]
  370. if (this.objData.semiProductList.length > 0) { // 预制体报工
  371. this.objData.workReportInfo.formedNum = this.objData.semiProductList.length
  372. }
  373. this.objData.workReportInfo.formingNum = res.formingNum
  374. this.objData.workReportInfo.formingWeight = res.formingWeight
  375. this.objData.workReportInfo.unit = res.unit
  376. this.objData.workReportInfo.weightUnit = res.weightUnit
  377. this.objData.workReportInfo.workOrderId = res.workOrderId
  378. this.paramDetailList = []
  379. this.paramDetailList = res.paramDetailList.map(m => {
  380. if (m.extInfo.textType == 5) {
  381. this.remainingTime = m.extInfo.remainingTime
  382. }
  383. return {
  384. ...m.extInfo
  385. }
  386. })
  387. }).finally(() => {
  388. this.isLoad = true
  389. if (this.taskType == 1) {
  390. this.getCacheFn()
  391. }
  392. })
  393. },
  394. scrolltolower() {},
  395. handAdd() {
  396. const storageKey = Date.now() + "";
  397. uni.setStorageSync(storageKey, this.objData || {});
  398. uni.navigateTo({
  399. url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job&taskId=${this.taskId}`
  400. })
  401. },
  402. penalize(index) {
  403. if (index || index == 0) {
  404. this.penalizeIndex = index
  405. this.formData.warehouseId = this.objData.productRecycleList[this.penalizeIndex].warehouseId || ''
  406. } else {
  407. this.penalizeIndex = null
  408. this.formData.warehouseId = this.objData.notFormedList[0].warehouseId || ''
  409. }
  410. this.$forceUpdate()
  411. if (this.warehouseList.length == 0) {
  412. getWarehouseList().then(res => {
  413. this.warehouseList = res
  414. this.searchShow = true
  415. })
  416. } else {
  417. this.searchShow = true
  418. }
  419. },
  420. inputChange(e) {
  421. console.log(e)
  422. },
  423. searchCancel() {
  424. this.searchShow = false
  425. },
  426. popupOk() {
  427. if (this.penalizeIndex == null) {
  428. this.$set(this.objData.notFormedList[0], 'warehouseId', this.formData.warehouseId || null)
  429. } else {
  430. this.objData.productRecycleList[this.penalizeIndex].warehouseId = this.formData.warehouseId
  431. }
  432. this.$forceUpdate()
  433. this.searchShow = false
  434. },
  435. modeNum(num) {
  436. if (this.objData.modelList.length == 0) {
  437. return false
  438. }
  439. this.$refs.modelRef.setNum(num)
  440. },
  441. async save(type) {
  442. uni.showLoading({
  443. title: '加载中'
  444. });
  445. if (!this.objData.workReportInfo['formedNum'] && this.objData.workReportInfo['formedNum'] != 0) {
  446. uni.showToast({
  447. title: '请输入合格品数量',
  448. icon: 'none'
  449. })
  450. return false
  451. }
  452. // 预制体
  453. if (this.objData.instanceList.length > 0 && this.taskType != 4) {
  454. let bol
  455. let _i
  456. bol = this.objData.instanceList.every((e, i) => {
  457. _i = i + 1
  458. if (this.taskType == 6) {
  459. return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId
  460. } else {
  461. return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId && e.extInfo
  462. .reportWeight
  463. }
  464. })
  465. if (!bol) {
  466. uni.showToast({
  467. title: `请完善第${_i}处置方式`,
  468. icon: 'none'
  469. })
  470. return false
  471. }
  472. }
  473. if (this.objData.productRecycleList.length > 0 && this.clientEnvironmentId != 2) {
  474. const isRecycle = await this.checkRecycle()
  475. if (!isRecycle) {
  476. return false
  477. }
  478. }
  479. if (this.taskType == 4 && this.clientEnvironmentId != 3) {
  480. const isPack = await this.checkPack()
  481. if (!isPack) {
  482. return false
  483. }
  484. }
  485. if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask 1是 判断是否首工序
  486. const isFirstTask = await this.checkFirstTask()
  487. if (!isFirstTask) {
  488. return false
  489. }
  490. }
  491. if (this.taskType == 1) {
  492. const isCache = await this.checkCache(type)
  493. if (!isCache) {
  494. return false
  495. }
  496. }
  497. jobSave(this.objData).then(res => {
  498. uni.hideLoading();
  499. if (this.taskType == 4) {
  500. uni.showModal({
  501. title: '提示',
  502. content: '打包完成是否去入库!',
  503. confirmText: '确认', //这块是确定按钮的文字
  504. success: rr => {
  505. if (rr.confirm) {
  506. uni.redirectTo({
  507. url: `/pages/pda/warehousing/index?workOrderId=${this.id}&taskId=-1&workReportId=${res}&delta=-2`
  508. })
  509. } else {
  510. uni.navigateBack()
  511. }
  512. }
  513. })
  514. } else {
  515. uni.navigateBack()
  516. }
  517. }).finally(() => {
  518. setTimeout(function() {
  519. uni.hideLoading();
  520. }, 3000);
  521. })
  522. },
  523. checkRecycle() {
  524. uni.hideLoading();
  525. return new Promise((resolve) => {
  526. uni.showModal({
  527. title: '提示',
  528. content: '是否跳过副产品回收处置!',
  529. confirmText: '确认', //这块是确定按钮的文字
  530. success: function(res) {
  531. if (res.confirm) {
  532. resolve(true)
  533. } else {
  534. resolve(false)
  535. }
  536. }
  537. })
  538. })
  539. },
  540. checkPack() {
  541. uni.hideLoading();
  542. return new Promise((resolve) => {
  543. let packInfo = this.$refs.packRef.getData()
  544. this.objData.packInfo = packInfo
  545. this.objData.taskType = this.taskType
  546. if (packInfo.formedNumLast != Number(this.objData.workReportInfo['formedNum']) + Number(this
  547. .objData
  548. .notFormedList[0].notFormedNum)) {
  549. uni.hideLoading();
  550. uni.showModal({
  551. title: '提示',
  552. content: '合格品数量加不合格品数量不等于包装总数!',
  553. confirmText: '确认', //这块是确定按钮的文字
  554. success: function(res) {
  555. if (res.confirm) {
  556. resolve(true)
  557. } else {
  558. resolve(false)
  559. }
  560. }
  561. })
  562. } else {
  563. resolve(true)
  564. }
  565. })
  566. },
  567. checkFirstTask() {
  568. uni.hideLoading();
  569. return new Promise((resolve) => {
  570. if (this.objData.formedNumLast != Number(this.objData.workReportInfo['formedNum']) + Number(
  571. this.objData.notFormedList[0].notFormedNum)) {
  572. uni.showModal({
  573. title: '提示',
  574. content: '合格品数量加不合格品数量不等于上道工序数量!',
  575. confirmText: '确认', //这块是确定按钮的文字
  576. success: function(res) {
  577. if (res.confirm) {
  578. resolve(true)
  579. } else {
  580. resolve(false)
  581. }
  582. }
  583. })
  584. } else {
  585. resolve(true)
  586. }
  587. })
  588. },
  589. checkCache(type) {
  590. uni.hideLoading();
  591. return new Promise((resolve) => {
  592. if (type == 1) {
  593. saveCache(this.objData).then(rr => {
  594. uni.showToast({
  595. title: `已经缓存`,
  596. icon: 'none'
  597. })
  598. })
  599. resolve(false)
  600. } else if (type == 2) {
  601. resolve(true)
  602. }
  603. })
  604. },
  605. removeCacheFn() {
  606. uni.showModal({
  607. title: '缓存',
  608. content: '是否清空缓存!',
  609. confirmText: '确认', //这块是确定按钮的文字
  610. success: rr => {
  611. if (rr.confirm) {
  612. let parma = {
  613. workOrderIds: [this.id],
  614. taskId: this.taskId,
  615. type: 1
  616. }
  617. removeCache(parma).then(res => {
  618. this.getList()
  619. })
  620. }
  621. }
  622. })
  623. },
  624. getCacheFn() {
  625. let parma = {
  626. workOrderId: this.id,
  627. taskId: this.taskId,
  628. type: 1
  629. }
  630. getCache(parma).then(res => {
  631. if (!res && res.length < 0) {
  632. return false;
  633. }
  634. this.objData['product'] = res.extInfo.product
  635. this.objData['workReportInfo'] = res.extInfo.workReportInfo
  636. this.objData['notFormedList'] = res.extInfo.notFormedList
  637. this.objData['turnover'] = res.extInfo.turnover
  638. this.objData['productRecycleList'] = res.extInfo.productRecycleList
  639. this.objData['semiProductList'] = res.extInfo.semiProductList
  640. this.objData['modelList'] = res.extInfo.modelList
  641. })
  642. },
  643. },
  644. beforeDestroy() {
  645. uni.hideLoading();
  646. },
  647. }
  648. </script>
  649. <style lang="scss" scoped>
  650. .content-box {
  651. height: 100vh;
  652. overflow: hidden;
  653. display: flex;
  654. flex-direction: column;
  655. }
  656. .list_box {
  657. flex: 1;
  658. overflow: hidden;
  659. padding: 4rpx 0;
  660. .u-list {
  661. height: 100% !important;
  662. }
  663. .card_box {
  664. padding: 16rpx 20rpx;
  665. }
  666. }
  667. .bottom-wrapper {
  668. width: 100%;
  669. display: flex;
  670. align-items: center;
  671. justify-content: space-around;
  672. .btn_box {
  673. width: 50%;
  674. height: 88rpx;
  675. line-height: 88rpx;
  676. background: $theme-color;
  677. text-align: center;
  678. font-size: 36rpx;
  679. font-style: normal;
  680. font-weight: 400;
  681. color: #fff;
  682. &:first-child {
  683. border-right: 2rpx solid #fff;
  684. }
  685. }
  686. }
  687. .operate_box {
  688. padding: 10rpx 160rpx;
  689. /deep/ .u-button {
  690. width: 160rpx;
  691. }
  692. }
  693. .search_list {
  694. min-height: 500rpx;
  695. padding: 0 32rpx;
  696. }
  697. .search_list2 {
  698. min-height: 120rpx;
  699. padding: 0 32rpx;
  700. }
  701. .flex_btn {
  702. position: fixed;
  703. right: 0;
  704. bottom: 160rpx;
  705. width: 40rpx;
  706. height: 50rpx;
  707. line-height: 66rpx;
  708. border-radius: 22rpx 0 0 22rpx;
  709. background: $theme-color;
  710. text-align: center;
  711. font-size: 22rpx;
  712. font-style: normal;
  713. font-weight: 400;
  714. color: #fff;
  715. opacity: 0.6;
  716. .jiantou {
  717. width: 30rpx;
  718. height: 30rpx;
  719. }
  720. }
  721. .flex_btn2 {
  722. position: fixed;
  723. right: 0;
  724. bottom: 160rpx;
  725. width: 126rpx;
  726. min-height: 140rpx;
  727. line-height: 62rpx;
  728. border-radius: 22rpx 0 0 22rpx;
  729. background: $theme-color;
  730. text-align: center;
  731. font-size: 22rpx;
  732. font-style: normal;
  733. font-weight: 400;
  734. color: #fff;
  735. opacity: 0.7;
  736. .close_box {
  737. height: 50rpx;
  738. line-height: 50rpx;
  739. width: 126rpx;
  740. text-align: left;
  741. .close {
  742. width: 40rpx;
  743. height: 40rpx;
  744. padding: 6rpx 10rpx;
  745. }
  746. }
  747. }
  748. </style>