index.vue 23 KB

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