1
0

MaintenanceStation.ets 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. import { TitleStateComp } from '../common/component/TitleStateComp';
  2. import { BottomOperateComp } from '../common/component/BottomOperateComp';
  3. import router from '@ohos.router';
  4. export default class repairList {
  5. deviceName?:string
  6. unqualifiedQuantity?:number
  7. repairedQuantity?:number
  8. time?:string
  9. }
  10. @Entry
  11. @Component
  12. struct MaintenanceStation{
  13. textcontroller: TextInputController = new TextInputController()
  14. @State deviceName?:string=''
  15. @State click:number=-1
  16. private repairList:Array<repairList>=[
  17. {deviceName:"DS123422233卫星天线1",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
  18. {deviceName:"DS123422233卫星天线2",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
  19. {deviceName:"DS123422233卫星天线3",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/5/1 15:11:11'},
  20. {deviceName:"DS123422233卫星天线4",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
  21. {deviceName:"DS123422233卫星天线5",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/4/30 15:11:11'},
  22. {deviceName:"DS123422233卫星天线6",unqualifiedQuantity:10,repairedQuantity:5,time:'2024/5/1 15:11:11'},
  23. ]
  24. private isHomePage:boolean = false
  25. build(){
  26. Column(){
  27. TitleStateComp({isHomePage : this.isHomePage})
  28. Row(){
  29. Column(){
  30. Text('待维修产品'+'['+this.repairList.length.toString()+']')
  31. .fontSize(px2vp(51))
  32. .fontColor('#e6000000')
  33. .fontWeight(FontWeight.Medium)
  34. .textAlign(TextAlign.Start)
  35. .width('90%')
  36. .height('8%')
  37. List({ space: 10, initialIndex: 0 }) {
  38. ForEach(this.repairList, (item:repairList,index:number) => {
  39. ListItem() {
  40. Column(){
  41. Text(item.deviceName)
  42. .fontWeight(FontWeight.Medium)
  43. .fontSize(px2vp(32))
  44. .fontColor('#e6000000')
  45. .width('100%')
  46. .height('40%')
  47. Row(){
  48. Text('不合格数')
  49. .fontWeight(FontWeight.Regular)
  50. .fontSize(px2vp(27))
  51. .fontColor('#99000000')
  52. .width('20%')
  53. .height('100%')
  54. Text(item.unqualifiedQuantity?.toString())
  55. .fontWeight(FontWeight.Medium)
  56. .fontSize(px2vp(27))
  57. .fontColor('#e6000000')
  58. .width('20%')
  59. .height('100%')
  60. Text('已维修数')
  61. .fontWeight(FontWeight.Regular)
  62. .fontSize(px2vp(27))
  63. .fontColor('#99000000')
  64. .width('20%')
  65. .height('100%')
  66. Text(item.repairedQuantity?.toString())
  67. .fontWeight(FontWeight.Medium)
  68. .fontSize(px2vp(27))
  69. .fontColor('#e6000000')
  70. .width('10%')
  71. .height('100%')
  72. }.width('100%')
  73. .height('30%')
  74. Row(){
  75. Text('审理时间:')
  76. .fontWeight(FontWeight.Regular)
  77. .fontSize(px2vp(27))
  78. .fontColor('#99000000')
  79. .width('30%')
  80. .height('100%')
  81. Text(item.time)
  82. .fontWeight(FontWeight.Medium)
  83. .fontSize(px2vp(27))
  84. .fontColor('#e6000000')
  85. .width('70%')
  86. .height('100%')
  87. }.width('100%')
  88. .height('30%')
  89. }.width('100%')
  90. .height('25%')
  91. .borderRadius(15)
  92. .padding({left:10})
  93. .backgroundColor(this.click===index?$r('app.color.robot_set_card_blue'):$r('app.color.general_card_background_color'))
  94. .onClick(()=>{
  95. this.click=index
  96. this.deviceName=item.deviceName
  97. })
  98. }
  99. }
  100. // , item => item
  101. )
  102. }
  103. .width('90%')
  104. .height('92%')
  105. }.height('100%')
  106. .width('30%')
  107. Column(){
  108. Text('故障详情')
  109. .fontSize(px2vp(51))
  110. .fontColor('#e6000000')
  111. .fontWeight(FontWeight.Medium)
  112. .textAlign(TextAlign.Start)
  113. .width('90%')
  114. .height('8%')
  115. Text(this.deviceName)
  116. .fontWeight(FontWeight.Medium)
  117. .fontSize(px2vp(32))
  118. .fontColor('#e6000000')
  119. .width('100%')
  120. .height('5%')
  121. }.height('100%')
  122. .width('30%')
  123. Column(){
  124. Row(){
  125. Text('不合格品状况')
  126. .fontSize(px2vp(51))
  127. .fontColor('#e6000000')
  128. .fontWeight(FontWeight.Medium)
  129. .textAlign(TextAlign.Start)
  130. .width('60%')
  131. .height('100%')
  132. Text('操作')
  133. .fontSize(px2vp(51))
  134. .fontColor('#e6000000')
  135. .fontWeight(FontWeight.Medium)
  136. .textAlign(TextAlign.Start)
  137. .width('40%')
  138. .height('100%')
  139. }
  140. .width('100%')
  141. .height('8%')
  142. Row(){
  143. Row(){
  144. Column(){
  145. Column(){
  146. Row(){
  147. Image($r('app.media.pending_report'))
  148. .width(px2vp(37))
  149. .height(px2vp(37))
  150. .margin({left:10})
  151. Text('待处理报故')
  152. .fontWeight(FontWeight.Regular)
  153. .fontSize(px2vp(27))
  154. .fontColor('#99000000')
  155. .margin({left:5})
  156. }
  157. .height('30%')
  158. .width("100%")
  159. Text('100')
  160. .textAlign(TextAlign.Center)
  161. .height('70%')
  162. .width("100%")
  163. .fontSize(px2vp(80))
  164. .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
  165. .fontWeight(FontWeight.Bold)
  166. }.width('90%')
  167. .height('45%')
  168. .borderRadius(px2vp(15))
  169. .margin({ left:10,right:10,top:5,bottom:5 })
  170. .backgroundColor($r('app.color.robot_set_card_white'))
  171. Divider()
  172. .width('85%')
  173. .margin({left:20})
  174. Column(){
  175. Row(){
  176. Image($r('app.media.repair_products'))
  177. .width(px2vp(37))
  178. .height(px2vp(37))
  179. .margin({left:10})
  180. Text('待维修产品')
  181. .fontWeight(FontWeight.Regular)
  182. .fontSize(px2vp(27))
  183. .fontColor('#99000000')
  184. .margin({left:5})
  185. }
  186. .height('30%')
  187. .width("100%")
  188. Text('100')
  189. .textAlign(TextAlign.Center)
  190. .height('70%')
  191. .width("100%")
  192. .fontSize(px2vp(80))
  193. .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
  194. .fontWeight(FontWeight.Bold)
  195. }.width('90%')
  196. .height('45%')
  197. .borderRadius(px2vp(15))
  198. .margin({ left:10,right:10,top:5,bottom:5 })
  199. }
  200. .width('50%')
  201. .height('100%')
  202. Divider()
  203. .vertical(true)
  204. .height('80%')
  205. Column(){
  206. Column(){
  207. Row(){
  208. Image($r('app.media.hear'))
  209. .width(px2vp(37))
  210. .height(px2vp(37))
  211. .margin({left:10})
  212. Text('审理中')
  213. .fontWeight(FontWeight.Regular)
  214. .fontSize(px2vp(27))
  215. .fontColor('#99000000')
  216. .margin({left:5})
  217. }
  218. .height('30%')
  219. .width("100%")
  220. Text('10')
  221. .textAlign(TextAlign.Center)
  222. .height('70%')
  223. .width("100%")
  224. .fontSize(px2vp(80))
  225. .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
  226. .fontWeight(FontWeight.Bold)
  227. }.width('90%')
  228. .height('45%')
  229. .borderRadius(px2vp(15))
  230. .margin({ left:10,right:10,top:5,bottom:5 })
  231. Divider()
  232. .width('85%')
  233. .margin({right:20})
  234. Column(){
  235. Row(){
  236. Image($r('app.media.maintenance_history'))
  237. .width(px2vp(37))
  238. .height(px2vp(37))
  239. .margin({left:10})
  240. Text('维修历史')
  241. .fontWeight(FontWeight.Regular)
  242. .fontSize(px2vp(27))
  243. .fontColor('#99000000')
  244. .margin({left:5})
  245. }
  246. .height('30%')
  247. .width("100%")
  248. Text('999+')
  249. .textAlign(TextAlign.Center)
  250. .height('70%')
  251. .width("100%")
  252. .fontSize(px2vp(80))
  253. .fontColor($r('app.color.OtherStorage_CallMaterials_text_color'))
  254. .fontWeight(FontWeight.Bold)
  255. }.width('90%')
  256. .height('45%')
  257. .borderRadius(px2vp(15))
  258. .margin({ left:10,right:10,top:5,bottom:5 })
  259. .backgroundColor($r('app.color.robot_set_card_white'))
  260. }
  261. .width('50%')
  262. .height('100%')
  263. }.width('60%')
  264. .height('100%')
  265. Column(){
  266. Row(){
  267. Text('生产履历')
  268. .fontWeight(FontWeight.Medium)
  269. .fontSize(px2vp(32))
  270. .fontColor('#e6000000')
  271. .width('60%')
  272. .height('100%')
  273. Image($r('app.media.product_history'))
  274. .width(px2vp(64))
  275. .height(px2vp(64))
  276. }.width('95%')
  277. .height('30%')
  278. .margin({right:20,left:10})
  279. .padding({left:10,right:10})
  280. .borderRadius(px2vp(15))
  281. .backgroundColor($r('app.color.robot_set_card_white'))
  282. }.width('40%')
  283. .height('100%')
  284. }.width('100%')
  285. .height('40%')
  286. Blank()
  287. Column(){
  288. Text('扫码')
  289. .fontSize(px2vp(51))
  290. .fontColor('#e6000000')
  291. .fontWeight(FontWeight.Medium)
  292. .textAlign(TextAlign.Start)
  293. .width('100%')
  294. .height('10%')
  295. Column(){
  296. Image($r('app.media.scan_qr'))
  297. .width(px2vp(141))
  298. .height(px2vp(141))
  299. }.width('100%')
  300. .height('50%')
  301. .justifyContent(FlexAlign.Center)
  302. Row(){
  303. Image($r('app.media.shaoma'))
  304. .width('56px')
  305. .height('56px')
  306. .margin({right:10})
  307. TextInput({ text: '', placeholder: '点击扫码或者输入编码', controller: this.textcontroller})
  308. .placeholderColor(Color.Grey)
  309. .placeholderFont({ size: 14, weight: 400 })
  310. .caretColor(Color.Blue)
  311. .backgroundColor($r('app.color.robot_set_card_white'))
  312. .height('100%')
  313. .fontSize(px2vp(32))
  314. .fontColor(Color.Black)
  315. .onSubmit(()=>{
  316. router.pushUrl({
  317. url:'pages/MaintenanceStationOperations'
  318. })
  319. })
  320. }.width('80%')
  321. .backgroundColor($r('app.color.robot_set_card_white'))
  322. .borderRadius(15)
  323. .height('15%')
  324. }
  325. .width('90%')
  326. .height('40%')
  327. }.height('100%')
  328. .width('40%')
  329. }.width("100%")
  330. .height("84%")
  331. BottomOperateComp({isHomePage : this.isHomePage})
  332. }
  333. .width("100%")
  334. .height("100%")
  335. .backgroundColor($r('app.color.title_bar_background'))
  336. }
  337. }