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
f534b4ef
Commit
f534b4ef
authored
Jan 19, 2024
by
陈桂东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单据导入
parent
87a166c8
显示空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
655 行增加
和
61 行删除
+655
-61
index.ets
common/index.ets
+5
-0
BzhxDao.ets
common/src/main/ets/db/dao/BzhxDao.ets
+3
-2
GldwDao.ets
common/src/main/ets/db/dao/GldwDao.ets
+3
-2
WzcrkDao.ets
common/src/main/ets/db/dao/WzcrkDao.ets
+14
-0
WzcrkmxDao.ets
common/src/main/ets/db/dao/WzcrkmxDao.ets
+8
-1
Wzcrk.ts
common/src/main/ets/entity/Wzcrk.ts
+7
-1
dict.ets
common/src/main/ets/utils/dict.ets
+474
-0
BzhxModel.ets
entry/src/main/ets/model/BzhxModel.ets
+6
-6
GldwModel.ets
entry/src/main/ets/model/GldwModel.ets
+6
-6
HjModel.ets
entry/src/main/ets/model/HjModel.ets
+4
-4
HwModel.ets
entry/src/main/ets/model/HwModel.ets
+4
-4
KfModel.ets
entry/src/main/ets/model/KfModel.ets
+4
-4
QyModel.ets
entry/src/main/ets/model/QyModel.ets
+4
-4
WzcrkModel.ets
entry/src/main/ets/model/WzcrkModel.ets
+26
-0
WzcrkmxModel.ets
entry/src/main/ets/model/WzcrkmxModel.ets
+19
-0
WzInPage.ets
entry/src/main/ets/pages/metailmange/WzInPage.ets
+11
-0
DataSynchronism.ets
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
+27
-7
sync.api.ts
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/sync.api.ts
+6
-1
Pmhx.ets
entry/src/main/ets/pages/sub_systemMaintenance/Pmhx/Pmhx.ets
+6
-5
pmhxList.ets
entry/src/main/ets/pages/sub_systemMaintenance/Pmhx/pmhxList.ets
+10
-7
Unit.ets
entry/src/main/ets/pages/sub_systemMaintenance/Unit/Unit.ets
+6
-4
UnitList.ets
entry/src/main/ets/pages/sub_systemMaintenance/Unit/UnitList.ets
+2
-3
没有找到文件。
common/index.ets
View file @
f534b4ef
...
...
@@ -12,6 +12,8 @@ export {HwInfoDao} from './src/main/ets/db/dao/HwInfoDao';
export {BzhxDao} from './src/main/ets/db/dao/BzhxDao';
export {QyInfoDao} from './src/main/ets/db/dao/QyInfoDao';
export {KfInfoDao} from './src/main/ets/db/dao/KfInfoDao';
export {WzcrkDao} from './src/main/ets/db/dao/WzcrkDao';
export {WzcrkmxDao} from './src/main/ets/db/dao/WzcrkmxDao';
export {HwInfo} from './src/main/ets/entity/HwInfo'
export {Bzhx} from './src/main/ets/entity/Bzhx'
export {KfInfo} from './src/main/ets/entity/KfInfo'
...
...
@@ -22,3 +24,5 @@ export {WzdmDao} from './src/main/ets/db/dao/WzdmDao';
export {WzhxdmDao} from './src/main/ets/db/dao/WzhxdmDao';
export {Wzdm} from './src/main/ets/entity/Wzdm';
export {Wzhxdm} from './src/main/ets/entity/Wzhxdm';
export {Wzcrk} from './src/main/ets/entity/Wzcrk';
export {Wzcrkmx} from './src/main/ets/entity/Wzcrkmx';
\ No newline at end of file
common/src/main/ets/db/dao/BzhxDao.ets
View file @
f534b4ef
...
...
@@ -54,12 +54,12 @@ export class BzhxDao extends BaseTable<Bzhx> {
}
// 获取被装号型列表
async getBzhxList(pmdmsix: string): Promise<Bzhx[]> {
async getBzhxList(
offset: number,
pmdmsix: string): Promise<Bzhx[]> {
let wp = this.getPredicates();
if (pmdmsix) {
wp.equalTo('PMDMSIX', pmdmsix);
}
wp.orderByAsc('GUID');
wp.orderByAsc('GUID')
.offsetAs(offset).limitAs(20)
;
return this.query(wp, this.getTableColumns())
}
}
\ No newline at end of file
common/src/main/ets/db/dao/GldwDao.ets
View file @
f534b4ef
...
...
@@ -50,12 +50,12 @@ export class GldwDao extends BaseTable<Gldw> {
/**
* 查询管理单位列表
*/
getGldwList(
dwmc
: string): Promise<Gldw[]> {
getGldwList(
offset: number, dwmc?
: string): Promise<Gldw[]> {
let wp = this.getPredicates();
if (dwmc) {
wp.like('DWFH', `%${dwmc}%`)
}
wp.orderByAsc('DWDM');
wp.orderByAsc('DWDM')
.offsetAs(offset).limitAs(20)
;
return this.query(wp, this.getTableColumns());
}
}
\ No newline at end of file
common/src/main/ets/db/dao/WzcrkDao.ets
View file @
f534b4ef
import relationalStore from '@ohos.data.relationalStore';
import { Wzcrk } from '../../entity/Wzcrk';
import { Wzcrkmx } from '../../entity/Wzcrkmx';
import { Logger } from '../../utils/Logger';
import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators';
...
...
@@ -115,4 +117,15 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
predicates.equalTo('guid',wzcrkguid)
return this.update(item,predicates)
}
async getWzcrk(crklx: string, pzh?: number): Promise<Wzcrk[]> {
let wp = this.getPredicates();
if (pzh) {
wp.equalTo('PZH', pzh)
}
wp.equalTo('CRKLX', crklx)
wp.orderByAsc('PZH');
return this.query(wp, this.getTableColumns());
}
}
\ No newline at end of file
common/src/main/ets/db/dao/WzcrkmxDao.ets
View file @
f534b4ef
...
...
@@ -2,7 +2,7 @@ import relationalStore from '@ohos.data.relationalStore';
import { Wzcrkmx } from '../../entity/Wzcrkmx';
import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators';
import { Logger } from '../utils/Logger';
import { Logger } from '../
../
utils/Logger';
/**
...
...
@@ -122,4 +122,10 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
Logger.info(this, 'queryAll items=' + JSON.stringify(items))
return items;
}
async getWzcrkmx(wzcrkguid: string): Promise<Wzcrkmx[]> {
let wp = this.getPredicates();
wp.equalTo('WZCRKGUID', wzcrkguid)
return this.query(wp, this.getTableColumns());
}
}
\ No newline at end of file
common/src/main/ets/entity/Wzcrk.ts
View file @
f534b4ef
/**
* 物资出入库信息
*/
import
{
Wzcrkmx
}
from
'./Wzcrkmx'
;
export
interface
Wzcrk
{
guid
?:
string
,
/**
...
...
@@ -98,5 +99,9 @@ export interface Wzcrk {
/**
* 备注
*/
dec
:
string
dec
:
string
,
/**
* 物资出入库明细
*/
jhmx
?:
Wzcrkmx
[]
}
\ No newline at end of file
common/src/main/ets/utils/dict.ets
0 → 100644
View file @
f534b4ef
/*
* @Description: 字典数据
*/
// ----------------------------------------- 账目类型_字典 -----------------------------------------
const zmlx_dict = [{
id: 1,
text: '正常供应被装账',
value: '111111ZMLX11'
},
{
id: 2,
text: '战略储备被装预计账',
value: '111111ZMLX1401'
},
{
id: 3,
text: '战役储备被装预计账',
value: '111111ZMLX1402'
},
{
id: 4,
text: '战术储备被装预计账',
value: '111111ZMLX1403'
},
{
id: 5,
text: '公用被装账',
value: '111111ZMLX13'
}
]
const new_zmlx_dict = [{
id: 1,
text: '正常供应被装账',
value: '11'
},
{
id: 2,
text: '战略储备被装预计账',
value: '01'
},
{
id: 3,
text: '战役储备被装预计账',
value: '02'
},
{
id: 4,
text: '战术储备被装预计账',
value: '03'
},
{
id: 5,
text: '公用被装账',
value: '13'
}
]
// ----------------------------------------- 物资状态_字典 -----------------------------------------
const military_depot_dict = [{
id: 1,
text: '未完成',
value: 0
},
{
id: 2,
text: '已完成',
value: 1
},
{
id: 3,
text: '完成已绑定',
value: 2
},
{
id: 4,
text: '完成未绑定',
value: 3
}
]
// ----------------------------------------- 出入库类型_字典 -----------------------------------------
const crklx_dict = [{
id: 1,
text: '出库',
lxdm: 1,
guid: '11111CRKLX1'
},
{
id: 2,
text: '入库',
lxdm: 2,
guid: '11111CRKLX2'
}, {
id: 3,
text: '盘库',
lxdm: 3,
guid: '11111CRKLX3'
}, {
id: 4,
text: '调号',
lxdm: 4,
guid: '11111CRKLX4'
}, {
id: 5,
text: '倒库',
lxdm: 5,
guid: '11111CRKLX5'
}, {
id: 6,
text: '换位',
lxdm: 6,
guid: '11111CRKLX6'
}
]
// ----------------------------------------- 凭证类型_字典 -----------------------------------------
const pzlx_dict = [{
id: 1,
text: '调号单',
value: 41,
type: 'thd'
},
{
id: 2,
text: '清库对账单',
value: 42,
type: 'pkd'
},
{
id: 3,
text: '调拨单',
value: 11,
type: 'wzth'
},
{
id: 4,
text: '收物单',
value: 14,
type: 'rkd'
},
{
id: 5,
text: '发物单',
value: 17,
type: 'ckd'
},
{
id: 6,
text: '倒库单',
value: 19,
type: 'rkd'
},
{
id: 7,
text: '价拨单',
value: 12,
type: 'ckd'
},
{
id: 8,
text: '物资换位',
value: 'HW44',
type: 'wzhw'
}
]
// ----------------------------------------- 收支类型_字典 -----------------------------------------
const szlx_dict = [{
id: 1,
text: '调出',
value: 'DC'
},
{
id: 2,
text: '调出(特殊情况)',
value: 'DC_SF'
},
{
id: 3,
text: '倒库',
value: 'DK'
},
{
id: 4,
text: '调入',
value: 'DR'
},
{
id: 5,
text: '发放',
value: 'FF'
},
{
id: 6,
text: '号型调换',
value: 'HXTH'
},
{
id: 7,
text: '结转',
value: 'JZ'
},
{
id: 8,
text: '零星购置',
value: 'LXGZ'
},
{
id: 9,
text: '清库对账',
value: 'QKDZ'
},
{
id: 10,
text: '其他收入',
value: 'QTSR'
},
{
id: 11,
text: '其他支出',
value: 'QTZC'
},
{
id: 12,
text: '新补',
value: 'XB'
},
{
id: 13,
text: '勋表生产',
value: 'XBSC'
},
{
id: 14,
text: '招标生产',
value: 'ZBSC'
},
{
id: 15,
text: '支出',
value: 'ZC'
},
{
id: 16,
text: '正常支出',
value: 'ZCZC'
}
]
// ----------------------------------------- 机器类型_字典 -----------------------------------------
const scanType = [{
id: 1,
text: '手持机终端',
value: 'barcodeScanner'
}, {
id: 2,
text: '手机APP终端',
value: 'phone'
}
// , {
// id: 3,
// text: '微信小程序',
// value: 'phone'
// },
]
// ----------------------------------------- 读取模式_字典 -----------------------------------------
const readType = [{
id: 1,
text: '激光扫描-ipk-sdk',
// text: '普华扫描模式(广播方式)',
value: 'sdk'
}, {
id: 2,
text: '激光扫描-ipk-sdk+射频扫描',
value: 'sdk+RFID'
}, {
id: 3,
text: '激光扫描-南京才华apk-sdk',
// text: '安卓扫描模式(广播方式)',
value: 'broadcast'
}, {
id: 4,
text: '激光扫描-南京才华apk-sdk+射频扫描',
value: 'broadcast+RFID'
}, {
id: 5,
text: '激光扫描-宁波均普apk-sdk',
value: 'Kolyp'
}, {
id: 6,
text: '激光扫描-宁波均普apk-sdk+射频扫描',
value: 'Kolyp+RFID'
}, {
id: 7,
text: '平板直连激光扫描-天创apk-sdk',
value: 'usbScan'
}]
// ----------------------------------------- 快递商家类型_字典 -----------------------------------------
const expressage = [{
id: 1,
text: '顺丰快递',
value: 'SF'
}, {
id: 2,
text: '邮政快递',
value: 'YZ'
}, {
id: 3,
text: '京东快递',
value: 'JD'
}, {
id: 4,
text: '自定义1快递',
value: 'WZ'
}, {
id: 5,
text: '自定义2快递',
value: 'JZWZ'
}]
// ----------------------------------------- _字典 -----------------------------------------
const userList = [{
id: 1,
text: '超级管理员',
value: 'admin',
isAdministrator: true, // 是否是管理员账户
userName: 'admin', // 管理员(用户名)
password: 'admin', // 管理员密码(用户密码)
}, {
id: 2,
text: '库管员',
value: 'kgy',
isAdministrator: false, // 是否是管理员账户
userName: '库管员', // 管理员(用户名)
password: '1', // 管理员密码(用户密码)
}]
const networkTypeList = [{
id: 1,
text: 'wifi 网络',
value: 'wifi'
},
{
id: 2,
text: '2g 网络',
value: '2g'
},
{
id: 3,
text: '3g 网络',
value: '3g'
},
{
id: 4,
text: '4g 网络',
value: '4g'
},
{
id: 5,
text: '5g 网络',
value: '5g'
},
{
id: 6,
text: '有线网络',
value: 'ethernet'
},
{
id: 7,
text: '内部网络',
value: 'unknown'
},
{
id: 8,
text: '无网络',
value: 'none'
},
]
const themeList = [{
id: 1,
text: '默认',
value: 'default'
}, {
id: 2,
text: '联勤保障',
value: 'lqbz'
}]
const gzndList = [{
id: 1,
text: '2018',
value: '2018'
}, {
id: 2,
text: '2019',
value: '2019'
}, {
id: 3,
text: '2020',
value: '2020'
}, {
id: 4,
text: '2021',
value: '2021'
}, {
id: 5,
text: '2022',
value: '2022'
}, {
id: 6,
text: '2023',
value: '2023'
}, {
id: 7,
text: '2024',
value: '2024'
}, {
id: 8,
text: '2025',
value: '2025'
}]
const pzlxList = [{
id: 1,
text: '调号单',
value: '111111PZLX41'
},
{
id: 2,
text: '清库对账单',
value: '111111PZLX42'
},
{
id: 3,
text: '调拨单',
value: '111111PZLX11'
},
{
id: 4,
text: '收物单',
value: '111111PZLX14'
},
{
id: 5,
text: '发物单',
value: '111111PZLX17'
},
{
id: 6,
text: '倒库单',
value: '111111PZLX19'
},
{
id: 7,
text: '价拨单',
value: '111111PZLX12'
}
]
// [{"dict":true,"guid":"1111PZZXZT1","id":"1","label":"正常","leaf":true,"level":0,"parentid":-1,"rootld":,"text":"正常"}"dict":true,"quid":111PZZXZT2","id’:2""label:"拒绝执行”,"leaf":true,"level":0, "parentid':1"."rootld":"2"."text":"拒绝执行"."SF":[{"dict":true,"guid":"11111111SF1","id":"1","label":是","leaf":true,"level":0,"parentld":"-1","rootld":"1","text":"是“).("dict":true,"guid":"11111111SF2","id":"O","label":"否","leaf";true,"level":0,"parentid":"-1"."rootld":"o","text":"否"’l),"status":200,"success":true
export {
zmlx_dict,
new_zmlx_dict,
military_depot_dict,
pzlx_dict,
szlx_dict,
scanType,
readType,
expressage,
userList,
networkTypeList,
themeList,
gzndList,
pzlxList
}
\ No newline at end of file
entry/src/main/ets/model/BzhxModel.ets
View file @
f534b4ef
...
...
@@ -2,7 +2,7 @@ import { uuid } from '@ohos/common/src/main/ets/utils/util'
import { Wzdm, Wzhxdm,Bzhx,SQLiteContext, WzdmDao,WzhxdmDao, BzhxDao,Logger } from '@ohos/common'
// 被装号型
class BzhxMod
a
l {
class BzhxMod
e
l {
// 添加被装号型
async set(data: Bzhx[]) {
...
...
@@ -21,8 +21,8 @@ class BzhxModal {
}
// 查询被装号型
async query(pmdmsix? : string): Promise<Bzhx[]> {
let res = await SQLiteContext.with(BzhxDao).getBzhxList(pmdmsix)
async query(
offset: number,
pmdmsix? : string): Promise<Bzhx[]> {
let res = await SQLiteContext.with(BzhxDao).getBzhxList(
offset,
pmdmsix)
return res;
}
async queryLsm(lsm?: string):Promise<Wzdm[]> {
...
...
@@ -35,6 +35,6 @@ class BzhxModal {
}
}
const bzhxMod
al = new BzhxModa
l()
const bzhxMod
el = new BzhxMode
l()
export default bzhxModal
\ No newline at end of file
export default bzhxModel
\ No newline at end of file
entry/src/main/ets/model/GldwModel.ets
View file @
f534b4ef
import { Gldw, SQLiteContext,GldwDao } from '@ohos/common'
// 管理单位
class GldwMod
a
l {
class GldwMod
e
l {
// 添加管理单位
async set(data: Gldw[]) {
...
...
@@ -9,12 +9,12 @@ class GldwModal {
}
// 查询管理单位
async query(dwmc? : string): Promise<Gldw[]> {
let res = await SQLiteContext.with(GldwDao).getGldwList(dwmc)
async query(
offset:number,
dwmc? : string): Promise<Gldw[]> {
let res = await SQLiteContext.with(GldwDao).getGldwList(
offset,
dwmc)
return res;
}
}
const gldwMod
al = new GldwModa
l()
const gldwMod
el = new GldwMode
l()
export default gldwModal
\ No newline at end of file
export default gldwModel
\ No newline at end of file
entry/src/main/ets/model/HjModel.ets
View file @
f534b4ef
import { HjInfo, SQLiteContext, HjInfoDao } from '@ohos/common'
// 货架管理
class HjMod
a
l {
class HjMod
e
l {
// 添加货架
async set(data: HjInfo[]) {
await SQLiteContext.with(HjInfoDao).batchInsert(data)
...
...
@@ -14,6 +14,6 @@ class HjModal {
}
}
const hjMod
al = new HjModa
l()
const hjMod
el = new HjMode
l()
export default hjModal
\ No newline at end of file
export default hjModel
\ No newline at end of file
entry/src/main/ets/model/HwModel.ets
View file @
f534b4ef
import { HwInfo, SQLiteContext,HwInfoDao } from '@ohos/common'
// 货位管理
class HwMod
a
l {
class HwMod
e
l {
// 添加货位
async set(data: HwInfo[]) {
await SQLiteContext.with(HwInfoDao).batchInsert(data)
...
...
@@ -14,6 +14,6 @@ class HwModal {
}
}
const hwMod
al = new HwModa
l()
const hwMod
el = new HwMode
l()
export default hwModal
\ No newline at end of file
export default hwModel
\ No newline at end of file
entry/src/main/ets/model/KfModel.ets
View file @
f534b4ef
import { KfInfoDao, SQLiteContext,KfInfo } from '@ohos/common'
// 库房管理
class KfMod
a
l {
class KfMod
e
l {
// 添加库房
async set(data: KfInfo[]) {
await SQLiteContext.with(KfInfoDao).batchInsert(data)
...
...
@@ -14,6 +14,6 @@ class KfModal {
}
}
const kfMod
al = new KfModa
l()
const kfMod
el = new KfMode
l()
export default kfModal
\ No newline at end of file
export default kfModel
\ No newline at end of file
entry/src/main/ets/model/QyModel.ets
View file @
f534b4ef
import { QyInfo, SQLiteContext,QyInfoDao } from '@ohos/common'
// 区域管理
class QyMod
a
l {
class QyMod
e
l {
// 添加区域
async set(data: QyInfo[]) {
await SQLiteContext.with(QyInfoDao).batchInsert(data)
...
...
@@ -13,6 +13,6 @@ class QyModal {
return res;
}
}
const qyMod
al = new QyModa
l()
const qyMod
el = new QyMode
l()
export default qyModal
\ No newline at end of file
export default qyModel
\ No newline at end of file
entry/src/main/ets/model/WzcrkModel.ets
0 → 100644
View file @
f534b4ef
import { WzcrkmxDao, WzcrkDao, Wzcrk, Wzcrkmx, SQLiteContext } from '@ohos/common'
import wzcrkmxModel from './WzcrkmxModel';
// 物资出库入库
class WzcrkModel {
// 添加
async set(data: Wzcrk[]) {
for (let index = 0; index < data.length; index++) {
const wzcrk = data[index];
const wzcrkmx = data[index].jhmx;
await SQLiteContext.with(WzcrkDao).insert(wzcrk)
await wzcrkmxModel.set(wzcrkmx)
}
// await SQLiteContext.with(WzcrkDao).batchInsert(data)
}
// 查询
async query(crklx:string, pzh?: number): Promise<Wzcrk[]> {
let res = await SQLiteContext.with(WzcrkDao).getWzcrk(crklx)
return res;
}
}
const wzcrkModel = new WzcrkModel()
export default wzcrkModel
\ No newline at end of file
entry/src/main/ets/model/WzcrkmxModel.ets
0 → 100644
View file @
f534b4ef
import { WzcrkmxDao, WzcrkDao, Wzcrk, Wzcrkmx, SQLiteContext } from '@ohos/common'
// 物资出库入库
class WzcrkmxModel {
// 添加
async set(data: Wzcrkmx[]) {
await SQLiteContext.with(WzcrkmxDao).batchInsert(data)
}
// 查询
async query(wzcrkguid: string): Promise<Wzcrkmx[]> {
let res = await SQLiteContext.with(WzcrkmxDao).getWzcrkmx(wzcrkguid)
return res;
}
}
const wzcrkmxModel = new WzcrkmxModel()
export default wzcrkmxModel
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzInPage.ets
View file @
f534b4ef
...
...
@@ -3,6 +3,8 @@ import { BasicTable } from '../../view/BasicTable/BasicTable'
import router from '@ohos.router';
import { Demo } from '../../view/demo/demo';
import { BasicDialog } from '../../view/BasicDialog/BasicDialog';
import wzcrkModel from '../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
...
...
@@ -29,6 +31,15 @@ export struct WzInPage {
router.pushUrl({url:'pages/order_detail/PzInOutDetailPage'})
}
aboutToAppear(){
this.getWzcrkList()
}
async getWzcrkList(qzh?: number) {
const res = await wzcrkModel.query('2', qzh)
Logger.info('出入库数据>>:', JSON.stringify(res))
}
@Builder container() {
Column() {
Row() {
...
...
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
View file @
f534b4ef
...
...
@@ -3,7 +3,7 @@ import { TitleBar } from '../../../view/title/TitleBar'
import { TipDialog } from '../../../view/TipDialog/TipDialog'
import { ListDialog } from './ListDialog'
import { listData, IProductName } from './sync.data'
import { getPmList, getBaseList } from './sync.api'
import { getPmList, getBaseList
, getDjList
} from './sync.api'
import { Bzhx } from '@ohos/common/src/main/ets/entity/Bzhx'
import bzhxModal from '../../../model/BzhxModel'
import kfModel from '../../../model/KfModel'
...
...
@@ -12,6 +12,8 @@ import qyModel from '../../../model/QyModel'
import hjModel from '../../../model/HjModel'
import hwModel from '../../../model/HwModel'
import promptAction from '@ohos.promptAction'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
import wzcrkModel from '../../../model/WzcrkModel'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
...
...
@@ -19,8 +21,8 @@ import promptAction from '@ohos.promptAction'
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(6)
.padding({ top:
5, bottom: 5
})
.margin({ top: 1
2
})
.padding({ top:
8, bottom: 8
})
.margin({ top: 1
5
})
.width('85%')
.type(ButtonType.Normal)
.stateEffect(true)
...
...
@@ -96,13 +98,11 @@ export struct Pmhx {
// await hjModel.set(hjList)
// 货位添加
//
await hwModel.set(hwList)
await hwModel.set(hwList)
// 添加管理单位
await gldwModel.set(ddwAndJw)
promptAction.showToast({
message: '同步数据成功'
})
...
...
@@ -112,7 +112,27 @@ export struct Pmhx {
})
} finally {
this.showProgress = false
}
break;
case "单据导入":
try {
this.showProgress = true
const { rows } = await getDjList({})
wzcrkModel.set(rows)
promptAction.showToast({
message: '同步数据成功'
})
}catch (error) {
promptAction.showToast({
message: '同步数据失败'
})
} finally {
this.showProgress = false
}
break;
...
...
@@ -147,7 +167,7 @@ export struct Pmhx {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Image($r("app.media.icon")).width("12")
Text(item.title).fontSize(1
0
).fontColor("#0fa983")
Text(item.title).fontSize(1
1
).fontColor("#0fa983")
}
}
}.CommonButtonStyle().onClick(() => this.handleClick(item))
...
...
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/sync.api.ts
View file @
f534b4ef
...
...
@@ -2,7 +2,8 @@ import defHttp from "@ohos/common/src/main/ets/utils/HttpUtil"
enum
Api
{
pmList
=
'/api/integrate/knzy/infrastructurePm'
,
baseList
=
'/api/integrate/knzy/infrastructure'
baseList
=
'/api/integrate/knzy/infrastructure'
,
djList
=
'/api/integrate/knzy/billOfDocument2'
}
// 获取品名信息
...
...
@@ -10,3 +11,6 @@ export const getPmList = (data) => defHttp.post({url: Api.pmList, data})
// 获取基础信息
export
const
getBaseList
=
(
data
)
=>
defHttp
.
post
({
url
:
Api
.
baseList
,
data
})
// 获取单据信息
export
const
getDjList
=
(
data
)
=>
defHttp
.
post
({
url
:
Api
.
djList
,
data
})
\ No newline at end of file
entry/src/main/ets/pages/sub_systemMaintenance/Pmhx/Pmhx.ets
View file @
f534b4ef
...
...
@@ -8,15 +8,16 @@ import {pmhxList} from './pmhxList'
export struct Pmhx {
@State dataSource: Bzhx[] = []
controller: SearchController = new SearchController()
@State offsetNumber: number = 0
aboutToAppear(){
//
this.getUnitList()
this.getUnitList()
}
async getUnitList(pmdmsix?: string) {
const res = await bzhxModal.query(pmdmsix)
this.dataSource =
res
Logger.info(this, "号型数据>>" + JSON.stringify(res));
const res = await bzhxModal.query(
this.offsetNumber * 20,
pmdmsix)
this.dataSource =
[...this.dataSource, ...res]
this.offsetNumber++
}
build() {
...
...
@@ -46,7 +47,7 @@ export struct Pmhx {
.margin({top:15})
}
Column() {
pmhxList({dataSource: $dataSource})
pmhxList({dataSource: $dataSource
,onScrollEdge: this.getUnitList
})
}.flexGrow(1)
}
}.linearGradient({
...
...
entry/src/main/ets/pages/sub_systemMaintenance/Pmhx/pmhxList.ets
View file @
f534b4ef
...
...
@@ -7,37 +7,40 @@ export struct pmhxList {
.padding({top:4, bottom:4})
.alignSelf(ItemAlign.Start)
}
onScrollEdge: () => void
@Builder renderList() {
Column() {
Scroll() {
List(){
ForEach(this.dataSource, (item, index) => {
ListItem(){
Row() {
Column() {
Row(){
Text("物资品名:").commonPadding()
Text(item.wzpm).commonPadding()
Text("物资品名:").commonPadding()
.fontSize(13)
Text(item.wzpm).commonPadding()
.fontSize(13)
}.margin({left:20})
Row(){
Text("号型名称:").commonPadding()
Text(item.hxmc).commonPadding()
Text("号型名称:").commonPadding()
.fontSize(13)
Text(item.hxmc).commonPadding()
.fontSize(13)
}
}.width('60%')
Column() {
Row(){
Text("型号:").commonPadding()
Text(item.xh + '').commonPadding()
Text("型号:").commonPadding()
.fontSize(13)
Text(item.xh + '').commonPadding()
.fontSize(13)
}
Row(){
Text(item.pmdmSix).commonPadding()
Text(item.pmdmSix).commonPadding()
.fontSize(13)
}
}.width('30%')
}.commonPadding()
}
})
}.divider({strokeWidth:1,color:'505050'})
}.onScrollEdge(() => this.onScrollEdge())
}.width('100%').height('100%').backgroundColor('#fff')
}
...
...
entry/src/main/ets/pages/sub_systemMaintenance/Unit/Unit.ets
View file @
f534b4ef
...
...
@@ -7,6 +7,7 @@ import {UnitList} from'./UnitList'
@Component
export struct Unit {
@State dataSource: Gldw[] = []
@State offsetNumber: number = 0
controller: SearchController = new SearchController()
aboutToAppear(){
...
...
@@ -14,11 +15,12 @@ export struct Unit {
}
async getUnitList(dwmc?: string) {
const res = await gldwModal.query(dwmc)
this.dataSource =
res
Logger.info(this, "单位数据>>" + JSON.stringify(res));
const res = await gldwModal.query(
this.offsetNumber * 20,
dwmc)
this.dataSource =
[...this.dataSource, ...res]
this.offsetNumber++
}
build() {
Column() {
Flex({ direction: FlexDirection.Column }) {
...
...
@@ -34,7 +36,7 @@ export struct Unit {
.borderRadius(5)
}.width('100%')
Column() {
UnitList({ dataSource: $dataSource })
UnitList({ dataSource: $dataSource
,onScrollEdge: this.getUnitList
})
}.margin({top:20}).borderRadius(2)
}
}.linearGradient({
...
...
entry/src/main/ets/pages/sub_systemMaintenance/Unit/UnitList.ets
View file @
f534b4ef
...
...
@@ -8,6 +8,7 @@ export struct UnitList {
.padding({top:4, bottom:4})
.alignSelf(ItemAlign.Start)
}
onScrollEdge: () => void
@Builder renderList() {
Column() {
...
...
@@ -33,9 +34,7 @@ export struct UnitList {
}
})
}.divider({strokeWidth:1,color:'505050'})
}.onScrollEdge(() => {
console.log("hhhhhhhhhhhhhhhhhhhhh")
})
}.onScrollEdge(() => this.onScrollEdge())
}.width('100%').height('100%').backgroundColor('#fff')
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论