Commit 36128af3 by 陈桂东

提交代码

parent 2bf6e7cf
...@@ -75,6 +75,14 @@ export class BgglDao extends BaseTable<Bggl> { ...@@ -75,6 +75,14 @@ export class BgglDao extends BaseTable<Bggl> {
} }
async setDpf(params: Partial<Bggl>) {
let db = await this.futureDb;
const sql = `update TAB_BZGL_KNZY_APP_BGGL set BGZT = '未领取',hwh = '${params.hwh}', kfdm = '${params.kfdm}' where guid in (${params.guid})`
Logger.info('setDpf>>', sql)
await db.executeSql(sql)
}
/** /**
* 获取最新上架信息 * 获取最新上架信息
*/ */
...@@ -130,7 +138,7 @@ export class BgglDao extends BaseTable<Bggl> { ...@@ -130,7 +138,7 @@ export class BgglDao extends BaseTable<Bggl> {
} }
} }
/*更新包裹状态*/ /*更新包裹状态*/
async updateBgSql(params?:any) { async updateBgSql(params?: any) {
try { try {
let val_sql = NativeSql.updateBgSql(params) let val_sql = NativeSql.updateBgSql(params)
Logger.info('更新包裹状态>>sql', val_sql) Logger.info('更新包裹状态>>sql', val_sql)
...@@ -144,7 +152,7 @@ export class BgglDao extends BaseTable<Bggl> { ...@@ -144,7 +152,7 @@ export class BgglDao extends BaseTable<Bggl> {
/** /**
* // 检测包裹是否重复添加 * // 检测包裹是否重复添加
*/ */
async testRepetitionBgSql(ddh?:string): Promise<newBgglDto[]> { async testRepetitionBgSql(ddh?: string): Promise<newBgglDto[]> {
try { try {
let val_sql = NativeSql.testRepetitionBgSql(ddh); let val_sql = NativeSql.testRepetitionBgSql(ddh);
Logger.info('检测包裹是否重复添加>>sql', val_sql) Logger.info('检测包裹是否重复添加>>sql', val_sql)
...@@ -162,6 +170,7 @@ export class BgglDao extends BaseTable<Bggl> { ...@@ -162,6 +170,7 @@ export class BgglDao extends BaseTable<Bggl> {
throw new Error('[查询异常]|' + e) throw new Error('[查询异常]|' + e)
} }
} }
toWzcrkRefWz(cursor: relationalStore.ResultSet): newBgglDto { toWzcrkRefWz(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = { let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')), guid: cursor.getString(cursor.getColumnIndex('guid')),
...@@ -185,6 +194,7 @@ export class BgglDao extends BaseTable<Bggl> { ...@@ -185,6 +194,7 @@ export class BgglDao extends BaseTable<Bggl> {
}; };
return info; return info;
} }
toPackageRef(cursor: relationalStore.ResultSet): newBgglDto { toPackageRef(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = { let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')), guid: cursor.getString(cursor.getColumnIndex('guid')),
......
import { Bggl } from '../../entity/Bggl'; import { Bggl } from '../../entity/Bggl';
import { uuid,dateUtils } from '../../utils/util'; import { dateUtils, uuid } from '../../utils/util';
export class NativeSql { export class NativeSql {
/** /**
...@@ -693,29 +693,29 @@ WHERE ...@@ -693,29 +693,29 @@ WHERE
} }
} }
/*查询包裹数据*/ /*查询包裹数据*/
static getBgglPageSql(params?: any):string{ static getBgglPageSql(params?: any): string {
var sql = `select bg.*,kf.kfmc from TAB_BZGL_KNZY_APP_BGGL bg left join TAB_BZGL_KNZY_APP_DWKF kf on kf.kfdm = bg.kfdm where bg.BGZT = ${params.bgzt} ` var sql = `select bg.*,kf.kfmc from TAB_BZGL_KNZY_APP_BGGL bg left join TAB_BZGL_KNZY_APP_DWKF kf on kf.kfdm = bg.kfdm where bg.BGZT = '${params.bgzt}' `
var sqlHz = ' order by bg.JSSJ desc' var sqlHz = ' order by bg.JSSJ desc'
if (params.ddh) { if (params.ddh) {
return `${sql} and (bg.DDH like ${params.ddh})${sqlHz}`; return `${sql} and (bg.DDH like '${params.ddh}')${sqlHz}`;
} else { } else {
return sql + sqlHz return sql + sqlHz
} }
} }
/*派发*/ /*派发*/
static SetYpfActive(guid?:string):string{ static SetYpfActive(guid?: string): string {
const time = dateUtils.formatDateTime(new Date(), 'all') const time = dateUtils.formatDateTime(new Date(), 'all')
const sql = const sql =
`update TAB_BZGL_KNZY_APP_BGGL set BGZT = '已领取' , sfdc = '0' ,CKSJ = '${time}' where guid in ('${guid}') ` `update TAB_BZGL_KNZY_APP_BGGL set BGZT = '已领取' , sfdc = '0' ,CKSJ = '${time}' where guid in ('${guid}') `
return sql return sql
} }
// 检测包裹是否重复添加 // 检测包裹是否重复添加
static testRepetitionBgSql (ddh?:string):string{ static testRepetitionBgSql(ddh?: string): string {
const sql = `select * from tab_bzgl_knzy_app_bggl where ddh = '${ddh}'` const sql = `select * from tab_bzgl_knzy_app_bggl where ddh = '${ddh}'`
return sql return sql
} }
// 更新包裹状态 // 更新包裹状态
static updateBgSql(params?:any):string { static updateBgSql(params?: any): string {
const time = dateUtils.formatDateTime(new Date(), 'all') const time = dateUtils.formatDateTime(new Date(), 'all')
const sql = const sql =
`update TAB_BZGL_KNZY_APP_BGGL set BGZT = '待上架', JSSJ =' ${time}' , XS = ${params.xs}, PC = ${params.pc} where ddh in ('${params.ddh}')` `update TAB_BZGL_KNZY_APP_BGGL set BGZT = '待上架', JSSJ =' ${time}' , XS = ${params.xs}, PC = ${params.pc} where ddh in ('${params.ddh}')`
......
...@@ -50,7 +50,8 @@ class BgglModel { ...@@ -50,7 +50,8 @@ class BgglModel {
ddh: item.ddh || '', ddh: item.ddh || '',
xs: item.xs || 1, xs: item.xs || 1,
fwdw: item.fwdw || '', fwdw: item.fwdw || '',
bgzt: this.test(index), // bgzt: this.test(index),
bgzt: '待入库',
// @ts-ignore // @ts-ignore
slr: item.ryxm || '', slr: item.ryxm || '',
sjh: item.sjh || '', sjh: item.sjh || '',
...@@ -76,6 +77,11 @@ class BgglModel { ...@@ -76,6 +77,11 @@ class BgglModel {
let res = await SQLiteContext.with(BgglDao).setYpfActive(guid); let res = await SQLiteContext.with(BgglDao).setYpfActive(guid);
} }
// 上架包裹
async setDpf(data: Partial<Bggl>) {
let res = await SQLiteContext.with(BgglDao).setDpf(data);
}
// 查询最新上架信息 // 查询最新上架信息
async queryNewDara(data: Partial<Bggl>): Promise<newBgglDto[]> { async queryNewDara(data: Partial<Bggl>): Promise<newBgglDto[]> {
let res = await SQLiteContext.with(BgglDao).getNewData(data); let res = await SQLiteContext.with(BgglDao).getNewData(data);
...@@ -94,7 +100,7 @@ class BgglModel { ...@@ -94,7 +100,7 @@ class BgglModel {
return res return res
} }
/*更新包裹状态*/ /*更新包裹状态*/
async updateBgSql(params?:any) { async updateBgSql(params?: any) {
let res = await SQLiteContext.with(BgglDao).updateBgSql(params) let res = await SQLiteContext.with(BgglDao).updateBgSql(params)
return res return res
} }
......
import { HwInfo } from '@ohos/common/src/main/ets/entity/HwInfo' import { HwInfo } from '@ohos/common/src/main/ets/entity/HwInfo'
import bgglModel from '../../model/BgglModel'
import hwModel from '../../model/HwModel' import hwModel from '../../model/HwModel'
import { TitleBar } from '../../view/title/TitleBar' import { TitleBar } from '../../view/title/TitleBar'
import promptAction from '@ohos.promptAction'
import kfModel from '../../model/KfModel'
import router from '@ohos.router'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
@Entry @Entry
@Component @Component
export struct ArrivePack { export struct ArrivePack {
@State isAuto: boolean = true @State isAuto: boolean = true
@State hwList: any[] = [] @State hwList: any[] = []
@State kfguid: string = ''
@State hwh: string = ''
checkedList: string[]
@Builder automatic() { @Builder automatic() {
Flex({ justifyContent: FlexAlign.End }) { Flex({ justifyContent: FlexAlign.End }) {
...@@ -42,6 +50,8 @@ export struct ArrivePack { ...@@ -42,6 +50,8 @@ export struct ArrivePack {
.borderColor($r("app.color.rank_secondary_border")) .borderColor($r("app.color.rank_secondary_border"))
.margin({ left: 30 }) .margin({ left: 30 })
.onSelect((index: number, value?: string) => { .onSelect((index: number, value?: string) => {
this.kfguid = this.hwList[index].id
this.hwh = value
}) })
Button('切换自动选').backgroundColor('#fff').fontColor('#1a9c34').onClick(() => { Button('切换自动选').backgroundColor('#fff').fontColor('#1a9c34').onClick(() => {
this.isAuto = true this.isAuto = true
...@@ -56,6 +66,30 @@ export struct ArrivePack { ...@@ -56,6 +66,30 @@ export struct ArrivePack {
.fontColor('#1a9c34') .fontColor('#1a9c34')
.height(40) .height(40)
.width('80%') .width('80%')
.onClick(async () => {
if (!this.kfguid) {
promptAction.showToast({
message: '请选择货位'
})
}
const res = await kfModel.query({ guid: this.kfguid })
const kfdm = res[0].kfdm
try {
await bgglModel.setDpf({ kfdm, guid: this.checkedList.join(','), hwh: this.hwh })
promptAction.showToast({
message: '上架成功'
})
router.back({ url: 'pages/package/Pack', params: { type: 'wait' } })
} catch (e) {
promptAction.showToast({
message: '上架失败'
})
}
})
}.width('100%') }.width('100%')
} }
...@@ -64,6 +98,9 @@ export struct ArrivePack { ...@@ -64,6 +98,9 @@ export struct ArrivePack {
} }
aboutToAppear() { aboutToAppear() {
const params = router.getParams() as any
this.checkedList = params.checkedList
Logger.info('checkedList>>', JSON.stringify(this.checkedList))
this.hwInit() this.hwInit()
} }
...@@ -72,7 +109,7 @@ export struct ArrivePack { ...@@ -72,7 +109,7 @@ export struct ArrivePack {
this.hwList = res.map(v => { this.hwList = res.map(v => {
return { return {
value: v.hwh, value: v.hwh,
id: v.guid id: v.kfguid,
} }
}) })
} }
......
...@@ -6,6 +6,7 @@ import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl' ...@@ -6,6 +6,7 @@ import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger' import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
import { PackList } from './PackList' import { PackList } from './PackList'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto' import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import promptAction from '@ohos.promptAction'
interface Type { interface Type {
type: "wait" | "unclaimed" | "received" | "all" type: "wait" | "unclaimed" | "received" | "all"
...@@ -41,13 +42,13 @@ export struct Pack { ...@@ -41,13 +42,13 @@ export struct Pack {
@State bgzt: string = '' @State bgzt: string = ''
@State checkedList: string[] = [] @State checkedList: string[] = []
aboutToAppear() { onPageShow() {
let params = router.getParams() as Type; let params = router.getParams() as Type;
this.type = params.type this.type = params.type
if (params.type == 'wait') { if (params.type == 'wait') {
this.bgzt = '待入库' this.bgzt = '待上架'
} }
if (params.type == 'unclaimed') { if (params.type == 'unclaimed') {
...@@ -100,10 +101,19 @@ export struct Pack { ...@@ -100,10 +101,19 @@ export struct Pack {
this.getPackList() this.getPackList()
}) })
Button("接收").CommonButtonStyle().onClick(() => { Button("接收").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/ReceivePack' }) router.pushUrl({ url: 'pages/package/scanpack/AddPackagePage' })
}) })
Button("上架").CommonButtonStyle().onClick(() => { Button("上架").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/Arrive' })
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请选择一条单据上架'
})
return
}
router.pushUrl({ url: 'pages/package/Arrive', params: {
checkedList: this.checkedList
} })
}) })
} }
......
...@@ -13,7 +13,7 @@ export struct PickList { ...@@ -13,7 +13,7 @@ export struct PickList {
.fontColor("#000") .fontColor("#000")
.fontSize(12) .fontSize(12)
.padding({ top: 5, bottom: 5 }) .padding({ top: 5, bottom: 5 })
Text(`库房:' ${this.item.kfmc || '暂无库房'}`) Text(`库房: ${this.item.kfmc || '暂无库房'}`)
.alignSelf(ItemAlign.Start) .alignSelf(ItemAlign.Start)
.fontColor("#000") .fontColor("#000")
.padding({ top: 5, bottom: 5 }) .padding({ top: 5, bottom: 5 })
......
import { TitleBar } from '../../../view/title/TitleBar' import { TitleBar } from '../../../view/title/TitleBar'
import { Logger, KfInfo, Gldw, WzPositionClass,SearchData,WzPositionInfo,HWFromData} from '@ohos/common'; import { Gldw, HWFromData, KfInfo, Logger, SearchData, WzPositionClass, WzPositionInfo } from '@ohos/common';
import router from '@ohos.router' import router from '@ohos.router'
import IdentifyService from '../../../identify/IdentifySerivce' import IdentifyService from '../../../identify/IdentifySerivce'
import {analysisQrCode} from '../../../identify/analysis/analysis_QR_code' import { analysisQrCode } from '../../../identify/analysis/analysis_QR_code'
import emitter from '@ohos.events.emitter'; import emitter from '@ohos.events.emitter';
import Prompt from '@system.prompt'; import Prompt from '@system.prompt';
import bgglModel from '../../../model/BgglModel' import bgglModel from '../../../model/BgglModel'
import { uuid } from '@ohos/common/src/main/ets/utils/util' import { uuid } from '@ohos/common/src/main/ets/utils/util'
import {InputPayDailog} from '../../package/dialog/InputPayDailog' import { InputPayDailog } from '../../package/dialog/InputPayDailog'
@Entry @Entry
@Component @Component
struct AddPackagePage{ struct AddPackagePage {
@State isAutomation:boolean=true @State isAutomation: boolean = true
@State dataList:Array<any>=[] @State dataList: Array<any> = []
build() { build() {
Column() { Column() {
TitleBar({ title: "新增包裹" }) TitleBar({ title: "新增包裹" })
Text('请扫描包裹').fontColor('#fff').fontSize(20).height("20").visibility(this.dataList.length>0?Visibility.None:Visibility.Visible) Text('请扫描包裹')
.fontColor('#fff')
.fontSize(20)
.height("20")
.visibility(this.dataList.length > 0 ? Visibility.None : Visibility.Visible)
Column() { Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween , alignItems: ItemAlign.Start}) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) {
Row() { Row() {
List({ space: 2 }) { List({ space: 2 }) {
ForEach(this.dataList, (item) => { ForEach(this.dataList, (item) => {
...@@ -29,6 +35,7 @@ struct AddPackagePage{ ...@@ -29,6 +35,7 @@ struct AddPackagePage{
Text('批次: ' + String(1)).fontSize(14).fontColor('#3b4144') Text('批次: ' + String(1)).fontSize(14).fontColor('#3b4144')
} }
.width('50%') .width('50%')
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) {
Text('状态: ' + item.bgzt).fontSize(14).fontColor('#3b4144') Text('状态: ' + item.bgzt).fontSize(14).fontColor('#3b4144')
Row() { Row() {
...@@ -41,7 +48,7 @@ struct AddPackagePage{ ...@@ -41,7 +48,7 @@ struct AddPackagePage{
item.xs = item.xs + 1 item.xs = item.xs + 1
}) })
.onDec(() => { .onDec(() => {
if( item.xs == 0) { if (item.xs == 0) {
return return
} }
item.xs = item.xs - 1 item.xs = item.xs - 1
...@@ -65,29 +72,29 @@ struct AddPackagePage{ ...@@ -65,29 +72,29 @@ struct AddPackagePage{
} }
.width('100%') .width('100%')
.height('100%') .height('100%')
.border({ width: 1, color: '#fff', style: BorderStyle.Dotted}) .border({ width: 1, color: '#fff', style: BorderStyle.Dotted })
} }
.padding(10) .padding(10)
.height('82%') .height('82%')
Flex({ justifyContent: FlexAlign.Center }) { Flex({ justifyContent: FlexAlign.Center }) {
Button("接收包裹") Button("接收包裹")
.borderRadius(4) .borderRadius(4)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.width('90%') .width('90%')
.fontColor('#0fa983') .fontColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')a
.onClick(() => { .onClick(() => {
// this.onSubmit()
this.handlePutGoodsOnShelf() this.handlePutGoodsOnShelf()
console.log("接收数据") console.log("接收数据")
// this.handleSave() router.back({ url: 'pages/package/Pack', params: { type: 'wait' } })
}) })
} }
.height(70) .height(70)
}.onKeyEvent((e: globalThis.KeyEvent) => { }.onKeyEvent((e: globalThis.KeyEvent) => {
console.error('keycode====》:' + e.keyCode) console.error('keycode====》:' + e.keyCode)
if ((e.keyCode == 2096 || e.keyCode == 2093)) { if ((e.keyCode == 2096 || e.keyCode == 2093)) {
if(e.type==1){ if (e.type == 1) {
IdentifyService.openScan() IdentifyService.openScan()
} }
} }
...@@ -95,9 +102,10 @@ struct AddPackagePage{ ...@@ -95,9 +102,10 @@ struct AddPackagePage{
}).height("100%").width("100%").linearGradient({ }).height("100%").width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 repeating: true, // 渐变颜色是否重复
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]]// 数组末尾元素占比小于1时满足重复着色效果 colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]] // 数组末尾元素占比小于1时满足重复着色效果
}) })
} }
scanCodeListen() { scanCodeListen() {
var innerEvent = { eventId: 2 } var innerEvent = { eventId: 2 }
emitter.on(innerEvent, (eventData) => { emitter.on(innerEvent, (eventData) => {
...@@ -108,12 +116,14 @@ struct AddPackagePage{ ...@@ -108,12 +116,14 @@ struct AddPackagePage{
} }
}) })
} }
async showQRDetail(hwQrCode: string) { async showQRDetail(hwQrCode: string) {
Logger.info("扫码二维码===》"+hwQrCode) Logger.info("扫码二维码===》" + hwQrCode)
this.isAutomation = false this.isAutomation = false
this.handleanalysisQrCode(hwQrCode) this.handleanalysisQrCode(hwQrCode)
} }
async handleanalysisQrCode(value:string) {
async handleanalysisQrCode(value: string) {
try { try {
const res = await analysisQrCode(value) const res = await analysisQrCode(value)
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
...@@ -143,7 +153,7 @@ struct AddPackagePage{ ...@@ -143,7 +153,7 @@ struct AddPackagePage{
item.ddh = item.ddh.slice(count, item.ddh.length) item.ddh = item.ddh.slice(count, item.ddh.length)
console.log('订单号', ddh) console.log('订单号', ddh)
if (ddh && bgzt) { if (ddh && bgzt) {
const textData = await bgglModel.testRepetitionBgSql(item) const textData = await bgglModel.testRepetitionBgSql(item.ddh)
console.log('textData', textData) console.log('textData', textData)
if (textData && textData.length == 0) { if (textData && textData.length == 0) {
Prompt.showToast({ Prompt.showToast({
...@@ -265,6 +275,7 @@ struct AddPackagePage{ ...@@ -265,6 +275,7 @@ struct AddPackagePage{
}) })
} }
} }
async handlePutGoodsOnShelf() { async handlePutGoodsOnShelf() {
try { try {
if (this.dataList && this.dataList.length > 0) { if (this.dataList && this.dataList.length > 0) {
...@@ -293,6 +304,7 @@ struct AddPackagePage{ ...@@ -293,6 +304,7 @@ struct AddPackagePage{
}) })
} }
} }
onPageShow() { onPageShow() {
console.error("========onPageShow=========") console.error("========onPageShow=========")
this.scanCodeListen() this.scanCodeListen()
......
...@@ -71,6 +71,7 @@ struct ScanPackPage{ ...@@ -71,6 +71,7 @@ struct ScanPackPage{
this.handleScanningDistribution() this.handleScanningDistribution()
console.log("派发数据") console.log("派发数据")
// this.handleSave() // this.handleSave()
router.back({ url: 'pages/package/Pick', params: { type: 'wait' } })
}) })
} }
.height(70) .height(70)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论