Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
f7024cbe
Commit
f7024cbe
authored
Jan 20, 2024
by
huangqy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询功能
parent
9c216eae
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
59 行增加
和
35 行删除
+59
-35
WzcrkDao.ets
common/src/main/ets/db/dao/WzcrkDao.ets
+4
-1
WzcrkModel.ets
entry/src/main/ets/model/WzcrkModel.ets
+2
-2
WzInList.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzInList.ets
+6
-2
WzInPage.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzInPage.ets
+38
-20
DataSynchronism.ets
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
+1
-1
SetStatusDialog.ets
entry/src/main/ets/view/SetStatusDialog/SetStatusDialog.ets
+8
-9
没有找到文件。
common/src/main/ets/db/dao/WzcrkDao.ets
View file @
f7024cbe
...
...
@@ -118,11 +118,14 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
return this.update(item,predicates)
}
async getWzcrk(crklx: string, pzh?:
number
): Promise<Wzcrk[]> {
async getWzcrk(crklx: string, pzh?:
string, wczt?: string
): Promise<Wzcrk[]> {
let wp = this.getPredicates();
if (pzh) {
wp.equalTo('PZH', pzh)
}
if (wczt) {
wp.equalTo('WCZT', wczt)
}
wp.equalTo('CRKLX', crklx)
wp.orderByAsc('PZH');
return this.query(wp, this.getTableColumns());
...
...
entry/src/main/ets/model/WzcrkModel.ets
View file @
f7024cbe
...
...
@@ -43,8 +43,8 @@ class WzcrkModel {
}
// 查询
async query(crklx:string, pzh?:
number
): Promise<Wzcrk[]> {
let res = await SQLiteContext.with(WzcrkDao).getWzcrk(crklx)
async query(crklx:string, pzh?:
string, wczt?: string
): Promise<Wzcrk[]> {
let res = await SQLiteContext.with(WzcrkDao).getWzcrk(crklx
, pzh, wczt
)
return res;
}
/*获取物资出入库*/
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzInList.ets
View file @
f7024cbe
...
...
@@ -12,7 +12,11 @@ export struct WzInList {
.selectedColor('#007DFF')
.select(this.checkedList.includes(this.item.guid))
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
if (value) {
this.checkedList.push(this.item.guid)
} else {
this.checkedList = this.checkedList.filter(i => i !== this.item.guid);
}
}).margin({ right: 10, left: 10 })
Column() {
Text(this.item.crkrq).alignSelf(ItemAlign.Start).width("30%")
...
...
@@ -45,7 +49,7 @@ export struct WzInList {
Row() {
Text("状态:")
if(this.item.wczt
!
= '未完成') {
if(this.item.wczt
=
= '未完成') {
Text( "未完成").fontColor('#ff3d43')
}
else {
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzInPage.ets
View file @
f7024cbe
import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router';
import { WzInList } from './WzInList';
import { BasicDialog } from '../../../view/BasicDialog/BasicDialog';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { WzinClass } from './Wzin.data'
import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
...
...
@@ -18,6 +18,11 @@ import promptAction from '@ohos.promptAction';
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
}
@Entry
@Component
export struct WzInPage {
...
...
@@ -26,6 +31,11 @@ export struct WzInPage {
@State currentIndex: number = 0
@State dataSource: WzinClass[] = []
@State checkedList: Array<string> = []
@State radioChecked: boolean = true
@State searchData: SearchData = {
pzh: '',
wczt: '未完成'
}
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State defaultSelectValue:Array<SelectOption>=[{ value: "未完成" }, { value: "已完成" }]
...
...
@@ -51,8 +61,10 @@ export struct WzInPage {
this.getWzcrkList()
}
async getWzcrkList(qzh?: number) {
const res = await wzcrkModel.query('2', qzh)
async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = []
const res = await wzcrkModel.query('2', this.searchData.pzh, this.searchData.wczt)
Logger.info('出入库数据>>:', JSON.stringify(res))
Logger.info('出入库数据长度>>:', JSON.stringify(res.length))
for (let index = 0; index < res.length; index++) {
...
...
@@ -67,36 +79,35 @@ export struct WzInPage {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('完成').margin({ left: 20 })
Radio({ value: 'Radio1', group: 'radioGroup' })
.checked(this.radioChecked)
.onChange((isChecked: boolean) => {
console.log('Radio1 status is ' + isChecked)
this.radioChecked = isChecked
}).margin({ right: 20 })
}
}.padding({ top: 10, bottom: 10 })
Divider().strokeWidth(1).color('rgb(242,242,242)')
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('未完成').margin({ left: 20 })
Radio({ value: 'Radio1', group: 'radioGroup' })
.onChange((isChecked: boolean) => {
console.log('Radio1 status is ' + isChecked)
}).margin({ right: 20 })
}
}.padding({ top: 10, bottom: 10 })
Divider().strokeWidth(1).color('rgb(242,242,242)')
}
}
dialogController: CustomDialogController = new CustomDialogController({
builder:
Basic
Dialog({
builder:
SetStatus
Dialog({
cancel: this.onCancel,
confirm: this.onSubmit,
title: '设置状态'
,
checkedList: $checkedList
,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
customStyle: true
})
onCancel() {
...
...
@@ -104,7 +115,9 @@ export struct WzInPage {
}
onSubmit() {
console.info('------确认------')
promptAction.showToast({
message: '选择了这些单子,把这些单子设置为:' + (this.radioChecked ? '已完成' : '未完成') + JSON.stringify(this.checkedList)
})
}
@Builder TabBuilder(index: number, name: string) {
...
...
@@ -114,7 +127,7 @@ export struct WzInPage {
.fontSize(16)
.lineHeight(22)
.margin({ bottom: 7 })
Divider()
Divider()
.strokeWidth(1).color('rgb(242,242,242)')
.strokeWidth(2)
.color('#fff')
.width(50)
...
...
@@ -138,8 +151,14 @@ export struct WzInPage {
Button("设置状态")
.bottomBtnSty()
.onClick(() => {
if (this.dialogController != undefined) {
this.dialogController.open()
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请至少选择一条单据'
})
} else {
if (this.dialogController != undefined) {
this.dialogController.open()
}
}
})
.fontColor("#0fa983")
...
...
@@ -214,6 +233,8 @@ export struct WzInPage {
this.pzh=value
})
.onChange((value: string) => {
this.searchData.pzh = value
this.getWzcrkList()
})
.borderRadius(5)
Select(this.currentIndex===1?this.selectValue:this.defaultSelectValue)
...
...
@@ -224,11 +245,8 @@ export struct WzInPage {
.margin({ left: 10 })
.borderColor("#454545")
.onSelect(async (index: number, value?: string) => {
if (value == '未完成') {
console.log("未完成", '未完成')
} else {
console.log("已完成", '已完成')
}
this.searchData.wczt = value
this.getWzcrkList()
})
.width(120)
.padding({
...
...
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
View file @
f7024cbe
...
...
@@ -130,7 +130,7 @@ export struct Pmhx {
return {
...row,
sjlx:"导入",
w
zc
t:"未完成",
w
cz
t:"未完成",
};
});
wzcrkModel.set(mappedRows)
...
...
entry/src/main/ets/view/SetStatusDialog/SetStatusDialog.ets
View file @
f7024cbe
...
...
@@ -30,13 +30,15 @@ interface FormData {
@CustomDialog
@Component
export struct
General
Dialog {
@Link formData: FormData;
@Link c
lickItem: UniListItem
export struct
SetStatus
Dialog {
@Link c
heckedList: Array<string>
controller: CustomDialogController
cancel: () => void
confirm: () => void
@BuilderParam container: () => void
build() {
Column() {
Flex({ alignItems: ItemAlign.Start }) {
...
...
@@ -48,14 +50,12 @@ export struct GeneralDialog {
.color('#19ac88')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Text(
this.clickItem.title
).fontSize(20)
Text(
'设置状态'
).fontSize(20)
}
.padding({ top: 10, bottom: 10 })
}
Column() {
}
this.container()
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('确认')
...
...
@@ -65,13 +65,12 @@ export struct GeneralDialog {
}).CommonButtonStyle()
Button('取消')
.onClick(() => {
this.formData[this.clickItem?.key] = ''
this.controller.close()
this.cancel()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
.width('
86
%')
.width('
100
%')
.borderRadius(5)
.backgroundColor('#fff')
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论