Commit 36128af3 by 陈桂东

提交代码

parent 2bf6e7cf
......@@ -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> {
}
}
/*更新包裹状态*/
async updateBgSql(params?:any) {
async updateBgSql(params?: any) {
try {
let val_sql = NativeSql.updateBgSql(params)
Logger.info('更新包裹状态>>sql', val_sql)
......@@ -144,7 +152,7 @@ export class BgglDao extends BaseTable<Bggl> {
/**
* // 检测包裹是否重复添加
*/
async testRepetitionBgSql(ddh?:string): Promise<newBgglDto[]> {
async testRepetitionBgSql(ddh?: string): Promise<newBgglDto[]> {
try {
let val_sql = NativeSql.testRepetitionBgSql(ddh);
Logger.info('检测包裹是否重复添加>>sql', val_sql)
......@@ -162,6 +170,7 @@ export class BgglDao extends BaseTable<Bggl> {
throw new Error('[查询异常]|' + e)
}
}
toWzcrkRefWz(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
......@@ -185,6 +194,7 @@ export class BgglDao extends BaseTable<Bggl> {
};
return info;
}
toPackageRef(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
......
import { Bggl } from '../../entity/Bggl';
import { uuid,dateUtils } from '../../utils/util';
import { dateUtils, uuid } from '../../utils/util';
export class NativeSql {
/**
......@@ -693,29 +693,29 @@ WHERE
}
}
/*查询包裹数据*/
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} `
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 sqlHz = ' order by bg.JSSJ desc'
if (params.ddh) {
return `${sql} and (bg.DDH like ${params.ddh})${sqlHz}`;
return `${sql} and (bg.DDH like '${params.ddh}')${sqlHz}`;
} else {
return sql + sqlHz
}
}
/*派发*/
static SetYpfActive(guid?:string):string{
static SetYpfActive(guid?: string): string {
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}') `
return sql
}
// 检测包裹是否重复添加
static testRepetitionBgSql (ddh?:string):string{
static testRepetitionBgSql(ddh?: string): string {
const sql = `select * from tab_bzgl_knzy_app_bggl where ddh = '${ddh}'`
return sql
}
// 更新包裹状态
static updateBgSql(params?:any):string {
static updateBgSql(params?: any): string {
const time = dateUtils.formatDateTime(new Date(), 'all')
const sql =
`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 {
ddh: item.ddh || '',
xs: item.xs || 1,
fwdw: item.fwdw || '',
bgzt: this.test(index),
// bgzt: this.test(index),
bgzt: '待入库',
// @ts-ignore
slr: item.ryxm || '',
sjh: item.sjh || '',
......@@ -76,6 +77,11 @@ class BgglModel {
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[]> {
let res = await SQLiteContext.with(BgglDao).getNewData(data);
......@@ -94,7 +100,7 @@ class BgglModel {
return res
}
/*更新包裹状态*/
async updateBgSql(params?:any) {
async updateBgSql(params?: any) {
let res = await SQLiteContext.with(BgglDao).updateBgSql(params)
return res
}
......
import { HwInfo } from '@ohos/common/src/main/ets/entity/HwInfo'
import bgglModel from '../../model/BgglModel'
import hwModel from '../../model/HwModel'
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
@Component
export struct ArrivePack {
@State isAuto: boolean = true
@State hwList: any[] = []
@State kfguid: string = ''
@State hwh: string = ''
checkedList: string[]
@Builder automatic() {
Flex({ justifyContent: FlexAlign.End }) {
......@@ -42,6 +50,8 @@ export struct ArrivePack {
.borderColor($r("app.color.rank_secondary_border"))
.margin({ left: 30 })
.onSelect((index: number, value?: string) => {
this.kfguid = this.hwList[index].id
this.hwh = value
})
Button('切换自动选').backgroundColor('#fff').fontColor('#1a9c34').onClick(() => {
this.isAuto = true
......@@ -56,6 +66,30 @@ export struct ArrivePack {
.fontColor('#1a9c34')
.height(40)
.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%')
}
......@@ -64,6 +98,9 @@ export struct ArrivePack {
}
aboutToAppear() {
const params = router.getParams() as any
this.checkedList = params.checkedList
Logger.info('checkedList>>', JSON.stringify(this.checkedList))
this.hwInit()
}
......@@ -72,7 +109,7 @@ export struct ArrivePack {
this.hwList = res.map(v => {
return {
value: v.hwh,
id: v.guid
id: v.kfguid,
}
})
}
......
......@@ -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 { PackList } from './PackList'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import promptAction from '@ohos.promptAction'
interface Type {
type: "wait" | "unclaimed" | "received" | "all"
......@@ -41,13 +42,13 @@ export struct Pack {
@State bgzt: string = ''
@State checkedList: string[] = []
aboutToAppear() {
onPageShow() {
let params = router.getParams() as Type;
this.type = params.type
if (params.type == 'wait') {
this.bgzt = '待入库'
this.bgzt = '待上架'
}
if (params.type == 'unclaimed') {
......@@ -100,10 +101,19 @@ export struct Pack {
this.getPackList()
})
Button("接收").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/ReceivePack' })
router.pushUrl({ url: 'pages/package/scanpack/AddPackagePage' })
})
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 {
.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 })
......
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 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 Prompt from '@system.prompt';
import bgglModel from '../../../model/BgglModel'
import { uuid } from '@ohos/common/src/main/ets/utils/util'
import {InputPayDailog} from '../../package/dialog/InputPayDailog'
import { InputPayDailog } from '../../package/dialog/InputPayDailog'
@Entry
@Component
struct AddPackagePage{
@State isAutomation:boolean=true
@State dataList:Array<any>=[]
struct AddPackagePage {
@State isAutomation: boolean = true
@State dataList: Array<any> = []
build() {
Column() {
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() {
Flex({ justifyContent: FlexAlign.SpaceBetween , alignItems: ItemAlign.Start}) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) {
Row() {
List({ space: 2 }) {
ForEach(this.dataList, (item) => {
......@@ -29,6 +35,7 @@ struct AddPackagePage{
Text('批次: ' + String(1)).fontSize(14).fontColor('#3b4144')
}
.width('50%')
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) {
Text('状态: ' + item.bgzt).fontSize(14).fontColor('#3b4144')
Row() {
......@@ -41,7 +48,7 @@ struct AddPackagePage{
item.xs = item.xs + 1
})
.onDec(() => {
if( item.xs == 0) {
if (item.xs == 0) {
return
}
item.xs = item.xs - 1
......@@ -65,29 +72,29 @@ struct AddPackagePage{
}
.width('100%')
.height('100%')
.border({ width: 1, color: '#fff', style: BorderStyle.Dotted})
.border({ width: 1, color: '#fff', style: BorderStyle.Dotted })
}
.padding(10)
.height('82%')
Flex({ justifyContent: FlexAlign.Center }) {
Button("接收包裹")
.borderRadius(4)
.type(ButtonType.Normal)
.width('90%')
.fontColor('#0fa983')
.backgroundColor('#fff')
.backgroundColor('#fff')a
.onClick(() => {
// this.onSubmit()
this.handlePutGoodsOnShelf()
console.log("接收数据")
// this.handleSave()
router.back({ url: 'pages/package/Pack', params: { type: 'wait' } })
})
}
.height(70)
}.onKeyEvent((e: globalThis.KeyEvent) => {
console.error('keycode====》:' + e.keyCode)
if ((e.keyCode == 2096 || e.keyCode == 2093)) {
if(e.type==1){
if (e.type == 1) {
IdentifyService.openScan()
}
}
......@@ -95,9 +102,10 @@ struct AddPackagePage{
}).height("100%").width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向
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() {
var innerEvent = { eventId: 2 }
emitter.on(innerEvent, (eventData) => {
......@@ -108,12 +116,14 @@ struct AddPackagePage{
}
})
}
async showQRDetail(hwQrCode: string) {
Logger.info("扫码二维码===》"+hwQrCode)
Logger.info("扫码二维码===》" + hwQrCode)
this.isAutomation = false
this.handleanalysisQrCode(hwQrCode)
}
async handleanalysisQrCode(value:string) {
async handleanalysisQrCode(value: string) {
try {
const res = await analysisQrCode(value)
if (res.data && res.data.length > 0) {
......@@ -143,7 +153,7 @@ struct AddPackagePage{
item.ddh = item.ddh.slice(count, item.ddh.length)
console.log('订单号', ddh)
if (ddh && bgzt) {
const textData = await bgglModel.testRepetitionBgSql(item)
const textData = await bgglModel.testRepetitionBgSql(item.ddh)
console.log('textData', textData)
if (textData && textData.length == 0) {
Prompt.showToast({
......@@ -265,6 +275,7 @@ struct AddPackagePage{
})
}
}
async handlePutGoodsOnShelf() {
try {
if (this.dataList && this.dataList.length > 0) {
......@@ -293,6 +304,7 @@ struct AddPackagePage{
})
}
}
onPageShow() {
console.error("========onPageShow=========")
this.scanCodeListen()
......
......@@ -71,6 +71,7 @@ struct ScanPackPage{
this.handleScanningDistribution()
console.log("派发数据")
// this.handleSave()
router.back({ url: 'pages/package/Pick', params: { type: 'wait' } })
})
}
.height(70)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论