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
13e95206
Commit
13e95206
authored
Jan 24, 2024
by
毛勇泽
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8caed643
9b7063de
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
240 行增加
和
73 行删除
+240
-73
DataSynchronism.ets
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
+10
-72
BasicInfoModal.ets
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/modal/BasicInfoModal.ets
+118
-0
DjInfoModal.ets
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/modal/DjInfoModal.ets
+110
-0
DividerTitle.ets
entry/src/main/ets/view/DividerTitle/DividerTitle.ets
+2
-1
没有找到文件。
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/DataSynchronism.ets
View file @
13e95206
...
...
@@ -21,6 +21,7 @@ import drModel from '../../../model/DrModel'
import dsRfidModel from '../../../model/DsRfidModel'
import { DrInfo } from '@ohos/common/src/main/ets/entity/DrInfo'
import wzcrkmxModel from '../../../model/WzcrkmxModel'
import {BasicInfoModal} from './modal/BasicInfoModal'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
...
...
@@ -46,39 +47,24 @@ export struct Pmhx {
dialogController: CustomDialogController = new CustomDialogController({
builder: TipDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
content: this.content,
}),
autoCancel: true,
alignment: DialogAlignment.Default,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
})
})
listController: CustomDialogController = new CustomDialogController({
builder: ListDialog({
cancel: this.onCancel,
getDrData: this.getDrData
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: -10 },
gridCount: 4,
customStyle: false
})
@Builder container() {
TextInput()
}
onCancel() {
console.log("onCancel")
}
basicController: CustomDialogController = new CustomDialogController({
builder: BasicInfoModal({ showProgress: $showProgress,finally: () => this.showProgress = false }),
})
onSubmit() {
console.log("onSubmit")
}
onSubmit() {}
aboutToAppear() {
this.getDrData()
...
...
@@ -95,56 +81,10 @@ export struct Pmhx {
switch (item.title) {
case "基础信息":
try {
this.showProgress = true
await qyModel.clear();
await kfModel.clear();
await hwModel.clear();
await hjModel.clear();
await gldwModel.clear();
const res = await getPmList({ rows: 5000, page: 1 })
// 获取品名
const allData = JSON.parse(res).bzhxList as Bzhx[]
// 添加品名
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)
// 添加库房
await kfModel.set(ckkfList)
// 区域添加
await qyModel.set(qyList)
// 货架添加
await hjModel.set(hjList)
// 货位添加
await hwModel.set(hwList)
// 添加管理单位
await gldwModel.set(ddwAndJw)
await drModel.set('基础信息数据(内部网络导入)')
this.getDrData()
promptAction.showToast({
message: '同步数据成功'
})
} catch (error) {
promptAction.showToast({
message: '同步数据失败'
})
} finally {
this.showProgress = false
if(this.basicController) {
this.basicController.open()
}
break;
case "单据导入":
...
...
@@ -303,7 +243,6 @@ export struct Pmhx {
Row() {
this.renderLeft()
this.renderRight()
}.justifyContent(FlexAlign.SpaceBetween).margin({ top: 6 })
}.width('100%').height("100%").linearGradient({
...
...
@@ -320,7 +259,6 @@ export struct Pmhx {
.position({ x: 0, y: 0 })
.backgroundColor('#000')
.opacity(0.2)
LoadingProgress()
.width(50)
.height(60)
...
...
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/modal/BasicInfoModal.ets
0 → 100644
View file @
13e95206
import { DividerTitle } from '../../../../view/DividerTitle/DividerTitle'
import { Bzhx } from '@ohos/common/src/main/ets/entity/Bzhx'
import bzhxModal from '../../../../model/BzhxModel'
import kfModel from '../../../../model/KfModel'
import gldwModel from '../../../../model/GldwModel'
import qyModel from '../../../../model/QyModel'
import hjModel from '../../../../model/HjModel'
import hwModel from '../../../../model/HwModel'
import { getBaseList, getPmList } from '../sync.api'
import wzdmModel from '../../../../model/WzdmModel'
import drModel from '../../../../model/DrModel'
import promptAction from '@ohos.promptAction'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.height(30)
.stateEffect(true)
}
@CustomDialog
@Component
export struct BasicInfoModal {
controller: CustomDialogController
@Link showProgress: boolean
@State dwguid: string = ''
finally: () => void
async handleClick() {
if (this.dwguid == '') {
promptAction.showToast({
message: '请输入单位代码',
bottom: 200
})
return
}
try {
this.controller.close()
this.showProgress = true
await qyModel.clear();
await kfModel.clear();
await hwModel.clear();
await hjModel.clear();
await gldwModel.clear();
const res = await getPmList({ rows: 5000, page: 1 })
// 获取品名
const allData = JSON.parse(res).bzhxList as Bzhx[]
// 添加品名
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)
// 添加库房
await kfModel.set(ckkfList)
// 区域添加
await qyModel.set(qyList)
// 货架添加
await hjModel.set(hjList)
// 货位添加
await hwModel.set(hwList)
// 添加管理单位
await gldwModel.set(ddwAndJw)
await drModel.set('基础信息数据(内部网络导入)')
this.showProgress = false
promptAction.showToast({
message: '同步基础数据成功'
})
} catch (error) {
promptAction.showToast({
message: '同步基础数据失败'
})
} finally {
this.finally()
}
}
build() {
Column() {
DividerTitle({ title: '基础信息导入' }).alignSelf(ItemAlign.Start).margin({ top: 15 })
Row() {
Text('*').fontColor('red')
Text('单位代码:').width('30%')
TextInput({ placeholder: "请输入单位代码", text: this.dwguid }).width('60%')
.borderRadius(6)
.onChange(value => this.dwguid = value)
}.margin({ top: 10, bottom: 10 })
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取消')
.onClick(() => {
this.controller.close()
})
.CommonButtonStyle()
Button('确认')
.onClick(() => this.handleClick()).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.margin({ left: 10 }).borderRadius(0)
}
}
\ No newline at end of file
entry/src/main/ets/pages/sub_systemMaintenance/DataSynchronism/modal/DjInfoModal.ets
0 → 100644
View file @
13e95206
import { DividerTitle } from '../../../../view/DividerTitle/DividerTitle'
import promptAction from '@ohos.promptAction'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.height(30)
.stateEffect(true)
}
@Observed
class DjInfo {
dwguid: string
gznd: string
pzlx: string
kfdm: string
constructor(data: {
dwguid: string
gznd?: string
pzlx: string
kfdm: string
}) {
this.dwguid = data.dwguid || ''
this.gznd = data.gznd || ''
this.pzlx = data.pzlx || ''
this.kfdm = data.kfdm || ''
}
}
@Entry
@Component
export struct BasicInfoModal {
controller: CustomDialogController
// @Link showProgress: boolean
@State dwguid: string = ''
@State form: DjInfo = new DjInfo({dwguid:"", gznd: new Date().getFullYear() + '', pzlx:"", kfdm:"" })
finally: () => void
async handleClick() {
if (this.dwguid == '') {
promptAction.showToast({
message: '请输入单位代码',
bottom: 200
})
return
}
try {
} catch (error) {
promptAction.showToast({
message: '同步单据数据失败'
})
} finally {
this.finally()
}
}
build() {
Column() {
DividerTitle({ title: '单据导入' }).alignSelf(ItemAlign.Start).margin({ top: 15 })
Row() {
Text('*').fontColor('red')
Text('单位代码:').width('25%')
TextInput({ placeholder: "请输入单位代码", text: this.form.dwguid }).width('60%')
.borderRadius(6)
.onChange(value => this.form.dwguid = value)
}.margin({ top: 10, bottom: 10 })
Row() {
Text('*').fontColor('red')
Text('年度:').width('25%')
TextInput({ placeholder: "请输入年度", text: this.form.gznd }).width('60%')
.borderRadius(6)
.onChange(value => this.form.gznd = value)
}.margin({ top: 10, bottom: 10 })
Row() {
Text('*').fontColor('red')
Text('年度:').width('25%')
// Select(item.options)
// .value(`请选择${item.title}`)
// .width(230)
// .borderWidth(1)
// .borderRadius(5)
// .flexGrow(1)
// .borderColor($r("app.color.rank_secondary_border"))
// .onSelect((index: number, value?: string) => {
// this.wzcrk[item.key] = item.options[index].id
// })
}.margin({ top: 10, bottom: 10 })
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取消')
.onClick(() => {
this.controller.close()
})
.CommonButtonStyle()
Button('确认')
.onClick(() => this.handleClick()).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.margin({ left: 10 }).borderRadius(0)
}
}
\ No newline at end of file
entry/src/main/ets/view/DividerTitle/DividerTitle.ets
View file @
13e95206
...
...
@@ -12,7 +12,7 @@ export struct DividerTitle {
.opacity(0.6)
.margin({ left: 8, right: 8 })
Text(this.title)
.fontSize(1
4
)
.fontSize(1
6
)
}
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论