Commit 8fb5c5a5 by 陈桂东

提交代码

parent 1f5f1fc6
import gldwModel from '../../../../model/GldwModel'
import kfModel from '../../../../model/KfModel'
import { renderPzlx, renderSzlx, renderZmlx, WzinClass } from '../Wzin.data'
@Component
// 物资信息
export struct PzInfo {
@State kfmc: string = ''
@State fwgldw: string = ''
@State swgldw: string = ''
@ObjectLink wzcrk: WzinClass
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false },
{ title: "凭证号", key: 'pzh', enabled: false },
{ title: "库房", key: 'kfguid', enabled: false },
{ title: "收支类型", key: 'pzszlx', enabled: false },
{ title: "运单号", key: 'ydh', enabled: true },
{ title: "发物管理单位", key: 'fwgldwdm', enabled: false },
{ title: "收物管理单位", key: 'swgldwdm', enabled: false },
{ title: "备注", key: 'dec', enabled: true }
]
aboutToAppear(){
this.getData()
}
async getData() {
const res = await kfModel.query({guid: this.wzcrk.kfguid})
this.kfmc = res[0].kfmc ?? ''
const res1 = await gldwModel.queryByData({dwdm:this.wzcrk.fwgldwdm})
this.fwgldw = res1[0].dwfh ?? ''
const res2 = await gldwModel.queryByData({dwdm:this.wzcrk.swgldwdm})
this.swgldw = res2[0].dwfh ?? ''
}
handleText(key: string): string {
switch (key) {
case 'pzlx':
return renderPzlx(this.wzcrk.pzlx)
case 'pzszlx':
return renderSzlx(this.wzcrk.pzszlx)
case 'zmlx':
return renderZmlx(this.wzcrk.zmlx)
case 'kfguid':
return this.kfmc
case 'fwgldwdm':
return this.fwgldw
case 'swgldwdm':
return this.swgldw
default:
return String(this.wzcrk[key])
}
}
build(){
Column(){
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
Divider()
.vertical(true)
.height(14)
.strokeWidth(3)
.color('#19ac88')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Text("凭证信息")
.fontSize(16)
}.height('8%')
ForEach(this.arr,(item) => {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Text(item.title)
.fontSize(14)
.width("30%")
.height(40)
.fontColor($r("app.color.item_color_black"))
TextInput({ text: this.handleText(item.key) })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
.borderRadius(5)
.width("70%")
.height(40)
.padding(10)
.borderColor('#bcc5d7')
.borderWidth(1)
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled)
.onChange((value: string) => {
if(item.enabled) {
this.wzcrk[item.key] = value
}
})
}.padding("10vp")
})
}.backgroundColor('#fff')
}
}
\ No newline at end of file
...@@ -48,7 +48,7 @@ struct WzinDetail { ...@@ -48,7 +48,7 @@ struct WzinDetail {
const res = await wzcrkmxModel.query(this.wzcrk.guid, wzpm) const res = await wzcrkmxModel.query(this.wzcrk.guid, wzpm)
res.forEach(i => { res.forEach(i => {
// @ts-ignore // @ts-ignore
//this.wzmx.push(new WzmxClass(i)) this.wzmx.push(new WzmxClass(i))
}) })
Logger.info('接收到出入库物资明细信息>>', JSON.stringify(res)) Logger.info('接收到出入库物资明细信息>>', JSON.stringify(res))
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论