Commit 58a6326e by 陈桂东

提交代码

parent 3fafc5c4
......@@ -2,6 +2,7 @@ import relationalStore from '@ohos.data.relationalStore';
import { newBgglDto } from '../../bean/dto/BgglDto';
import { Bggl } from '../../entity/Bggl';
import { Logger } from '../../utils/Logger';
import { dateUtils } from '../../utils/util';
import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators';
import { NativeSql } from '../sql/NativeSql';
......@@ -65,6 +66,14 @@ export class BgglDao extends BaseTable<Bggl> {
return this.query(wp, this.getTableColumns());
}
async setYpfActive(guid) {
let db = await this.futureDb;
const time = dateUtils.formatDateTime(new Date(), 'all')
const sql = `update TAB_BZGL_KNZY_APP_BGGL set BGZT = '已领取' , sfdc = '0' ,CKSJ = '${time}' where guid in (${guid})`
Logger.info('setYpfActive>>', sql)
await db.executeSql(sql)
}
/**
* 获取最新上架信息
......@@ -109,7 +118,7 @@ export class BgglDao extends BaseTable<Bggl> {
}
}
/*派发*/
async SetYpfActive(guid?:string) {
async SetYpfActive(guid?: string) {
try {
let val_sql = NativeSql.SetYpfActive(guid)
Logger.info('派发>>sql', val_sql)
......
......@@ -72,6 +72,10 @@ class BgglModel {
return res;
}
async setYpfActive(guid) {
let res = await SQLiteContext.with(BgglDao).setYpfActive(guid);
}
// 查询最新上架信息
async queryNewDara(data: Partial<Bggl>): Promise<newBgglDto[]> {
let res = await SQLiteContext.with(BgglDao).getNewData(data);
......@@ -85,7 +89,7 @@ class BgglModel {
return res;
}
/*派发*/
async SetYpfActive(guid?:string) {
async SetYpfActive(guid?: string) {
let res = await SQLiteContext.with(BgglDao).SetYpfActive(guid)
return res
}
......
......@@ -17,6 +17,7 @@ struct MainPage {
aboutToAppear() {
this.breakpointSystem.register();
Logger.info('hhhhhhhhhhhhhhhhhhhhhhh')
}
aboutToDisappear() {
......@@ -24,6 +25,7 @@ struct MainPage {
}
onPageShow() {
this.index++
}
build() {
......
......@@ -25,13 +25,11 @@ export struct PageManagement {
private controller: TabsController = new TabsController()
onCountUpdated(index: number) {
if (this.currentPageIndex == 2) {
this.getTotal()
this.getDsj()
this.getYlq()
this.getWlq()
this.getPackList()
}
this.getTotal()
this.getDsj()
this.getYlq()
this.getWlq()
this.getPackList()
}
@Builder TabBuilder(index: number, name: string) {
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import { PickDetailDialog } from '../package/dialog/PickDetailDialog'
@Component
export struct YqjList {
@Link dataSource: newBgglDto[]
@State Currentitem: newBgglDto = null
orderController: CustomDialogController = new CustomDialogController({
builder: PickDetailDialog({ item: this.Currentitem }),
// @ts-ignore
// item: this.Currentitem
})
build() {
Column() {
......@@ -32,6 +39,10 @@ export struct YqjList {
}.padding(10).borderWidth(1).borderColor('#fff')
}
}
.onClick(() => {
this.Currentitem = item
this.orderController.open()
})
.backgroundColor('#0fa983')
.height(100)
.width('100%')
......
import { HwInfo } from '@ohos/common/src/main/ets/entity/HwInfo'
import hwModel from '../../model/HwModel'
import { TitleBar } from '../../view/title/TitleBar'
@Entry
@Component
export struct ArrivePack {
@State isAuto: boolean = true
@State hwList: any[] = []
@Builder automatic() {
Flex({ justifyContent: FlexAlign.End }) {
Button('切换手动选').backgroundColor('#fff').fontColor('#1a9c34').margin({ right: 20, bottom: 10 })
.onClick(() => {
this.isAuto = false
})
}
Column() {
Text("请扫描包裹").fontColor('#fff').fontSize(26).margin({ top: 300 })
}
.alignItems(HorizontalAlign.Center)
.flexGrow(1)
.width('88%')
.borderWidth(3)
.border({ style: BorderStyle.Dotted })
.borderColor('#fff')
}
@Builder movement() {
Column() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween }) {
Row() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Select(this.hwList)
.value(`请选择货位号`)
.borderWidth(1)
.borderRadius(5)
.width(150)
.height(34)
.borderColor($r("app.color.rank_secondary_border"))
.margin({ left: 30 })
.onSelect((index: number, value?: string) => {
})
Button('切换自动选').backgroundColor('#fff').fontColor('#1a9c34').onClick(() => {
this.isAuto = true
}).margin({ right: 30 })
}
}
}
Flex({ justifyContent: FlexAlign.Center }) {
Button('上架')
.backgroundColor('#fff')
.fontColor('#1a9c34')
.height(40)
.width('80%')
}.width('100%')
}
}.height('88%')
}
aboutToAppear() {
this.hwInit()
}
async hwInit() {
const res = await hwModel.query()
this.hwList = res.map(v => {
return {
value: v.hwh,
id: v.guid
}
})
}
build() {
Column() {
TitleBar({ title: "上架包裹" })
if (this.isAuto) {
this.automatic()
} else {
this.movement()
}
}.height('100%')
.width('100%')
.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
}).padding({ bottom: 20 })
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import bgglModel from '../../model/BgglModel'
import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
import { PackList } from './PackList'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
interface Type {
type: "wait" | "unclaimed" | "received" | "all"
......@@ -34,10 +35,11 @@ interface Type {
@Component
export struct Pack {
@State type: string = ''
@State packList: Bggl[] = []
@State packList: newBgglDto[] = []
controller: SearchController = new SearchController()
@State ddh: string = ''
@State bgzt: string = ''
@State checkedList: string[] = []
aboutToAppear() {
let params = router.getParams() as Type;
......@@ -100,7 +102,9 @@ export struct Pack {
Button("接收").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/ReceivePack' })
})
Button("上架").CommonButtonStyle()
Button("上架").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/Arrive' })
})
}
if (this.type == 'unclaimed') {
......@@ -143,7 +147,19 @@ export struct Pack {
List() {
ForEach(this.packList, (item) => {
ListItem() {
PackList({ item })
Row() {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
if (value) {
this.checkedList.push(item.guid)
} else {
this.checkedList = this.checkedList.filter(i => i !== item.guid);
}
})
.margin({ right: 10, left: 10 })
PackList({ item })
}
}
})
}.divider({ strokeWidth: 1, color: "#bbbbb1" }).backgroundColor('#fff')
......
......@@ -12,25 +12,28 @@ export struct PackList {
build() {
Column() {
Row() {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
})
.margin({ right: 10, left: 10 })
Column() {
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%')
Text(`库房: ${this.item.kfmc || '暂无库房'} `)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
.fontSize(12)
}.width('40%')
Column() {
Text(`货位: ${this.item.hwh || '暂无货位'}`).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('箱数:' + this.item.xs).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text(`货位: ${this.item.hwh || '暂无货位'}`)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
.fontSize(12)
Text('箱数:' + this.item.xs).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }).fontSize(12)
}.width('30%').margin({ left: 10 })
Column() {
Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text(`未导出 ${this.item.sfdc == '0' ? '未导出' : '已导出'}`)
Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }).fontSize(12)
Text(`${this.item.sfdc == '0' ? '未导出' : '已导出'}`)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
.fontSize(12)
}.width('30%').margin({ left: 10 })
}
}
......
......@@ -4,6 +4,8 @@ import bgglModel from '../../model/BgglModel'
import { TitleBar } from '../../view/title/TitleBar'
import { YqjList } from '../PageManagement/YqjList'
import { PickList } from './listview/PickList'
import router from '@ohos.router'
import promptAction from '@ohos.promptAction'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
......@@ -23,6 +25,7 @@ export struct Pick {
@State showList: boolean = false
@State ddh: string = ''
@State packList: newBgglDto[] = []
@State checkedList: string[] = []
aboutToAppear() {
this.getPackList()
......@@ -49,14 +52,14 @@ export struct Pick {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) {
TitleBar({ title: "取件" })
Row() {
Flex({ justifyContent: FlexAlign.Center }) {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入包裹信息', controller: this.controller })
.height(40)
.backgroundColor('#F5F5F5')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 })
.width('80%')
.width('70%')
.onSubmit((value: string) => {
})
.onChange((value: string) => {
......@@ -78,7 +81,20 @@ export struct Pick {
List() {
ForEach(this.packList, (item) => {
ListItem() {
PickList({ item })
Row() {
Row() {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
if (value) {
this.checkedList.push(item.guid)
} else {
this.checkedList = this.checkedList.filter(i => i !== item.guid);
}
})
.margin({ right: 10, left: 10 })
PickList({ item })
}
}
}
})
}.divider({ strokeWidth: 1, color: "#bbbbb1" }).backgroundColor('#fff')
......@@ -92,8 +108,29 @@ export struct Pick {
Button("打印面单").CommonButtonStyle().onClick(async () => {
})
Button("扫码取件").CommonButtonStyle().onClick(async () => {
router.pushUrl({ url: 'pages/package/scanpack/ScanPackPage' })
})
Button("手动取件").CommonButtonStyle().onClick(async () => {
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请至少选择一条单据'
})
return
}
try {
await bgglModel.setYpfActive(this.checkedList.join(','))
this.getPackList()
promptAction.showToast({
message: '取件成功'
})
} catch (e) {
promptAction.showToast({
message: '取件失败'
})
}
})
}.height(80).backgroundColor('#97c6a6')
}
......
import { DividerTitle } from '../../../view/DividerTitle/DividerTitle';
import { Logger, KfInfo, Gldw, WzPositionClass,SearchData } from '@ohos/common';
import { Gldw, KfInfo, Logger, SearchData, WzPositionClass } from '@ohos/common';
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import bgglModel from '../../../model/BgglModel';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
......@@ -9,26 +13,38 @@ import { Logger, KfInfo, Gldw, WzPositionClass,SearchData } from '@ohos/common';
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@CustomDialog
@Component
export struct PickDetailDialog{
export struct PickDetailDialog {
controller: CustomDialogController
item: newBgglDto
getCurrent() {
}
build() {
Column() {
Flex({ justifyContent:FlexAlign.SpaceBetween,alignItems: ItemAlign.Start }) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) {
DividerTitle({ title: "订单信息" })
}.padding({top:10,bottom:10 })
}.padding({ top: 10, bottom: 10 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("订单号:").fontSize(16).lineHeight(18)
Text('JD288242733482X').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.ddh).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("申领人:").fontSize(16).lineHeight(18)
Text('张三').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.slr).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("手机号:").fontSize(16).lineHeight(18)
Text('18100000262').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.sjh + '').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -38,16 +54,19 @@ export struct PickDetailDialog{
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("库房:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.kfmc || '暂无库房').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("发物单位:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.fwdw).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("货位号:").fontSize(16).lineHeight(18)
Text('A-1-1-1').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.hwh || '暂无货位').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -57,16 +76,19 @@ export struct PickDetailDialog{
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("箱数:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.xs + '').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("批次:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.pc + '').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("包裹状态:").fontSize(16).lineHeight(18)
Text('未领取').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.bgzt).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -76,8 +98,9 @@ export struct PickDetailDialog{
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("是否到付:").fontSize(16).lineHeight(18)
Text('否').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.sfdf == '1' ? '是' : '否').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -87,8 +110,9 @@ export struct PickDetailDialog{
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("到付金额:").fontSize(16).lineHeight(18)
Text('暂无到付金额').fontSize(16).fontColor("#000").fontWeight(700)
Text(String(this.item.dfje) || '暂无到付金额').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -98,12 +122,14 @@ export struct PickDetailDialog{
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("取件码:").fontSize(16).lineHeight(18)
Text('WC6794').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.qjm).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("接收时间:").fontSize(16).lineHeight(18)
Text('2024-01-25 20:53:22').fontSize(16).fontColor("#000").fontWeight(700)
Text(this.item.jssj).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
......@@ -111,12 +137,28 @@ export struct PickDetailDialog{
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取件')
.onClick(() => {
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.padding({left:10,right:10})
if (this.item.bgzt == '已领取') {
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('关闭')
.onClick(() => {
this.controller.close()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
if (this.item.bgzt == '未领取') {
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取件')
.onClick(async () => {
await bgglModel.setYpfActive(this.item.guid)
this.controller.close()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
}.padding({ left: 10, right: 10 })
.width('100%')
.borderRadius(5)
.backgroundColor('#fff')
......
......@@ -7,17 +7,13 @@ export struct PickList {
build() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
})
.margin({ right: 10, left: 10 })
Column() {
Text('订单号:' + this.item.ddh)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.fontSize(12)
.padding({ top: 5, bottom: 5 })
Text('库房:' + this.item.kfmc)
Text(`库房:' ${this.item.kfmc || '暂无库房'}`)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
......@@ -50,8 +46,12 @@ export struct PickList {
}.width('30%').margin({ left: 10 })
Column() {
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 })
Text('批次:' + this.item.pc)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('未取件').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 }).fontSize(13)
}.width('20%').margin({ left: 10 })
}
}.width("100%")
......
......@@ -6,6 +6,7 @@
"pages/package/Pack",
"pages/package/scanpack/ScanPackPage",
"pages/package/scanpack/AddPackagePage",
"pages/package/Arrive",
"pages/metailmange/WzInPage/WzInPage",
"pages/metailmange/WzOutPage/WzOutPage",
"pages/metailmange/WzExchangePage",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论