details.vue 21 KB

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