Commit 66eef2b5 by 陈桂东

物资代码同步

parent a2a8d316
import { WzdmDao, SQLiteContext, Wzdm, Bzhx } from '@ohos/common'
import { isEmpty, uuid } from '@ohos/common/src/main/ets/utils/util'
// 物资代码
class WzdmModel {
// 添加物资代码
async set(data: Bzhx[]) {
const copyData = data.map(v => {
return {
guid: uuid(),
drxh: isEmpty(v.xh),
dmlbbm: isEmpty(),
dmlbmc: isEmpty(),
wzdm: isEmpty(),
hxdm:isEmpty(v.pmdmTen),
fldm: isEmpty(),
lsm: isEmpty(v.pmdmTen.slice(0, 6)),
sfdel: isEmpty(),
hxlbbsm: isEmpty(),
}
})
await SQLiteContext.with(WzdmDao).batchInsert(copyData)
}
// 查询物资代码
async query(lsm?: string): Promise<Wzdm[]> {
let res = await SQLiteContext.with(WzdmDao).selectWZDM(lsm)
return res;
}
// 清空表
async clear() {
await SQLiteContext.with(WzdmDao).clearTable()
}
}
const wzdmModel = new WzdmModel()
export default wzdmModel
\ No newline at end of file
......@@ -16,6 +16,7 @@ import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
import wzcrkModel from '../../../model/WzcrkModel'
import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl'
import bgglModel from '../../../model/BgglModel'
import wzdmModel from '../../../model/WzdmModel'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
......@@ -86,6 +87,8 @@ export struct Pmhx {
// 添加品名
await bzhxModal.set(allData)
await wzdmModel.set(allData)
// 获取基础信息
const baseRes = await getBaseList({ dwguid: this.dwguid })
const { bzdw, ckkfList, ddwAndJw, hjList, hwList, qyList} = JSON.parse(baseRes)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论