Commit 7fee8966 by 陈桂东

数据保存

parent f7c77630
...@@ -159,7 +159,9 @@ export class WzcrkDao extends BaseTable<Wzcrk> { ...@@ -159,7 +159,9 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
// wp.equalTo('CRKLX', crklx) // wp.equalTo('CRKLX', crklx)
// wp.orderByAsc('PZH'); // wp.orderByAsc('PZH');
for (const [key, value] of Object.entries(data)) { for (const [key, value] of Object.entries(data)) {
wp.equalTo(key, value) if(value) {
wp.equalTo(key, value)
}
} }
return this.query(wp, this.getTableColumns()); return this.query(wp, this.getTableColumns());
} }
......
...@@ -31,5 +31,5 @@ export interface Wzcrkmx { ...@@ -31,5 +31,5 @@ export interface Wzcrkmx {
/** /**
* 临时码 * 临时码
*/ */
// wzdm: string wzdm?: string
} }
\ No newline at end of file
...@@ -65,8 +65,8 @@ export struct WzInPage { ...@@ -65,8 +65,8 @@ export struct WzInPage {
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData)) Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = [] this.dataSource = []
// const res = await wzcrkModel.query({ crklx: "2", pzh: Number(this.pzh), wczt: this.wczt, sjlx: this.sjlx }) const res = await wzcrkModel.query({ crklx: "2", pzh: Number(this.pzh) , wczt: this.wczt, sjlx: this.currentIndex === 0 ? "导入" : "临时收物" })
const res = await wzcrkModel.query({ crklx: "2" }) // const res = await wzcrkModel.query({ crklx: "2" })
Logger.info('出入库数据>>:', JSON.stringify(res)) Logger.info('出入库数据>>:', JSON.stringify(res))
Logger.info('出入库数据长度>>:', JSON.stringify(res.length)) Logger.info('出入库数据长度>>:', JSON.stringify(res.length))
res.forEach(element => { res.forEach(element => {
...@@ -299,6 +299,7 @@ export struct WzInPage { ...@@ -299,6 +299,7 @@ export struct WzInPage {
.height(80) .height(80)
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
this.getWzcrkList()
}) })
Row() { Row() {
......
...@@ -162,11 +162,11 @@ export class WzmxClass { ...@@ -162,11 +162,11 @@ export class WzmxClass {
/** /**
* 工作年度 * 工作年度
*/ */
gznd: string // gznd: string
/** /**
* 品名代码 * 品名代码
*/ */
pmdmcode: string // pmdmcode: string
/** /**
* 凭证数量 * 凭证数量
*/ */
...@@ -210,8 +210,8 @@ export class WzmxClass { ...@@ -210,8 +210,8 @@ export class WzmxClass {
constructor(data: { constructor(data: {
guid?: string, guid?: string,
gznd: string, // gznd: string,
pmdmcode: string, // pmdmcode: string,
pzsl: number, pzsl: number,
crksl: number, crksl: number,
wzcrkguid: string, wzcrkguid: string,
...@@ -224,8 +224,8 @@ export class WzmxClass { ...@@ -224,8 +224,8 @@ export class WzmxClass {
wczt:string wczt:string
}) { }) {
this.guid = data.guid; this.guid = data.guid;
this.gznd = data.gznd; // this.gznd = data.gznd;
this.pmdmcode = data.pmdmcode; // this.pmdmcode = data.pmdmcode;
this.pzsl = data.pzsl; this.pzsl = data.pzsl;
this.crksl = data.crksl; this.crksl = data.crksl;
this.wzcrkguid = data.wzcrkguid; this.wzcrkguid = data.wzcrkguid;
......
...@@ -24,6 +24,7 @@ export struct WzInfo { ...@@ -24,6 +24,7 @@ export struct WzInfo {
@State sfdw: string = '' @State sfdw: string = ''
@State private wzmx: WzmxClass[] = [] @State private wzmx: WzmxClass[] = []
@ObjectLink wzcrk: WzinClass @ObjectLink wzcrk: WzinClass
getDetail: (wzpm?:string) => void
aboutToAppear(){ aboutToAppear(){
this.getData() this.getData()
...@@ -100,6 +101,7 @@ export struct WzInfo { ...@@ -100,6 +101,7 @@ export struct WzInfo {
.textFont({ size: 14, weight: 400 }) .textFont({ size: 14, weight: 400 })
.width('75%') .width('75%')
.onSubmit((value: string) => { .onSubmit((value: string) => {
this.getDetail(value)
}) })
.onChange((value: string) => { .onChange((value: string) => {
}) })
......
...@@ -43,30 +43,14 @@ struct WzinDetail { ...@@ -43,30 +43,14 @@ struct WzinDetail {
} }
// 获取凭证信息 // 获取凭证信息
async getDetail() { async getDetail(wzpm?) {
const res = await wzcrkmxModel.query(this.wzcrk.guid) this.wzmx = []
const res = await wzcrkmxModel.query(this.wzcrk.guid, wzpm)
res.forEach(i => { res.forEach(i => {
// @ts-ignore
this.wzmx.push(new WzmxClass(i)) this.wzmx.push(new WzmxClass(i))
}) })
Logger.info('接收到出入库物资明细信息>>', JSON.stringify(res)) Logger.info('接收到出入库物资明细信息>>', JSON.stringify(res))
// for (let index = 0; index < res.length; index++) {
// const element = res[index];
// const res1 = await bzhxModel.queryByCode(element.pmdmcode)
// Logger.info('查询到对应品名代码》》', JSON.stringify(res1))
// // @ts-ignore
// element.xh = res1.xh
// // @ts-ignore
// element.hxmc = res1.hxmc
// // @ts-ignore
// element.pmdmSix = res1.pmdmSix
// // @ts-ignore
// element.wzpm = res1.wzpm
// // @ts-ignore
// element.wczt = this.wzcrk.wczt
// // @ts-ignore
// this.wzmx.push(new WzmxClass(element))
// }
} }
@Builder TabBuilder(index: number, name: string) { @Builder TabBuilder(index: number, name: string) {
...@@ -96,7 +80,7 @@ struct WzinDetail { ...@@ -96,7 +80,7 @@ struct WzinDetail {
TabContent() { TabContent() {
Column() { Column() {
WzInfo({ wzmx: this.wzmx, wzcrk: this.wzcrk }) WzInfo({ wzmx: this.wzmx, wzcrk: this.wzcrk,getDetail:this.getDetail })
}.width("100%") }.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息')) }.tabBar(this.TabBuilder(1, '物资信息'))
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论