Commit 21938e5a by 陈桂东

提交代码

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