Commit 412119d3 by huangqy

导出

parent cb6c4d13
...@@ -25,7 +25,11 @@ export interface Wzcrkmx { ...@@ -25,7 +25,11 @@ export interface Wzcrkmx {
*/ */
hwh: string, hwh: string,
/** /**
* * 凭证明细的guid
*/ */
pzmxguid: string pzmxguid: string
/**
* 临时码
*/
wzdm: string
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import { Logger } from '@ohos/common/src/main/ets/utils/Logger'; ...@@ -6,6 +6,7 @@ import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { WzinClass } from './Wzin.data' import { WzinClass } from './Wzin.data'
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog'; import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
@Extend(Button) function bottomBtnSty() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
...@@ -98,6 +99,12 @@ export struct WzInPage { ...@@ -98,6 +99,12 @@ export struct WzInPage {
} }
} }
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({ dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({ builder: SetStatusDialog({
cancel: this.onCancel, cancel: this.onCancel,
...@@ -120,7 +127,6 @@ export struct WzInPage { ...@@ -120,7 +127,6 @@ export struct WzInPage {
this.checkedList.forEach(async (element) => { this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, this.radioChecked ? '已完成' : '未完成') let num = await wzcrkModel.updateWzcrkWczt(element, this.radioChecked ? '已完成' : '未完成')
if (num) {// 如果更新成功就减少 if (num) {// 如果更新成功就减少
Logger.info("删除的数据是:" + JSON.stringify(this.dataSource))
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
...@@ -131,6 +137,49 @@ export struct WzInPage { ...@@ -131,6 +137,49 @@ export struct WzInPage {
} }
} }
exportDialogController: CustomDialogController = new CustomDialogController({
builder: ExportOrderDialog({
cancel: this.onExportCancel,
confirm: this.onExportSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.exportContainer
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onExportCancel() {
}
onExportSubmit() {
// let newObj = {
// cbdwdm: filterData.ckdwguid,
// ckkfdm: filterData.KFDM,
// ...filterData,
// scjid: getClientId(),
// cjmc: '普华',
// bbh: this.sysConfig.bbh,
// imei: getDevice().imei,
// model: getDevice().model,
// vendor: getDevice().vendor,
// dcsj: date,
// pzmx: ItemData
// }
this.checkedList.forEach(element => {
this.dataSource.find(i => i.guid == element)
})
Logger.info('--------覆盖合并-------:' + JSON.stringify(this.dataSource), JSON.stringify(this.checkedList))
promptAction.showToast({
message: '导出'
})
}
@Builder TabBuilder(index: number, name: string) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
...@@ -188,6 +237,19 @@ export struct WzInPage { ...@@ -188,6 +237,19 @@ export struct WzInPage {
.visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None) .visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None)
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请至少选择一条单据'
})
} else if (this.dataSource.filter(i => i.wczt == '未完成').length > 0) {
promptAction.showToast({
message: '请选择已完成的单据'
})
} else {
if (this.exportDialogController != undefined) {
this.exportDialogController.open()
}
}
}).fontColor("#0fa983").fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
Button("全选") Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp") .bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
......
...@@ -98,10 +98,6 @@ export class WzinClass { ...@@ -98,10 +98,6 @@ export class WzinClass {
* 备注 * 备注
*/ */
dec: string dec: string
/**
* 有无被选中
*/
checked: boolean
constructor(data: { constructor(data: {
gznd: string; gznd: string;
...@@ -129,7 +125,6 @@ export class WzinClass { ...@@ -129,7 +125,6 @@ export class WzinClass {
pzh?: number; pzh?: number;
pzsl?: number; pzsl?: number;
crksl?: number; crksl?: number;
checked?: boolean;
}) { }) {
this.guid = data.guid; this.guid = data.guid;
this.gznd = data.gznd; this.gznd = data.gznd;
...@@ -156,7 +151,6 @@ export class WzinClass { ...@@ -156,7 +151,6 @@ export class WzinClass {
this.zmlx = data.zmlx; this.zmlx = data.zmlx;
this.bdguid = data.bdguid; this.bdguid = data.bdguid;
this.dec = data.dec; this.dec = data.dec;
this.checked = data.checked
} }
} }
......
import { UniListItem } from '@ohos/system/src/main/ets/model/UniInitList';
import { WzinClass } from '../../pages/metailmange/WzInPage/Wzin.data';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
// 需要提交的表单
interface FormData {
httpURL: string,
httpPORT: string,
scoketURL: string,
scoketPORT: string,
themeName: string,
themeColor: string,
reconnection_mode: boolean,
push_mode: boolean,
transmission_mode: string,
continue_scan_mode: boolean,
scan_read_mode: string,
scanning_mode: string,
broadcastKey: string,
power: string
}
@CustomDialog
@Component
export struct ExportOrderDialog {
@Link dataSource: WzinClass[]
@Link checkedList: Array<string>
controller: CustomDialogController
cancel: () => void
confirm: () => void
@BuilderParam container: () => void
build() {
Column() {
Flex({ alignItems: ItemAlign.Start }) {
Row() {
Divider()
.vertical(true)
.height(14)
.strokeWidth(3)
.color('#19ac88')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Text('提示').fontSize(20)
}
.padding({ top: 10, bottom: 10 })
}
this.container()
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('覆盖')
.onClick(() => {
this.controller.close()
this.confirm()
}).CommonButtonStyle()
Button('合并')
.onClick(() => {
this.controller.close()
this.confirm()
}).CommonButtonStyle()
Button('取消')
.onClick(() => {
this.controller.close()
this.cancel()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
.width('100%')
.borderRadius(5)
.backgroundColor('#fff')
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论