details.vue 21 KB

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