Commit 21938e5a by 陈桂东

提交代码

parent 3551ef94
import { Bggl } from '../../entity/Bggl';
import { uuid } from '../../utils/util'; import { uuid } from '../../utils/util';
export class NativeSql { export class NativeSql {
...@@ -605,8 +606,8 @@ WHERE ...@@ -605,8 +606,8 @@ WHERE
return sql return sql
} }
/*物资落位导出*/ /*物资落位导出*/
static exportPageSql(params?: any):string{ static exportPageSql(params?: any): string {
const sql=`select hw.* from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid =hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB qy on qy.guid = hj.qyguid where hw.pmdmcode is not null and hw.pmdmcode !='' and hw.hwh not like 'LS%' and hw.kfguid = '${params.kfguid}' and hw.gldwguid = '${params.gldwguid}' and hw.zmlx = ${params.zmlx}` const sql = `select hw.* from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid =hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB qy on qy.guid = hj.qyguid where hw.pmdmcode is not null and hw.pmdmcode !='' and hw.hwh not like 'LS%' and hw.kfguid = '${params.kfguid}' and hw.gldwguid = '${params.gldwguid}' and hw.zmlx = ${params.zmlx}`
return sql return sql
} }
...@@ -614,8 +615,11 @@ WHERE ...@@ -614,8 +615,11 @@ WHERE
* 获取最新上架信息 * 获取最新上架信息
*/ */
static getNewBgglSql(params: Partial<Bggl>): string { static getNewBgglSql(params: Partial<Bggl>): string {
var sql = `select bg.*,kf.kfmc from TAB_BZGL_KNZY_APP_BGGL bg left join TAB_BZGL_KNZY_APP_DWKF kf on kf.kfdm = bg.kfdm where bg.BGZT = '${params.bgzt}' ` var sql = `select bg.*,kf.kfmc from TAB_BZGL_KNZY_APP_BGGL bg left join TAB_BZGL_KNZY_APP_DWKF kf on kf.kfdm = bg.kfdm `
var sqlHz = ' order by bg.JSSJ desc' var sqlHz = ' order by bg.JSSJ desc'
if (params.bgzt) {
sql = sql + ` where bg.BGZT = '${params.bgzt}'`
}
if (params.ddh) { if (params.ddh) {
return `${sql} and (bg.DDH like ${params.ddh} ${sqlHz}`; return `${sql} and (bg.DDH like ${params.ddh} ${sqlHz}`;
} else { } else {
......
...@@ -27,15 +27,30 @@ class BgglModel { ...@@ -27,15 +27,30 @@ class BgglModel {
return RandomSixStr return RandomSixStr
} }
// 测试随机分配包裹状态
test(index) {
switch (index % 4) {
case 0:
return '未领取'
break;
case 1:
return '已领取'
case 2:
return '待上架'
case 3:
return '待入库'
}
}
// 添加包裹 // 添加包裹
async set(data: Bggl[]) { async set(data: Bggl[]) {
const copyData = data.map(item => { const copyData = data.map((item, index) => {
return { return {
guid: item.guid || uuid(), guid: item.guid || uuid(),
ddh: item.ddh || '', ddh: item.ddh || '',
xs: item.xs || 1, xs: item.xs || 1,
fwdw: item.fwdw || '', fwdw: item.fwdw || '',
bgzt: '未领取', bgzt: this.test(index),
// @ts-ignore // @ts-ignore
slr: item.ryxm || '', slr: item.ryxm || '',
sjh: item.sjh || '', sjh: item.sjh || '',
......
@Entry import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
@Extend(Text) function textRender() {
.padding({ top: 8, bottom: 8 })
.textAlign(TextAlign.Center)
}
@Component @Component
export struct PageManagement { export struct NewDataList {
@Link dataSource: newBgglDto[]
build() { build() {
Column() { Column() {
Row() { Row() {
Text('订单').width('30%').padding({ top: 8, bottom: 8 }) Text('订单').width('30%').textRender()
Text('姓名').width('30%').padding({ top: 8, bottom: 8 }) Text('姓名').width('30%').textRender()
Text('手机号').width('30%').padding({ top: 8, bottom: 8 }) Text('手机号').width('30%').textRender()
}.margin({ left: 30 }) }
List() { List() {
ForEach([1, 2, 3], item => { ForEach(this.dataSource, (item: newBgglDto) => {
ListItem() { ListItem() {
Row() { Row() {
Text('111111111').width('30%') Text(item.ddh).width('30%').textRender().fontSize(12)
Text('111111111').width('30%') Text(item.slr).width('30%').textRender()
Text('111111111').width('30%') Text(item.sjh + '').width('30%').textRender()
}.margin({ left: 30 }) }.margin({ left: 30 })
} }
}) })
} }.margin({ bottom: 30 })
} }
} }
......
import router from '@ohos.router' import router from '@ohos.router'
import { BgglDao, Logger, SQLiteContext, StatusBarManager } from '@ohos/common'; import { BgglDao, Logger, SQLiteContext, StatusBarManager } from '@ohos/common';
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
import bgglModel from '../../model/BgglModel'; import bgglModel from '../../model/BgglModel';
import { NewDataList } from './NewDataLst';
import { YqjList } from './YqjList';
@Extend(Text) function numberStyle() { @Extend(Text) function numberStyle() {
.fontSize(20) .fontSize(20)
...@@ -17,6 +20,8 @@ export struct PageManagement { ...@@ -17,6 +20,8 @@ export struct PageManagement {
@State dsj: number = 0 @State dsj: number = 0
@State wlq: number = 0 @State wlq: number = 0
@State ylq: number = 0 @State ylq: number = 0
@State newDataList: newBgglDto[] = []
@State ylqList: newBgglDto[] = []
private controller: TabsController = new TabsController() private controller: TabsController = new TabsController()
onCountUpdated(index: number) { onCountUpdated(index: number) {
...@@ -43,10 +48,14 @@ export struct PageManagement { ...@@ -43,10 +48,14 @@ export struct PageManagement {
}.width('100%') }.width('100%')
} }
// 最新上架数据 // 最新上架数据和取件记录数据
async getPackList(ddh?: string) { async getPackList(ddh?: string) {
const res = await bgglModel.queryNewDara({ bgzt: "未领取" }) const res = await bgglModel.queryNewDara({ bgzt: "未领取", ddh })
this.newDataList = res
Logger.info('最新上架数据>>', JSON.stringify(res)) Logger.info('最新上架数据>>', JSON.stringify(res))
const res1 = await bgglModel.queryNewDara({ bgzt: "已领取", ddh })
this.ylqList = res1
Logger.info('取件记录>>', JSON.stringify(res))
} }
async getTotal() { async getTotal() {
...@@ -91,7 +100,7 @@ export struct PageManagement { ...@@ -91,7 +100,7 @@ export struct PageManagement {
this.getPackList(value) this.getPackList(value)
}) })
.onChange((value: string) => { .onChange((value: string) => {
// this.getPackList(value) this.getPackList(value)
}) })
}.backgroundColor("#0fa983").width('100%').height(70) }.backgroundColor("#0fa983").width('100%').height(70)
...@@ -125,17 +134,26 @@ export struct PageManagement { ...@@ -125,17 +134,26 @@ export struct PageManagement {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() { TabContent() {
if (this.newDataList.length == 0) {
Column() { Column() {
Image($r('app.media.express')).width(60) Image($r('app.media.express')).width(60)
Text("暂无最新上架订单信息").margin({ top: 15 }) Text("暂无最新上架订单信息").margin({ top: 15 })
} }
} else {
NewDataList({ dataSource: $newDataList })
}
}.tabBar(this.TabBuilder(0, '最新上架')) }.tabBar(this.TabBuilder(0, '最新上架'))
TabContent() { TabContent() {
if (this.newDataList.length == 0) {
Column() { Column() {
Image($r('app.media.express')).width(60) Image($r('app.media.express')).width(60)
Text("暂无最新上架订单信息").margin({ top: 15 }) Text("暂无最新上架订单信息").margin({ top: 15 })
} }
} else {
YqjList({ dataSource: $ylqList })
}
}.tabBar(this.TabBuilder(1, '取件记录')) }.tabBar(this.TabBuilder(1, '取件记录'))
} }
.height(250) .height(250)
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
@Component
export struct YqjList {
@Link dataSource: newBgglDto[]
build() {
Column() {
List() {
ForEach(this.dataSource, (item: newBgglDto) => {
ListItem() {
Column() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("订单号:" + item.ddh)
Text(item.cksj)
}
}
Row() {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems: ItemAlign.Center }) {
Column() {
Text(item.slr + ' ' + item.sjh).fontColor('#fff').fontSize(18)
Row() {
Text('取件码:').fontColor('#fff').fontSize(18)
Text(item.qjm).fontColor('#fff').fontSize(26).fontWeight(800)
}.margin({ top: 10 }).alignSelf(ItemAlign.Start)
}.margin({ left: 10 })
Row() {
Text(item.bgzt).fontColor('#fff')
}.padding(10).borderWidth(1).borderColor('#fff')
}
}
.backgroundColor('#0fa983')
.height(100)
.width('100%')
.margin({ top: 8 })
.borderRadius(8)
}
}
})
}
}.width('100%').padding({ left: 20, right: 20 })
}
}
\ No newline at end of file
...@@ -65,7 +65,7 @@ export struct Pack { ...@@ -65,7 +65,7 @@ export struct Pack {
// 获取包裹列表 // 获取包裹列表
async getPackList() { async getPackList() {
const res = await bgglModel.query({ ddh: this.ddh, bgzt: this.bgzt }) const res = await bgglModel.queryNewDara({ ddh: this.ddh, bgzt: this.bgzt })
Logger.info('获取到包裹数据', JSON.stringify(res)) Logger.info('获取到包裹数据', JSON.stringify(res))
this.packList = res this.packList = res
} }
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl' import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl'
import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo' import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger' import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
...@@ -6,22 +7,7 @@ import kfModel from '../../model/KfModel' ...@@ -6,22 +7,7 @@ import kfModel from '../../model/KfModel'
@Entry @Entry
@Component @Component
export struct PackList { export struct PackList {
private item: Bggl private item: newBgglDto
@State kfList: KfInfo[] = []
async aboutToAppear() {
const res = await kfModel.query({})
Logger.info('获取到库房名称》》', JSON.stringify(res))
this.kfList = res
}
renderKfdm(kfdm) {
if(!kfdm) {
return ''
}
const res = this.kfList.find(v => v.kfdm == kfdm)
return res ? res.kfmc : ''
}
build() { build() {
Column() { Column() {
...@@ -31,18 +17,20 @@ export struct PackList { ...@@ -31,18 +17,20 @@ export struct PackList {
}) })
.margin({ right: 10, left: 10 }) .margin({ right: 10, left: 10 })
Column() { Column() {
Text('订单号:' + this.item.ddh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text('订单号:' + this.item.ddh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }).fontSize(12)
Text('库房:' + this.renderKfdm(this.item.kfdm)).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text(`库房: ${this.item.kfmc || '暂无库房'} `).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
}.width('30%') }.width('30%')
Column() { Column() {
Text('货位:' + this.item.hwh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text(`货位: ${this.item.hwh || '暂无货位'}`).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('箱数:' + this.item.xs).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text('箱数:' + this.item.xs).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
}.width('30%').margin({ left: 10 }) }.width('30%').margin({ left: 10 })
Column() { Column() {
Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('未导出' + this.item.sfdc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }) Text(`未导出 ${this.item.sfdc == '0' ? '未导出' : '已导出'}`)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
}.width('30%').margin({ left: 10 }) }.width('30%').margin({ left: 10 })
} }
} }
......
import { Bggl, Logger, SQLiteContext, Wzcrkmx, WzcrkmxDao } from '@ohos/common' import { Bggl, Logger, SQLiteContext, Wzcrkmx, WzcrkmxDao } from '@ohos/common'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import bgglModel from '../../model/BgglModel' import bgglModel from '../../model/BgglModel'
import wzcrkModel from '../../model/WzcrkModel'
import wzcrkmxModel from '../../model/WzcrkmxModel'
import { BasicTable } from '../../view/BasicTable/BasicTable'
import { TitleBar } from '../../view/title/TitleBar' import { TitleBar } from '../../view/title/TitleBar'
import { YqjList } from '../PageManagement/YqjList'
import { PickList } from './listview/PickList' import { PickList } from './listview/PickList'
import { PackList } from './PackList'
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
.borderWidth(2) .borderWidth(2)
...@@ -22,16 +20,17 @@ import { PackList } from './PackList' ...@@ -22,16 +20,17 @@ import { PackList } from './PackList'
export struct Pick { export struct Pick {
controller: SearchController = new SearchController() controller: SearchController = new SearchController()
wzcrkmxDao: WzcrkmxDao = SQLiteContext.with(WzcrkmxDao) wzcrkmxDao: WzcrkmxDao = SQLiteContext.with(WzcrkmxDao)
@State showList: boolean = false
@State ddh: string = '' @State ddh: string = ''
@State packList: Bggl[] = [] @State packList: newBgglDto[] = []
onPageShow() { aboutToAppear() {
this.getPackList() this.getPackList()
} }
// 获取包裹列表 // 获取包裹列表
async getPackList() { async getPackList() {
const res = await bgglModel.query({ ddh: this.ddh, bgzt: '未领取' }) const res = await bgglModel.queryNewDara({ ddh: this.ddh, bgzt: '未领取' })
Logger.info('获取到包裹数据', JSON.stringify(res)) Logger.info('获取到包裹数据', JSON.stringify(res))
this.packList = res this.packList = res
} }
...@@ -62,6 +61,9 @@ export struct Pick { ...@@ -62,6 +61,9 @@ export struct Pick {
}) })
.onChange((value: string) => { .onChange((value: string) => {
}) })
Image($r("app.media.menu")).width(30).height(30).onClick(() => {
this.showList = !this.showList
})
} }
}.margin({ top: 20 }) }.margin({ top: 20 })
...@@ -70,15 +72,19 @@ export struct Pick { ...@@ -70,15 +72,19 @@ export struct Pick {
if (this.packList.length == 0) { if (this.packList.length == 0) {
this.renderEmpty() this.renderEmpty()
} else { } else {
if (this.showList) {
YqjList({ dataSource: $packList })
} else {
List() { List() {
ForEach(this.packList, (item) => { ForEach(this.packList, (item) => {
ListItem() { ListItem() {
// PackList({ item }) PickList({ item })
PickList()
} }
}) })
}.divider({ strokeWidth: 1, color: "#bbbbb1" }).backgroundColor('#fff') }.divider({ strokeWidth: 1, color: "#bbbbb1" }).backgroundColor('#fff')
} }
}
}.flexGrow(1).padding(15) }.flexGrow(1).padding(15)
Row() { Row() {
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
@Component @Component
export struct PickList{ export struct PickList {
build(){ item: newBgglDto
build() {
Column() { Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween,alignItems:ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => { .onChange((value: boolean) => {
}) })
.margin({ right: 10, left: 10 }) .margin({ right: 10, left: 10 })
Column() { Column() {
Text('订单号:' + 'JD288242733483X').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) Text('订单号:' + this.item.ddh)
Text('库房:' + "1号库房").alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) .alignSelf(ItemAlign.Start)
Text('张三:' + "13655664466").alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) .fontColor("#000")
}.width('50%') .fontSize(12)
.padding({ top: 5, bottom: 5 })
Text('库房:' + this.item.kfmc)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('张三:' + this.item.slr)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
}.width('40%')
Column() { Column() {
Text('货位:' + 'A-1-1-1').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) Text(`货位: ${this.item.hwh || '暂无货位'}`)
Text('箱数:' + "1").alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) .alignSelf(ItemAlign.Start)
Text('取件码:' + "YZ1215").alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) .padding({ top: 5, bottom: 5 })
}.width('20%').margin({ left: 10 }) .alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('箱数:' + this.item.xs)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('取件码:' + this.item.qjm)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
}.width('30%').margin({ left: 10 })
Column() { Column() {
Text('批次:' + '1').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 })
Text('未取件:').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }) Text('未取件').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 })
}.width('20%').margin({ left: 10 }) }.width('20%').margin({ left: 10 })
} }
}.width("100%") }.width("100%")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论