Commit b41e99db by 陈桂东

入库列表

parent 6894394b
......@@ -57,7 +57,7 @@ class Database {
while (!result.isAtLastRow) {
let obj = { } as T
let obj = {} as T
// 3.3.指针移动到下一行
result.goToNextRow()
......
......@@ -104,9 +104,11 @@ struct WzExchangePage{
.onChange((index: number) => {
this.currentIndex = index
})
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 底部按钮
this.bottomButtons();
......
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
import router from '@ohos.router';
import { Demo } from '../../view/demo/demo';
import { BasicDialog } from '../../view/BasicDialog/BasicDialog';
@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')
......@@ -13,6 +15,7 @@ import router from '@ohos.router';
.stateEffect(true)
}
@Entry
@Component
export struct WzInPage {
......@@ -22,13 +25,63 @@ export struct WzInPage {
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
itemClick() {
router.pushUrl({url:'pages/order_detail/PzInvDetailPage'})
}
@Builder container() {
Column() {
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 })
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 })
}
}
dialogController: CustomDialogController = new CustomDialogController({
builder: BasicDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
title: '设置状态',
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
console.info('------确认------')
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({bottom: 7 })
.margin({ bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
......@@ -36,13 +89,14 @@ export struct WzInPage {
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时收物")
.visibility(this.currentIndex === 1 ? Visibility.Visible:Visibility.None)
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick( () => {
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
})
......@@ -52,27 +106,31 @@ export struct WzInPage {
Button("设置状态")
.bottomBtnSty()
.onClick(() => {
if (this.dialogController != undefined) {
this.dialogController.open()
}
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
}).fontColor("#0fa983").fontSize("14vp")
// Button("全选")
// .bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(() =>{
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(80)
}
build(){
build() {
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资入库" })
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "物资入库" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
......@@ -86,8 +144,9 @@ export struct WzInPage {
.onChange((index: number) => {
this.currentIndex = index
})
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
.backgroundColor('#F5F5F5')
......@@ -95,7 +154,7 @@ export struct WzInPage {
.textAlign(TextAlign.Center)
.placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 })
.width('70%')
.width('60%')
.onSubmit((value: string) => {
})
.onChange((value: string) => {
......@@ -104,28 +163,33 @@ export struct WzInPage {
Select([{ value: "未完成" }, { value: "已完成" }])
.value('请选择状态')
.borderWidth(1)
.borderRadius(10)
.borderRadius(6)
.height(42)
.margin({ left: 10 })
.borderColor("#454545")
.onSelect(async (index: number, value?: string) => {
if(value == '未完成') {
console.log("未完成",'未完成')
if (value == '未完成') {
console.log("未完成", '未完成')
} else {
console.log("已完成",'已完成')
console.log("已完成", '已完成')
}
})
.width(110)
.width(120)
.padding({
right:10
right: 15
})
}
}.margin({top:-30})
}.margin({ top: -20 })
.width("100%")
.padding('15vp')
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 列表
Column() {
Demo({itemClick: this.itemClick}).width('90%')
}.flexGrow(1).backgroundColor('#fff').alignSelf(ItemAlign.Center)
// 底部按钮
Row() {
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
......
@Entry
@Component
struct ActionSheetExample {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Button('Click to Show ActionSheet')
.onClick(() => {
ActionSheet.show({
title: '',
message: '',
autoCancel: false,
confirm: {
value: '取消',
action: () => {
console.log('Get Alert Dialog handled')
}
},
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: -10 },
sheets: [
{
title: '清除基础数据',
action: () => {
console.log('apples')
}
},
{
title: '清除单据数据',
action: () => {
console.log('bananas')
}
},
{
title: 'pears',
action: () => {
console.log('pears')
}
}
]
})
})
}.width('100%')
.height('100%')
}
}
\ No newline at end of file
@Entry
@Component
export struct Demo {
arr = [1, 2, 3, 4, 5, 6,7,8,9,10,11,12]
itemClick: () => void
build() {
Column() {
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
CheckboxGroup({ group: 'checkboxGroup' })
.selectedColor('#007DFF')
.onChange((itemName: CheckboxGroupResult) => {
console.info("checkbox group content" + JSON.stringify(itemName))
})
Text("全选").margin({ left: 10 })
}.margin({ bottom: -15, left: 8 }).backgroundColor('#fff').zIndex(999)
List(){
ForEach(this.arr, (item, index) => {
ListItem(){
Row() {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor('#007DFF')
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
}).margin({ right: 10,left: 10 })
Column() {
Text('2023-01-17').alignSelf(ItemAlign.Start).width("30%")
Text("收物单").alignSelf(ItemAlign.Start).width("30%").margin({ top: 5 })
}
Column() {
Row() {
Text('凭证号: ')
Text('1')
}.alignSelf(ItemAlign.Start).padding({ top: 8, bottom: 8 })
Row() {
Text("数量: ")
Text('0').fontColor('#ff3d43')
Text('/').fontColor('#ff3d43')
Text('500').fontColor('#ff3d43')
}.alignSelf(ItemAlign.Start)
}.width("30%").padding({ top: 8, bottom: 8 })
Row() {
Text("状态: ")
Text("未完成").fontColor('#ff3d43')
}
}.margin({ top: 10 }).border({ width: { bottom: '1lpx' }, color: "#717171" })
}.onClick(() => this.itemClick())
})
}
}.width('100%').height('100%')
}
}
\ No newline at end of file
@Observed
class Good {
index: number
constructor(index) {
this.index = index
}
}
@Entry
@Component
export struct Demo1 {
@State goodList: Good[] = [new Good(10), new Good(20) ]
build() {
Column() {
ForEach(this.goodList, (item) => {
child({ good: item })
})
}.width('100%').height('100%')
}
}
@Component
struct child {
@ObjectLink good: Good
build() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Column() {
Text("冬季防寒靴100000").padding({ top: 5, bottom: 5 })
Row() {
Text("号型: ")
Text("1003")
}.alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Row() {
Text("货位号: ")
Text("2")
}.alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
}.margin({ left: 15 })
Column() {
Row() {
Text("总数: ")
Text(this.good.index.toString())
}.alignSelf(ItemAlign.End).padding({ top: 5, bottom: 5 })
Row() {
Counter() {
Text(this.good.index.toString())
}
.width(120)
.onInc(() => {
this.good.index++
console.log("item++",this.good.index)
})
.onDec(() => {
this.good.index--
})
}.alignSelf(ItemAlign.End)
Row() {
Image($r('app.media.trash')).width(35)
}.alignSelf(ItemAlign.End)
}.margin({ right: 20 })
}.margin({ top: 10 }).border({ width: { bottom: '1lpx' }, color: "#717171" })
}
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论