Commit b4767243 by huangqy

提交下

parent aea4e738
...@@ -44,8 +44,8 @@ export interface CommonHxPzMxDto { ...@@ -44,8 +44,8 @@ export interface CommonHxPzMxDto {
pmdmsix: string, pmdmsix: string,
pmdmcode: string, pmdmcode: string,
hxmc: string, hxmc: string,
pzsl: string, pzsl: number,
crksl: string, crksl: number,
hwh: string, hwh: string,
mxguid: string, mxguid: string,
pzmxguid: string pzmxguid: string
......
...@@ -361,12 +361,28 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> { ...@@ -361,12 +361,28 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
items.push(this.toCommonHxPzMx(rs)) items.push(this.toCommonHxPzMx(rs))
} while (rs.goToNextRow()) } while (rs.goToNextRow())
} }
Logger.info(this, 'queryAll items=' + JSON.stringify(items)) Logger.info(this, 'queryAll items9999=' + JSON.stringify(items))
return items; return items;
} catch (e) { } catch (e) {
throw new Error('[查询异常]|' + e) throw new Error('[查询异常]|' + e)
} }
} }
toCommonHxPzMx(cursor: relationalStore.ResultSet): CommonHxPzMxDto {
let info: CommonHxPzMxDto = {
wzpm: cursor.getString(cursor.getColumnIndex('wzpm')),
pmdmsix: cursor.getString(cursor.getColumnIndex('pmdmsix')),
pmdmcode: cursor.getString(cursor.getColumnIndex('pmdmcode')),
hxmc: cursor.getString(cursor.getColumnIndex('hxmc')),
pzsl: cursor.getLong(cursor.getColumnIndex('pzsl')),
crksl: cursor.getLong(cursor.getColumnIndex('crksl')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
mxguid: cursor.getString(cursor.getColumnIndex('mxguid')),
pzmxguid: cursor.getString(cursor.getColumnIndex('pzmxguid'))
};
return info;
}
async exportPageSql(params): Promise<TestHwWzDto[]>{ async exportPageSql(params): Promise<TestHwWzDto[]>{
try { try {
let val_sql = NativeSql.exportPageSql(params); let val_sql = NativeSql.exportPageSql(params);
...@@ -386,20 +402,7 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> { ...@@ -386,20 +402,7 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
} }
} }
toCommonHxPzMx(cursor: relationalStore.ResultSet): CommonHxPzMxDto {
let info: CommonHxPzMxDto = {
wzpm: cursor.getString(cursor.getColumnIndex('wzpm')),
pmdmsix: cursor.getString(cursor.getColumnIndex('pmdmsix')),
pmdmcode: cursor.getString(cursor.getColumnIndex('pmdmcode')),
hxmc: cursor.getString(cursor.getColumnIndex('hxmc')),
pzsl: cursor.getString(cursor.getColumnIndex('pzsl')),
crksl: cursor.getString(cursor.getColumnIndex('crksl')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
mxguid: cursor.getString(cursor.getColumnIndex('mxguid')),
pzmxguid: cursor.getString(cursor.getColumnIndex('pzmxguid'))
};
return info;
}
async insertWz(params) { async insertWz(params) {
try { try {
......
...@@ -83,18 +83,18 @@ WHERE ...@@ -83,18 +83,18 @@ WHERE
} }
// 查询物资明细是否含有对应物资数据 // 查询物资明细是否含有对应物资数据
static getPzMxItemSql(params, isPmSix): string { static getPzMxItemSql(params, isPmSix):string {
if (isPmSix) { if (isPmSix) {
return `select * from TAB_BZGL_KNZY_APP_WZCRKMX where wzcrkguid='${params.wzcrkguid}' and substr(PMDMCODE,1,6)='${params.pmdmcode}'` return `select * from TAB_BZGL_KNZY_APP_WZCRKMX where wzcrkguid=${isEmpty(params.wzcrkguid)} and substr(PMDMCODE,1,6)=${isEmpty(params.pmdmcode)}`
} else { } else {
return `select * from TAB_BZGL_KNZY_APP_WZCRKMX where wzcrkguid='${params.wzcrkguid}' and PMDMCODE='${params.pmdmcode}'` return `select * from TAB_BZGL_KNZY_APP_WZCRKMX where wzcrkguid=${isEmpty(params.wzcrkguid)} and PMDMCODE=${isEmpty(params.pmdmcode)}`
} }
} }
// 查询同号型 // 查询同号型
static getCommonHxPzMxSql(params): string { static getCommonHxPzMxSql(params):string {
// pmdm前6位 // pmdm前6位
return `select hx.wzpm wzpm, hx.pmdmsix pmdmsix,hx.pmdmten pmdmcode, hx.hxmc hxmc, mx.pzsl pzsl, mx.crksl crksl, mx.hwh hwh, mx.guid mxguid,mx.pzmxguid pzmxguid from tab_bzgl_knzy_app_wzcrk crk left join tab_bzgl_knzy_app_wzcrkmx mx on crk.GUID = mx.wzcrkguid left join tab_xtwh_jcsj_bzhx hx on mx.pmdmcode = hx.pmdmten where crk.guid = '${(params.guid)}' and hx.PMDMSIX= '${(params.pmdm)}' order by hx.PMDMSIX, hx.XH` return `select hx.wzpm wzpm, hx.pmdmsix pmdmsix,hx.pmdmten pmdmcode, hx.hxmc hxmc, mx.pzsl pzsl, mx.crksl crksl, mx.hwh hwh, mx.guid mxguid,mx.pzmxguid pzmxguid from tab_bzgl_knzy_app_wzcrk crk left join tab_bzgl_knzy_app_wzcrkmx mx on crk.GUID = mx.wzcrkguid left join tab_xtwh_jcsj_bzhx hx on mx.pmdmcode = hx.pmdmten where crk.guid = ${isEmpty(params.guid)} and hx.PMDMSIX= ${isEmpty(params.pmdm)} order by hx.PMDMSIX, hx.XH`
} }
// 出入盘库 // 出入盘库
...@@ -111,7 +111,7 @@ WHERE ...@@ -111,7 +111,7 @@ WHERE
} }
// -- -- - 物资列表详情 // -- -- - 物资列表详情
static getPzMxSql(params): string { static getPzMxSql(params): string {
const sql = `select * from (select hx.wzpm wzpm, hx.pmdmsix pmdmsix,hx.pmdmten pmdmcode, hx.hxmc hxmc, mx.pzsl pzsl, mx.crksl crksl, mx.hwh hwh, mx.guid mxguid ,mx.pzmxguid from tab_bzgl_knzy_app_wzcrk crk left join tab_bzgl_knzy_app_wzcrkmx mx on crk.GUID = mx.wzcrkguid left join tab_xtwh_jcsj_bzhx hx on mx.pmdmcode = hx.pmdmten where crk.guid = '${params.guid}' order by hx.PMDMSIX, hx.XH)` const sql = `select * from (select hx.wzpm wzpm, hx.pmdmsix pmdmsix,hx.pmdmten pmdmcode, hx.hxmc hxmc, mx.pzsl pzsl, mx.crksl crksl, mx.hwh hwh, mx.guid mxguid ,mx.pzmxguid from tab_bzgl_knzy_app_wzcrk crk left join tab_bzgl_knzy_app_wzcrkmx mx on crk.GUID = mx.wzcrkguid left join tab_xtwh_jcsj_bzhx hx on mx.pmdmcode = hx.pmdmten where crk.guid = ${isEmpty(params.guid)} order by hx.PMDMSIX, hx.XH)`
return sql return sql
} }
......
...@@ -5,7 +5,7 @@ import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk'; ...@@ -5,7 +5,7 @@ import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk';
import { WzInfo } from './WzInfo' import { WzInfo } from './WzInfo'
import { PzInfo } from '../WzInPage/WzinDetail/PzInfo' import { PzInfo } from '../WzInPage/WzinDetail/PzInfo'
import wzcrkmxModel from '../../../model/WzcrkmxModel'; import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { historicalInformationClass, PzFormClass, WzClass, WzmxClass } from './Wzcrk.data'; import { PzFormClass, WzClass, WzmxClass } from './Wzcrk.data';
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import wzcrkModel from '../../../model/WzcrkModel'; import wzcrkModel from '../../../model/WzcrkModel';
import { AddWzin } from '../WzInPage/WzinDetail/AddWzin' import { AddWzin } from '../WzInPage/WzinDetail/AddWzin'
...@@ -41,7 +41,6 @@ struct WzinDetail { ...@@ -41,7 +41,6 @@ struct WzinDetail {
@State pageType: string = '入库' @State pageType: string = '入库'
@State pzxqGuild: string = '' @State pzxqGuild: string = ''
@State wzcrk: WzClass = null // 物资出入库单据信息 @State wzcrk: WzClass = null // 物资出入库单据信息
@State historicalInformation: historicalInformationClass[] = [] // 物资出入库明细
@State pzForm: PzFormClass = null // 物资出入库表单详情 @State pzForm: PzFormClass = null // 物资出入库表单详情
@State flag: boolean = true @State flag: boolean = true
private controller: TabsController = new TabsController() private controller: TabsController = new TabsController()
...@@ -92,7 +91,7 @@ struct WzinDetail { ...@@ -92,7 +91,7 @@ struct WzinDetail {
} }
this.getWzFormDetail() this.getWzFormDetail()
this.getWzmxList() // this.getWzmxList()
this.scanCodeListen() this.scanCodeListen()
IdentifyService.openScanPort() IdentifyService.openScanPort()
} }
...@@ -104,14 +103,6 @@ struct WzinDetail { ...@@ -104,14 +103,6 @@ struct WzinDetail {
this.pzForm = new PzFormClass(res[0]) this.pzForm = new PzFormClass(res[0])
} }
// 获取物资列表详情信息
async getWzmxList(wzpm?) {
const pzmxRes = await wzcrkModel.getPzMx({ guid: this.wzcrk.guid })
pzmxRes.forEach((element) => {
this.historicalInformation.push(new historicalInformationClass(element))
})
Logger.info('接收到出入库物资明细信息>>', JSON.stringify(pzmxRes))
}
/*** /***
* @description: 保存 * @description: 保存
...@@ -227,8 +218,6 @@ struct WzinDetail { ...@@ -227,8 +218,6 @@ struct WzinDetail {
WzInfo({ WzInfo({
wzcrk: this.wzcrk, wzcrk: this.wzcrk,
pzForm: this.pzForm, pzForm: this.pzForm,
getDetail: this.getWzmxList,
historicalInformation: this.historicalInformation,
pageType: this.pageType, pageType: this.pageType,
dataType: this.dataType, dataType: this.dataType,
isHaveButton: this.isHaveButton isHaveButton: this.isHaveButton
...@@ -254,7 +243,6 @@ struct WzinDetail { ...@@ -254,7 +243,6 @@ struct WzinDetail {
Button("保存").CommonButtonStyle().width(['入库', '出库'].includes(this.pageType) ? '50%' : '90%') Button("保存").CommonButtonStyle().width(['入库', '出库'].includes(this.pageType) ? '50%' : '90%')
.onClick(async () => { .onClick(async () => {
try { try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
this.submit() this.submit()
} catch (e) { } catch (e) {
......
...@@ -11,6 +11,9 @@ import emitter from '@ohos.events.emitter'; ...@@ -11,6 +11,9 @@ import emitter from '@ohos.events.emitter';
import Prompt from '@system.prompt'; import Prompt from '@system.prompt';
import wzcrkmxModel from '../../../model/WzcrkmxModel'; import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util'; import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import promptAction from '@ohos.promptAction';
import wzcrkModel from '../../../model/WzcrkModel';
import xtpzInfoModel from '../../../model/XtpzInfoModel';
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
...@@ -44,7 +47,6 @@ export struct WzInfo { ...@@ -44,7 +47,6 @@ export struct WzInfo {
@State kfmc: string = '' @State kfmc: string = ''
@State rkkfmc: string = '' @State rkkfmc: string = ''
@ObjectLink wzcrk: WzClass @ObjectLink wzcrk: WzClass
getDetail: (wzpm?: string) => void
scanInfoDialog: CustomDialogController = new CustomDialogController({ scanInfoDialog: CustomDialogController = new CustomDialogController({
builder: WzScanInfoDialog({ builder: WzScanInfoDialog({
container: this.container, container: this.container,
...@@ -136,6 +138,8 @@ export struct WzInfo { ...@@ -136,6 +138,8 @@ export struct WzInfo {
// 页面初始化 // 页面初始化
aboutToAppear() { aboutToAppear() {
this.pzxqGuild = this.wzcrk.guid this.pzxqGuild = this.wzcrk.guid
// 获取物资明细信息
this.getMxDetailsData()
this.getData() this.getData()
this.scanCodeListen(); this.scanCodeListen();
} }
...@@ -143,7 +147,6 @@ export struct WzInfo { ...@@ -143,7 +147,6 @@ export struct WzInfo {
// 在自定义组件即将析构销毁时将dialogController置空 // 在自定义组件即将析构销毁时将dialogController置空
aboutToDisappear() { aboutToDisappear() {
this.scanInfoDialog = undefined // 将dialogController置空 this.scanInfoDialog = undefined // 将dialogController置空
Logger.info('Aaaaa>>', JSON.stringify(this.historicalInformation))
} }
scanCodeListen() { scanCodeListen() {
...@@ -169,6 +172,30 @@ export struct WzInfo { ...@@ -169,6 +172,30 @@ export struct WzInfo {
} }
} }
async getMxDetailsData() {
try {
const params = {
guid: this.pzxqGuild
}
const res = await wzcrkModel.getPzMx(params)
// 3.设置物资数据状态
if (res && res.length > 0) {
this.isAutomation = false
res.forEach(element => {
this.historicalInformation.push(new historicalInformationClass(element))
})
this.setDefaultActive()
} else {
this.isAutomation = true
this.historicalInformation = []
}
} catch (e) {
promptAction.showToast({
message: '获取明细信息失败'
})
}
}
/*** /***
* @description: 扫码解析 * @description: 扫码解析
*/ */
...@@ -438,8 +465,13 @@ export struct WzInfo { ...@@ -438,8 +465,13 @@ export struct WzInfo {
}) })
} }
this.currentPmdmcode = ITEM.pmdmcode this.currentPmdmcode = ITEM.pmdmcode
// @ts-ignore this.historicalInformation = []
this.historicalInformation = res res.forEach(element => {
this.historicalInformation.push(new historicalInformationClass(element))
})
res.forEach(i => {
Logger.info(this, '赋值成为了什么', JSON.stringify(i))
})
this.setDefaultActive() this.setDefaultActive()
callback && callback() callback && callback()
} catch (e) { } catch (e) {
...@@ -506,7 +538,7 @@ export struct WzInfo { ...@@ -506,7 +538,7 @@ export struct WzInfo {
} }
console.log("updateParams", JSON.stringify(updateParams)) console.log("updateParams", JSON.stringify(updateParams))
let s = await wzcrkmxModel.updateWzmx(updateParams) let s = await wzcrkmxModel.updateWzmx(updateParams)
console.log("updateParams执行成功或者失败:" + JSON.stringify(this.historicalInformation)) console.log("updateParams执行成功或者失败:" + s)
} else { } else {
var insert_crksl = 0 var insert_crksl = 0
if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') { if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') {
...@@ -1146,36 +1178,35 @@ export struct WzInfo { ...@@ -1146,36 +1178,35 @@ export struct WzInfo {
.width("100%") .width("100%")
Row() { Row() {
if (this.isAutomation) {
Column() {
Text("请扫描货位码").fontColor("#36a3c0").fontSize(24)
}.width("100%").height(480)
} else {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入品名名称', controller: this.searchcontroller }) if (this.isAutomation) {
.height(40) Column() {
.backgroundColor('#F5F5F5') Text("请扫描货位码").fontColor("#36a3c0").fontSize(24)
.placeholderColor(Color.Grey) }.width("100%").height(30)
.textAlign(TextAlign.Center) } else {
.placeholderFont({ size: 14, weight: 400 }) Search({ placeholder: '请输入品名名称', controller: this.searchcontroller })
.textFont({ size: 14, weight: 400 }) .height(40)
.width('75%') .backgroundColor('#F5F5F5')
.onSubmit((value: string) => { .placeholderColor(Color.Grey)
this.getDetail(value) .textAlign(TextAlign.Center)
}) .placeholderFont({ size: 14, weight: 400 })
.onChange((value: string) => { .textFont({ size: 14, weight: 400 })
.width('75%')
.onSubmit((value: string) => {
})
.onChange((value: string) => {
})
.margin({ left: 10 })
.borderRadius(5)
Button("查看状态").CommonButtonStyle().width("25%").margin({ left: 5, right: 5 }).onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzStatus', params: {
wzcrkguid: this.pzxqGuild,
pageType: this.pageType
}})
}) })
.margin({ left: 10 }) }
.borderRadius(5)
Button("查看状态").CommonButtonStyle().width("25%").margin({ left: 5, right: 5 }).onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzInPage/WzinDetail/WzStatus', params: {
// wzmx: this.historicalInformation
pageType: this.pageType,
wzcrkguid: this.pzxqGuild
} })
})
}.width("100%") }.width("100%")
}
}.padding({ top: 10, bottom: 10 }).width("100%") }.padding({ top: 10, bottom: 10 }).width("100%")
Column() { Column() {
......
...@@ -188,7 +188,6 @@ export struct WzStatus { ...@@ -188,7 +188,6 @@ export struct WzStatus {
existApp() { existApp() {
console.info('Click the callback in the blank area') console.info('Click the callback in the blank area')
} }
build() { build() {
Column() { Column() {
TitleBar({ title: "物资状态" }) TitleBar({ title: "物资状态" })
......
...@@ -85,7 +85,7 @@ struct WzInvDetail{ ...@@ -85,7 +85,7 @@ struct WzInvDetail{
TabContent() { TabContent() {
Column() { Column() {
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getDetail }) WzInfo({ wzcrk: this.wzcrk })
}.width("100%") }.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息')) }.tabBar(this.TabBuilder(1, '物资信息'))
} }
......
...@@ -92,7 +92,7 @@ struct WzOutDetail { ...@@ -92,7 +92,7 @@ struct WzOutDetail {
TabContent() { TabContent() {
Column() { Column() {
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getDetail, pageType: "出库" }) WzInfo({ wzcrk: this.wzcrk, pageType: "出库" })
}.width("100%") }.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息')) }.tabBar(this.TabBuilder(1, '物资信息'))
} }
......
...@@ -19,7 +19,7 @@ struct WzReversePage{ ...@@ -19,7 +19,7 @@ struct WzReversePage{
@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() { itemClick() {
router.pushUrl({url:'pages/order_detail/PzPourStoragePage'}) router.pushUrl({url:'pages/order_detail/PzPourStoragePage'})
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论