CompleteSet.ets 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072
  1. import EquipmentRequest from '../common/util/request/EquipmentRequest'
  2. import JGRequest from '../common/util/request/Request'
  3. import StorageRequest from '../common/util/request/StorageRequest'
  4. import OrderInfo from '../model/OrderInfo'
  5. import { Materialpositionclass, Tasklist } from './IntelligentWarehousingOutbound'
  6. import { Materialpositionclass1} from '../common/util/request/StorageRequestInstance'
  7. import MaterialInfo from '../viewmodel/MaterialInfo'
  8. import PageModel from '../viewmodel/PageModel'
  9. import ProcessData from '../viewmodel/ProcessData'
  10. import RequestParamModel from '../viewmodel/RequestParamModel'
  11. import RequestParamModel2 from '../viewmodel/RequestParamModel2'
  12. import { stat2 } from './ManualWarehousing'
  13. import { MaterialInformationModel } from '../model/MaterialInformation'
  14. import promptAction from '@ohos.promptAction'
  15. import CommonConstants from '../common/constants/CommonConstants'
  16. import { StationInfoModel } from '../model/StorageSpace'
  17. import { SureToDoDialog } from '../common/component/SureToDoDialog'
  18. export interface stat3 {
  19. statNo?: string
  20. //料箱编号
  21. rfid?: string
  22. //料箱检测的io位,1:有,0:没有
  23. io?: string
  24. //0:无锁定,1:锁定,即机器人正在动作,不能进出库动作
  25. lock?: string
  26. ts?: string
  27. }
  28. @Entry
  29. @Component
  30. export struct CompleteSet {
  31. @State private MaterialInfoArray: Array<Materialpositionclass1> = []
  32. @State materialInfoName: string = 'aaa'
  33. @State private positionInfoList: Array<MaterialInformationModel> = []
  34. currentBoxStationModel: Materialpositionclass1 = {}
  35. goingToLookDetail = async (m: Materialpositionclass1) => {
  36. console.log('dyy',JSON.stringify(m))
  37. this.currentBoxStationModel = m
  38. this.positionInfoList = m?.materials ?? []
  39. this.infoListController.open()
  40. }
  41. goingToOut = (m: Materialpositionclass1) => {
  42. this.currentBoxStationModel = m
  43. this.infoDialogController.open()
  44. }
  45. materialInfoController: CustomDialogController = new CustomDialogController({
  46. builder: MaterailInfoDialog({
  47. Materialposition: this.MaterialInfoArray,
  48. materialName:this.materialInfoName,
  49. lookDetail: this.goingToLookDetail,
  50. goToOut: this.goingToOut,
  51. }),
  52. alignment: DialogAlignment.Center,
  53. customStyle: true,
  54. autoCancel: false,
  55. })
  56. dialogCancel = () => {
  57. this.currentBoxStationModel = {}
  58. this.infoDialogController.close()
  59. this.infoListController.close()
  60. }
  61. dialogSure = async () => {
  62. // let res: outBoxClass = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
  63. // houseNo: this.currentBoxStationModel?.houseNo ?? "",
  64. // vehicleNo: this.currentBoxStationModel?.vehicleNo ?? this.currentBoxStationModel.vehicleCode ?? "",
  65. // stanCode: CommonConstants.STATION_CODE
  66. // } as RequestParamModel)
  67. // this.outBox = res
  68. promptAction.showToast({
  69. message: "任务进行中,请等待....",
  70. duration: 1800,
  71. bottom: '50%'
  72. })
  73. this.infoDialogController.close()
  74. this.materialLocationController.close()
  75. }
  76. infoDialogController: CustomDialogController = new CustomDialogController({
  77. builder: SureToDoDialog(
  78. {
  79. cancel: this.dialogCancel,
  80. confirm: this.dialogSure,
  81. title: "出库确认",
  82. info: '确认出库当前料箱吗?'
  83. }
  84. ),
  85. alignment: DialogAlignment.Center,
  86. customStyle: true,
  87. autoCancel: false,
  88. })
  89. infoListController: CustomDialogController = new CustomDialogController({
  90. builder: LocationInfoListDialog(
  91. {
  92. closeDialog: this.dialogCancel,
  93. materials: this.positionInfoList
  94. }
  95. ),
  96. alignment: DialogAlignment.Center,
  97. customStyle: true,
  98. autoCancel: false,
  99. })
  100. //请求物料位置
  101. MaterialpositionHttp = async (code :string,name:string) => {
  102. let res: Materialpositionclass1[] = await StorageRequest.post("/api/v1/process/vehicleOperation/stockMaterials", {
  103. label: code,
  104. } as RequestParamModel)
  105. this.MaterialInfoArray = res
  106. if(this.MaterialInfoArray.length>0){
  107. this.materialInfoName = name
  108. this.materialInfoController.open()
  109. }else{
  110. promptAction.showToast({
  111. message: "无库存",
  112. duration: 1800,
  113. bottom: '50%'
  114. })
  115. }
  116. }
  117. //任务单id
  118. @State orderId: string = ''
  119. //齐套料箱重量
  120. @State BoxWeight: number = 20
  121. // 暂时的料箱编码
  122. @State vehicleCode: string = ''
  123. //物料名称
  124. @State materialName: string = ''
  125. //工序id
  126. @State operationId: string = ''
  127. //扫描料箱获得料箱编码绑定料箱为齐套料箱
  128. @State boxInfo: BoxInfo = {}
  129. //取料箱中物料信息
  130. @State private boxMaterials: Array<MaterialInformationModel> = []
  131. //取出料箱
  132. @State private outBox: Array<outBoxClass> = []
  133. //齐套物料信息
  134. @State private Mposition: Array<MaterialInformationModel> = []
  135. //查询物料存放的所有位置
  136. @State materialPositionArray: Array<Materialpositionclass> = []
  137. //选中取出的物料位置
  138. @State materialPosition: Materialpositionclass = {}
  139. //暂时固定的料箱编码
  140. @State binCode: string = 'ZJ-JG031'
  141. //点击任务单
  142. @State selectOrder: number = -2
  143. //任务单列表
  144. @State orderArray: OrderInfo[] = [];
  145. //任务单工单单号
  146. @State taskOrderNumber: string = ''
  147. //工单物料切换(1:显示工单列表 2:显示工序下的物料列表)
  148. @State orderMaterialSwitch: number = 1
  149. //任务单id
  150. @State primaryKeyId: string = ''
  151. //齐套料箱状态不可以点击:0,可以点击:1
  152. @State completeSetMaterialState: number = 0
  153. //物料编码
  154. @State materialCode: string = ''
  155. //1:抽屉在料格内 2:抽屉在料格外
  156. @State drawerPositionStatus: number = 1
  157. //出库口料格状态(1:有料箱 0:无料箱)
  158. @State materialGridStatus: number = 0
  159. //是否取空箱子(1:是 2:否)
  160. @State isTakeOutBox: number = 0
  161. // 叫空料箱数量
  162. @State callBoxNum: number = 1
  163. //点击选择任务单变颜色
  164. @State onclick: number = -1
  165. //点击扫描料箱切换成齐套料箱编码
  166. @State clickScan: number = 0
  167. //物料列表
  168. @State scanCodeMIndex: number = 2 //齐套料箱扫码后对应的最左侧的index
  169. @State materialArray: MaterialInfo[] = []
  170. materialController: Scroller = new Scroller()
  171. // 中间输入框绑定的值
  172. @State scanCodeValue: string = ""
  173. //工单分页查询相关参数
  174. private orderPageNo: number = 1
  175. private orderPageSize: number = 10
  176. orderTotalCount?: number = 0
  177. private orderTotalPages: number = 0
  178. //料箱等级(类型)
  179. @State vehicleLevel: string = ''
  180. //料箱编号
  181. @State vehicleNo: string = ''
  182. //工序列表
  183. @State processes: ProcessData[] = [];
  184. @State currentWorkOrderCode: string = ""
  185. // 选择工序
  186. @State selectProcess: ProcessData = {}
  187. // 工序关联物料分页查询相关参数
  188. private pageNo: number = 1
  189. private pageSize: number = 10
  190. totalCount?: number = 0
  191. private totalPages: number = 0
  192. //硬件数据
  193. @State private entranceWaiting: Array<stat3> = []
  194. //左边任务单列表
  195. @State private TasklistoutboundData: Array<Tasklist> = []
  196. //扫码控制器
  197. textController: TextInputController = new TextInputController()
  198. // 通过RFID请求读取料箱的信息
  199. rfidTimer: number = -1
  200. @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表
  201. @State imgSrc:Resource = $r('app.media.drawer_inside')
  202. //设置img图片路径
  203. setImgSrc = ()=>{
  204. if(this.drawerPositionStatus == 1 && this.materialGridStatus == 0){
  205. this.imgSrc = $r('app.media.drawer_inside')
  206. }else if(this.drawerPositionStatus == 0 && this.materialGridStatus == 0){
  207. this.imgSrc = $r('app.media.drawer_outside')
  208. }
  209. else if(this.drawerPositionStatus === 1 && this.materialGridStatus === 1){
  210. this.imgSrc = $r('app.media.D_W_inside')
  211. }
  212. else if(this.drawerPositionStatus === 0 && this.materialGridStatus === 1) {
  213. this.imgSrc = $r('app.media.D_W_outside')
  214. }
  215. }
  216. @State private recentlyRecordObject: StationInfoModel = {}
  217. rfidInfoIntervalFun = async () => {
  218. let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
  219. stanCode: CommonConstants.STATION_CODE
  220. } as RequestParamModel)
  221. this.recentlyRecordObject = res
  222. console.log('dyyinfo',JSON.stringify(res))
  223. this.drawerPositionStatus = res.lock==null? 1: Number(res.lock)
  224. this.setImgSrc()
  225. // 清空回库下面的数组逻辑
  226. if (this.preRfid && this.preRfid != this.recentlyRecordObject.rfid) {
  227. this.boxMaterials = []
  228. }
  229. this.preRfid = this.recentlyRecordObject.rfid ?? ""
  230. // console.log("jjjj", JSON.stringify(this.recentlyRecordObject))
  231. // 是否有料箱逻辑
  232. this.materialGridStatus = 0
  233. if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
  234. this.materialGridStatus = 1
  235. this.BoxWeight = Number(res.weight)
  236. this.recentlyRecordObject.weight = this.recentlyRecordObject.weight + 'Kg'
  237. }
  238. }
  239. //扫码请求
  240. @State private MaterialInformation: Array<MaterialInformationModel> = []
  241. ScanStorageCode = async (itemCode: string) => {
  242. // BM51264341413217;SL9;PHthi5558;
  243. this.scanCodeValue = ""
  244. let res: MaterialInformationModel = await StorageRequest.post("/api/v1/process/circulation/material", {
  245. label: itemCode //"#gys022#sc022#100#20220929#31"
  246. } as MaterialInformationModel)
  247. //let res = await StorageRequest.get("/api/v3/stock/selectSafeList/1")
  248. // {"batchCode":"BM47111400130447;SL5","codeType":"BATCH","materialCode":"47111400130447","materialName":"穿心电容","num":5,"spec":"G CT52-4-1-2C1-63V-103-M","unitDictLabel":"个","unitDictValue":"个"}
  249. let obj: MaterialInformationModel = JSON.parse(JSON.stringify(res))
  250. // 判断扫描完成后返回的物料码是否是当前需要齐套的物料
  251. let hasCode: boolean = false
  252. for (let i = 0; i < this.materialArray.length; i++) {
  253. if (obj.materialCode == this.materialArray[i].materialCode) {
  254. hasCode = true
  255. this.scanCodeMIndex = i
  256. break
  257. }
  258. }
  259. if (!hasCode) {
  260. promptAction.showToast({
  261. message: "不是当前工序中的物料",
  262. bottom: "50%",
  263. duration: 2000
  264. })
  265. return
  266. }
  267. this.materialController.scrollToIndex(this.scanCodeMIndex)
  268. // 扫码完成之后,如果数组中有对应的值,就添加数量否则就push
  269. let toPushArray: MaterialInformationModel[] = [...this.MaterialInformation]
  270. let has = false
  271. for (let i = 0; i < toPushArray.length; i++) {
  272. let box: MaterialInformationModel = toPushArray[i]
  273. if (obj.materialCode == box.materialCode && obj.batchCode == box.batchCode && obj.batchNo == box.batchNo) {
  274. let number = obj.num! + box.num!
  275. box.num = number
  276. has = true
  277. }
  278. }
  279. if (!has) {
  280. toPushArray.unshift(JSON.parse(JSON.stringify(obj)))
  281. }
  282. this.MaterialInformation = [...toPushArray]
  283. }
  284. async aboutToAppear() {
  285. this.rfidTimer = setInterval(() => {
  286. this.rfidInfoIntervalFun()
  287. }, 1500)
  288. // 查询订单数据
  289. let res = await this.queryOrderPage()
  290. if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) {
  291. return
  292. }
  293. this.orderTotalCount = res.totalCount
  294. this.orderTotalPages = res.totalPages
  295. if (res.records) {
  296. this.orderArray = res.records
  297. }
  298. // 设置默认值
  299. if (this.orderArray && this.orderArray.length > 0) {
  300. this.selectOrder = -1
  301. if (this.orderArray[0]?.workOrderCode) {
  302. this.processes = await JGRequest.get('/api/v1/process/vehicleOperation/operation/' + this.orderArray[0]?.workOrderCode, {
  303. }) as ProcessData[]
  304. }
  305. }
  306. }
  307. aboutToDisappear(): void {
  308. clearInterval(this.rfidTimer)
  309. }
  310. // 未齐套订单分页查询
  311. private async queryOrderPage() {
  312. return await JGRequest.post('/api/v1/plan/workOrder/page', {
  313. pageNo: this.orderPageNo,
  314. pageSize: this.orderPageSize,
  315. itemAllotState: '0'
  316. } as RequestParamModel2) as PageModel<OrderInfo>;
  317. }
  318. // 工序物料分页查询
  319. private async queryMaterialPage() {
  320. return await StorageRequest.post('/api/v1/process/vehicleOperation/operationMaterial', {
  321. operationId: this.selectProcess?.operationId!,
  322. pageNo: this.pageNo,
  323. pageSize: this.pageSize,
  324. workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode!
  325. } as RequestParamModel2) as PageModel<MaterialInfo>
  326. }
  327. //工序弹窗
  328. selectProcessController: CustomDialogController = new CustomDialogController({
  329. builder: SelectProcessDialog({
  330. selectProcess: this.selectProcess,
  331. processes: this.processes,
  332. orderMaterialSwitch: this.orderMaterialSwitch,
  333. confirm: async () => {
  334. this.materialArray = []
  335. //重置pageNo
  336. this.pageNo = 1
  337. // 查询工序关联的物料信息
  338. let res = await this.queryMaterialPage()
  339. // if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) {
  340. // return
  341. // }
  342. this.totalCount = res.totalCount ?? 0
  343. this.totalPages = res.totalPages ?? 0
  344. // if (res.records) {
  345. //
  346. // }
  347. this.scanCodeMIndex = -1
  348. this.materialArray = res.records ?? []
  349. this.textController.stopEditing()
  350. }
  351. }),
  352. alignment: DialogAlignment.Center,
  353. customStyle: true,
  354. autoCancel: true,
  355. })
  356. //料箱绑定工序操作
  357. //后端回库入库操作
  358. Warehousing = async (): Promise<MaterialInformationModel[]> => {
  359. let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
  360. houseNo: '1',
  361. stanCode: CommonConstants.STATION_CODE,
  362. vehicleCode: this.recentlyRecordObject.rfid,
  363. detailsList: this.boxMaterials,
  364. wcsType: "kitting",
  365. } as RequestParamModel)
  366. promptAction.showToast({
  367. message: '请求成功,业务处理中。。。',
  368. duration: 2000,
  369. bottom: 150
  370. });
  371. if (!this.recentlyRecordObject.rfid) {
  372. // 当盒子被小车吊走了才清空
  373. this.boxMaterials = []
  374. }
  375. return res
  376. }
  377. /////请求齐套物料信息
  378. Materialposition = async (item: MaterialInfo) => {
  379. let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/process/vehicleMaterial/list", {
  380. materialName: item.materialName,
  381. materialCode: item.materialCode,
  382. operationId: this.selectProcess.operationId
  383. } as RequestParamModel)
  384. this.materialName = item?.materialName ?? ""
  385. console.log("xxxxxxxxxxxxxxxxxx", JSON.stringify(item), JSON.stringify(res))
  386. this.Mposition = res
  387. this.materialLocationController.open()
  388. }
  389. //齐套的物料信息
  390. materialLocationController: CustomDialogController = new CustomDialogController({
  391. builder: MaterialLocationDialog({
  392. materialName: this.materialName,
  393. boxMaterials: this.Mposition,
  394. }),
  395. alignment: DialogAlignment.Center,
  396. customStyle: true,
  397. autoCancel: false,
  398. })
  399. //取空箱子弹窗
  400. emptyBoxController: CustomDialogController = new CustomDialogController({
  401. builder: EmptyBoxDialog({
  402. callBoxNum: this.callBoxNum,
  403. isTakeOutBox: this.isTakeOutBox,
  404. }),
  405. alignment: DialogAlignment.Center,
  406. customStyle: true,
  407. autoCancel: true,
  408. })
  409. //扫描料箱弹窗
  410. scanningMaterialBoxController: CustomDialogController = new CustomDialogController({
  411. builder: scanningMaterialBox({
  412. binCode: this.binCode,
  413. boxInfo: this.boxInfo,
  414. clickScan: this.clickScan,
  415. vehicleCode: this.vehicleCode,
  416. selectOrder: this.selectOrder,
  417. orderArray: this.orderArray,
  418. materialCode: this.materialCode
  419. }),
  420. alignment: DialogAlignment.Center,
  421. customStyle: true,
  422. autoCancel: true,
  423. })
  424. // async materialBoxHTTP(vehicleCode: string) {
  425. // return await StorageRequest.post('/api/v1/process/vehicleOperation/vehicleDetail', {
  426. // workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode!,
  427. // operationId: Number.parseInt(this.selectProcess?.operationId!),
  428. // vehicleCode: vehicleCode,
  429. // } as RequestParamModel) as BoxInfo
  430. // }
  431. //查询取出的料箱里面的物料信息
  432. boxMaterialHttp = async (): Promise<MaterialInformationModel[]> => {
  433. let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", {
  434. vehicleCode: this.entranceWaiting[0].rfid!
  435. } as RequestParamModel)
  436. console.log('testTag', 'aaaaaaaa2' + JSON.stringify(res));
  437. this.boxMaterials = res
  438. return res
  439. }
  440. //硬件请求回库操作
  441. warehousingHttp = async (): Promise<boxMaterialClass> => {
  442. let res: boxMaterialClass = await StorageRequest.post("/api/v1/wcs/stockin", {
  443. boxNo: this.vehicleNo,
  444. position: "stat3",
  445. mtype: this.vehicleLevel
  446. } as RequestParamModel)
  447. console.log('testTag1', '----------' + JSON.stringify(res));
  448. return res
  449. }
  450. // 点击齐套料箱的时候需要将右侧的数组push到左侧,但是需要先提前掉一个接口
  451. toCompleteSuitFun = async () => {
  452. let result: boxMaterialClass = await StorageRequest.post("api/v1/process/vehicleOperation/add", {
  453. operationId: this.selectProcess.operationId,
  454. workOrderCode: this.currentWorkOrderCode,
  455. vehicleCode: this.recentlyRecordObject.rfid,
  456. processVehicleMaterialList: this.MaterialInformation
  457. } as RequestParamModel)
  458. // =====================
  459. let toPushArray: MaterialInformationModel[] = [...this.boxMaterials]
  460. this.MaterialInformation.forEach((middleBox) => {
  461. let has = false
  462. for (let i = 0; i < toPushArray.length; i++) {
  463. let box = toPushArray[i]
  464. if (middleBox.materialCode == box.materialCode) {
  465. let number = middleBox.num! + box.num!
  466. box.num = number
  467. has = true
  468. }
  469. }
  470. if (!has) {
  471. toPushArray.push(JSON.parse(JSON.stringify(middleBox)))
  472. }
  473. })
  474. this.boxMaterials = [...toPushArray]
  475. this.MaterialInformation = []
  476. // =====================
  477. // 添加完成之后需要更新最左侧已经选择的工序下边的物料列表
  478. let res = await this.queryMaterialPage()
  479. if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) {
  480. return
  481. }
  482. this.totalCount = res.totalCount
  483. this.totalPages = res.totalPages
  484. if (res.records) {
  485. this.materialArray = res.records
  486. }
  487. }
  488. build() {
  489. Row({ space: px2vp(24) }) {
  490. if (this.orderMaterialSwitch === 1) {
  491. Column() {
  492. List({ space: px2vp(20) }) {
  493. ForEach(this.orderArray, (item: OrderInfo, index: number) => {
  494. ListItem() {
  495. Column() {
  496. Row() {
  497. Text(item.orderName)
  498. .fontSize($r('app.float.fontSize_24'))
  499. .fontWeight(FontWeight.Medium)
  500. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  501. .opacity(this.selectOrder === index ? $r('app.float.card_font_select_opacity') : 1)
  502. }
  503. .width('100%')
  504. .justifyContent(FlexAlign.Start)
  505. Row() {
  506. Text('产品型号: ' + item?.materialModel ?? "")
  507. .fontWeight(FontWeight.Regular)
  508. .fontSize($r('app.float.fontSize_20'))
  509. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  510. }
  511. .width('100%')
  512. .justifyContent(FlexAlign.Start)
  513. Row() {
  514. Text('计划编号: ')
  515. .fontWeight(FontWeight.Regular)
  516. .fontSize($r('app.float.fontSize_20'))
  517. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  518. Text(item.workOrderCode)
  519. .fontSize($r('app.float.fontSize_20'))
  520. .fontWeight(FontWeight.Medium)
  521. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  522. }
  523. .width('100%')
  524. .justifyContent(FlexAlign.Start)
  525. Row() {
  526. Text('订单编号: ')
  527. .fontWeight(FontWeight.Regular)
  528. .fontSize($r('app.float.fontSize_20'))
  529. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  530. Text(item.orderCode)
  531. .fontSize($r('app.float.fontSize_20'))
  532. .fontWeight(FontWeight.Medium)
  533. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  534. }
  535. .width('100%')
  536. .justifyContent(FlexAlign.Start)
  537. Row() {
  538. Text('下发时间: ')
  539. .fontSize($r('app.float.fontSize_20'))
  540. .fontWeight(FontWeight.Regular)
  541. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  542. Text(item?.planStartWhen && item.planStartWhen.length > 0 ? item.planStartWhen.split(' ')[0] : '')
  543. .fontSize($r('app.float.fontSize_20'))
  544. .fontWeight(FontWeight.Medium)
  545. .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  546. }
  547. .width('100%')
  548. .justifyContent(FlexAlign.Start)
  549. }
  550. .justifyContent(FlexAlign.Center)
  551. // .alignItems(HorizontalAlign.Center)
  552. .onClick(async () => {
  553. // 另外选择了工单,则把工序、选择的工序清空
  554. // if (this.selectOrder && this.selectOrder != index) {
  555. // this.selectProcess = {}
  556. // this.processes = []
  557. // }
  558. this.processes = []
  559. this.currentWorkOrderCode = item.workOrderCode ?? ""
  560. this.orderId = item.taskId!
  561. if (item?.workOrderCode && item.workOrderCode.length > 0) {
  562. this.selectProcessController.open()
  563. this.selectOrder = index
  564. this.processes = await StorageRequest.get("/api/v1/process/vehicleOperation/operation/" + item.workOrderCode, {
  565. })
  566. }
  567. // else {
  568. // this.selectProcess = {}
  569. // this.processes = []
  570. // }
  571. })
  572. .width(px2vp(608))
  573. .padding(8)
  574. .borderRadius($r('app.float.general_border_radius'))
  575. .backgroundColor(this.selectOrder === index ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
  576. }
  577. })
  578. }
  579. .width(px2vp(608))
  580. .height(px2vp(870))
  581. // 未完成订单大于10条,触底再去查询
  582. .onReachEnd(async () => {
  583. if (!this.orderTotalPages || this.orderTotalPages <= 1) {
  584. return
  585. }
  586. if (this.orderPageNo >= this.orderTotalPages) {
  587. return
  588. }
  589. this.orderPageNo++
  590. let res = await this.queryOrderPage() as PageModel<OrderInfo>
  591. this.orderArray = this.orderArray?.concat(res.records as OrderInfo[])
  592. })
  593. }
  594. .width(px2vp(608))
  595. .height(px2vp(900))
  596. .borderRadius($r('app.float.borderRadius_16'))
  597. }
  598. // 已经选择了工序后 展示的列表和上面的title
  599. else if (this.orderMaterialSwitch === 2) {
  600. Column() {
  601. Row() {
  602. Image($r('app.media.circular_return'))
  603. .width(px2vp(80))
  604. .height(px2vp(80))
  605. .onClick(() => {
  606. this.orderMaterialSwitch = 1
  607. })
  608. Blank()
  609. Row() {
  610. Column({ space: 10 }) {
  611. Text(this.selectProcess?.operationName && this.selectProcess.operationName.length > 0 ? this.selectProcess.operationName! : '')
  612. .fontWeight(FontWeight.Medium)
  613. .fontSize($r('app.float.fontSize_20'))
  614. .fontColor($r('app.color.blue_100'))
  615. .opacity($r('app.float.general_font_opacity'))
  616. Text(this.orderArray[this.selectOrder]?.orderName && (this.orderArray[this.selectOrder]?.orderName?.length!) > 0 ? this.orderArray[this.selectOrder]?.orderName! : '')
  617. .fontSize($r('app.float.fontSize_20'))
  618. .fontWeight(FontWeight.Regular)
  619. .fontColor($r('app.color.blue_100'))
  620. .opacity($r('app.float.general_font_opacity'))
  621. }
  622. .margin({ left: 10 })
  623. .width('80%')
  624. .height('100%')
  625. .padding({ left: 10 })
  626. .borderRadius(px2vp(15))
  627. .alignItems(HorizontalAlign.Start)
  628. .justifyContent(FlexAlign.Center)
  629. Blank()
  630. Image($r('app.media.subscript'))
  631. .width(px2vp(20))
  632. .height(px2vp(20))
  633. }
  634. .alignItems(VerticalAlign.Bottom)
  635. .width('80%')
  636. .borderRadius(px2vp(15))
  637. .backgroundColor('#0f000000')
  638. .height('100%')
  639. .onClick(() => {
  640. this.selectProcessController.open()
  641. })
  642. }
  643. .width('100%')
  644. .height('10%')
  645. .margin({ bottom: "2%" })
  646. Column() {
  647. List({ space: 3, scroller: this.materialController }) {
  648. ForEach(this.materialArray, (item: MaterialInfo, index: number) => {
  649. ListItem() {
  650. Row() {
  651. Column() {
  652. Text(item.materialName)
  653. .fontSize($r('app.float.fontSize_24'))
  654. .fontWeight(FontWeight.Medium)
  655. .fontColor($r('app.color.black_90'))
  656. .width('100%')
  657. Text(item.materialCode)
  658. .fontWeight(FontWeight.Regular)
  659. .fontSize($r('app.float.fontSize_20'))
  660. .fontColor($r('app.color.black_60'))
  661. .width('100%')
  662. Text(item.completeNum?.toString() + '/' + item.totalMaterial?.toString())
  663. .fontSize($r('app.float.fontSize_24'))
  664. .fontColor($r('app.color.black_90'))
  665. .fontWeight(FontWeight.Bold)
  666. .width('100%')
  667. .margin({ top: 8 })
  668. Text('已拣/总需')
  669. .fontSize($r('app.float.fontSize_20'))
  670. .fontColor($r('app.color.black_60'))
  671. .width('100%')
  672. }
  673. .width('70%')
  674. .padding({ left: 20, right: 20 })
  675. .borderRadius(px2vp(16))
  676. .alignItems(HorizontalAlign.Start)
  677. .justifyContent(FlexAlign.Center)
  678. Column(){
  679. Button("库存详情").margin("4vp")
  680. .onClick(() => {
  681. this.MaterialpositionHttp(item.materialCode,item.materialName)
  682. })
  683. }.width('20%')
  684. .height('100')
  685. .justifyContent(FlexAlign.Center)
  686. .alignItems(HorizontalAlign.Center)
  687. // if (item.completeNum! === item.totalMaterial!) {
  688. // Column() {
  689. // Image($r('app.media.collect_completed'))
  690. // .width(px2vp(80))
  691. // .height(px2vp(80))
  692. // .borderRadius(px2vp(16))
  693. // }
  694. // .justifyContent(FlexAlign.Start)
  695. // .width('30%')
  696. //
  697. // .borderRadius(px2vp(16))
  698. // }
  699. }
  700. .border({ width: this.scanCodeMIndex === index ? 3 : 0, color: $r("app.color.warn_1") })
  701. .padding(8)
  702. .borderRadius(10)
  703. .margin(px2vp(8))
  704. .width('98%')
  705. .onClick(async () => {
  706. this.Materialposition(item)
  707. })
  708. .backgroundColor(item.completeNum! >= item.totalMaterial! ?
  709. $r('app.color.green_100') : $r('app.color.robot_set_card_white'))
  710. }
  711. })
  712. }
  713. .width('100%')
  714. .height('100%')
  715. .onReachEnd(async () => {
  716. if (!this.totalPages || this.totalPages <= 1) {
  717. return
  718. }
  719. if (this.pageNo >= this.totalPages) {
  720. return
  721. }
  722. this.pageNo++
  723. // 查询工序关联的物料信息
  724. let res = await this.queryMaterialPage()
  725. this.materialArray = this.materialArray?.concat(res.records as MaterialInfo[])
  726. })
  727. }
  728. .width('100%')
  729. .height('88%')
  730. .borderRadius($r('app.float.borderRadius_16'))
  731. }
  732. .width(px2vp(608))
  733. .height(px2vp(900))
  734. .borderRadius($r('app.float.borderRadius_16'))
  735. }
  736. Column() {
  737. Stack() {
  738. Image(this.imgSrc)
  739. .width(px2vp(608))
  740. .height(px2vp(220))
  741. .borderRadius(px2vp(16))
  742. Column() {
  743. Text('抽屉状态')
  744. .textAlign(TextAlign.End)
  745. .width('48%')
  746. .height('20%')
  747. .fontWeight(FontWeight.Regular)
  748. .fontSize($r('app.float.fontSize_20'))
  749. .fontColor($r('app.color.process_nameplate_grey_color'))
  750. Text(this.recentlyRecordObject.lockStr)
  751. .textAlign(TextAlign.End)
  752. .width('48%')
  753. .height('25%')
  754. .fontWeight(FontWeight.Regular)
  755. .fontSize($r('app.float.fontSize_24'))
  756. .fontColor($r('app.color.black_90'))
  757. Blank()
  758. Text('料箱ID')
  759. .textAlign(TextAlign.End)
  760. .width('48%')
  761. .height('20%')
  762. .fontWeight(FontWeight.Regular)
  763. .fontSize($r('app.float.fontSize_20'))
  764. .fontColor($r('app.color.process_nameplate_grey_color'))
  765. Text(this.recentlyRecordObject.rfid ?? "")
  766. .textAlign(TextAlign.End)
  767. .width('100%')
  768. .height('25%')
  769. .fontWeight(FontWeight.Regular)
  770. .fontSize($r('app.float.fontSize_24'))
  771. .fontColor($r('app.color.black_90'))
  772. }
  773. .width(px2vp(608))
  774. .height(px2vp(220))
  775. .borderRadius(px2vp(16))
  776. .padding({ right: $r('app.float.borderRadius_16') })
  777. .alignItems(HorizontalAlign.End)
  778. }
  779. .width(px2vp(608))
  780. .height(px2vp(220))
  781. .borderRadius(px2vp(16))
  782. .margin({ bottom: px2vp(20) })
  783. Button('回库')
  784. .fontSize($r('app.float.fontSize_24'))
  785. .fontColor($r('app.color.general_font_white_color'))
  786. .width(px2vp(608))
  787. .height(px2vp(80))
  788. .margin({ bottom: px2vp(20) })
  789. .focusable(false)
  790. .backgroundColor(this.materialGridStatus === 1 ? $r('app.color.green_100') : this.materialGridStatus === 0 ? $r('app.color.Green_20') : '')
  791. .onClick(() => {
  792. if (this.materialGridStatus === 1) {
  793. //执行后端入库操作
  794. this.Warehousing()
  795. }
  796. })
  797. List({ space: '2%' }) {
  798. ForEach(this.boxMaterials, (item: MaterialInformationModel, index: number) => {
  799. ListItem() {
  800. Row() {
  801. Column() {
  802. Column() {
  803. Row().height('23%')
  804. Text(item.materialName ? item.materialName! : '')
  805. .fontSize($r('app.float.fontSize_24'))
  806. .fontColor($r('app.color.general_font_color'))
  807. .fontWeight(FontWeight.Medium)
  808. .opacity($r('app.float.general_font_opacity'))
  809. Text(item.materialCode ? item.materialCode : '')
  810. .fontSize($r('app.float.fontSize_20'))
  811. .fontColor($r('app.color.process_nameplate_grey_color'))
  812. .fontWeight(FontWeight.Medium)
  813. }
  814. .height('50%')
  815. .width('90%')
  816. .alignItems(HorizontalAlign.Start)
  817. Column() {
  818. Row() {
  819. Text(item.num?.toString())
  820. .fontSize($r('app.float.fontSize_38'))
  821. .fontColor($r('app.color.general_font_color'))
  822. .fontWeight(FontWeight.Bold)
  823. Text(item.unitDictLabel ?? "个")
  824. .fontSize($r('app.float.fontSize_20'))
  825. .fontColor($r('app.color.process_nameplate_grey_color'))
  826. .fontWeight(FontWeight.Medium)
  827. }
  828. .width('90%')
  829. Blank()
  830. Row() {
  831. Image($r('app.media.subscript_space'))
  832. .height($r('app.float.card_subscript_new_size'))
  833. .width($r('app.float.card_subscript_new_size'))
  834. }
  835. .alignItems(VerticalAlign.Bottom)
  836. .justifyContent(FlexAlign.End)
  837. .width('100%')
  838. }
  839. .height('50%')
  840. .width('100%')
  841. }
  842. .width('100%')
  843. .borderRadius($r('app.float.general_border_radius'))
  844. .alignItems(HorizontalAlign.Center)
  845. .justifyContent(FlexAlign.Center)
  846. .height('100%')
  847. }
  848. .borderRadius(px2vp(16))
  849. .height('30%')
  850. .onClick(() => {
  851. })
  852. .backgroundColor(this.onclick === index ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
  853. }
  854. })
  855. }
  856. .width(px2vp(608))
  857. .height(px2vp(525))
  858. }
  859. .width(px2vp(608))
  860. .height(px2vp(900))
  861. .borderRadius($r('app.float.borderRadius_16'))
  862. Column() {
  863. Stack() {
  864. Image(this.BoxWeight === 0 ? $r('app.media.no_material_box') : this.BoxWeight <= 15 && this.BoxWeight !== 0 ? $r('app.media.normal_box') : $r('app.media.overweight_box'))
  865. .width(px2vp(608))
  866. .height(px2vp(220))
  867. .borderRadius(px2vp(16))
  868. Column() {
  869. Text('料箱重量')
  870. .textAlign(TextAlign.End)
  871. .width('48%')
  872. .height('20%')
  873. .fontWeight(FontWeight.Regular)
  874. .fontSize($r('app.float.fontSize_20'))
  875. .fontColor($r('app.color.process_nameplate_grey_color'))
  876. Text(this.recentlyRecordObject.weight)
  877. .textAlign(TextAlign.End)
  878. .width('48%')
  879. .height('25%')
  880. .fontWeight(FontWeight.Regular)
  881. .fontSize($r('app.float.fontSize_24'))
  882. .fontColor(this.BoxWeight <= 15 ? $r('app.color.black_90') : $r('app.color.brown_100'))
  883. Blank()
  884. Text('料箱ID')
  885. .textAlign(TextAlign.End)
  886. .width('48%')
  887. .height('20%')
  888. .fontWeight(FontWeight.Regular)
  889. .fontSize($r('app.float.fontSize_20'))
  890. .fontColor($r('app.color.process_nameplate_grey_color'))
  891. .focusable(true)
  892. .defaultFocus(false)
  893. Text(this.recentlyRecordObject.rfid)
  894. .textAlign(TextAlign.End)
  895. .width('100%')
  896. .height('25%')
  897. .fontWeight(FontWeight.Regular)
  898. .fontSize($r('app.float.fontSize_24'))
  899. .fontColor($r('app.color.black_90'))
  900. }
  901. .width(px2vp(608))
  902. .height(px2vp(220))
  903. .borderRadius(px2vp(16))
  904. .padding({ right: $r('app.float.borderRadius_16') })
  905. .alignItems(HorizontalAlign.End)
  906. }
  907. .width(px2vp(608))
  908. .height(px2vp(220))
  909. Row() {
  910. Image($r('app.media.shaoma'))
  911. .width(px2vp(25))
  912. .height(px2vp(25))
  913. .focusable(true)
  914. .defaultFocus(false)
  915. TextInput({ text: this.scanCodeValue,
  916. placeholder: '点击扫码添加物料',
  917. controller: this.textController })
  918. .width('92%')
  919. .height('100%')
  920. .width('80%')
  921. .defaultFocus(false)
  922. .fontWeight(FontWeight.Medium)
  923. .fontSize('32px')
  924. .backgroundColor("#ffff")
  925. .borderRadius(21)
  926. .onChange((value: string) => {
  927. this.scanCodeValue = value
  928. })
  929. .onSubmit(() => {
  930. this.ScanStorageCode(this.scanCodeValue)
  931. })
  932. Image($r('app.media.search'))
  933. .width(px2vp(32))
  934. .height(px2vp(32))
  935. .onClick(async () => {
  936. this.ScanStorageCode(this.scanCodeValue)
  937. this.textController.stopEditing()
  938. })
  939. }
  940. .width(px2vp(608))
  941. .height(px2vp(80))
  942. .justifyContent(FlexAlign.Center)
  943. .borderRadius(px2vp(100))
  944. .alignItems(VerticalAlign.Center)
  945. .backgroundColor($r('app.color.process_divider_white_color'))
  946. .margin({ top: px2vp(20) })
  947. Column() {
  948. List() {
  949. ForEach(this.MaterialInformation, (item: MaterialInformationModel, index: number) => {
  950. ListItem() {
  951. Row() {
  952. Column() {
  953. Text(item.materialName)
  954. .fontSize($r('app.float.fontSize_24'))
  955. .fontColor($r('app.color.general_font_color'))
  956. .fontWeight(FontWeight.Medium)
  957. .opacity($r('app.float.general_font_opacity'))
  958. Text(item.batchNo)
  959. .fontSize($r('app.float.fontSize_20'))
  960. .fontColor($r('app.color.process_nameplate_grey_color'))
  961. .fontWeight(FontWeight.Medium)
  962. Text(item.materialCode)
  963. .fontSize($r('app.float.fontSize_20'))
  964. .fontColor($r('app.color.process_nameplate_grey_color'))
  965. .fontWeight(FontWeight.Medium)
  966. Text(item.spec)
  967. .fontSize($r('app.float.fontSize_20'))
  968. .fontColor($r('app.color.process_nameplate_grey_color'))
  969. .fontWeight(FontWeight.Medium)
  970. Row() {
  971. // 可以更改数量的输入框
  972. TextInput({ text: item.num?.toString() })
  973. .fontSize(14)
  974. .fontWeight(FontWeight.Bold)
  975. .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
  976. .height(30)
  977. .width(120)
  978. .type(InputType.Number)
  979. .defaultFocus(false)
  980. .textAlign(TextAlign.Start)
  981. .borderRadius(0)
  982. .border({ width: 0.4 })
  983. .onChange((value) => {
  984. item.num = Number(value)
  985. })
  986. Text(item.unitDictLabel ?? item.unit ?? "个")
  987. .fontSize($r('app.float.fontSize_20'))
  988. .fontColor($r('app.color.process_nameplate_grey_color'))
  989. .fontWeight(FontWeight.Medium)
  990. }
  991. .justifyContent(FlexAlign.End)
  992. .width("100%")
  993. }
  994. .width("100%")
  995. .alignItems(HorizontalAlign.Start)
  996. // 删除按钮
  997. Row() {
  998. Image($r("app.media.reduce")).width(25).height(5)
  999. }
  1000. .width(30)
  1001. .height(30)
  1002. .position({ x: '90%', y: 3 })
  1003. .alignItems(VerticalAlign.Center)
  1004. .justifyContent(FlexAlign.Center)
  1005. .onClick(() => {
  1006. this.MaterialInformation.splice(index, 1)
  1007. })
  1008. }
  1009. .width("100%")
  1010. .borderRadius(10)
  1011. .margin({ top: 5 })
  1012. .padding(8)
  1013. .backgroundColor($r('app.color.robot_set_card_white'))
  1014. }
  1015. })
  1016. }
  1017. .width(px2vp(608))
  1018. .height(px2vp(450))
  1019. .margin({ bottom: px2vp(20) })
  1020. Button('齐套料箱')
  1021. .fontSize($r('app.float.fontSize_24'))
  1022. .fontColor($r('app.color.general_font_white_color'))
  1023. .width(px2vp(608))
  1024. .height(px2vp(80))
  1025. .backgroundColor(this.selectProcess.operationId && this.MaterialInformation.length > 0 ? $r('app.color.blue_100') : $r('app.color.blue_20'))
  1026. .onClick(() => {
  1027. if (this.selectProcess.operationId) {
  1028. if (this.MaterialInformation.length > 0) {
  1029. // 把中间的数据push到左边的数组,如果xx一样就数量相加
  1030. this.toCompleteSuitFun()
  1031. }
  1032. }
  1033. else {
  1034. promptAction.showToast({
  1035. message: '请先选择工单和工序!',
  1036. duration: 1700,
  1037. bottom: 150
  1038. });
  1039. }
  1040. })
  1041. }
  1042. .width(px2vp(608))
  1043. .height(px2vp(520))
  1044. .borderRadius($r('app.float.borderRadius_16'))
  1045. }
  1046. .width(px2vp(608))
  1047. .height(px2vp(900))
  1048. .borderRadius($r('app.float.borderRadius_16'))
  1049. }
  1050. .width(px2vp(1920))
  1051. .height(px2vp(900))
  1052. .padding({ left: px2vp(24), right: px2vp(24) })
  1053. }
  1054. }
  1055. // 选择工序
  1056. @CustomDialog
  1057. struct SelectProcessDialog {
  1058. @Link selectProcess: ProcessData
  1059. @Link processes: ProcessData[]
  1060. @Link orderMaterialSwitch: number
  1061. controller?: CustomDialogController
  1062. cancel: () => void = () => {
  1063. }
  1064. confirm: () => void = () => {
  1065. }
  1066. build() {
  1067. Column() {
  1068. Row() {
  1069. Text('选择工序')
  1070. .fontSize($r('app.float.fontSize_38'))
  1071. .fontWeight(FontWeight.Medium)
  1072. .fontColor($r('app.color.general_font_color'))
  1073. .opacity($r('app.float.general_font_opacity'))
  1074. }
  1075. .height('15%')
  1076. .alignItems(VerticalAlign.Center)
  1077. List({ space: px2vp(20), initialIndex: 0 }) {
  1078. ForEach(this.processes, (item: ProcessData) => {
  1079. ListItem() {
  1080. Row() {
  1081. Text(item.operationName)
  1082. .fontSize($r('app.float.fontSize_24'))
  1083. .fontWeight(FontWeight.Medium)
  1084. .fontColor(JSON.stringify(this.selectProcess) != '{}' && item.operationId === this.selectProcess?.operationId ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
  1085. .textAlign(TextAlign.Center)
  1086. .width('71%')
  1087. .height('12.5%')
  1088. .borderRadius($r('app.float.general_border_radius'))
  1089. .onClick(() => {
  1090. this.selectProcess = item
  1091. this.orderMaterialSwitch = 2
  1092. this.confirm()
  1093. this.controller?.close()
  1094. })
  1095. if (item.state === 2) {
  1096. Image($r('app.media.collect_completed'))
  1097. .width(px2vp(80))
  1098. .height(px2vp(80))
  1099. .borderRadius($r('app.float.general_border_radius'))
  1100. }
  1101. Text() {
  1102. }
  1103. .width(px2vp(80))
  1104. .height(px2vp(80))
  1105. .borderRadius($r('app.float.general_border_radius'))
  1106. }
  1107. .borderRadius($r('app.float.general_border_radius'))
  1108. .backgroundColor(JSON.stringify(this.selectProcess) != '{}' && item.operationId === this.selectProcess?.operationId ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
  1109. }
  1110. })
  1111. }
  1112. .listDirection(Axis.Vertical) // 排列方向
  1113. // .edgeEffect(EdgeEffect.Spring) // 滑动到边缘无效果
  1114. .height('80%')
  1115. .width('100%')
  1116. .alignListItem(ListItemAlign.Center)
  1117. }
  1118. .width('48%')
  1119. .height('74%')
  1120. .backgroundColor($r('app.color.page_general_background'))
  1121. .justifyContent(FlexAlign.SpaceEvenly)
  1122. .borderRadius($r('app.float.general_border_radius'))
  1123. }
  1124. }
  1125. // 物料位置(物料在哪些料箱里面)
  1126. @CustomDialog
  1127. struct MaterialLocationDialog {
  1128. @Link materialName: string
  1129. @Link boxMaterials: MaterialInformationModel[]
  1130. Controller: CustomDialogController
  1131. scroller: Scroller = new Scroller()
  1132. build() {
  1133. Stack() {
  1134. Column() {
  1135. }.width('100%')
  1136. .height('100%')
  1137. .blur(30)
  1138. .backgroundColor('#4d000000')
  1139. Column() {
  1140. Row() {
  1141. Row() {
  1142. Image($r('app.media.back_white'))
  1143. .width(px2vp(64))
  1144. .height(px2vp(64))
  1145. .onClick(() => {
  1146. this.Controller?.close()
  1147. })
  1148. }
  1149. .width('5%')
  1150. .padding({ left: 10 })
  1151. Row() {
  1152. Text(this.materialName && this.materialName.length > 0 ? this.materialName : '')
  1153. .fontSize($r('app.float.fontSize_38'))
  1154. .fontWeight(FontWeight.Medium)
  1155. .fontColor($r('app.color.process_divider_white_color'))
  1156. .width('100%')
  1157. .height('100%')
  1158. .textAlign(TextAlign.Center)
  1159. }
  1160. .width('90%')
  1161. .justifyContent(FlexAlign.Center)
  1162. Row() {
  1163. }.width('5%')
  1164. }
  1165. .width('100%')
  1166. .height('15%')
  1167. .padding({ top: 8 })
  1168. Grid(this.scroller) {
  1169. ForEach(this.boxMaterials, (item: MaterialInformationModel, index: number) => {
  1170. GridItem() {
  1171. Row() {
  1172. Column() {
  1173. Text(item.materialName)
  1174. .fontSize($r('app.float.fontSize_24'))
  1175. .fontWeight(FontWeight.Regular)
  1176. .fontColor($r('app.color.black_60'))
  1177. .height('20%')
  1178. .width('100%')
  1179. Text(item.materialCode)
  1180. .fontSize($r('app.float.fontSize_24'))
  1181. .fontWeight(FontWeight.Regular)
  1182. .fontColor($r('app.color.black_60'))
  1183. .height('20%')
  1184. .width('100%')
  1185. Text(item.spec)
  1186. .fontSize($r('app.float.fontSize_24'))
  1187. .fontWeight(FontWeight.Regular)
  1188. .fontColor($r('app.color.black_60'))
  1189. .height('20%')
  1190. .width('100%')
  1191. Text(item.batchNo)
  1192. .fontSize($r('app.float.fontSize_24'))
  1193. .fontWeight(FontWeight.Regular)
  1194. .fontColor($r('app.color.black_60'))
  1195. .height('20%')
  1196. .width('100%')
  1197. Row() {
  1198. Text(item.num?.toString())
  1199. .fontSize($r('app.float.fontSize_38'))
  1200. .fontWeight(FontWeight.Bold)
  1201. .fontColor($r('app.color.black_90'))
  1202. Text(item.unit ?? item.unitDictLabel)
  1203. .fontSize($r('app.float.fontSize_24'))
  1204. .fontWeight(FontWeight.Regular)
  1205. .fontColor($r('app.color.black_60'))
  1206. }
  1207. .margin({ top: 5 })
  1208. }
  1209. .width('100%')
  1210. .padding(10)
  1211. .borderRadius(10)
  1212. .alignItems(HorizontalAlign.Start)
  1213. .justifyContent(FlexAlign.Center)
  1214. .height('100%')
  1215. }
  1216. .padding(5)
  1217. .borderRadius(10)
  1218. .height('25%')
  1219. .width('100%')
  1220. .backgroundColor(Color.White)
  1221. }
  1222. .padding({ left: 5 })
  1223. })
  1224. }
  1225. .padding(10)
  1226. .columnsTemplate('1fr 1fr 1fr')
  1227. .columnsGap(10)
  1228. .rowsGap(10)
  1229. .width('100%')
  1230. .height('85%')
  1231. }
  1232. .width('100%')
  1233. .height('100%')
  1234. }
  1235. .width('100%')
  1236. .height('100%')
  1237. }
  1238. }
  1239. //取空箱子弹窗
  1240. @CustomDialog
  1241. struct EmptyBoxDialog {
  1242. @Link callBoxNum: number
  1243. @Link isTakeOutBox: number
  1244. controller?: CustomDialogController
  1245. cancel: () => void = () => {
  1246. }
  1247. confirm: () => void = () => {
  1248. }
  1249. build() {
  1250. Column({ space: 10 }) {
  1251. Text('取空箱数量')
  1252. .textAlign(TextAlign.Center)
  1253. .width('80%')
  1254. .height('30%')
  1255. .fontWeight(FontWeight.Regular)
  1256. .fontSize($r('app.float.fontSize_24'))
  1257. .fontColor($r('app.color.black_90'))
  1258. Row() {
  1259. Image($r('app.media.subtract_disabled'))
  1260. .width(px2vp(120))
  1261. .height(px2vp(120))
  1262. .border({ width: 0.8 })
  1263. .borderRadius({ topLeft: px2vp(16), bottomLeft: px2vp(16) })
  1264. .onClick(() => {
  1265. if (this.callBoxNum <= 1) {
  1266. return
  1267. }
  1268. this.callBoxNum--
  1269. })
  1270. TextInput({ text: this.callBoxNum.toString() })
  1271. .fontSize($r('app.float.title_font_size'))
  1272. .fontWeight(FontWeight.Bold)
  1273. .fontColor($r('app.color.general_font_color'))
  1274. .height(px2vp(120))// .opacity($r('app.float.general_font_opacity'))
  1275. //.height('40%')
  1276. .width('50%')
  1277. .type(InputType.Number)
  1278. .textAlign(TextAlign.Center)
  1279. .borderRadius(0)
  1280. .backgroundColor($r('app.color.general_card_background_color'))
  1281. .border({ width: 0.8 })
  1282. .onChange((value: string) => {
  1283. if (!value || value.length === 0) {
  1284. this.callBoxNum = 0
  1285. return
  1286. }
  1287. let num: number = Number.parseInt(value)
  1288. if (num < 1) {
  1289. this.callBoxNum = 1
  1290. }
  1291. })
  1292. Image($r('app.media.add_disabled'))
  1293. .width(px2vp(120))
  1294. .height(px2vp(120))
  1295. .border({ width: 0.8 })
  1296. .borderRadius({ topRight: px2vp(16), bottomRight: px2vp(16) })
  1297. .onClick(() => {
  1298. this.callBoxNum++
  1299. })
  1300. }
  1301. .width('60%')
  1302. .height('40%')
  1303. .justifyContent(FlexAlign.Center)
  1304. Row() {
  1305. Button('取消')
  1306. .fontSize($r('app.float.fontSize_24'))
  1307. .fontColor($r('app.color.blue_100'))
  1308. .width('50%')
  1309. .height('100%')
  1310. .backgroundColor($r('app.color.black_6'))
  1311. .onClick(() => {
  1312. this.isTakeOutBox = 2
  1313. this.callBoxNum = 1
  1314. this.controller?.close()
  1315. })
  1316. Button('确认')
  1317. .fontSize($r('app.float.fontSize_24'))
  1318. .fontColor($r('app.color.general_font_white_color'))
  1319. .width('50%')
  1320. .height('100%')
  1321. .backgroundColor($r('app.color.blue_100'))
  1322. .onClick(() => {
  1323. this.isTakeOutBox = 1
  1324. this.controller?.close()
  1325. })
  1326. }
  1327. .width('60%')
  1328. .height('15%')
  1329. }.width('60%')
  1330. .height('50%')
  1331. .borderRadius($r('app.float.borderRadius_16'))
  1332. .backgroundColor($r('app.color.process_divider_white_color'))
  1333. }
  1334. }
  1335. // 扫描齐套料箱弹窗
  1336. @CustomDialog
  1337. struct scanningMaterialBox {
  1338. @Link binCode: string
  1339. @Link boxInfo: BoxInfo
  1340. @Link clickScan: number
  1341. @Link selectOrder: number
  1342. @Link vehicleCode: string
  1343. @Link orderArray: OrderInfo[]
  1344. async materialBoxHTTP(vehicleCode: string) {
  1345. return await StorageRequest.post('/api/v1/process/vehicleOperation/vehicleDetail', {
  1346. workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode!,
  1347. vehicleCode: vehicleCode,
  1348. } as RequestParamModel) as BoxInfo
  1349. }
  1350. @Link materialCode: string
  1351. //扫码控制器
  1352. textController: TextInputController = new TextInputController()
  1353. controller: CustomDialogController
  1354. build() {
  1355. Column() {
  1356. Text('扫描料箱')
  1357. .fontSize($r('app.float.fontSize_38'))
  1358. .fontWeight(FontWeight.Medium)
  1359. .width('100%')
  1360. .height('40%')
  1361. .textAlign(TextAlign.Center)
  1362. Blank()
  1363. Row() {
  1364. Image($r('app.media.shaoma'))
  1365. .width('60px')
  1366. .height('60px')
  1367. TextInput({ text: this.materialCode,
  1368. placeholder: '点击扫码添加编码',
  1369. controller: this.textController })
  1370. .width('92%')
  1371. .height('100%')
  1372. .width('80%')
  1373. .fontWeight(FontWeight.Medium)
  1374. .fontSize('32px')
  1375. .backgroundColor("#ffff")
  1376. .borderRadius(21)
  1377. .onSubmit(() => {
  1378. this.binCode = this.materialCode
  1379. this.clickScan = 1
  1380. this.controller.close()
  1381. //this.boxInfo = await this.materialBoxHTTP(this.binCode)
  1382. })
  1383. Image($r('app.media.search'))
  1384. .width('60px')
  1385. .height('60px')
  1386. .onClick(async () => {
  1387. this.controller.close()
  1388. this.clickScan = 1
  1389. this.boxInfo = await this.materialBoxHTTP(this.binCode)
  1390. })
  1391. }
  1392. .width('60%')
  1393. .height('30%')
  1394. .border({ width: 0.4 })
  1395. .borderRadius(px2vp(100))
  1396. .alignItems(VerticalAlign.Center)
  1397. .backgroundColor($r('app.color.process_divider_white_color'))
  1398. Blank()
  1399. }
  1400. .width('50%')
  1401. .height('40%')
  1402. .padding(10)
  1403. .alignItems(HorizontalAlign.Center)
  1404. .borderRadius($r('app.float.borderRadius_16'))
  1405. .backgroundColor($r('app.color.process_divider_white_color'))
  1406. }
  1407. }
  1408. // 物料位置(物料在哪些料箱里面)
  1409. @CustomDialog
  1410. struct LocationInfoListDialog {
  1411. @Link materials: MaterialInformationModel[]
  1412. scroller: Scroller = new Scroller()
  1413. Controller: CustomDialogController
  1414. closeDialog: () => void = () => {
  1415. }
  1416. build() {
  1417. Stack() {
  1418. Column() {
  1419. Grid(this.scroller) {
  1420. ForEach(this.materials, (item: MaterialInformationModel, index: number) => {
  1421. GridItem() {
  1422. Column() {
  1423. Row() {
  1424. Text(item?.materialName)
  1425. .fontSize($r('app.float.fontSize_24'))
  1426. .fontWeight(FontWeight.Regular)
  1427. .fontColor($r('app.color.black_90'))
  1428. .margin({ right: 15 })
  1429. Row() {
  1430. Text(item.num?.toString())
  1431. .fontSize($r('app.float.fontSize_38'))
  1432. .fontWeight(FontWeight.Bold)
  1433. .fontColor($r('app.color.black_90'))
  1434. Text(item.unit)
  1435. .fontSize($r('app.float.fontSize_24'))
  1436. .fontWeight(FontWeight.Regular)
  1437. .fontColor($r('app.color.black_60'))
  1438. }
  1439. }
  1440. .justifyContent(FlexAlign.SpaceBetween)
  1441. .width('100%')
  1442. Text(item.materialNo)
  1443. .fontSize($r('app.float.fontSize_24'))
  1444. .fontWeight(FontWeight.Regular)
  1445. .fontColor($r('app.color.black_60'))
  1446. .width('100%')
  1447. Text(item.spec)
  1448. .fontSize($r('app.float.fontSize_24'))
  1449. .fontWeight(FontWeight.Regular)
  1450. .fontColor($r('app.color.black_60'))
  1451. .width('100%')
  1452. }
  1453. .width('100%')
  1454. .alignItems(HorizontalAlign.Start)
  1455. .justifyContent(FlexAlign.Center)
  1456. .padding({ left: 8, right: 10 })
  1457. .height('60')
  1458. }
  1459. .padding({ left: 5, bottom: 8 })
  1460. .borderRadius(5)
  1461. .border({ width: 2, color: Color.Gray })
  1462. })
  1463. }
  1464. .padding(10)
  1465. .columnsTemplate('1fr')
  1466. .columnsGap(10)
  1467. .rowsGap(10)
  1468. .width('100%')
  1469. .height('100%')
  1470. }
  1471. .width('100%')
  1472. .height('100%')
  1473. }
  1474. .width('60%')
  1475. .height('80%')
  1476. .backgroundColor($r('app.color.page_general_background'))
  1477. .borderRadius(20)
  1478. .onClick(() => {
  1479. this.closeDialog()
  1480. })
  1481. }
  1482. }
  1483. //库存详情弹窗
  1484. @CustomDialog
  1485. struct MaterailInfoDialog {
  1486. @Link Materialposition: Materialpositionclass1[]
  1487. scroller: Scroller = new Scroller()
  1488. @Link materialName: string
  1489. Controller: CustomDialogController
  1490. lookDetail: (m: Materialpositionclass1) => void = () => {
  1491. }
  1492. goToOut: (m: Materialpositionclass1) => void = () => {
  1493. }
  1494. build() {
  1495. Stack() {
  1496. Column() {
  1497. }
  1498. .width('100%')
  1499. .height('100%')
  1500. .blur(30)
  1501. .backgroundColor('#4d000000')
  1502. Column() {
  1503. Row() {
  1504. Row() {
  1505. Image($r('app.media.back_white'))
  1506. .width(px2vp(64))
  1507. .height(px2vp(64))
  1508. .onClick(() => {
  1509. this.Controller?.close()
  1510. })
  1511. }
  1512. .width('5%')
  1513. .padding({ left: 10 })
  1514. Row() {
  1515. Text(this.materialName && this.materialName.length > 0 ? this.materialName : '')
  1516. .fontSize($r('app.float.fontSize_38'))
  1517. .fontWeight(FontWeight.Medium)
  1518. .fontColor($r('app.color.process_divider_white_color'))
  1519. .width('100%')
  1520. .height('100%')
  1521. .textAlign(TextAlign.Center)
  1522. }
  1523. .width('90%')
  1524. .justifyContent(FlexAlign.Center)
  1525. Row() {
  1526. }.width('5%')
  1527. }
  1528. .width('100%')
  1529. .height('15%')
  1530. .padding({ top: 8 })
  1531. Grid(this.scroller) {
  1532. ForEach(this.Materialposition, (item: Materialpositionclass1, index: number) => {
  1533. GridItem() {
  1534. Row() {
  1535. Column() {
  1536. Text(item.vehicleCode)
  1537. .fontSize($r('app.float.fontSize_24'))
  1538. .fontWeight(FontWeight.Regular)
  1539. .fontColor($r('app.color.black_60'))
  1540. .width('100%')
  1541. Text("坐标: " + item?.coordinate)
  1542. .fontSize($r('app.float.fontSize_24'))
  1543. .fontWeight(FontWeight.Regular)
  1544. .fontColor($r('app.color.black_90'))
  1545. .margin({ right: 15 })
  1546. Text("层数: " + item.position)
  1547. .fontSize($r('app.float.fontSize_24'))
  1548. .fontWeight(FontWeight.Regular)
  1549. .fontColor($r('app.color.black_90'))
  1550. .margin({ right: 15 })
  1551. }
  1552. .width('60%')
  1553. .alignItems(HorizontalAlign.Start)
  1554. .justifyContent(FlexAlign.Center)
  1555. .height('100%')
  1556. Row() {
  1557. Text("详情")
  1558. .fontSize($r('app.float.fontSize_24'))
  1559. .fontWeight(FontWeight.Regular)
  1560. .fontColor($r('app.color.white_100'))
  1561. .backgroundColor($r('app.color.blue_100'))
  1562. .height(40)
  1563. .textAlign(TextAlign.Center)
  1564. .borderRadius(10)
  1565. .width(60)
  1566. .onClick(() => {
  1567. this.lookDetail(item)
  1568. })
  1569. // Text("出库")
  1570. // .fontSize($r('app.float.fontSize_24'))
  1571. // .fontWeight(FontWeight.Regular)
  1572. // .fontColor($r('app.color.white_100'))
  1573. // .margin({ left: 15 })
  1574. // .backgroundColor($r('app.color.warn_1'))
  1575. // .height(40)
  1576. // .textAlign(TextAlign.Center)
  1577. // .borderRadius(10)
  1578. // .width(60)
  1579. // .onClick(() => {
  1580. // this.goToOut(item)
  1581. // })
  1582. }
  1583. .width('40%')
  1584. .justifyContent(FlexAlign.End)
  1585. .height('100%')
  1586. }
  1587. .padding(5)
  1588. .borderRadius(10)
  1589. .height('12%')
  1590. .width('100%')
  1591. .backgroundColor($r('app.color.robot_set_card_white'))
  1592. }
  1593. .padding({ left: 5 })
  1594. })
  1595. }
  1596. .padding(10)
  1597. .columnsTemplate('1fr 1fr 1fr')
  1598. .columnsGap(10)
  1599. .rowsGap(10)
  1600. .width('100%')
  1601. .height('85%')
  1602. }
  1603. .width('100%')
  1604. .height('100%')
  1605. }
  1606. .width('100%')
  1607. .height('100%')
  1608. }
  1609. }
  1610. // 物料详情弹窗(序列号)
  1611. @CustomDialog
  1612. struct MaterialDetailOneDialog {
  1613. @Link material: Materialpositionclass
  1614. scroller: Scroller = new Scroller()
  1615. controller: CustomDialogController
  1616. // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
  1617. build() {
  1618. Column() {
  1619. Row() {
  1620. Text('物料详情')
  1621. .textAlign(TextAlign.Center)
  1622. .width('100%')
  1623. .height('20%')
  1624. .fontSize($r('app.float.fontSize_24'))
  1625. }
  1626. .height('25%')
  1627. Column({ space: 20 }) {
  1628. Column({ space: 10 }) {
  1629. Text(this.material?.materialName && this.material?.materialName.length > 0 ? this.material.materialName! : '')
  1630. .fontSize($r('app.float.fontSize_20'))
  1631. .fontColor($r('app.color.general_font_white_color'))
  1632. .opacity($r('app.float.card_font_default_opacity'))
  1633. .width('100%')
  1634. Text('100*200')
  1635. .fontSize($r('app.float.robot_state_font_size'))
  1636. .textAlign(TextAlign.Start)
  1637. .fontColor('#99000000')
  1638. .width('100%')
  1639. Text('批次号:' + '1223341232123124121')
  1640. .fontSize($r('app.float.robot_state_font_size'))
  1641. .textAlign(TextAlign.Start)
  1642. .fontColor('#99000000')
  1643. .width('100%')
  1644. Text('计划编号:' + '1231231231233')
  1645. .fontSize($r('app.float.robot_state_font_size'))
  1646. .textAlign(TextAlign.Start)
  1647. .fontColor('#99000000')
  1648. .width('100%')
  1649. Text('订单编号:' + '1231231231233')
  1650. .fontSize($r('app.float.robot_state_font_size'))
  1651. .textAlign(TextAlign.Start)
  1652. .fontColor('#99000000')
  1653. .width('100%')
  1654. Text('出库单号:' + '1231231231233')
  1655. .fontSize($r('app.float.robot_state_font_size'))
  1656. .textAlign(TextAlign.Start)
  1657. .fontColor('#99000000')
  1658. .width('100%')
  1659. }.width('40%')
  1660. .height('30%')
  1661. Divider().vertical(false)
  1662. .width('60%')
  1663. Column() {
  1664. Text('录入数量')
  1665. .fontSize($r('app.float.robot_state_font_size'))
  1666. .textAlign(TextAlign.Start)
  1667. .fontColor('#99000000')
  1668. .width('40%')
  1669. Counter() {
  1670. }
  1671. .width('417px')
  1672. .height('107px')
  1673. .onInc(() => {
  1674. })
  1675. .onDec(() => {
  1676. })
  1677. }
  1678. }
  1679. .width('50%')
  1680. .height('100%')
  1681. .backgroundColor('#F1F3F5')
  1682. .borderRadius(20)
  1683. Row() {
  1684. }.width('25%')
  1685. .height('100%')
  1686. .onClick(() => {
  1687. this.controller.close()
  1688. })
  1689. }
  1690. .width('48%')
  1691. .height('74%')
  1692. .backgroundColor($r('app.color.white_f1f3f5'))
  1693. .height('100%')
  1694. .justifyContent(FlexAlign.Center)
  1695. }
  1696. }
  1697. // 物料详情弹窗(批次号)
  1698. @CustomDialog
  1699. struct MaterialDetailTwoDialog {
  1700. @Link value: number
  1701. @Link CunQuHuo: number
  1702. scroller: Scroller = new Scroller()
  1703. @State navigation: number = 0
  1704. @Link textValue: string
  1705. @Link inputValue: string
  1706. controller: CustomDialogController
  1707. // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
  1708. build() {
  1709. Column() {
  1710. Column() {
  1711. }
  1712. .width('100%')
  1713. .height('20%')
  1714. .onClick(() => {
  1715. this.controller.close()
  1716. })
  1717. Row() {
  1718. Row() {
  1719. }
  1720. .width('25%')
  1721. .height('100%')
  1722. .onClick(() => {
  1723. this.controller.close()
  1724. })
  1725. Column({ space: 20 }) {
  1726. Text('物料详情')
  1727. .textAlign(TextAlign.Center)
  1728. .width('100%')
  1729. .height('20%')
  1730. .fontSize('51px')
  1731. Column({ space: 10 }) {
  1732. Text('PCBA-ASSSD电路板')
  1733. .fontSize('32px')
  1734. .width('100%')
  1735. Text('100*200')
  1736. .fontSize($r('app.float.robot_state_font_size'))
  1737. .textAlign(TextAlign.Start)
  1738. .fontColor('#99000000')
  1739. .width('100%')
  1740. Text('批次号:' + '1223341232123124121')
  1741. .fontSize($r('app.float.robot_state_font_size'))
  1742. .textAlign(TextAlign.Start)
  1743. .fontColor('#99000000')
  1744. .width('100%')
  1745. Text('计划编号:' + '1231231231233')
  1746. .fontSize($r('app.float.robot_state_font_size'))
  1747. .textAlign(TextAlign.Start)
  1748. .fontColor('#99000000')
  1749. .width('100%')
  1750. Text('订单编号:' + '1231231231233')
  1751. .fontSize($r('app.float.robot_state_font_size'))
  1752. .textAlign(TextAlign.Start)
  1753. .fontColor('#99000000')
  1754. .width('100%')
  1755. Text('出库单号:' + '1231231231233')
  1756. .fontSize($r('app.float.robot_state_font_size'))
  1757. .textAlign(TextAlign.Start)
  1758. .fontColor('#99000000')
  1759. .width('100%')
  1760. }.width('40%')
  1761. .height('30%')
  1762. Divider().vertical(false)
  1763. .width('60%')
  1764. Column() {
  1765. Text('录入数量')
  1766. .fontSize($r('app.float.robot_state_font_size'))
  1767. .textAlign(TextAlign.Start)
  1768. .fontColor('#99000000')
  1769. .width('40%')
  1770. Counter() {
  1771. Text(this.value.toString())
  1772. }
  1773. .width('417px')
  1774. .height('107px')
  1775. .onInc(() => {
  1776. this.value++
  1777. })
  1778. .onDec(() => {
  1779. this.value--
  1780. })
  1781. }
  1782. }.width('50%')
  1783. .height('100%')
  1784. .backgroundColor('#F1F3F5')
  1785. .borderRadius(20)
  1786. Row() {
  1787. }.width('25%')
  1788. .height('100%')
  1789. .onClick(() => {
  1790. this.controller.close()
  1791. })
  1792. }.width('100%')
  1793. .height('60%')
  1794. Column() {
  1795. }.width('100%')
  1796. .height('20%')
  1797. .onClick(() => {
  1798. this.controller.close()
  1799. })
  1800. }.width('100%')
  1801. .backgroundColor('#4d000000')
  1802. .height('100%')
  1803. .justifyContent(FlexAlign.Center)
  1804. // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
  1805. }
  1806. }
  1807. function getMaterialPositionStr(locationNo: string): string {
  1808. if (!locationNo || locationNo.length <= 0 || locationNo.split('-').length != 3) {
  1809. return ''
  1810. }
  1811. let resultStr: string = 'X:'
  1812. let strArray: string[] = locationNo.split('-')
  1813. resultStr += strArray[0]
  1814. resultStr += ' Y:' + strArray[1]
  1815. resultStr += ' ' + strArray[2] + '层'
  1816. return resultStr
  1817. }
  1818. class BoxInfo {
  1819. // 是否可绑定0-否 1-是
  1820. isEnable?: number
  1821. // 物料信息
  1822. list?: MaterialInfo[]
  1823. // 料箱id
  1824. vehicleId?: string
  1825. // 料箱名称
  1826. vehicleName?: string
  1827. // 料箱编号
  1828. vehicleNo?: string
  1829. }
  1830. export interface boxMaterialClass {
  1831. //料箱等级
  1832. vehicleLevel?: string
  1833. materialCode?: string
  1834. //载具编号
  1835. vehicleCode?: string
  1836. //产品规格
  1837. spec?: string
  1838. //批次号
  1839. batchCode?: string;
  1840. ///完成数量
  1841. completedNum?: number
  1842. //已经占用箱数
  1843. useNum?: number
  1844. //空箱数
  1845. emptyBoxNum?: string
  1846. //可用箱数
  1847. canUsedNum?: string
  1848. //总容量箱数
  1849. allNum?: number
  1850. //仓储类型
  1851. type?: string
  1852. //储位坐标
  1853. coordinate?: string
  1854. //储位位置
  1855. position?: string
  1856. //创建时间
  1857. created?: string
  1858. //
  1859. creator?: string
  1860. //仓库编码
  1861. houseNo?: string
  1862. deptId?: string
  1863. houseType?: string
  1864. //主键
  1865. id?: string
  1866. locationNo?: string
  1867. // 物料名称
  1868. materialName?: string
  1869. //物料编码
  1870. materialNo?: string
  1871. //出入库数量
  1872. num?: number
  1873. orgId?: string
  1874. planNo?: string
  1875. // 序列号
  1876. seqNo?: string
  1877. // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
  1878. state?: number
  1879. // 库存数量
  1880. stockNum?: string
  1881. //出入库任务单号
  1882. taskNo?: string
  1883. unit?: string
  1884. updated?: string
  1885. //任务名称
  1886. taskName?: string
  1887. updator?: string
  1888. vehicleNo?: string
  1889. pageNo?: number
  1890. pageSize?: number
  1891. }
  1892. export interface outBoxClass {
  1893. orderId?: string
  1894. orderType?: string
  1895. }
  1896. export interface outboundClass {
  1897. cmdId?: string
  1898. code?: string
  1899. msg?: string
  1900. }
  1901. export class controlClass {
  1902. houseNo?: string
  1903. orderId?: string
  1904. type?: number
  1905. vehicleNo?: string
  1906. }