details.vue 21 KB

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