Commit b41e99db by 陈桂东

入库列表

parent 6894394b
...@@ -57,7 +57,7 @@ class Database { ...@@ -57,7 +57,7 @@ class Database {
while (!result.isAtLastRow) { while (!result.isAtLastRow) {
let obj = { } as T let obj = {} as T
// 3.3.指针移动到下一行 // 3.3.指针移动到下一行
result.goToNextRow() result.goToNextRow()
......
...@@ -104,9 +104,11 @@ struct WzExchangePage{ ...@@ -104,9 +104,11 @@ struct WzExchangePage{
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
}) })
Column(){ Column(){
BasicTable({dataSource:[]}) BasicTable({dataSource:[]})
}.flexGrow(1) }.flexGrow(1)
Row(){ Row(){
// 底部按钮 // 底部按钮
this.bottomButtons(); this.bottomButtons();
......
import { TitleBar } from '../../view/title/TitleBar' import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable' import { BasicTable } from '../../view/BasicTable/BasicTable'
import router from '@ohos.router'; import router from '@ohos.router';
import { Demo } from '../../view/demo/demo';
import { BasicDialog } from '../../view/BasicDialog/BasicDialog';
@Extend(Button) function bottomBtnSty() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({top:1,bottom:1,right:7,left:7}) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
.borderColor('#0fa983') .borderColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')
.fontColor('#0fa983') .fontColor('#0fa983')
...@@ -13,6 +15,7 @@ import router from '@ohos.router'; ...@@ -13,6 +15,7 @@ import router from '@ohos.router';
.stateEffect(true) .stateEffect(true)
} }
@Entry @Entry
@Component @Component
export struct WzInPage { export struct WzInPage {
...@@ -20,7 +23,57 @@ export struct WzInPage { ...@@ -20,7 +23,57 @@ export struct WzInPage {
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
private controller: TabsController = new TabsController() private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController() 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) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
...@@ -28,7 +81,7 @@ export struct WzInPage { ...@@ -28,7 +81,7 @@ export struct WzInPage {
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16) .fontSize(16)
.lineHeight(22) .lineHeight(22)
.margin({bottom: 7 }) .margin({ bottom: 7 })
Divider() Divider()
.strokeWidth(2) .strokeWidth(2)
.color('#fff') .color('#fff')
...@@ -36,13 +89,14 @@ export struct WzInPage { ...@@ -36,13 +89,14 @@ export struct WzInPage {
.opacity(this.currentIndex === index ? 1 : 0) .opacity(this.currentIndex === index ? 1 : 0)
}.width('100%') }.width('100%')
} }
@Builder bottomButtons() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时收物") Button("临时收物")
.visibility(this.currentIndex === 1 ? Visibility.Visible:Visibility.None) .visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty() .bottomBtnSty()
.onClick( () => { .onClick(() => {
router.pushUrl({ router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage", url: "pages/metailmange/AddTemporaryInPage",
}) })
...@@ -52,27 +106,31 @@ export struct WzInPage { ...@@ -52,27 +106,31 @@ export struct WzInPage {
Button("设置状态") Button("设置状态")
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
if (this.dialogController != undefined) {
this.dialogController.open()
}
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
.fontSize("14vp") .fontSize("14vp")
Button("导出数据包") Button("导出数据包")
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
Button("全选") // Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp") // .bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择") Button("清空选择")
.bottomBtnSty() .bottomBtnSty()
.onClick(() =>{ .onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
} }
}.height(80) }.height(80)
} }
build(){
build() {
Column() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资入库" }) TitleBar({ title: "物资入库" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() { TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87') // Column().width('100%').height('100%').backgroundColor('#00CB87')
...@@ -86,8 +144,9 @@ export struct WzInPage { ...@@ -86,8 +144,9 @@ export struct WzInPage {
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
}) })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){ Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
.backgroundColor('#F5F5F5') .backgroundColor('#F5F5F5')
...@@ -95,7 +154,7 @@ export struct WzInPage { ...@@ -95,7 +154,7 @@ export struct WzInPage {
.textAlign(TextAlign.Center) .textAlign(TextAlign.Center)
.placeholderFont({ size: 14, weight: 400 }) .placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 }) .textFont({ size: 14, weight: 400 })
.width('70%') .width('60%')
.onSubmit((value: string) => { .onSubmit((value: string) => {
}) })
.onChange((value: string) => { .onChange((value: string) => {
...@@ -104,35 +163,40 @@ export struct WzInPage { ...@@ -104,35 +163,40 @@ export struct WzInPage {
Select([{ value: "未完成" }, { value: "已完成" }]) Select([{ value: "未完成" }, { value: "已完成" }])
.value('请选择状态') .value('请选择状态')
.borderWidth(1) .borderWidth(1)
.borderRadius(10) .borderRadius(6)
.height(42)
.margin({ left: 10 })
.borderColor("#454545") .borderColor("#454545")
.onSelect(async (index: number, value?: string) => { .onSelect(async (index: number, value?: string) => {
if(value == '未完成') { if (value == '未完成') {
console.log("未完成",'未完成') console.log("未完成", '未完成')
} else { } else {
console.log("已完成",'已完成') console.log("已完成", '已完成')
} }
}) })
.width(110) .width(120)
.padding({ .padding({
right:10 right: 15
}) })
} }
}.margin({top:-30}) }.margin({ top: -20 })
.width("100%") .width("100%")
.padding('15vp') .padding('15vp')
Column(){
BasicTable({dataSource:[]}) // 列表
}.flexGrow(1) Column() {
Row(){ Demo({itemClick: this.itemClick}).width('90%')
// 底部按钮 }.flexGrow(1).backgroundColor('#fff').alignSelf(ItemAlign.Center)
// 底部按钮
Row() {
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.backgroundColor("#97c6a6").width("100%").height(80)
} }
}.linearGradient({ }.linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果 colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
}) })
} }
} }
\ No newline at end of file
@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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论