details.vue 21 KB

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