Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
bcacdcb7
Commit
bcacdcb7
authored
Jan 26, 2024
by
huangqy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新列表的值
parent
8060334d
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
143 行增加
和
17 行删除
+143
-17
RecommendHwDto.ts.ets
common/src/main/ets/bean/dto/RecommendHwDto.ts.ets
+13
-0
WzcrkDao.ets
common/src/main/ets/db/dao/WzcrkDao.ets
+37
-0
WzcrkmxDao.ets
common/src/main/ets/db/dao/WzcrkmxDao.ets
+1
-1
NativeSql.ets
common/src/main/ets/db/sql/NativeSql.ets
+5
-0
WzcrkModel.ets
entry/src/main/ets/model/WzcrkModel.ets
+7
-0
WzInfo.ets
entry/src/main/ets/pages/metailmange/Common/WzInfo.ets
+30
-11
Wzcrk.data.ets
entry/src/main/ets/pages/metailmange/Common/Wzcrk.data.ets
+45
-0
WzList.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzList.ets
+2
-2
WzinDetail.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzinDetail.ets
+1
-1
WzInvDetail.ets
entry/src/main/ets/pages/metailmange/WzInvPage/WzInvDetail/WzInvDetail.ets
+1
-1
WzOutDetail.ets
entry/src/main/ets/pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail.ets
+1
-1
没有找到文件。
common/src/main/ets/bean/dto/RecommendHwDto.ts.ets
View file @
bcacdcb7
...
...
@@ -49,4 +49,16 @@ export interface CommonHxPzMxDto {
hwh: string,
mxguid: string,
pzmxguid: string
}
export interface PzMxDto {
wzpm: string,
pmdmsix: string,
pmdmcode: string,
hxmc: string,
pzsl: number,
crksl: number,
hwh: string,
mxguid: string,
pzmxguid: string
}
\ No newline at end of file
common/src/main/ets/db/dao/WzcrkDao.ets
View file @
bcacdcb7
import relationalStore from '@ohos.data.relationalStore';
import { PzMxDto } from '../../bean/dto/RecommendHwDto.ts';
import { WzcrkDetailDto } from '../../bean/dto/WzcrkMxRefWzDto';
import { Wzcrk } from '../../entity/Wzcrk';
import { Wzcrkmx } from '../../entity/Wzcrkmx';
...
...
@@ -202,4 +203,39 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
}
return items;
}
async getPzMx(params): Promise<PzMxDto[]> {
try {
let val_sql = NativeSql.getPzMxSql(params);
Logger.info(this, '---getPzMx---' + val_sql)
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toPzMx(rs))
} while (rs.goToNextRow())
}
Logger.info(this, 'queryAll items22=' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toPzMx(cursor: relationalStore.ResultSet): PzMxDto {
let info: PzMxDto = {
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;
}
}
\ No newline at end of file
common/src/main/ets/db/dao/WzcrkmxDao.ets
View file @
bcacdcb7
...
...
@@ -5,7 +5,7 @@ import { Table } from '../decorator/Decorators';
import { Logger } from '../../utils/Logger';
import { NativeSql } from '../sql/NativeSql';
import { WzcrkDetailDto, WzcrkMxRefWzDto } from '../../bean/dto/WzcrkMxRefWzDto';
import { CommonHxPzMxDto, PzMxItemDto, RecommendHwDto, TestHwWzDto } from '../../bean/dto/RecommendHwDto.ts';
import { CommonHxPzMxDto, PzMx
Dto, PzMx
ItemDto, RecommendHwDto, TestHwWzDto } from '../../bean/dto/RecommendHwDto.ts';
/**
...
...
common/src/main/ets/db/sql/NativeSql.ets
View file @
bcacdcb7
...
...
@@ -106,6 +106,11 @@ WHERE
`insert into tab_bzgl_knzy_app_hwb (guid, hwh, pmdmcode, hwsl, hjguid, hwzt) values ('${params.guid}', '${params.hwh}', '${params.pmdmcode}', '${params.hwsl}', '${params.hjguid}','11111111SF1')`
return sql
}
// -- -- - 物资列表详情
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)`
return sql
}
/**
* 包裹管理表
...
...
entry/src/main/ets/model/WzcrkModel.ets
View file @
bcacdcb7
...
...
@@ -83,6 +83,13 @@ class WzcrkModel {
return res;
}
// 物资列表详情
async getPzMx(params) {
let res = await SQLiteContext.with(WzcrkDao).getPzMx(params)
Logger.info(this, JSON.stringify(res))
return res
}
// 清空表
async clear() {
...
...
entry/src/main/ets/pages/metailmange/Common/WzInfo.ets
View file @
bcacdcb7
...
...
@@ -3,7 +3,7 @@ import { Logger } from '@ohos/common';
import gldwModel from '../../../model/GldwModel';
import kfModel from '../../../model/KfModel';
import { DividerTitle } from '../../../view/DividerTitle/DividerTitle';
import { PzFormClass, ScanWzClass, WzClass, WzmxClass } from './Wzcrk.data';
import {
historicalInformationClass,
PzFormClass, ScanWzClass, WzClass, WzmxClass } from './Wzcrk.data';
import { WzList } from '../WzInPage/WzinDetail/WzList';
import { WzScanInfoDialog } from './Dialog/WzScanInfoDialog';
import { analysisQrCode } from '../../../identify/analysis/analysis_QR_code'
...
...
@@ -11,6 +11,8 @@ import emitter from '@ohos.events.emitter';
import Prompt from '@system.prompt';
import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import { PzMxDto } from '@ohos/common/src/main/ets/bean/dto/RecommendHwDto.ts';
import wzcrkModel from '../../../model/WzcrkModel';
@Extend(Button) function CommonButtonStyle() {
...
...
@@ -35,7 +37,7 @@ export struct WzInfo {
@State isHaveButton: boolean = false // 完成状态, 未完成是true, 其他false
@State isAutomation: boolean = true //控制扫描提示显示隐藏
@State pzxqGuild: string = '' //当前凭证guid
@State historicalInformation:
Wzmx
Class[] = [] //物资数据
@State historicalInformation:
historicalInformation
Class[] = [] //物资数据
@State currentPmdmcode: string = '' //当前扫描pmdm10位
@State defaultHwh: string = this.convertionDefaultHwh()
...
...
@@ -58,11 +60,6 @@ export struct WzInfo {
})
private searchcontroller: SearchController = new SearchController()
// 在自定义组件即将析构销毁时将dialogController置空
aboutToDisappear() {
this.scanInfoDialog = undefined // 将dialogController置空
}
@Builder container() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
...
...
@@ -137,6 +134,12 @@ export struct WzInfo {
this.scanCodeListen();
}
// 在自定义组件即将析构销毁时将dialogController置空
aboutToDisappear() {
this.scanInfoDialog = undefined // 将dialogController置空
}
scanCodeListen() {
var innerEvent = { eventId: 3 }
emitter.on(innerEvent, (eventQRData) => {
...
...
@@ -149,13 +152,17 @@ export struct WzInfo {
}
async getData() {
Logger.info(">>>>>>>>>>>>>>>PAGETYPE:", this.pageType)
// 获取收物单位
const res1 = await gldwModel.queryByData({ dwdm: this.wzcrk.sfdw })
this.currentDw = res1[0].dwfh ?? ''
// 获取库房名称
const res = await kfModel.query({ guid: this.wzcrk.kfguid })
this.kfmc = res[0].kfmc ?? ''
const pzmxRes = await wzcrkModel.getPzMx({guid : this.wzcrk.guid})
pzmxRes.forEach((element) => {
this.historicalInformation.push(new historicalInformationClass(element))
})
}
/***
...
...
@@ -263,6 +270,19 @@ export struct WzInfo {
}
// 扫描物资
if (res.data && res.data.length > 0) {
console.log(">>>>>>>>扫描物资>>>>>>>" + JSON.stringify(res.data))
let isNumber = false
res.data.forEach(element => {
if (/^\d+$/.test(element.srsl)) {// 判断扫描的物资的srsl一定是数字才会通过校验不是就报错
isNumber = true
}
});
if (!isNumber) {
Prompt.showToast({
message: '当前扫描的物资信息不完整',
})
return
}
res.data.forEach(async (ITEM) => {
if (this.dataType) {
// 单据导入
...
...
@@ -274,7 +294,7 @@ export struct WzInfo {
pmdmcode: ITEM.pmdmcode.slice(0, 6)
}
const pzData = await wzcrkmxModel.getPzMxItem(params, true)
console.log('pzData',
pzData
)
console.log('pzData',
JSON.stringify(pzData)
)
if (pzData.length == 0) {
Prompt.showToast({
// title: this.pageType + '导入的凭证中无扫描品种,不容许添加!',
...
...
@@ -397,7 +417,6 @@ export struct WzInfo {
})
}
})
console.log('this.historicalInformation', this.historicalInformation)
}
}
}
...
...
@@ -460,7 +479,7 @@ export struct WzInfo {
testPmdmCodeSql = this.historicalInformation.filter((item) => item.pmdmcode ==
filterInsrtData.pmdmcode && (item.hwh == '' || item.hwh == this.pzForm.hwh))
}
console.log('testPmdmCodeSql',
testPmdmCodeSql
, this.currentModel)
console.log('testPmdmCodeSql',
JSON.stringify(testPmdmCodeSql)
, this.currentModel)
if (testPmdmCodeSql && testPmdmCodeSql.length > 0) {
var update_crksl = 0
if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') {
...
...
entry/src/main/ets/pages/metailmange/Common/Wzcrk.data.ets
View file @
bcacdcb7
...
...
@@ -248,6 +248,51 @@ export class WzmxClass {
}
}
// 物资明细
@Observed
export class historicalInformationClass {
wzpm: string
pmdmsix: string
pmdmcode: string
hxmc: string
pzsl: number
crksl: number
hwh: string
mxguid: string
pzmxguid: string
currentModel?: boolean
constructor(data: {
wzpm: string
pmdmsix: string
pmdmcode: string
hxmc: string
pzsl: number
crksl: number
hwh: string
mxguid: string
pzmxguid: string
currentModel?: boolean
}) {
this.wzpm = data.wzpm
this.pmdmsix = data.pmdmsix
this.pmdmcode = data.pmdmcode
this.hxmc = data.hxmc
this.pzsl = data.pzsl
this.crksl = data.crksl
this.hwh = data.hwh
this.mxguid = data.mxguid
this.pzmxguid = data.pzmxguid
this.currentModel = data.currentModel || false
}
}
// 物资表单详情
@Observed
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzList.ets
View file @
bcacdcb7
import { WzmxClass } from '../../Common/Wzcrk.data'
import {
historicalInformationClass,
WzmxClass } from '../../Common/Wzcrk.data'
@Component
export struct WzList {
@ObjectLink wzmx:
Wzmx
Class
@ObjectLink wzmx:
historicalInformation
Class
build() {
Column() {
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzinDetail.ets
View file @
bcacdcb7
...
...
@@ -108,7 +108,7 @@ struct WzinDetail {
// pageType必传 入库 出库 盘库 调号 倒库 换位
// dataType必传 导入是true, 其他为false
// isHaveButton 必传 完成状态 未完成是true, 其他为false
WzInfo({
historicalInformation: this.wzmx,
wzcrk: this.wzcrk, getDetail: this.getWzmxList,
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getWzmxList,
pageType: "入库", pzForm: this.pzForm, dataType: this.isUpdate ? true : false, isHaveButton: this.wzcrk.wczt == '未完成' ? true : false})
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
...
...
entry/src/main/ets/pages/metailmange/WzInvPage/WzInvDetail/WzInvDetail.ets
View file @
bcacdcb7
...
...
@@ -85,7 +85,7 @@ struct WzInvDetail{
TabContent() {
Column() {
WzInfo({
historicalInformation: this.wzmx,
wzcrk: this.wzcrk, getDetail: this.getDetail })
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getDetail })
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
...
...
entry/src/main/ets/pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail.ets
View file @
bcacdcb7
...
...
@@ -92,7 +92,7 @@ struct WzOutDetail {
TabContent() {
Column() {
WzInfo({
historicalInformation: this.wzmx,
wzcrk: this.wzcrk, getDetail: this.getDetail, pageType: "出库" })
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getDetail, pageType: "出库" })
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论