Commit 036c0889 by 陈桂东

入库列表

parents f7c16fe1 4fd626e2
......@@ -127,5 +127,17 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
wp.orderByAsc('PZH');
return this.query(wp, this.getTableColumns());
}
async selectWzcrkList(sql?: string): Promise<Wzcrk[]> {
let db = await this.futureDb;
let rs = await db.querySql('', []);
let items: Wzcrk[];
if (rs.goToFirstRow()) {
do {
Logger.info(this, 'queryAll rowIndex=' + rs.rowIndex)
items.push(this.toBean(rs))
} while (rs.goToNextRow())
}
return items;
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
},
"sourceOption": {
"workers": [
'./src/main/ets/identify/workers/Worker.ts'
]
}
},
......
......@@ -20,6 +20,11 @@ class WzcrkModel {
let res = await SQLiteContext.with(WzcrkDao).getWzcrk(crklx)
return res;
}
/*获取物资出入库*/
async queryWzcrklist(sql?: string):Promise<Wzcrk[]> {
let res = await SQLiteContext.with(WzcrkDao).selectWzcrkList(sql);
return res;
}
// 清空表
async clear() {
......
import { TitleBar } from '../../view/title/TitleBar'
import promptAction from '@ohos.promptAction'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct GoodsSelectHwPage{
@State model: boolean = true
build(){
Column() {
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "货位"})
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Column() {
Select([{ value: "LS-1-1-2" }, { value: "LS-1-1-3" }, { value: "LS-1-1-4" }])
.value('请选择')
.borderWidth(1)
.borderRadius(6)
.flexGrow(1)
.height(34)
.fontColor('rgb(103,110,112)')
.backgroundColor('#00000000')
.borderColor("#e5e5e5")
.width(220)
.onSelect((index: number, value?: string) => {
})
}.width('70%').margin({ right: 10 })
Button(this.model ? "切换自动选" : "切换手动选")
.borderRadius(6)
.width('30%')
.fontColor('#0fa983')
.backgroundColor('#fff')
.type(ButtonType.Normal)
.onClick(() => {
this.model = ! this.model
})
}.padding({left: 20, right: 20})
Column() {
if (this.model) {
} else {
Flex({ justifyContent: FlexAlign.Center , alignItems: ItemAlign.Center }) {
Text('请扫描货位码').fontColor('#fff').fontSize(20)
}
.width('100%')
.height('100%')
.border({ width: 1, color: '#fff', style: BorderStyle.Dotted})
}
}
.padding(20)
.height('100%')
Flex({ justifyContent: FlexAlign.Center }) {
Button("保存")
.borderRadius(4)
.type(ButtonType.Normal)
.width('90%')
.fontColor('#0fa983')
.backgroundColor('#fff')
.onClick(() => {
promptAction.showToast({
message: "保存"
})
})
}
.height(70)
}.width("100%")
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]]// 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
@Entry
@Component
struct GoodsSelectRfidTools{
build(){
Column() {
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "射频数据统计"})
}.width("100%")
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]]// 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
......@@ -24,8 +24,8 @@ struct UHFScanPage{
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(21)
.fontColor(this.selectedFontColor)
.fontSize(16)
.lineHeight(36)
} .width('100%')
.height(45)
......@@ -94,15 +94,15 @@ struct UHFScanPage{
}.flexGrow(1)
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center}) {
Button("选择货位").CommonButtonStyle().width("50%")
Button("扫货位码").CommonButtonStyle().width("50%")
Button("选择货位").CommonButtonStyle().width("45%")
Button("扫货位码").CommonButtonStyle().width("45%")
}
}.margin({left:10,right:10}).height(80)
}.width("100%")
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.5], ['#c7d799', 2.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
/*界面展示*/
......
......@@ -72,6 +72,7 @@ struct WzConversionPage{
}.height(60)
}.width("100%")
.padding('15vp')
this.bottomButtons()
// 列表
Column() {
Demo({itemClick: this.itemClick}).width('90%')
......
......@@ -5,19 +5,18 @@ import { Demo } from '../../view/demo/demo';
import { BasicDialog } from '../../view/BasicDialog/BasicDialog';
import wzcrkModel from '../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { isEmpty } from '@ohos/common/src/main/ets/utils/util';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({ top: 1, bottom: 1, right: 7, left: 7 })
.padding({top:1,bottom:1,right:7,left:7})
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(7)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
export struct WzInPage {
......@@ -26,18 +25,52 @@ export struct WzInPage {
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State defaultSelectValue:Array<SelectOption>=[{ value: "未完成" }, { value: "已完成" }]
@State selectValue:Array<SelectOption>=[{ value: "未完成" }, { value: "已完成" }, { value: "完成已绑定" }]
@State page:number=1
@State rows:number=6
@State sjlx:string="0"
@State wczt:string=""
@State pzh:string=""
params = {
pzh:this.pzh,
page: this.page,
rows: this.rows,
sjlx: this.currentIndex===0?"导入":"临时收物",
wczt: "未完成"
}
itemClick() {
router.pushUrl({url:'pages/order_detail/PzInOutDetailPage'})
}
aboutToAppear(){
try {
this.getWzcrkList()
}catch (err){
console.log("sql查询报错"+JSON.stringify(err))
}
}
async getWzcrkList() {
const res = await wzcrkModel.queryWzcrklist(this.getPM())
Logger.info('入库数据>>:', JSON.stringify(res))
// const res2 = await wzcrkModel.query("5")
// Logger.info('全部出入库数据>>:', JSON.stringify(res2))
async getWzcrkList(qzh?: number) {
const res = await wzcrkModel.query('2', qzh)
Logger.info('出入库数据>>:', JSON.stringify(res))
}
getPM():string{
const sql1 =
`select * from(select crk.guid, STRFTIME ('%Y-%m-%d', crk.crkrq) crkrq, crk.pzlx, crk.pzh, crk.wczt from TAB_BZGL_KNZY_APP_WZCRK crk where 1=1`
const sql2 = ` and (crk.pzh like ${isEmpty(this.params.pzh)})`
const sql3 =
` and crk.sjlx = ${isEmpty(this.params.sjlx)} and crk.wczt = ${isEmpty(this.params.wczt)} and crk.pzlx in ('14') order by pzh+0 ) limit ${this.params.rows} offset ( ${this.params.page} - 1 ) * ${this.params.rows} `
if (this.params.pzh) {
return sql1 + sql2 + sql3
} else {
console.log("sql查询"+sql1+sql3)
return sql1 + sql3
}
}
@Builder container() {
......@@ -85,6 +118,11 @@ export struct WzInPage {
onSubmit() {
console.info('------确认------')
}
@Builder searchSelectView(){
Column(){
}
}
@Builder TabBuilder(index: number, name: string) {
Column() {
......@@ -123,12 +161,23 @@ export struct WzInPage {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("单据匹配")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
})
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983").fontSize("14vp")
// Button("全选")
// .bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(() => {
......@@ -167,11 +216,12 @@ export struct WzInPage {
.textFont({ size: 14, weight: 400 })
.width('60%')
.onSubmit((value: string) => {
this.pzh=value
})
.onChange((value: string) => {
})
.borderRadius(5)
Select([{ value: "未完成" }, { value: "已完成" }])
Select(this.currentIndex===1?this.selectValue:this.defaultSelectValue)
.value('请选择状态')
.borderWidth(1)
.borderRadius(6)
......@@ -198,13 +248,11 @@ export struct WzInPage {
Column() {
Demo({itemClick: this.itemClick}).width('90%')
}.flexGrow(1).backgroundColor('#fff').alignSelf(ItemAlign.Center)
// 底部按钮
Row() {
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
}.width("100%")
}.width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
......
......@@ -46,6 +46,11 @@ struct WzInvPage{
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
......
......@@ -57,7 +57,18 @@ export struct WzOutPage {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("单据匹配")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
})
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
......
......@@ -46,12 +46,16 @@ struct WzReversePage{
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(50)
......
......@@ -121,7 +121,15 @@ export struct Pmhx {
try {
this.showProgress = true
const { rows } = await getDjList({})
wzcrkModel.set(rows)
// 使用map对rows进行操作
const mappedRows = rows.map((row) => {
// 在这里执行对每个元素的操作
return {
...row,
sjlx:"导入",
};
});
wzcrkModel.set(mappedRows)
promptAction.showToast({
message: '同步数据成功'
})
......
......@@ -37,6 +37,9 @@
"pages/metailmange/WzStatus",
"pages/metailmange/UHFScanPage",
"identify/demo_page/UHFDemo",
"identify/demo_page/ScanDemo"
"identify/demo_page/ScanDemo",
"pages/metailmange/GoodsSelectHwPage",
"pages/metailmange/GoodsSelectRfidTools"
]
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论