|
@@ -1,7 +1,7 @@
|
|
|
import router from '@ohos.router'
|
|
|
import CommonConstants from '../common/constants/CommonConstants'
|
|
|
import JGRequest from '../common/util/request/Request'
|
|
|
-import {getToken, getUserInfo} from '../common/util/request/RequestInstance'
|
|
|
+import { getToken, getUserInfo } from '../common/util/request/RequestInstance'
|
|
|
import AssistantSetModel from '../model/database/AssistantSetModel'
|
|
|
import UserAuthModel from '../model/database/UserAuthModel';
|
|
|
import UserInfo from '../model/UserInfo'
|
|
@@ -9,26 +9,25 @@ import process from '@ohos.process'
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel'
|
|
|
import StorageRequest from '../common/util/request/StorageRequest'
|
|
|
import EquipmentRequest from '../common/util/request/EquipmentRequest'
|
|
|
-export const stationDictValue:string=''
|
|
|
+
|
|
|
+export const stationDictValue: string = ''
|
|
|
+
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct LoginPage {
|
|
|
controller: TextInputController = new TextInputController()
|
|
|
//1是拣选,2是装配,3是测试,4是维修站,5是入库,6是出库
|
|
|
- @State stationDictValue:string= ''
|
|
|
+ @State stationDictValue: string = ''
|
|
|
@State loginName: string = 'JGtest-32'
|
|
|
@State password: string = 'admin@123'
|
|
|
-
|
|
|
- @State dept: DeptInfo = {deptName:'仿真中心'}
|
|
|
+ @State dept: DeptInfo = { deptName: '仿真中心' }
|
|
|
@State workstation: WorkstationInfo = {}
|
|
|
- @State productionLine: ProductionLine = {name:'仿真中心电装产线'}
|
|
|
-
|
|
|
+ @State productionLine: ProductionLine = { name: '仿真中心电装产线' }
|
|
|
@State deptArray: DeptInfo[] = []
|
|
|
@State lineArray: ProductionLine[] = []
|
|
|
- @State workstationArray: WorkstationInfo[] = [{name:'入库工位',stationDictValue:"5"},
|
|
|
- {name:'预齐套工位',stationDictValue:"6"},
|
|
|
-{name:'装配工位',stationDictValue:"3"}]
|
|
|
-
|
|
|
+ @State workstationArray: WorkstationInfo[] = [{ name: '入库工位', stationDictValue: "5" },
|
|
|
+ { name: '预齐套工位', stationDictValue: "6" },
|
|
|
+ { name: '装配工位', stationDictValue: "3" }]
|
|
|
// 部门选择弹框
|
|
|
selectDeptController: CustomDialogController = new CustomDialogController({
|
|
|
builder: SelectDeptDialog({
|
|
@@ -40,7 +39,6 @@ struct LoginPage {
|
|
|
// gridCount: 3,
|
|
|
customStyle: true,
|
|
|
})
|
|
|
-
|
|
|
// 产线选择弹框
|
|
|
selectProductionLineController: CustomDialogController = new CustomDialogController({
|
|
|
builder: ProductionLineDialog({
|
|
@@ -54,11 +52,10 @@ struct LoginPage {
|
|
|
// gridCount: 3,
|
|
|
customStyle: true,
|
|
|
})
|
|
|
-
|
|
|
// 工位选择弹框
|
|
|
selectWorkstationController: CustomDialogController = new CustomDialogController({
|
|
|
builder: SelectWorkstationDialog({
|
|
|
- stationDictValue:this.stationDictValue,
|
|
|
+ stationDictValue: this.stationDictValue,
|
|
|
workstation: this.workstation,
|
|
|
workstationArray: this.workstationArray,
|
|
|
lineCode: this.productionLine.code,
|
|
@@ -79,14 +76,16 @@ struct LoginPage {
|
|
|
this.dept = this.deptArray[0]
|
|
|
}
|
|
|
//查询产线
|
|
|
- this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {} as RequestParamModel) as ProductionLine[]
|
|
|
+ this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {
|
|
|
+ } as RequestParamModel) as ProductionLine[]
|
|
|
if (this.lineArray && this.lineArray.length > 0) {
|
|
|
this.productionLine = this.lineArray[0]
|
|
|
// 根据产线查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code + "/1", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
- CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
|
|
|
+ CommonConstants.stationDictValue = this.workstationArray[0].stationDictValue!
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -101,41 +100,42 @@ struct LoginPage {
|
|
|
if (userInfo && userInfo.maintainLoginStatus === 1) {
|
|
|
CommonConstants.STATION_NANE = userInfo.stationName!
|
|
|
CommonConstants.STATION_ID = userInfo.stationId!
|
|
|
- await getToken(userInfo.userName as string, userInfo.password as string, userInfo.orgId as number, userInfo?.stationId!.toString()).then(token=>{
|
|
|
- if (token && token.length > 0) {
|
|
|
- CommonConstants.AUTH_TOKEN = token
|
|
|
- }
|
|
|
- })
|
|
|
+ await getToken(userInfo.userName as string, userInfo.password as string, userInfo.orgId as number, userInfo?.stationId!.toString())
|
|
|
+ .then(token => {
|
|
|
+ if (token && token.length > 0) {
|
|
|
+ CommonConstants.AUTH_TOKEN = token
|
|
|
+ }
|
|
|
+ })
|
|
|
let user = await getUserInfo() as UserInfo
|
|
|
if (null != user) {
|
|
|
- CommonConstants.USER_ID= user.id!
|
|
|
+ CommonConstants.USER_ID = user.id!
|
|
|
CommonConstants.USER_NAME = user.userName!
|
|
|
CommonConstants.USER_AVATAR = user.avatar!
|
|
|
CommonConstants.USER_AVATAR = user.avatar!
|
|
|
CommonConstants.LOGIN_OUT = false
|
|
|
}
|
|
|
if (CommonConstants.AUTH_TOKEN && CommonConstants.AUTH_TOKEN.length > 0) {
|
|
|
- if ( CommonConstants.stationDictValue === '5') {
|
|
|
+ if (CommonConstants.stationDictValue === '5') {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/Warehousing',
|
|
|
+ url: 'pages/Warehousing',
|
|
|
params: {
|
|
|
- userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
- avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
- stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
+ userName: CommonConstants.USER_NAME as UserInfo,
|
|
|
+ avatar: CommonConstants.USER_AVATAR as UserInfo,
|
|
|
+ stationId: CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
}
|
|
|
})
|
|
|
- } else if ( CommonConstants.stationDictValue=== '6'){
|
|
|
+ } else if (CommonConstants.stationDictValue === '6') {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/OutboundStation',
|
|
|
+ url: 'pages/OutboundStation',
|
|
|
params: {
|
|
|
- userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
- avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
- stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
+ userName: CommonConstants.USER_NAME as UserInfo,
|
|
|
+ avatar: CommonConstants.USER_AVATAR as UserInfo,
|
|
|
+ stationId: CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/process/ProcessHome',
|
|
|
+ url: 'pages/process/ProcessHome',
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -155,9 +155,9 @@ struct LoginPage {
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
|
|
|
- TextInput({placeholder: '账号', text: this.loginName ,controller:this.controller})
|
|
|
+ TextInput({ placeholder: '账号', text: this.loginName, controller: this.controller })
|
|
|
.placeholderColor($r('app.color.login_text_input_placeholder_color'))
|
|
|
- .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium})
|
|
|
+ .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium })
|
|
|
.fontColor($r('app.color.login_text_input_font_color'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
@@ -170,11 +170,12 @@ struct LoginPage {
|
|
|
.onChange((value: string) => {
|
|
|
this.loginName = value
|
|
|
})
|
|
|
- Row() {}.height('4%')
|
|
|
+ Row() {
|
|
|
+ }.height('4%')
|
|
|
|
|
|
- TextInput({placeholder: '密码', text: this.password })
|
|
|
+ TextInput({ placeholder: '密码', text: this.password })
|
|
|
.placeholderColor($r('app.color.login_text_input_placeholder_color'))
|
|
|
- .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium})
|
|
|
+ .placeholderFont({ size: $r('app.float.set_card_font_size'), weight: FontWeight.Medium })
|
|
|
.fontColor($r('app.color.login_text_input_font_color'))
|
|
|
.width('90.4%')
|
|
|
.height('10.6%')
|
|
@@ -188,7 +189,8 @@ struct LoginPage {
|
|
|
this.password = value
|
|
|
})
|
|
|
|
|
|
- Row() {}.height('2.65%')
|
|
|
+ Row() {
|
|
|
+ }.height('2.65%')
|
|
|
|
|
|
// 部门、产线选择
|
|
|
Row() {
|
|
@@ -200,6 +202,7 @@ struct LoginPage {
|
|
|
.width('47.8%')
|
|
|
.height('100%')
|
|
|
.alignItems(VerticalAlign.Top)
|
|
|
+
|
|
|
Blank()
|
|
|
Row() {
|
|
|
Text('产线')
|
|
@@ -212,6 +215,7 @@ struct LoginPage {
|
|
|
}
|
|
|
.height('4.5%')
|
|
|
.width('90.4%')
|
|
|
+
|
|
|
// 部门选择
|
|
|
Row() {
|
|
|
Row() {
|
|
@@ -233,19 +237,20 @@ struct LoginPage {
|
|
|
}
|
|
|
.width('47.8%')
|
|
|
.height('100%')
|
|
|
- .padding({left: 10})
|
|
|
+ .padding({ left: 10 })
|
|
|
.backgroundColor($r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .onClick(async ()=>{
|
|
|
+ .onClick(async () => {
|
|
|
this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
|
|
|
if (this.deptArray && this.deptArray.length > 0) {
|
|
|
this.dept = this.deptArray[0]
|
|
|
}
|
|
|
// 查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {}) as WorkstationInfo[]
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
- CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
|
|
|
+ CommonConstants.stationDictValue = this.workstationArray[0].stationDictValue!
|
|
|
|
|
|
}
|
|
|
this.selectDeptController.open()
|
|
@@ -273,19 +278,20 @@ struct LoginPage {
|
|
|
}
|
|
|
.width('47.8%')
|
|
|
.height('100%')
|
|
|
- .padding({left: 10})
|
|
|
+ .padding({ left: 10 })
|
|
|
.backgroundColor($r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .onClick(async ()=>{
|
|
|
+ .onClick(async () => {
|
|
|
this.deptArray = await JGRequest.get("/api/v1/sys/dept/orgList", {}) as DeptInfo[]
|
|
|
if (this.deptArray && this.deptArray.length > 0) {
|
|
|
this.dept = this.deptArray[0]
|
|
|
}
|
|
|
// 查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {}) as WorkstationInfo[]
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/queryStationList", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
- CommonConstants.stationDictValue=this.workstationArray[0].stationDictValue!
|
|
|
+ CommonConstants.stationDictValue = this.workstationArray[0].stationDictValue!
|
|
|
|
|
|
}
|
|
|
this.selectProductionLineController.open()
|
|
@@ -294,10 +300,12 @@ struct LoginPage {
|
|
|
.width('90.4%')
|
|
|
.height('10.6%')
|
|
|
|
|
|
- Row() {}.height('2.65%')
|
|
|
+ Row() {
|
|
|
+ }.height('2.65%')
|
|
|
|
|
|
if (JSON.stringify(this.productionLine) === '{}') {
|
|
|
- Row() {}.height('15.1%')
|
|
|
+ Row() {
|
|
|
+ }.height('15.1%')
|
|
|
} else {
|
|
|
// 工位选择
|
|
|
Row() {
|
|
@@ -331,9 +339,9 @@ struct LoginPage {
|
|
|
.height('10.6%')
|
|
|
.backgroundColor($r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .padding({left: 10})
|
|
|
- .onClick(()=>{
|
|
|
- if (!this.workstationArray || this.workstationArray.length <= 0 ) {
|
|
|
+ .padding({ left: 10 })
|
|
|
+ .onClick(() => {
|
|
|
+ if (!this.workstationArray || this.workstationArray.length <= 0) {
|
|
|
return
|
|
|
}
|
|
|
this.selectWorkstationController.open()
|
|
@@ -357,25 +365,26 @@ struct LoginPage {
|
|
|
.layoutWeight(1)
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
- .onClick(async ()=>{
|
|
|
+ .onClick(async () => {
|
|
|
//todo
|
|
|
- // 没有网的时候直接进去
|
|
|
- // router.pushUrl({
|
|
|
- // url:'pages/OutboundStation',
|
|
|
- // params: {
|
|
|
- // userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
- // avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
- // stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- console.log("tesTag1"+'+++++++++++++++'+this.workstation.stationDictValue)
|
|
|
- if (this.loginName && this.loginName.length > 0 && this.password && this.password.length > 0) {
|
|
|
- await getToken(this.loginName, this.password, this.dept?.id ? this.dept.id : 0, this.workstation?.id ? this.workstation.id : '0').then(token =>{
|
|
|
- if (token && token.length > 0) {
|
|
|
- CommonConstants.AUTH_TOKEN = token
|
|
|
- }
|
|
|
- })
|
|
|
+ // 没有网的时候直接进去
|
|
|
+ // router.pushUrl({
|
|
|
+ // url:'pages/OutboundStation',
|
|
|
+ // params: {
|
|
|
+ // userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
+ // avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
+ // stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ console.log("tesTag1" + '+++++++++++++++' + this.workstation.stationDictValue)
|
|
|
+ if (this.loginName && this.loginName.length > 0 && this.password && this.password.length > 0) {
|
|
|
+ await getToken(this.loginName, this.password, this.dept?.id ? this.dept.id : 0, this.workstation?.id ? this.workstation.id : '0')
|
|
|
+ .then(token => {
|
|
|
+ if (token && token.length > 0) {
|
|
|
+ CommonConstants.AUTH_TOKEN = token
|
|
|
+ }
|
|
|
+ })
|
|
|
if (CommonConstants.AUTH_TOKEN.length <= 0) {
|
|
|
return
|
|
|
}
|
|
@@ -383,51 +392,67 @@ struct LoginPage {
|
|
|
CommonConstants.USER_ID = userInfo.id!
|
|
|
CommonConstants.USER_NAME = userInfo.userName!
|
|
|
CommonConstants.USER_AVATAR = userInfo.avatar!
|
|
|
- CommonConstants.STATION_CODE = userInfo.stationCode!
|
|
|
+ CommonConstants.STATION_CODE = userInfo.stationCode!
|
|
|
CommonConstants.STATION_NANE = this.workstation && this.workstation.name ? this.workstation.name : ''
|
|
|
CommonConstants.STATION_ID = this.workstation && this.workstation.id ? Number.parseInt(this.workstation.id) : 0
|
|
|
- let user = await UserAuthModel.getByUserId(userInfo.id?userInfo.id:0)
|
|
|
+ let user = await UserAuthModel.getByUserId(userInfo.id ? userInfo.id : 0)
|
|
|
if (!user || !user.id) {
|
|
|
// 将后端数据库id作为userId, 默认是保持登录
|
|
|
- user = {userId: userInfo.id, userName: this.loginName, password: this.password, orgId: this.dept ? this.dept.id : 0,
|
|
|
- stationId: this.workstation ? Number.parseInt(this.workstation.id!) : 0, stationName: this.workstation && this.workstation.name ? this.workstation.name : '',
|
|
|
- stationDictValue: this.workstation?.stationDictValue ? this.workstation.stationDictValue! : '', avatar: userInfo.avatar, maintainLoginStatus: 1, updateTime: new Date().getTime()}
|
|
|
+ user = {
|
|
|
+ userId: userInfo.id,
|
|
|
+ userName: this.loginName,
|
|
|
+ password: this.password,
|
|
|
+ orgId: this.dept ? this.dept.id : 0,
|
|
|
+ stationId: this.workstation ? Number.parseInt(this.workstation.id!) : 0,
|
|
|
+ stationName: this.workstation && this.workstation.name ? this.workstation.name : '',
|
|
|
+ stationDictValue: this.workstation?.stationDictValue ? this.workstation.stationDictValue! : '',
|
|
|
+ avatar: userInfo.avatar,
|
|
|
+ maintainLoginStatus: 1,
|
|
|
+ updateTime: new Date().getTime()
|
|
|
+ }
|
|
|
let res = await UserAuthModel.addUser(user)
|
|
|
- res = await AssistantSetModel.addAssistantSet({userId: userInfo.id, voiceWakeUp: 1, timbre: 2, wakeFree: 2, promptBroadcast: 1, voiceVolume: 0})
|
|
|
+ res = await AssistantSetModel.addAssistantSet({
|
|
|
+ userId: userInfo.id,
|
|
|
+ voiceWakeUp: 1,
|
|
|
+ timbre: 2,
|
|
|
+ wakeFree: 2,
|
|
|
+ promptBroadcast: 1,
|
|
|
+ voiceVolume: 0
|
|
|
+ })
|
|
|
}
|
|
|
CommonConstants.LOGIN_OUT = false
|
|
|
|
|
|
if (this.workstation.stationDictValue === '6') {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/OutboundStation',
|
|
|
+ url: 'pages/OutboundStation',
|
|
|
params: {
|
|
|
- userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
- avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
- stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
+ userName: CommonConstants.USER_NAME as UserInfo,
|
|
|
+ avatar: CommonConstants.USER_AVATAR as UserInfo,
|
|
|
+ stationId: CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
}
|
|
|
})
|
|
|
- } else if (this.workstation.stationDictValue === '5'){
|
|
|
+ } else if (this.workstation.stationDictValue === '5') {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/Warehousing',
|
|
|
+ url: 'pages/Warehousing',
|
|
|
params: {
|
|
|
- userName:CommonConstants.USER_NAME as UserInfo,
|
|
|
- avatar:CommonConstants.USER_AVATAR as UserInfo,
|
|
|
- stationId:CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
+ userName: CommonConstants.USER_NAME as UserInfo,
|
|
|
+ avatar: CommonConstants.USER_AVATAR as UserInfo,
|
|
|
+ stationId: CommonConstants.STATION_NANE as WorkstationInfo
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
router.pushUrl({
|
|
|
- url:'pages/process/ProcessHome',
|
|
|
+ url: 'pages/process/ProcessHome',
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
.width('35%')
|
|
|
.height('70%')
|
|
|
.backgroundColor($r('app.color.login_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .margin({right: '8.25%'})
|
|
|
+ .margin({ right: '8.25%' })
|
|
|
|
|
|
Row() {
|
|
|
Image($r('app.media.shutdown'))
|
|
@@ -438,8 +463,8 @@ struct LoginPage {
|
|
|
.width('100%')
|
|
|
.alignItems(VerticalAlign.Bottom)
|
|
|
.justifyContent(FlexAlign.End)
|
|
|
- .margin({bottom: '1%', right: '1%'})
|
|
|
- .onClick(()=>{
|
|
|
+ .margin({ bottom: '1%', right: '1%' })
|
|
|
+ .onClick(() => {
|
|
|
let pro = new process.ProcessManager();
|
|
|
pro.exit(0);
|
|
|
})
|
|
@@ -447,7 +472,7 @@ struct LoginPage {
|
|
|
.width('100%')
|
|
|
.height('100%')
|
|
|
.backgroundImage($r('app.media.login_backgroundImage'))
|
|
|
- .backgroundImageSize({width: '100%', height: '100%'})
|
|
|
+ .backgroundImageSize({ width: '100%', height: '100%' })
|
|
|
.alignItems(HorizontalAlign.End)
|
|
|
.justifyContent(FlexAlign.End)
|
|
|
|
|
@@ -458,12 +483,12 @@ struct LoginPage {
|
|
|
@CustomDialog
|
|
|
struct SelectDeptDialog {
|
|
|
@Link dept: DeptInfo
|
|
|
-
|
|
|
- @State deptArray: DeptInfo[] = [{deptName:'仿真中心',id:111,orgId:112}]
|
|
|
-
|
|
|
+ @State deptArray: DeptInfo[] = [{ deptName: '仿真中心', id: 111, orgId: 112 }]
|
|
|
controller?: CustomDialogController
|
|
|
- cancel: () => void = () => {}
|
|
|
- confirm: () => void = () => {}
|
|
|
+ cancel: () => void = () => {
|
|
|
+ }
|
|
|
+ confirm: () => void = () => {
|
|
|
+ }
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
if (!this.deptArray || this.deptArray.length <= 0) {
|
|
@@ -487,8 +512,8 @@ struct SelectDeptDialog {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Column() {
|
|
|
- List({space: 10}) {
|
|
|
- ForEach(this.deptArray, (item: DeptInfo)=>{
|
|
|
+ List({ space: 10 }) {
|
|
|
+ ForEach(this.deptArray, (item: DeptInfo) => {
|
|
|
ListItem() {
|
|
|
Row() {
|
|
|
Text(item.deptName)
|
|
@@ -501,8 +526,8 @@ struct SelectDeptDialog {
|
|
|
.width('80%')
|
|
|
.backgroundColor(this.dept && this.dept.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .padding({left: 10})
|
|
|
- .onClick(()=>{
|
|
|
+ .padding({ left: 10 })
|
|
|
+ .onClick(() => {
|
|
|
this.dept = item
|
|
|
if (this.controller != undefined) {
|
|
|
this.controller.close()
|
|
@@ -529,29 +554,31 @@ struct SelectDeptDialog {
|
|
|
@CustomDialog
|
|
|
struct ProductionLineDialog {
|
|
|
@Link productionLine: ProductionLine
|
|
|
-
|
|
|
@State lineArray: ProductionLine[] = []
|
|
|
-
|
|
|
@Link workstation: WorkstationInfo
|
|
|
@Link workstationArray: WorkstationInfo[]
|
|
|
controller?: CustomDialogController
|
|
|
- cancel: () => void = () => {}
|
|
|
- confirm: () => void = () => {}
|
|
|
+ cancel: () => void = () => {
|
|
|
+ }
|
|
|
+ confirm: () => void = () => {
|
|
|
+ }
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
if (this.lineArray && this.lineArray.length > 0) {
|
|
|
return
|
|
|
}
|
|
|
// 查询产线
|
|
|
- this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {} as RequestParamModel) as ProductionLine[]
|
|
|
+ this.lineArray = await JGRequest.post("/api/v1/base/productionLine/list/list", {
|
|
|
+ } as RequestParamModel) as ProductionLine[]
|
|
|
if (this.lineArray && this.lineArray.length > 0) {
|
|
|
this.productionLine = this.lineArray[0]
|
|
|
// 根据产线查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
|
|
|
- console.log("====================1234567890"+"成功+++++"+this.workstationArray[0])
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code + "/1", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
+ console.log("====================1234567890" + "成功+++++" + this.workstationArray[0])
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
- console.log("====================1234567890"+"成功"+this.workstation)
|
|
|
+ console.log("====================1234567890" + "成功" + this.workstation)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -569,8 +596,8 @@ struct ProductionLineDialog {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Column() {
|
|
|
- List({space: 10}) {
|
|
|
- ForEach(this.lineArray, (item: ProductionLine)=>{
|
|
|
+ List({ space: 10 }) {
|
|
|
+ ForEach(this.lineArray, (item: ProductionLine) => {
|
|
|
ListItem() {
|
|
|
Row() {
|
|
|
Text(item.name)
|
|
@@ -583,11 +610,12 @@ struct ProductionLineDialog {
|
|
|
.width('80%')
|
|
|
.backgroundColor(this.productionLine && this.productionLine.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .padding({left: 10})
|
|
|
- .onClick(async ()=>{
|
|
|
+ .padding({ left: 10 })
|
|
|
+ .onClick(async () => {
|
|
|
this.productionLine = item
|
|
|
// 根据产线查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code, {}) as WorkstationInfo[]
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.productionLine.code + "/1", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
} else {
|
|
@@ -617,15 +645,16 @@ struct ProductionLineDialog {
|
|
|
// 工位选择弹框
|
|
|
@CustomDialog
|
|
|
struct SelectWorkstationDialog {
|
|
|
- @Link stationDictValue:string
|
|
|
+ @Link stationDictValue: string
|
|
|
@Link workstation: WorkstationInfo
|
|
|
// 产线编码
|
|
|
private lineCode: string = ''
|
|
|
@Link workstationArray: WorkstationInfo[]
|
|
|
-
|
|
|
controller?: CustomDialogController
|
|
|
- cancel: () => void = () => {}
|
|
|
- confirm: () => void = () => {}
|
|
|
+ cancel: () => void = () => {
|
|
|
+ }
|
|
|
+ confirm: () => void = () => {
|
|
|
+ }
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
@@ -635,7 +664,8 @@ struct SelectWorkstationDialog {
|
|
|
return
|
|
|
}
|
|
|
// 根据产线查询工位
|
|
|
- this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.lineCode, {}) as WorkstationInfo[]
|
|
|
+ this.workstationArray = await JGRequest.get("/api/v1/base/station/getStationList/" + this.lineCode + "/1", {
|
|
|
+ }) as WorkstationInfo[]
|
|
|
if (this.workstationArray && this.workstationArray.length > 0) {
|
|
|
this.workstation = this.workstationArray[0]
|
|
|
}
|
|
@@ -654,8 +684,8 @@ struct SelectWorkstationDialog {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Column() {
|
|
|
- List({space: 10}) {
|
|
|
- ForEach(this.workstationArray, (item: WorkstationInfo,index:number)=>{
|
|
|
+ List({ space: 10 }) {
|
|
|
+ ForEach(this.workstationArray, (item: WorkstationInfo, index: number) => {
|
|
|
ListItem() {
|
|
|
Row() {
|
|
|
Text(item.name)
|
|
@@ -668,11 +698,11 @@ struct SelectWorkstationDialog {
|
|
|
.width('80%')
|
|
|
.backgroundColor(this.workstation && this.workstation.id === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
|
|
|
.borderRadius($r('app.float.general_border_radius'))
|
|
|
- .padding({left: 10})
|
|
|
- .onClick(()=>{
|
|
|
+ .padding({ left: 10 })
|
|
|
+ .onClick(() => {
|
|
|
this.workstation = item
|
|
|
- this.stationDictValue=item.stationDictValue!
|
|
|
- CommonConstants.stationDictValue=this.workstationArray[index].stationDictValue!
|
|
|
+ this.stationDictValue = item.stationDictValue!
|
|
|
+ CommonConstants.stationDictValue = this.workstationArray[index].stationDictValue!
|
|
|
|
|
|
|
|
|
if (this.controller != undefined) {
|
|
@@ -709,7 +739,7 @@ export class WorkstationInfo {
|
|
|
// 工位名称
|
|
|
name?: string
|
|
|
//工位类型
|
|
|
- stationDictValue?:string
|
|
|
+ stationDictValue?: string
|
|
|
}
|
|
|
|
|
|
class ProductionLine {
|