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
3ee1d9e0
Commit
3ee1d9e0
authored
Jan 22, 2024
by
陈桂东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据保存
parent
9521010d
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
101 行增加
和
9 行删除
+101
-9
GldwDao.ets
common/src/main/ets/db/dao/GldwDao.ets
+14
-0
KfInfoDao.ets
common/src/main/ets/db/dao/KfInfoDao.ets
+6
-3
WzcrkmxDao.ets
common/src/main/ets/db/dao/WzcrkmxDao.ets
+17
-0
GldwModel.ets
entry/src/main/ets/model/GldwModel.ets
+6
-0
KfModel.ets
entry/src/main/ets/model/KfModel.ets
+2
-2
WzcrkmxModel.ets
entry/src/main/ets/model/WzcrkmxModel.ets
+9
-0
Wzin.data.ets
entry/src/main/ets/pages/metailmange/WzInPage/Wzin.data.ets
+5
-1
PzInfo.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/PzInfo.ets
+32
-0
WzinDetail.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzinDetail.ets
+9
-2
Warehouse.ets
entry/src/main/ets/pages/sub_systemMaintenance/Warehouse/Warehouse.ets
+1
-1
没有找到文件。
common/src/main/ets/db/dao/GldwDao.ets
View file @
3ee1d9e0
...
@@ -58,4 +58,18 @@ export class GldwDao extends BaseTable<Gldw> {
...
@@ -58,4 +58,18 @@ export class GldwDao extends BaseTable<Gldw> {
}
}
return this.query(wp, this.getTableColumns());
return this.query(wp, this.getTableColumns());
}
}
/**
* 询管理单位列表
* @param 库房名称
*/
async queryByData(data:Partial<Gldw>): Promise<Gldw[]> {
let wp = this.getPredicates();
for (const [key, value] of Object.entries(data)) {
wp.equalTo(key,value)
}
wp.orderByAsc("DWDM");
return this.query(wp, this.getTableColumns());
}
}
}
common/src/main/ets/db/dao/KfInfoDao.ets
View file @
3ee1d9e0
...
@@ -48,10 +48,13 @@ export class KfInfoDao extends BaseTable<KfInfo> {
...
@@ -48,10 +48,13 @@ export class KfInfoDao extends BaseTable<KfInfo> {
* 查询库房列表
* 查询库房列表
* @param 库房名称
* @param 库房名称
*/
*/
async getKf(
kfmc: string
): Promise<KfInfo[]> {
async getKf(
data:Partial<KfInfo>
): Promise<KfInfo[]> {
let wp = this.getPredicates();
let wp = this.getPredicates();
if (kfmc) {
// if (kfmc) {
wp.like('KFMC', `%${kfmc}%`);
// wp.like('KFMC', `%${kfmc}%`);
// }
for (const [key, value] of Object.entries(data)) {
wp.equalTo(key,value)
}
}
wp.orderByAsc("KFDM");
wp.orderByAsc("KFDM");
return this.query(wp, this.getTableColumns());
return this.query(wp, this.getTableColumns());
...
...
common/src/main/ets/db/dao/WzcrkmxDao.ets
View file @
3ee1d9e0
...
@@ -128,4 +128,20 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
...
@@ -128,4 +128,20 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
wp.equalTo('WZCRKGUID', wzcrkguid)
wp.equalTo('WZCRKGUID', wzcrkguid)
return this.query(wp, this.getTableColumns());
return this.query(wp, this.getTableColumns());
}
}
/**
* 更新单据状态
*/
async updateWcztmxByData(guid: string, data: Partial<Wzcrkmx>): Promise<number> {
const valueBucket = {
// "wczt": wczt
};
for (const [key, value] of Object.entries(data)) {
valueBucket[key] = value
}
let wp = this.getPredicates()
wp.equalTo('guid', guid)
return this.updateData(valueBucket, wp)
}
}
}
\ No newline at end of file
entry/src/main/ets/model/GldwModel.ets
View file @
3ee1d9e0
...
@@ -14,6 +14,12 @@ class GldwModel {
...
@@ -14,6 +14,12 @@ class GldwModel {
return res;
return res;
}
}
// 查询管理单位
async queryByData(data:Partial<Gldw>): Promise<Gldw[]> {
let res = await SQLiteContext.with(GldwDao).queryByData(data)
return res;
}
// 清空表
// 清空表
async clear() {
async clear() {
await SQLiteContext.with(GldwDao).clearTable()
await SQLiteContext.with(GldwDao).clearTable()
...
...
entry/src/main/ets/model/KfModel.ets
View file @
3ee1d9e0
...
@@ -8,8 +8,8 @@ class KfModel {
...
@@ -8,8 +8,8 @@ class KfModel {
}
}
// 查询库房
// 查询库房
async query(
kfmc? : string
): Promise<KfInfo[]> {
async query(
data: Partial<KfInfo>
): Promise<KfInfo[]> {
let res = await SQLiteContext.with(KfInfoDao).getKf(
kfmc
)
let res = await SQLiteContext.with(KfInfoDao).getKf(
data
)
return res;
return res;
}
}
...
...
entry/src/main/ets/model/WzcrkmxModel.ets
View file @
3ee1d9e0
...
@@ -13,11 +13,19 @@ class WzcrkmxModel {
...
@@ -13,11 +13,19 @@ class WzcrkmxModel {
return res;
return res;
}
}
// 更新单据信息
async updateWcztmxByData(guid: string, data: Partial<Wzcrkmx>):Promise<number> {
let res = await SQLiteContext.with(WzcrkmxDao).updateWcztmxByData(guid, data)
return res;
}
// 清空表
// 清空表
async clear() {
async clear() {
await SQLiteContext.with(WzcrkmxDao).clearTable()
await SQLiteContext.with(WzcrkmxDao).clearTable()
}
}
}
}
const wzcrkmxModel = new WzcrkmxModel()
const wzcrkmxModel = new WzcrkmxModel()
export default wzcrkmxModel
export default wzcrkmxModel
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzInPage/Wzin.data.ets
View file @
3ee1d9e0
import { pzlx_dict, szlx_dict,new_zmlx_dict } from '@ohos/common'
import { pzlx_dict, szlx_dict,new_zmlx_dict
, Logger
} from '@ohos/common'
@Observed
@Observed
export class WzinClass {
export class WzinClass {
guid?: string
guid?: string
...
@@ -247,16 +247,19 @@ export class WzmxClass {
...
@@ -247,16 +247,19 @@ export class WzmxClass {
// 凭证类型
// 凭证类型
export function renderPzlx(pzlx) {
export function renderPzlx(pzlx) {
Logger.info('szlx>>', pzlx)
const res = pzlx_dict.find(v => v.value == pzlx)
const res = pzlx_dict.find(v => v.value == pzlx)
return res ? res.text : ''
return res ? res.text : ''
}
}
// 收支类型
// 收支类型
export function renderSzlx(szlx) {
export function renderSzlx(szlx) {
Logger.info('szlx>>', szlx)
const res = szlx_dict.find(v => v.value == szlx)
const res = szlx_dict.find(v => v.value == szlx)
return res ? res.text : ''
return res ? res.text : ''
}
}
// 账目类型
// 账目类型
export function renderZmlx(zmlx) {
export function renderZmlx(zmlx) {
Logger.info('szlx>>', zmlx)
const res = new_zmlx_dict.find(v => v.value == zmlx)
const res = new_zmlx_dict.find(v => v.value == zmlx)
return res ? res.text : ''
return res ? res.text : ''
}
}
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/PzInfo.ets
View file @
3ee1d9e0
import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk'
import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk'
import gldwModel from '../../../../model/GldwModel'
import kfModel from '../../../../model/KfModel'
import { renderPzlx, renderSzlx, renderZmlx, WzinClass } from '../Wzin.data'
import { renderPzlx, renderSzlx, renderZmlx, WzinClass } from '../Wzin.data'
@Component
@Component
// 物资信息
// 物资信息
export struct PzInfo {
export struct PzInfo {
@State kfmc: string = ''
@State fwgldw: string = ''
@State swgldw: string = ''
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false },
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false },
{ title: "凭证号", key: 'pzh', enabled: false },
{ title: "凭证号", key: 'pzh', enabled: false },
{ title: "库房", key: 'kfguid', enabled: false },
{ title: "库房", key: 'kfguid', enabled: false },
...
@@ -13,6 +19,21 @@ export struct PzInfo {
...
@@ -13,6 +19,21 @@ export struct PzInfo {
{ title: "备注", key: 'dec', enabled: true }
{ 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 ?? ''
}
@ObjectLink wzcrk: WzinClass
@ObjectLink wzcrk: WzinClass
handleText(key: string): string {
handleText(key: string): string {
...
@@ -26,6 +47,15 @@ export struct PzInfo {
...
@@ -26,6 +47,15 @@ export struct PzInfo {
case 'zmlx':
case 'zmlx':
return renderZmlx(this.wzcrk.zmlx)
return renderZmlx(this.wzcrk.zmlx)
case 'kfguid':
return this.kfmc
case 'fwgldwdm':
return this.fwgldw
case 'swgldwdm':
return this.swgldw
default:
default:
return String(this.wzcrk[key])
return String(this.wzcrk[key])
}
}
...
@@ -52,7 +82,9 @@ export struct PzInfo {
...
@@ -52,7 +82,9 @@ export struct PzInfo {
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled)
.enabled(item.enabled)
.onChange((value: string) => {
.onChange((value: string) => {
if(item.enabled) {
this.wzcrk[item.key] = value
this.wzcrk[item.key] = value
}
})
})
}.padding("10vp")
}.padding("10vp")
})
})
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/WzinDetail.ets
View file @
3ee1d9e0
...
@@ -113,14 +113,21 @@ struct WzinDetail {
...
@@ -113,14 +113,21 @@ struct WzinDetail {
try {
try {
Logger.info('保存的入库数据>>', JSON.stringify(this.wzcrk))
Logger.info('保存的入库数据>>', JSON.stringify(this.wzcrk))
Logger.info('保存的入库明细数据>>', JSON.stringify(this.wzmx))
await wzcrkModel.updateWcztByData(this.wzcrk.guid, { dec: this.wzcrk.dec, ydh: this.wzcrk.ydh })
await wzcrkModel.updateWcztByData(this.wzcrk.guid, { dec: this.wzcrk.dec, ydh: this.wzcrk.ydh })
for (let index = 0; index < this.wzmx.length; index++) {
const element = this.wzmx[index];
await wzcrkmxModel.updateWcztmxByData(element.guid, {crksl:element.crksl})
}
promptAction.showToast({
promptAction.showToast({
message: '保存入库数据成功',
message: '保存入库数据成功',
bottom: 200
bottom: 200
})
})
setTimeout(() => {
setTimeout(() => {
router.
push
Url({ url: 'pages/metailmange/WzInPage/WzInPage' })
router.
replace
Url({ url: 'pages/metailmange/WzInPage/WzInPage' })
},
10
00)
},
5
00)
}catch (e) {
}catch (e) {
promptAction.showToast({
promptAction.showToast({
message: '保存入库数据失败',
message: '保存入库数据失败',
...
...
entry/src/main/ets/pages/sub_systemMaintenance/Warehouse/Warehouse.ets
View file @
3ee1d9e0
...
@@ -16,7 +16,7 @@ export struct Warehouse {
...
@@ -16,7 +16,7 @@ export struct Warehouse {
// 获取库房数据
// 获取库房数据
async getWarehouseList(kfmc?: string ) {
async getWarehouseList(kfmc?: string ) {
const res = await kfModel.query(
kfmc
)
const res = await kfModel.query(
{kfmc}
)
this.dataSource = res
this.dataSource = res
Logger.info(this, "库房数据>" + JSON.stringify(res));
Logger.info(this, "库房数据>" + JSON.stringify(res));
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论