details.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  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"></uni-nav-bar>
  5. <!-- 投料 -->
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view v-for="(item, index) in List" :key="index" class="card_box">
  9. <!-- 工单信息 -->
  10. <workOrderBom :item='item' pType="feed" :taskType="item.currentTaskDiagram.type"
  11. @handleScan='handleScan'></workOrderBom>
  12. <paramBom v-if='item.paramDetailList.length != 0' :list='item.paramDetailList'></paramBom>
  13. <!-- //设备信息 -->
  14. <deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId' :wordItem='item'
  15. :list='item.equipmentList' :turnover="item.turnover" @scanIt='scanIt' :type="type"></deviceBom>
  16. <!-- //在制品 -->
  17. <productsBom v-if="item.product != null && item.product != '{}'" :itemObj="item"
  18. :productsObj="item.product">
  19. </productsBom>
  20. <!-- feedNeedMould -->
  21. <modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList'
  22. @scanIt='scanIt' :pattern="'feed'">
  23. </modelBom>
  24. <instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId'
  25. :list='item.instanceList' :equipmentList="item.equipmentList"
  26. :currentTaskDiagram="item.currentTaskDiagram" :workInfo="item">
  27. </instanceBom>
  28. <semiProductBom v-if='item.semiProductList.length != 0' :workOrderId='item.workOrderId'
  29. :list='item.semiProductList' :equipmentList="item.equipmentList"
  30. :currentTaskDiagram="item.currentTaskDiagram" :workInfo="item"></semiProductBom>
  31. <!-- 11 周转车 -->
  32. <turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='feed'
  33. @handleScan='handleScan' @handleDel='handleDel' :productsObj="item.product"
  34. :productsObjClone="cloneListNum"></turnoverBom>
  35. <aridRegion v-if='item.aridRegionList.length != 0' :list='item.aridRegionList'
  36. @handleScan='handleScan'></aridRegion>
  37. <palletBom v-if='item.palletList.length != 0' :palletList='item.palletList'></palletBom>
  38. <revolvingDiskBom v-if="item.revolvingDiskList.length != 0"
  39. :revolvingDiskList="item.revolvingDiskList"></revolvingDiskBom>
  40. <packingBom v-if='item.packingList.length != 0' :list='item.packingList'></packingBom>
  41. <view :class="[operateBtn ? 'flex_btn' : 'flex_btn2']">
  42. <image v-if="operateBtn" class="jiantou" src="../../../static/rightJt.png"
  43. @click="operateBtn = false"> </image>
  44. <view class="close_box" @click="operateBtn = true">
  45. <image v-if="!operateBtn" class="close" src="../../../static/close.png"></image>
  46. </view>
  47. <view v-if="!operateBtn" @click="openDetails(item.workOrderId)">出库单</view>
  48. <view v-if="!operateBtn" @click="removeCacheFn()">清空缓存</view>
  49. </view>
  50. <view :class="[idsList.length == 1 ? 'operate_box' : 'operate_box2']">
  51. <u-button size="small" class="u-reset-button" type="success"
  52. @click="handAdd(item.workOrderId)">手动添加</u-button>
  53. <u-button size="small" class="u-reset-button" type="success"
  54. @click="scanIt(item.workOrderId)">扫一扫</u-button>
  55. </view>
  56. </view>
  57. </u-list>
  58. </view>
  59. <view class="bottom-wrapper">
  60. <view class="btn_box" @click="save(1)">缓存</view>
  61. <view class="btn_box" @click="save(2)">一键投料</view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import workOrderBom from './components/workOrderBom.vue' //gd
  67. import deviceBom from './components/deviceBom.vue' //设备信息
  68. import modelBom from './components/modelBom.vue' //模具信息
  69. import instanceBom from './components/instanceBom.vue'
  70. import semiProductBom from './components/semiProductBom' //半成品信息
  71. import aridRegion from './components/aridRegion' //干燥区
  72. import paramBom from './components/paramBom.vue' //
  73. import turnoverBom from './components/turnoverBom.vue' //周转车信息
  74. import packingBom from './components/packingBom.vue' //包装信息
  75. import productsBom from './components/productsBom.vue' //在制品信息
  76. import palletBom from './components/palletBom' //舟皿
  77. import revolvingDiskBom from './components/revolvingDiskBom'
  78. import {
  79. workorderList,
  80. getByCode,
  81. scanLedger,
  82. feedSaveCache,
  83. feedGetCache,
  84. removeCache
  85. } from '@/api/pda/workOrder.js'
  86. import {
  87. batchSave
  88. } from '@/api/pda/feeding.js'
  89. export default {
  90. components: {
  91. workOrderBom,
  92. deviceBom,
  93. modelBom,
  94. instanceBom,
  95. semiProductBom,
  96. aridRegion,
  97. paramBom,
  98. turnoverBom,
  99. packingBom,
  100. productsBom,
  101. palletBom,
  102. revolvingDiskBom,
  103. },
  104. data() {
  105. return {
  106. title: '',
  107. idsList: [],
  108. List: [],
  109. taskId: null,
  110. type: '',
  111. clientEnvironmentId: null,
  112. operateBtn: true,
  113. cloneListNum: '',
  114. }
  115. },
  116. onLoad(options) {
  117. this.title = options.taskName ? options.taskName + '-投料' : '投料'
  118. let queryArray = decodeURIComponent(options.arr);
  119. this.idsList = JSON.parse(queryArray);
  120. this.taskId = options.taskId;
  121. this.taskName = options.taskName;
  122. this.type = options.type;
  123. this.getList()
  124. this.clientEnvironmentId = uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId
  125. },
  126. onShow() {
  127. uni.$off("setSelectList");
  128. uni.$on("setSelectList", (selectList, id) => {
  129. console.log(this.List, selectList, '444444444444465555555555555');
  130. this.List.forEach(m => {
  131. let num=0;
  132. selectList.map(v => {
  133. v.extInfo.positionList.map(d => {
  134. if (m.code == d.workOrderCode) {
  135. console.log(d);
  136. num+=d.quantity;
  137. }
  138. })
  139. })
  140. this.cloneListNum = num;
  141. m.product.feedQuantity = num;
  142. if (m.workOrderId == id) {
  143. let modelList = [] // 模具
  144. let instanceList = [] // 投料
  145. let aridRegionList = [] // 干燥区
  146. let equipmentList = [] // 生产设备
  147. let palletList = [] // 舟皿
  148. let revolvingDiskList = [] // 周转盘
  149. let semiProductList = [] // 半成品
  150. let turnover = [] //周转车
  151. selectList.forEach(f => {
  152. if (f.rootCategoryLevelId == 4) {
  153. equipmentList = equipmentList.concat(f)
  154. equipmentList.map(d => {
  155. if (d.equipmentLabelJson.length) {
  156. d.equipmentLabelJson.map(v => {
  157. if (v.SJSB) {
  158. d.isSJSB = v.SJSB
  159. }
  160. })
  161. }
  162. })
  163. console.log(equipmentList, '----------');
  164. }
  165. if (f.rootCategoryLevelId == 5) {
  166. modelList = modelList.concat(f)
  167. } else if (f.rootCategoryLevelId == 1) {
  168. instanceList = instanceList.concat(f)
  169. } else if (f.rootCategoryLevelId == 11) {
  170. aridRegionList = aridRegionList.concat(f)
  171. } else if (f.rootCategoryLevelId == 7) {
  172. turnover = turnover.concat(f)
  173. } else if (f.rootCategoryLevelId == 8) {
  174. palletList = palletList.concat(f)
  175. } else if (f.rootCategoryLevelId == 26) {
  176. revolvingDiskList = revolvingDiskList.concat(f)
  177. } else if ([23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))) {
  178. semiProductList = semiProductList.concat(f)
  179. }
  180. })
  181. this.$set(m, 'modelList', modelList)
  182. this.$set(m, 'instanceList', instanceList)
  183. this.$set(m, 'aridRegionList', aridRegionList)
  184. this.$set(m, 'equipmentList', equipmentList)
  185. this.$set(m, 'turnover', turnover)
  186. this.$set(m, 'palletList', palletList)
  187. this.$set(m, 'revolvingDiskList', revolvingDiskList)
  188. this.$set(m, 'semiProductList', semiProductList)
  189. }
  190. })
  191. });
  192. },
  193. methods: {
  194. scrolltolower() { },
  195. clonenember(e) {
  196. return JSON.parse(JSON.stringify(e))
  197. },
  198. async save(type) {
  199. console.log(this.List);
  200. this.List.forEach(f => {
  201. this.$isJobExls(2, f)
  202. })
  203. this.List.forEach(f => {
  204. f.instanceList.forEach(e => {
  205. if (Object.prototype.hasOwnProperty.call(e, 'type')) {
  206. e.extInfo['type'] = e.type
  207. }
  208. e.extInfo['isConsumable'] = e.isConsumable
  209. })
  210. })
  211. const isCache = await this.checkCache(type)
  212. if (!isCache) {
  213. return false
  214. }
  215. if (this.clientEnvironmentId == 3 && this.List[0].currentTaskDiagram.type == 1) {
  216. if (this.List[0] && this.List[0].executorTime && this.List[0].executorTime != undefined) {
  217. // 正则表达式1:匹配 yyyy-MM-dd 格式
  218. let dateRegex = /^\d{4}-\d{2}-\d{2}$/;
  219. if (dateRegex.test(this.List[0].executorTime.trimRight())) {
  220. this.List[0].executorTime = this.List[0].executorTime + ' 00:00:00'
  221. }
  222. } else {
  223. uni.showToast({
  224. title: `请先选择时间投料时间`,
  225. icon: 'none'
  226. })
  227. return false
  228. }
  229. }
  230. const isDevice = await this.checkdDevice()
  231. if (!isDevice) {
  232. return false
  233. }
  234. // item.equipmentList
  235. // 索尔环境下,需要填写炉次号
  236. if (this.clientEnvironmentId === 2) {
  237. if (this.List[0].equipmentList.length) {
  238. if (!this.equipmentListList('heatNumber')) {
  239. return uni.showToast({
  240. title: `请填写炉次号`,
  241. icon: 'none'
  242. })
  243. }
  244. }
  245. }
  246. batchSave(this.List).then(res => {
  247. uni.redirectTo({
  248. url: `/pages/pda/feeding/index/index?feedStatus=1`,
  249. });
  250. })
  251. },
  252. equipmentListList(propertyName) {
  253. return this.List.every(f => {
  254. if (f.equipmentList && f.equipmentList.length > 0) {
  255. return f.equipmentList.every(obj => {
  256. // 检查属性存在且不为空(null, undefined, 空字符串等)
  257. return obj.extInfo.hasOwnProperty(propertyName) &&
  258. obj.extInfo[propertyName] !== null &&
  259. obj.extInfo[propertyName] !== undefined &&
  260. obj.extInfo[propertyName] !== '';
  261. })
  262. }
  263. })
  264. },
  265. checkCache(type) {
  266. uni.hideLoading();
  267. return new Promise((resolve) => {
  268. if (type == 1) {
  269. feedSaveCache(this.List).then(rr => {
  270. uni.showToast({
  271. title: `已经缓存`,
  272. icon: 'none'
  273. })
  274. })
  275. resolve(false)
  276. } else if (type == 2) {
  277. resolve(true)
  278. }
  279. })
  280. },
  281. getList() {
  282. workorderList({
  283. ids: this.idsList,
  284. taskId: this.taskId
  285. }).then(res => {
  286. this.List = res.map(m => {
  287. m.workOrderId = m.id
  288. m.instanceList = [] // 物料
  289. m.equipmentList = [] // 设备
  290. m.modelList = [] // 模具
  291. m.aridRegionList = [] // 干燥区
  292. m.packingList = [] // 包装
  293. m.palletList = [] // 舟皿
  294. m.revolvingDiskList = [] // 周转盘
  295. m.semiProductList = [] //半成品
  296. if (m.pickOutInList.length > 0) {
  297. m.pickOutInList.forEach(f => {
  298. if (f.rootCategoryLevelId == 1) {
  299. m.instanceList.push(f)
  300. } else if (f.rootCategoryLevelId == 4) {
  301. m.modelList.push(f)
  302. } else if (f.rootCategoryLevelId == 5) {
  303. m.modelList.push(f)
  304. } else if (f.rootCategoryLevelId == 11) {
  305. m.aridRegionList.push(f)
  306. } else if (f.rootCategoryLevelId == 13) {
  307. m.packingList.push(f)
  308. } else if (f.rootCategoryLevelId == 8) {
  309. m.palletList.push(f)
  310. } else if (f.rootCategoryLevelId == 26) {
  311. m.revolvingDiskList.push(f)
  312. } else if ([23, 2, 9, 28].includes(Number(f
  313. .rootCategoryLevelId))) {
  314. m.semiProductList.push(f)
  315. }
  316. })
  317. }
  318. // 处理字段
  319. m.quality == '' ? m.quality = {} : ''
  320. if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
  321. m.product = '{}'
  322. }
  323. delete m.id
  324. if (this.taskId) {
  325. m.taskId = this.taskId
  326. m.taskName = this.taskName
  327. }
  328. return {
  329. ...m
  330. }
  331. })
  332. this.cloneList = JSON.parse(JSON.stringify(this.List));
  333. }).finally(() => {
  334. this.getCacheFn()
  335. })
  336. },
  337. handleScan(id, type) {
  338. uni.scanCode({
  339. success: (res) => {
  340. this.scanData(res.result, type, id)
  341. }
  342. })
  343. },
  344. scanData(result, type, id) {
  345. if (type == 'wordOrder') {
  346. let isFals = this.List.some(m => m.code == result)
  347. if (isFals) {
  348. uni.showToast({
  349. title: '工单已存在',
  350. icon: 'none'
  351. })
  352. return false
  353. }
  354. getByCode(result).then(res => {
  355. let _arr = this.List
  356. _arr.forEach((e, index) => {
  357. if (e.workOrderId == id && res) {
  358. _arr[index] = res
  359. }
  360. })
  361. this.List = _arr
  362. this.$forceUpdate()
  363. })
  364. }
  365. },
  366. scanIt(id) {
  367. uni.scanCode({
  368. success: (res) => {
  369. this.scanItData(res.result, id)
  370. }
  371. })
  372. },
  373. scanItData(result, id) {
  374. scanLedger(result).then(res => {
  375. let _arr = []
  376. if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
  377. _arr = this.List
  378. _arr.forEach((e, index) => {
  379. if (e.workOrderId == id) {
  380. _arr[index].equipmentList = _arr[index].equipmentList.concat(res)
  381. }
  382. })
  383. this.List = _arr
  384. this.$forceUpdate()
  385. } else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
  386. _arr = this.List
  387. _arr.forEach((e, index) => {
  388. if (e.workOrderId == id) {
  389. _arr[index].modelList = res
  390. }
  391. })
  392. this.List = _arr
  393. this.$forceUpdate()
  394. } else if (res.length >= 1 && [1].includes(Number(res[0].rootCategoryLevelId))) { // 物料
  395. _arr = this.List
  396. _arr.forEach((e, index) => {
  397. if (e.workOrderId == id) {
  398. _arr[index].instanceList = _arr[index].instanceList.concat(res)
  399. }
  400. })
  401. this.List = _arr
  402. this.$forceUpdate()
  403. } else if (res.length >= 1 && [23, 2, 9, 28].includes(Number(res[0].rootCategoryLevelId))) {
  404. _arr = this.List
  405. _arr.forEach((e, index) => {
  406. if (e.workOrderId == id) {
  407. _arr[index].semiProductList = _arr[index].semiProductList.concat(res)
  408. }
  409. })
  410. this.List = _arr
  411. this.$forceUpdate()
  412. } else if (res.length >= 1 && res[0].rootCategoryLevelId == 11) { // 干燥区
  413. _arr = this.List
  414. _arr.forEach((e, index) => {
  415. if (e.workOrderId == id) {
  416. let isFals = _arr[index].aridRegionList.some(m => m.code == res[0]
  417. .aridRegionList[0].code)
  418. if (isFals) {
  419. uni.showToast({
  420. title: '干燥区已存在',
  421. icon: 'none'
  422. })
  423. return false
  424. }
  425. let _obj = res[0].aridRegionList[0]
  426. if (_obj.status == 0) {
  427. _obj['name'] = res[0].name
  428. _obj['region'] = res[0].extInfo.region
  429. _arr[index].aridRegionList = _arr[index].aridRegionList.concat(res[0]
  430. .aridRegionList)
  431. } else {
  432. uni.showToast({
  433. title: '干燥区已占用',
  434. icon: 'none'
  435. })
  436. }
  437. }
  438. })
  439. this.List = _arr
  440. this.$forceUpdate()
  441. } else if (res.length >= 1 && res[0].rootCategoryLevelId == 7) { // 周转车
  442. _arr = this.List
  443. _arr.forEach((e, index) => {
  444. if (e.workOrderId == id) {
  445. let isFals = _arr[index].turnover.some(m => m.code == res[0].code)
  446. if (isFals) {
  447. uni.showToast({
  448. title: '周转车已存在',
  449. icon: 'none'
  450. })
  451. return false
  452. }
  453. _arr.forEach((e, index) => {
  454. if (e.workOrderId == id) {
  455. _arr[index].turnover = _arr[index].turnover.concat(res)
  456. }
  457. })
  458. this.List = _arr
  459. this.$forceUpdate()
  460. }
  461. })
  462. }
  463. })
  464. },
  465. // 全部扫一扫
  466. handlScanCode() {
  467. uni.scanCode({
  468. success: (res) => {
  469. this.scanItAllData(res.result)
  470. }
  471. })
  472. },
  473. scanItAllData(result) {
  474. scanLedger(result).then(res => {
  475. let _arr = []
  476. if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
  477. _arr = this.List
  478. _arr.forEach((e, index) => {
  479. res['extInfo'].fixCode = res.fixCode
  480. e.equipmentList = e.equipmentList.concat(res)
  481. })
  482. this.List = _arr
  483. this.$forceUpdate()
  484. } else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
  485. _arr = this.List
  486. _arr.forEach((e, index) => {
  487. e.modelList = res
  488. })
  489. this.List = _arr
  490. this.$forceUpdate()
  491. } else if (res.length >= 1 && [1].includes(Number(res[0].rootCategoryLevelId))) {
  492. _arr = this.List
  493. _arr.forEach((e, index) => {
  494. e.instanceList = e.instanceList.concat(res)
  495. })
  496. this.List = _arr
  497. this.$forceUpdate()
  498. } else if (res.length >= 1 && [23, 2, 9, 28].includes(Number(res[0].rootCategoryLevelId))) {
  499. _arr = this.List
  500. _arr.forEach((e, index) => {
  501. e.semiProductList = e.semiProductList.concat(res)
  502. })
  503. this.List = _arr
  504. this.$forceUpdate()
  505. } else if (res.length >= 1 && res[0].rootCategoryLevelId == 7) { // 周转车
  506. _arr = this.List
  507. if (_arr.length == 1) {
  508. _arr.forEach((e, index) => {
  509. e.turnover = e.turnover.concat(res)
  510. })
  511. this.List = _arr
  512. this.$forceUpdate()
  513. } else if (_arr.length > 1) {
  514. uni.showToast({
  515. title: '多个工单通过下面单个扫一扫添加',
  516. icon: 'none'
  517. })
  518. }
  519. }
  520. })
  521. },
  522. getCacheFn() {
  523. let parma = {
  524. workOrderIds: this.idsList,
  525. taskId: this.taskId,
  526. type: 2
  527. }
  528. feedGetCache(parma).then(res => {
  529. if (res.length == 0) {
  530. return false
  531. }
  532. let objList = res[0].extInfo.objList
  533. this.List.forEach(f => {
  534. objList.forEach(o => {
  535. if (f.workOrderId == o.workOrderId && f.taskId == o.taskId) {
  536. // f['instanceList'] = o.instanceList || [] // 实例
  537. f['equipmentList'] = o.equipmentList || [] // 设备
  538. f['modelList'] = o.modelList || [] // 模具
  539. f['aridRegionList'] = o.aridRegionList || [] // 干燥区
  540. f['packingList'] = o.packingList || [] // 包装
  541. f['palletList'] = o.palletList || [] //舟皿
  542. f['instanceList'] = o.instanceList || [] // 物料
  543. f['revolvingDiskList'] = o.revolvingDiskList || [] // 周转盘
  544. f['semiProductList'] = o.semiProductList || [] // 半成品
  545. f['turnover'] = o.turnover || [] // 周转车
  546. this.$forceUpdate()
  547. }
  548. })
  549. })
  550. })
  551. },
  552. removeCacheFn() {
  553. uni.showModal({
  554. title: '缓存',
  555. content: '是否清空缓存!',
  556. confirmText: '确认', //这块是确定按钮的文字
  557. success: rr => {
  558. if (rr.confirm) {
  559. let parma = {
  560. workOrderIds: this.idsList,
  561. taskId: this.taskId,
  562. type: 2
  563. }
  564. removeCache(parma).then(res => {
  565. this.getList()
  566. })
  567. }
  568. }
  569. })
  570. },
  571. handAdd(id) {
  572. const storageKey = Date.now() + "";
  573. uni.setStorageSync(storageKey, this.List || []);
  574. uni.navigateTo({
  575. url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=feed&taskId=${this.taskId}`
  576. })
  577. },
  578. openDetails(id) {
  579. const storageKey = Date.now() + "";
  580. uni.setStorageSync(storageKey, this.List || []);
  581. let url = `/pages/pda/feeding/single?id=${id}&taskId=${this.taskId}&storageKey=${storageKey}`
  582. uni.navigateTo({
  583. url
  584. })
  585. },
  586. checkdDevice() {
  587. return new Promise((resolve) => {
  588. console.log(this.List)
  589. let isFalse = this.List.every(item => {
  590. return item.equipmentList && item.equipmentList.length > 0
  591. })
  592. if (isFalse) {
  593. resolve(true)
  594. } else {
  595. uni.showModal({
  596. title: '提示',
  597. content: '没有选择设备,是否继续?',
  598. confirmText: '确认', //这块是确定按钮的文字
  599. success: function (res) {
  600. if (res.confirm) {
  601. resolve(true)
  602. } else {
  603. resolve(false)
  604. }
  605. }
  606. })
  607. }
  608. })
  609. },
  610. },
  611. beforeDestroy() {
  612. uni.hideLoading();
  613. },
  614. }
  615. </script>
  616. <style lang="scss" scoped>
  617. .content-box {
  618. height: 100vh;
  619. overflow: hidden;
  620. display: flex;
  621. flex-direction: column;
  622. }
  623. .list_box {
  624. flex: 1;
  625. overflow: hidden;
  626. padding: 4rpx 0;
  627. .u-list {
  628. height: 100% !important;
  629. }
  630. .card_box {
  631. padding: 16rpx;
  632. }
  633. }
  634. .bottom-wrapper {
  635. width: 100%;
  636. display: flex;
  637. align-items: center;
  638. justify-content: space-around;
  639. .btn_box {
  640. width: 50%;
  641. height: 88rpx;
  642. line-height: 88rpx;
  643. background: $theme-color;
  644. text-align: center;
  645. font-size: 36rpx;
  646. font-style: normal;
  647. font-weight: 400;
  648. color: #fff;
  649. &:first-child {
  650. border-right: 2rpx solid #fff;
  651. }
  652. }
  653. }
  654. .operate_box {
  655. position: fixed;
  656. right: 0;
  657. top: 400rpx;
  658. /deep/ .u-button {
  659. margin-top: 20rpx;
  660. width: 150rpx;
  661. border-radius: 22rpx 0 0 22rpx;
  662. opacity: 0.6;
  663. font-size: 22rpx;
  664. }
  665. }
  666. .operate_box2 {
  667. display: flex;
  668. /deep/ .u-button {
  669. margin-top: 20rpx;
  670. width: 150rpx;
  671. }
  672. }
  673. .flex_btn {
  674. position: fixed;
  675. right: 0;
  676. bottom: 160rpx;
  677. width: 40rpx;
  678. height: 50rpx;
  679. line-height: 66rpx;
  680. border-radius: 22rpx 0 0 22rpx;
  681. background: $theme-color;
  682. text-align: center;
  683. font-size: 22rpx;
  684. font-style: normal;
  685. font-weight: 400;
  686. color: #fff;
  687. opacity: 0.6;
  688. .jiantou {
  689. width: 30rpx;
  690. height: 30rpx;
  691. }
  692. }
  693. .flex_btn2 {
  694. position: fixed;
  695. right: 0;
  696. bottom: 160rpx;
  697. width: 126rpx;
  698. min-height: 140rpx;
  699. line-height: 62rpx;
  700. border-radius: 22rpx 0 0 22rpx;
  701. background: $theme-color;
  702. text-align: center;
  703. font-size: 22rpx;
  704. font-style: normal;
  705. font-weight: 400;
  706. color: #fff;
  707. opacity: 0.7;
  708. .close_box {
  709. height: 50rpx;
  710. line-height: 50rpx;
  711. width: 126rpx;
  712. text-align: left;
  713. .close {
  714. width: 40rpx;
  715. height: 40rpx;
  716. padding: 6rpx 10rpx;
  717. }
  718. }
  719. }
  720. </style>