Commit 9c73eeea by 陈桂东

Merge remote-tracking branch 'origin/master'

parents 84bce72a aee46615
...@@ -15,6 +15,8 @@ export class NativeSql { ...@@ -15,6 +15,8 @@ export class NativeSql {
return sql_val; return sql_val;
} }
/** /**
* 获取推荐货位 * 获取推荐货位
* @param pmguid 品名主键 * @param pmguid 品名主键
......
...@@ -39,6 +39,11 @@ class WzcrkmxModel { ...@@ -39,6 +39,11 @@ class WzcrkmxModel {
Logger.info('splsplspl>>',sql) Logger.info('splsplspl>>',sql)
return await SQLiteContext.with(WzcrkmxDao).updateWcztBySql(sql) return await SQLiteContext.with(WzcrkmxDao).updateWcztBySql(sql)
} }
// 获取推荐货位
async queryRecommendHw(data) {
let res = await SQLiteContext.with(WzcrkmxDao).queryRecommendHw(data.pmguid, data.kfdm)
return res
}
// 清空表 // 清空表
async clear() { async clear() {
await SQLiteContext.with(WzcrkmxDao).clearTable() await SQLiteContext.with(WzcrkmxDao).clearTable()
......
...@@ -9,6 +9,8 @@ import { pzForm } from './action' ...@@ -9,6 +9,8 @@ import { pzForm } from './action'
import { WzScanInfoDialog } from './Dialog/WzScanInfoDialog'; import { WzScanInfoDialog } from './Dialog/WzScanInfoDialog';
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 wzcrkmxModel from '../../../model/WzcrkmxModel';
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
...@@ -41,6 +43,12 @@ export struct WzInfo { ...@@ -41,6 +43,12 @@ export struct WzInfo {
@ObjectLink wzcrk: WzClass @ObjectLink wzcrk: WzClass
getDetail: (wzpm?: string) => void getDetail: (wzpm?: string) => void
// 在自定义组件即将析构销毁时将dialogController置空
aboutToDisappear() {
this.scanInfoDialog = undefined // 将dialogController置空
}
@Builder container() { @Builder container() {
Column() { Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) { Flex({ justifyContent: FlexAlign.SpaceBetween }) {
...@@ -153,10 +161,90 @@ export struct WzInfo { ...@@ -153,10 +161,90 @@ export struct WzInfo {
* @description: 扫码解析 * @description: 扫码解析
*/ */
async handleanalysisQrCode(value) { async handleanalysisQrCode(value) {
console.log("扫码校验", "handleanalysisQrCode:" + value) this.isAutomation = false
if (this.scanInfoDialog != undefined) {
this.scanInfoDialog.open()
}
const res = await analysisQrCode(value, false) const res = await analysisQrCode(value, false)
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
console.log("解析货位", JSON.stringify(res.data)) console.log("解析货位", JSON.stringify(res.data))
//1. 获取默认货位
this.handleGetDefaultHwh(res)
// 2.检验基础数据
if (res.data.length == 0) {
Prompt.showToast({
message: '请检查基础数据是否完善'
})
return
}
// 无货位
// if (!this.wzcrk.hwh && !res.data[0].hwh) {
// Prompt.showToast({
// message: '请优先扫描货位'
// })
// return
// }
// 如果没有货位:
// if (!this.pzFrom.hwh && res.data[0].hwh) {
// // if (this.pageType == '倒库') {
// const hwParams = {
// kfdm: this.pzFrom.kfdm,
// hwh: res.data[0].hwh,
// hjguid: res.data[0].hjguid
// }
// // console.log('this.currentModel', this.currentModel, this.pzFrom)
// if (this.pageType == '倒库') {
// if (this.currentModel) {
// hwParams.kfdm = this.pzFrom.kfdm
// } else {
// hwParams.kfdm = this.pzFrom.rkkfdm
// }
// } else {
// hwParams.kfdm = this.pzFrom.kfdm
// }
// const testHwForKf = await selectInformationType("GY_M_PMV3",
// testHwWzSql(hwParams))
// if (testHwForKf.length == 0) {
// Prompt.showToast({
// message: '当前库房不存在' + res.data[0].hwh + '货位'
// })
// return
// }
// // }
// this.pzFrom.hwh = res.data[0].hwh
// this.pzFrom.hjguid = res.data[0].hjguid
// this.currentHwh = res.data[0].hwh
// Prompt.showToast({
// message: '当前货位:' + res.data[0].hwh,
// })
// return
// }
}
}
handleGetDefaultHwh(res) {
try {
var defaultArr = []
res.data.forEach(async (item, index) => {
const defaultParams = {
kfdm: this.wzcrk.kfdm,
pmguid: item.pmdm
}
// 获取推荐货位
const defaultData = await wzcrkmxModel.queryRecommendHw(defaultParams)
defaultArr = defaultArr.concat(defaultData)
const last = res.data.length - 1
if (index == last) {
Logger.info(this, 'defaultArr-------', JSON.stringify(defaultArr))
this.defaultArr = defaultArr
}
})
} catch (e) {
Prompt.showToast({
message: '获取默认货位失败'
})
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论