123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- import ProcessRequest from '../common/util/request/ProcessRequest'
- import { MessageInfo, MessagePage } from '../viewmodel/MessageInfo'
- import TaskSeqVO from '../viewmodel/process/TaskSeqInfo'
- import { DeptInfo, ProductionLine, WorkstationInfo } from '../viewmodel/UserInfo'
- import RequestParamModel from '../viewmodel/RequestParamModel'
- @CustomDialog
- export struct SwitchingStationDialog{
- private scrollerList: Scroller = new Scroller()
- //当前工位
- @Link currentStation:string
- @Link currentPLCode:string
- @Link currentStationId:string
- @State selectStationIndex: number = -1
- //工位列表
- @State stationsList : WorkstationInfo[]=[]
- loadStations = async () => {
- this.stationsList = await ProcessRequest.get(`api/v1/base/station/getStationList/${this.currentPLCode}/0`, {}) as WorkstationInfo[];
- };
- controller: CustomDialogController
- aboutToAppear(): void {
- this.loadStations();
- }
- private onSelectStation(index: number) {
- this.selectStationIndex = index
- }
- build() {
- Column() {
- Column() {
- Text("切换工位")
- .fontColor($r('app.color.FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .height('8%')
- .width('100%')
- .justifyContent(FlexAlign.Center)
- Column(){
- List({space:10,scroller:this.scrollerList}) {
- ForEach(this.stationsList, (item:WorkstationInfo,index) => {
- ListItem() {
- Column(){
- Text(item.name)
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.FFFFFF'))
- } .backgroundColor(index === this.selectStationIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
- .borderRadius($r('app.float.virtualSize_16'))
- .padding(8)
- .width('100%')
- .height('12%')
- .alignItems(HorizontalAlign.Center)
- .justifyContent(FlexAlign.Center)
- .border({
- width: index === this.selectStationIndex ? 2 : 0,
- color: index === this.selectStationIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
- })
- .onClick(() => {
- this.onSelectStation(index)
- })
- }
- })
- }
- .width('70%')
- .height('100%')
- }
- .justifyContent(FlexAlign.SpaceEvenly)
- .width('100%')
- .height('81%')
- .margin({ top: '2%'})
- Column() {
- Divider()
- .vertical(false)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Row() {
- Text('取消')
- .fontColor($r('app.color.60FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => this.controller.close())
- Divider()
- .vertical(true)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Text('确定')
- .fontColor($r('app.color.007AFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => {
- this.currentStation = this.stationsList[this.selectStationIndex].name??""
- this.currentStationId=this.stationsList[this.selectStationIndex].id??""
- this.controller.close();
- })
- }
- }
- .width('100%')
- .height('8%')
- }
- .height('71%')
- .width('30%')
- .backgroundColor($r('app.color.2A2A2A'))
- .justifyContent(FlexAlign.End)
- .alignItems(HorizontalAlign.Start)
- .borderColor($r('app.color.000000'))
- .borderWidth(1)
- .borderRadius($r('app.float.virtualSize_16'))
- }
- }
- @CustomDialog
- export struct SwitchingProductLineDialog{
- private scrollerList: Scroller = new Scroller()
- //当前产线
- @Link currentProductLine:string
- @Link currentPLCode:string
- @State selectProductLineIndex: number = -1
- //产线列表
- @State productLineList : ProductionLine[]=[]
- loadStations = async () => {
- this.productLineList = await ProcessRequest.post('api/v1/base/productionLine/list/list', {}as RequestParamModel) as ProductionLine[];
- };
- controller: CustomDialogController
- aboutToAppear(): void {
- this.loadStations();
- }
- private onSelectProductLine(index: number) {
- this.selectProductLineIndex = index
- }
- build() {
- Column() {
- Column() {
- Text("切换工位")
- .fontColor($r('app.color.FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .height('8%')
- .width('100%')
- .justifyContent(FlexAlign.Center)
- Column(){
- List({space:10,scroller:this.scrollerList}) {
- ForEach(this.productLineList, (item:ProductionLine,index) => {
- ListItem() {
- Column(){
- Text(item.name)
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.FFFFFF'))
- } .backgroundColor(index === this.selectProductLineIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
- .borderRadius($r('app.float.virtualSize_16'))
- .padding(8)
- .width('100%')
- .height('12%')
- .alignItems(HorizontalAlign.Center)
- .justifyContent(FlexAlign.Center)
- .border({
- width: index === this.selectProductLineIndex ? 2 : 0,
- color: index === this.selectProductLineIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
- })
- .onClick(() => {
- this.onSelectProductLine(index)
- })
- }
- })
- }
- .width('70%')
- .height('100%')
- }
- .justifyContent(FlexAlign.SpaceEvenly)
- .width('100%')
- .height('81%')
- .margin({ top: '2%'})
- Column() {
- Divider()
- .vertical(false)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Row() {
- Text('取消')
- .fontColor($r('app.color.60FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => this.controller.close())
- Divider()
- .vertical(true)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Text('确定')
- .fontColor($r('app.color.007AFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => {
- this.currentProductLine = this.productLineList[this.selectProductLineIndex].name??""
- this.currentPLCode = this.productLineList[this.selectProductLineIndex].code??""
- this.controller.close();
- })
- }
- }
- .width('100%')
- .height('8%')
- }
- .height('71%')
- .width('30%')
- .backgroundColor($r('app.color.2A2A2A'))
- .justifyContent(FlexAlign.End)
- .alignItems(HorizontalAlign.Start)
- .borderColor($r('app.color.000000'))
- .borderWidth(1)
- .borderRadius($r('app.float.virtualSize_16'))
- }
- }
- @CustomDialog
- export struct SwitchingDeptDialog{
- private scrollerList: Scroller = new Scroller()
- //当前部门
- @Link currentDept:string
- @Link currentOrgId:number
- @State selectDeptIndex: number = -1
- //部门列表
- @State departmentsList : DeptInfo[]=[]
- loadStations = async () => {
- this.departmentsList = await ProcessRequest.get('/api/v1/sys/dept/orgList', {}) as DeptInfo[];
- };
- controller: CustomDialogController
- aboutToAppear(): void {
- this.loadStations();
- }
- private onSelectStation(index: number) {
- this.selectDeptIndex = index
- }
- build() {
- Column() {
- Column() {
- Text("切换部门")
- .fontColor($r('app.color.FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .height('8%')
- .width('100%')
- .justifyContent(FlexAlign.Center)
- Column(){
- List({space:10,scroller:this.scrollerList}) {
- ForEach(this.departmentsList, (item:DeptInfo,index) => {
- ListItem() {
- Column(){
- Text(item.deptName)
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.FFFFFF'))
- } .backgroundColor(index === this.selectDeptIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
- .borderRadius($r('app.float.virtualSize_16'))
- .padding(8)
- .width('100%')
- .height('12%')
- .alignItems(HorizontalAlign.Center)
- .justifyContent(FlexAlign.Center)
- .border({
- width: index === this.selectDeptIndex ? 2 : 0,
- color: index === this.selectDeptIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
- })
- .onClick(() => {
- this.onSelectStation(index)
- })
- }
- })
- }
- .width('70%')
- .height('100%')
- }
- .justifyContent(FlexAlign.SpaceEvenly)
- .width('100%')
- .height('81%')
- .margin({ top: '2%'})
- Column() {
- Divider()
- .vertical(false)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Row() {
- Text('取消')
- .fontColor($r('app.color.60FFFFFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => this.controller.close())
- Divider()
- .vertical(true)
- .strokeWidth(1)
- .color($r('app.color.15FFFFFF'))
- Row() {
- Text('确定')
- .fontColor($r('app.color.007AFF'))
- .fontSize($r('app.float.fontSize_30'))
- }
- .justifyContent(FlexAlign.Center)
- .width('50%')
- .onClick(() => {
- this.currentDept = this.departmentsList[this.selectDeptIndex].deptName??""
- this.currentOrgId = this.departmentsList[this.selectDeptIndex].id??0
- this.controller.close();
- })
- }
- }
- .width('100%')
- .height('8%')
- }
- .height('71%')
- .width('30%')
- .backgroundColor($r('app.color.2A2A2A'))
- .justifyContent(FlexAlign.End)
- .alignItems(HorizontalAlign.Start)
- .borderColor($r('app.color.000000'))
- .borderWidth(1)
- .borderRadius($r('app.float.virtualSize_16'))
- }
- }
|