Commit caa2e622 by huangqy

Merge remote-tracking branch 'origin/master'

parents e8225d69 21938e5a
export interface newBgglDto {
guid: string;
ddh: string;
xs: number;
pc: number;
fwdw: string;
kfdm: string;
bgzt: string;
slr: string;
sldwdm: string;
sjh: number;
jssj: string;
cksj: string;
sfdc: string;
sfdf: string;
hwh: string;
qjm: string;
dfje: number;
kfmc: string;
}
\ No newline at end of file
......@@ -15,17 +15,17 @@ export interface RecommendHwDto {
*/
export interface TestHwWzDto {
guid: string,
hwh: string,
pmdmcode: string,
hwsl: string,
hjguid: string,
hwzt: string,
hwxgsj: string,
gldwguid: string,
kfguid: string,
zmlx: string,
kfdm: string
guid?: string,
hwh?: string,
pmdmcode?: string,
hwsl?: string,
hjguid?: string,
hwzt?: string,
hwxgsj?: string,
gldwguid?: string,
kfguid?: string,
zmlx?: string,
kfdm?: string
}
export interface PzMxItemDto {
......
......@@ -8,7 +8,8 @@ export interface SearchData{
kfmc?:string
kfdm?:string
zmmc?:string,
hwh?:string
hwh?:string,
exportToal?:number
}
export interface HWFromData{
hwh?: string,
......
import relationalStore from '@ohos.data.relationalStore';
import { newBgglDto } from '../../bean/dto/BgglDto';
import { Bggl } from '../../entity/Bggl';
import { Logger } from '../../utils/Logger';
import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators';
import { NativeSql } from '../sql/NativeSql';
......@@ -62,4 +64,52 @@ export class BgglDao extends BaseTable<Bggl> {
}
return this.query(wp, this.getTableColumns());
}
/**
* 获取最新上架信息
*/
async getNewData(params: Partial<Bggl>): Promise<newBgglDto[]> {
try {
let val_sql = NativeSql.getNewBgglSql(params);
Logger.info('最新上架>>sql', val_sql)
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toWzcrkRefWz(rs))
} while (rs.goToNextRow())
}
Logger.info(this, '最新上架>>' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toWzcrkRefWz(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
ddh: cursor.getString(cursor.getColumnIndex('ddh')),
xs: cursor.getLong(cursor.getColumnIndex('xs')),
pc: cursor.getLong(cursor.getColumnIndex('pc')),
fwdw: cursor.getString(cursor.getColumnIndex('fwdw')),
bgzt: cursor.getString(cursor.getColumnIndex('bgzt')),
slr: cursor.getString(cursor.getColumnIndex('slr')),
sldwdm: cursor.getString(cursor.getColumnIndex('sldwdm')),
sjh: cursor.getLong(cursor.getColumnIndex('sjh')),
jssj: cursor.getString(cursor.getColumnIndex('jssj')),
cksj: cursor.getString(cursor.getColumnIndex('cksj')),
sfdc: cursor.getString(cursor.getColumnIndex('sfdc')),
sfdf: cursor.getString(cursor.getColumnIndex('sfdf')),
kfdm: cursor.getString(cursor.getColumnIndex('kfdm')),
kfmc: cursor.getString(cursor.getColumnIndex('kfmc')),
qjm: cursor.getString(cursor.getColumnIndex('qjm')),
dfje: cursor.getLong(cursor.getColumnIndex('dfje')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
};
return info;
}
}
\ No newline at end of file
......@@ -298,7 +298,21 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
};
return info;
}
toExportHwWzDto(cursor: relationalStore.ResultSet): TestHwWzDto {
let info: TestHwWzDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
pmdmcode: cursor.getString(cursor.getColumnIndex('pmdmcode')),
hwsl: cursor.getString(cursor.getColumnIndex('hwsl')),
hjguid: cursor.getString(cursor.getColumnIndex('hjguid')),
hwzt: cursor.getString(cursor.getColumnIndex('hwzt')),
hwxgsj: cursor.getString(cursor.getColumnIndex('hwxgsj')),
gldwguid: cursor.getString(cursor.getColumnIndex('gldwguid')),
kfguid: cursor.getString(cursor.getColumnIndex('kfguid')),
zmlx: cursor.getString(cursor.getColumnIndex('zmlx'))
};
return info;
}
async getPzMxItem(params, isPmSix): Promise<PzMxItemDto[]> {
try {
......@@ -353,6 +367,24 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
throw new Error('[查询异常]|' + e)
}
}
async exportPageSql(params): Promise<TestHwWzDto[]>{
try {
let val_sql = NativeSql.exportPageSql(params);
Logger.info(this,"查询sql====>"+val_sql)
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toExportHwWzDto(rs))
} while (rs.goToNextRow())
}
Logger.info(this, 'queryAll items=' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toCommonHxPzMx(cursor: relationalStore.ResultSet): CommonHxPzMxDto {
let info: CommonHxPzMxDto = {
......
import { Bggl } from '../../entity/Bggl';
import { uuid } from '../../utils/util';
export class NativeSql {
/**
* 构建出入库明细查询语句
......@@ -595,7 +597,7 @@ WHERE
/**
**临时区物资查询
*/
static getLsqPageSql(params?: any):string{
static getLsqPageSql(params?: any): string {
const sql1 =
`SELECT * FROM (SELECT pmdmsix ,wzpm ,sum(case when lx ='LS' then hwsl else 0 end) SY ,sum(case when lx ='LW' then hwsl else 0 end) YL,sum(hwsl) ZS from (SELECT hx.pmdmsix, hx.wzpm,sum(hw.hwsl) hwsl,(case when hwh ='LS-1-1-1' then 'LS' else 'LW' end ) LX FROM tab_bzgl_knzy_app_hwb hw INNER JOIN TAB_BZGL_KNZY_APP_HJB hj ON hj.guid = hw.hjguid INNER JOIN TAB_BZGL_KNZY_APP_QYB qy ON qy.guid = hj.qyguid LEFT JOIN tab_xtwh_jcsj_bzhx hx ON hw.pmdmcode = hx.pmdmten WHERE hw.pmdmcode IS NOT NULL AND hw.hwsl IS NOT NULL AND hw.gldwguid = ${params.gldwguid} AND hw.kfguid = ${params.kfguid} AND hw.zmlx = ${params.zmlx}`
const sql2 = ` AND (hx.wzpm like ${params.wzpm})`
......@@ -607,23 +609,47 @@ WHERE
return sql1 + sql3
}
}
static getHXpageSql(params?: any):string{
const sql=`select hw.pmdmcode, hx.hxmc, sum (case when hw.hwh='LS-1-1-1' then ifnull (hw.hwsl,0) +0 else 0 end) SY,sum (case when hw.hwh != 'LS-1-1-1' then ifnull (hw.hwsl, 0) +0 else 0 end) YL from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid = hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB gy on gy.guid = hj.qyguid left join TAB_XTWH_JCSJ_BZHX hx on hw.pmdmcode = hx.pmdmten where substr (hw.pmdmcode, 1, 6) = ${params.pmdmcode} and hw.kfguid = ${params.kfguid} and hw.gldwguid= ${params.gldwguid} and zmlx = ${params.zmlx} group by hw.pmdmcode, hx.hxmc`
static getHXpageSql(params?: any): string {
const sql = `select hw.pmdmcode, hx.hxmc, sum (case when hw.hwh='LS-1-1-1' then ifnull (hw.hwsl,0) +0 else 0 end) SY,sum (case when hw.hwh != 'LS-1-1-1' then ifnull (hw.hwsl, 0) +0 else 0 end) YL from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid = hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB gy on gy.guid = hj.qyguid left join TAB_XTWH_JCSJ_BZHX hx on hw.pmdmcode = hx.pmdmten where substr (hw.pmdmcode, 1, 6) = ${params.pmdmcode} and hw.kfguid = ${params.kfguid} and hw.gldwguid= ${params.gldwguid} and zmlx = ${params.zmlx} group by hw.pmdmcode, hx.hxmc`
return sql
}
/*验证扫描:验证扫描完的数据有没有*/
static testInsertSql(params?: any):string{
const sql= `select * from (select hw.*,qy.kfdm kfdm from tab_bzgl_knzy_app_hwb hw left join tab_bzgl_knzy_app_hjb hj on hj.guid = hw.hjguid left join tab_bzgl_knzy_app_qyb qy on qy.guid = hj.qyguid ) where kfguid = '${params.kfguid}' and hwh = ${params.hwh} and (pmdmcode = ${(params.pmdmcode)} or pmdmcode ='' or pmdmcode is null )`
static testInsertSql(params?: any): string {
const sql = `select * from (select hw.*,qy.kfdm kfdm from tab_bzgl_knzy_app_hwb hw left join tab_bzgl_knzy_app_hjb hj on hj.guid = hw.hjguid left join tab_bzgl_knzy_app_qyb qy on qy.guid = hj.qyguid ) where kfguid = '${params.kfguid}' and hwh = ${params.hwh} and (pmdmcode = ${(params.pmdmcode)} or pmdmcode ='' or pmdmcode is null )`
return sql
}
/*验证扫描完更新*/
static updateWzcshSql(params?: any):string{
const sql=`update tab_bzgl_knzy_app_hwb set hwsl = ifnull(hwsl,0) + ${params.srsl}, pmdmcode = ${params.pmdmcode} where guid = ${params.guid}`
static updateWzcshSql(params?: any): string {
const sql = `update tab_bzgl_knzy_app_hwb set hwsl = ifnull(hwsl,0) + ${params.srsl}, pmdmcode = ${params.pmdmcode} where guid = ${params.guid}`
return sql
}
/*验证扫描完新增*/
static insertWzcshSql(params?: any):string{
const sql=`insert into tab_bzgl_knzy_app_hwb (guid, hwh, pmdmcode, hwsl, hjguid,hwzt,gldwguid,kfguid,zmlx) values ('${params.guid}','${params.hwh}',${params.pmdmcode},${params.srsl},'${params.hjguid}','11111111SF1','${params.gldwguid}','${params.kfguid}',${params.zmlx})`
static insertWzcshSql(params?: any): string {
const sql = `insert into tab_bzgl_knzy_app_hwb (guid, hwh, pmdmcode, hwsl, hjguid,hwzt,gldwguid,kfguid,zmlx) values ('${params.guid}','${params.hwh}',${params.pmdmcode},${params.srsl},'${params.hjguid}','11111111SF1','${params.gldwguid}','${params.kfguid}',${params.zmlx})`
return sql
}
/*物资落位导出*/
static exportPageSql(params?: any): string {
const sql = `select hw.* from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid =hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB qy on qy.guid = hj.qyguid where hw.pmdmcode is not null and hw.pmdmcode !='' and hw.hwh not like 'LS%' and hw.kfguid = '${params.kfguid}' and hw.gldwguid = '${params.gldwguid}' and hw.zmlx = ${params.zmlx}`
return sql
}
/**
* 获取最新上架信息
*/
static getNewBgglSql(params: Partial<Bggl>): string {
var sql = `select bg.*,kf.kfmc from TAB_BZGL_KNZY_APP_BGGL bg left join TAB_BZGL_KNZY_APP_DWKF kf on kf.kfdm = bg.kfdm `
var sqlHz = ' order by bg.JSSJ desc'
if (params.bgzt) {
sql = sql + ` where bg.BGZT = '${params.bgzt}'`
}
if (params.ddh) {
return `${sql} and (bg.DDH like ${params.ddh} ${sqlHz}`;
} else {
return sql + sqlHz
}
}
}
import { BgglDao, SQLiteContext, Bggl } from '@ohos/common'
import { Bggl, BgglDao, SQLiteContext } from '@ohos/common'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
import { uuid } from '@ohos/common/src/main/ets/utils/util'
// 包裹管理
......@@ -26,15 +27,30 @@ class BgglModel {
return RandomSixStr
}
// 测试随机分配包裹状态
test(index) {
switch (index % 4) {
case 0:
return '未领取'
break;
case 1:
return '已领取'
case 2:
return '待上架'
case 3:
return '待入库'
}
}
// 添加包裹
async set(data: Bggl[]) {
const copyData = data.map(item => {
const copyData = data.map((item, index) => {
return {
guid: item.guid || uuid(),
ddh: item.ddh || '',
xs: item.xs || 1,
fwdw: item.fwdw || '',
bgzt: '待入库',
bgzt: this.test(index),
// @ts-ignore
slr: item.ryxm || '',
sjh: item.sjh || '',
......@@ -46,16 +62,22 @@ class BgglModel {
sfdf: item.sfdf,
dfje: 0
}
})
await SQLiteContext.with(BgglDao).batchInsert(data)
}) as Bggl[]
await SQLiteContext.with(BgglDao).batchInsert(copyData)
}
// 查询包裹
async query(data: Partial<Bggl>):Promise<Bggl[]> {
async query(data: Partial<Bggl>): Promise<Bggl[]> {
let res = await SQLiteContext.with(BgglDao).getDdh(data);
return res;
}
// 查询最新上架信息
async queryNewDara(data: Partial<Bggl>): Promise<newBgglDto[]> {
let res = await SQLiteContext.with(BgglDao).getNewData(data);
return res;
}
// 清空表
async clear() {
await SQLiteContext.with(BgglDao).clearTable()
......
......@@ -58,6 +58,11 @@ class WzcrkmxModel {
let res = await SQLiteContext.with(WzcrkmxDao).testInsertSql(params)
return res
}
// 物资落位导出
async exportPageSql(params) {
let res = await SQLiteContext.with(WzcrkmxDao).exportPageSql(params)
return res
}
async getPzMxItem(params, isPmSix) {
let res = await SQLiteContext.with(WzcrkmxDao).getPzMxItem(params, isPmSix)
return res
......
......@@ -3,7 +3,7 @@ import { PageConstants } from '../constants/PageConstants';
import { buttonInfo, ButtonInfoModel } from '../viewmodel/MainPageData';
import { DirectConnect } from '@ohos/direct';
import { MaterialManagement } from '@ohos/material';
import { PageManagement } from '@ohos/pagemanagement';
import { PageManagement } from './PageManagement/PageManagement';
import { SystemMaintenance } from '@ohos/system';
import { BreakpointConstants, BreakpointSystem, Logger, StyleConstants } from '@ohos/common';
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
@Extend(Text) function textRender() {
.padding({ top: 8, bottom: 8 })
.textAlign(TextAlign.Center)
}
@Component
export struct NewDataList {
@Link dataSource: newBgglDto[]
build() {
Column() {
Row() {
Text('订单').width('30%').textRender()
Text('姓名').width('30%').textRender()
Text('手机号').width('30%').textRender()
}
List() {
ForEach(this.dataSource, (item: newBgglDto) => {
ListItem() {
Row() {
Text(item.ddh).width('30%').textRender().fontSize(12)
Text(item.slr).width('30%').textRender()
Text(item.sjh + '').width('30%').textRender()
}.margin({ left: 30 })
}
})
}.margin({ bottom: 30 })
}
}
}
\ No newline at end of file
import router from '@ohos.router'
import { BgglDao, Logger, SQLiteContext, StatusBarManager } from '@ohos/common';
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto';
import bgglModel from '../../model/BgglModel';
import { NewDataList } from './NewDataLst';
import { YqjList } from './YqjList';
@Extend(Text) function numberStyle() {
.fontSize(20)
......@@ -16,6 +20,8 @@ export struct PageManagement {
@State dsj: number = 0
@State wlq: number = 0
@State ylq: number = 0
@State newDataList: newBgglDto[] = []
@State ylqList: newBgglDto[] = []
private controller: TabsController = new TabsController()
onCountUpdated(index: number) {
......@@ -24,6 +30,7 @@ export struct PageManagement {
this.getDsj()
this.getYlq()
this.getWlq()
this.getPackList()
}
}
......@@ -41,8 +48,14 @@ export struct PageManagement {
}.width('100%')
}
// 获取包裹列表
// 最新上架数据和取件记录数据
async getPackList(ddh?: string) {
const res = await bgglModel.queryNewDara({ bgzt: "未领取", ddh })
this.newDataList = res
Logger.info('最新上架数据>>', JSON.stringify(res))
const res1 = await bgglModel.queryNewDara({ bgzt: "已领取", ddh })
this.ylqList = res1
Logger.info('取件记录>>', JSON.stringify(res))
}
async getTotal() {
......@@ -53,21 +66,21 @@ export struct PageManagement {
async getDsj() {
let wp = SQLiteContext.with(BgglDao).getPredicates()
wp.equalTo('WCZT', '待上架')
wp.equalTo('BGZT', '待上架')
const res = await SQLiteContext.with(BgglDao).query(wp)
this.dsj = res.length
}
async getWlq() {
let wp = SQLiteContext.with(BgglDao).getPredicates()
wp.equalTo('WCZT', '未领取')
wp.equalTo('BGZT', '未领取')
const res = await SQLiteContext.with(BgglDao).query(wp)
this.wlq = res.length
}
async getYlq() {
let wp = SQLiteContext.with(BgglDao).getPredicates()
wp.equalTo('WCZT', '已领取')
wp.equalTo('BGZT', '已领取')
const res = await SQLiteContext.with(BgglDao).query(wp)
this.ylq = res.length
}
......@@ -87,7 +100,7 @@ export struct PageManagement {
this.getPackList(value)
})
.onChange((value: string) => {
// this.getPackList(value)
this.getPackList(value)
})
}.backgroundColor("#0fa983").width('100%').height(70)
......@@ -121,17 +134,26 @@ export struct PageManagement {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
if (this.newDataList.length == 0) {
Column() {
Image($r('app.media.express')).width(60)
Text("暂无最新上架订单信息").margin({ top: 15 })
}
} else {
NewDataList({ dataSource: $newDataList })
}
}.tabBar(this.TabBuilder(0, '最新上架'))
TabContent() {
if (this.newDataList.length == 0) {
Column() {
Image($r('app.media.express')).width(60)
Text("暂无最新上架订单信息").margin({ top: 15 })
}
} else {
YqjList({ dataSource: $ylqList })
}
}.tabBar(this.TabBuilder(1, '取件记录'))
}
.height(250)
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
@Component
export struct YqjList {
@Link dataSource: newBgglDto[]
build() {
Column() {
List() {
ForEach(this.dataSource, (item: newBgglDto) => {
ListItem() {
Column() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("订单号:" + item.ddh)
Text(item.cksj)
}
}
Row() {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems: ItemAlign.Center }) {
Column() {
Text(item.slr + ' ' + item.sjh).fontColor('#fff').fontSize(18)
Row() {
Text('取件码:').fontColor('#fff').fontSize(18)
Text(item.qjm).fontColor('#fff').fontSize(26).fontWeight(800)
}.margin({ top: 10 }).alignSelf(ItemAlign.Start)
}.margin({ left: 10 })
Row() {
Text(item.bgzt).fontColor('#fff')
}.padding(10).borderWidth(1).borderColor('#fff')
}
}
.backgroundColor('#0fa983')
.height(100)
.width('100%')
.margin({ top: 8 })
.borderRadius(8)
}
}
})
}
}.width('100%').padding({ left: 20, right: 20 })
}
}
\ No newline at end of file
......@@ -6,11 +6,13 @@ import promptAction from '@ohos.promptAction';
import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
import Prompt from '@system.prompt';
import { ExportPositionDialog } from './dialog/ExportPositionDialog';
import { zmlx_dict } from '@ohos/common/src/main/ets/utils/dict'
import gldwModel from '../../../model/GldwModel'
import kfModel from '../../../model/KfModel'
import hwModel from "../../../model/HwModel"
import wzcrkmxModel from '../../../model/WzcrkmxModel';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
......@@ -21,7 +23,6 @@ import hwModel from "../../../model/HwModel"
.borderRadius(7)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
......@@ -39,6 +40,7 @@ struct WzPositionPage {
@State zmlxselectValue: Array<SelectOption> = []
private kfList: KfInfo[] = []
private dwList: Gldw[] = []
private exportData:Array<any>=[]
private searchcontroller: SearchController = new SearchController()
@Builder bottomButtons() {
......@@ -57,7 +59,6 @@ struct WzPositionPage {
bottom: 200
})
}
})
.fontColor("#0fa983")
.fontSize("14vp")
......@@ -78,13 +79,14 @@ struct WzPositionPage {
})
Button("导出结果数据包")
.bottomBtnSty()
.onClick(async () => {
.onClick(() => {
this.onShowExportDialog()
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(50)
}
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
......@@ -92,82 +94,32 @@ struct WzPositionPage {
}
exportDialogController: CustomDialogController = new CustomDialogController({
builder: ExportOrderDialog({
cancel: this.onExportCancel,
confirm: this.onExportSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.exportContainer
builder: ExportPositionDialog({
searchData:$searchData,
confirm: this.onExportSubmit
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onExportCancel() {
}
onExportSubmit() {
this.checkedList.forEach(async element => {
let res = await ViewdrdcModel.queryExport({ guid: element, wczt: '已完成', pzlx: '17' })
const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before')
const newArr = [...new Set(jhguidArr)]
const exportData = newArr.map((item) => {
let newObj = {}
let ItemData = []
res.forEach((Item) => {
if (item == Item.guid) {
ItemData.push({
jhmxguid: Item.jhmxguid,
hwh: Item.hwh,
pmdmcode: Item.pmdmcode,
wzdm: Item.wzdm,
pzsl: Item.pzsl || 0,
sjsl: Item.crksl || 0
})
async onShowExportDialog() {
this.exportData=await wzcrkmxModel.exportPageSql(this.searchData)
Logger.info(this,"导出数据包"+JSON.stringify(this.exportData))
if(this.exportData&&this.exportData.length>0){
this.searchData.exportToal=this.exportData.length
if (this.exportDialogController != undefined) {
this.exportDialogController.open()
}
}else{
Prompt.showToast({
message:'暂无数据,无法导出'
})
const [filterData] = res.filter((fItem) => fItem
.guid == item)
if (filterData) {
newObj = {
cbdwdm: filterData.ckdwguid,
ckkfdm: filterData.kfdm,
...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b
}, 0),
scjid: "863576927543400,863576927543400",
cjmc: "普华",
imei: "863576927543400,863576927543400",
model: "ax6737_65_n",
vendor: "alps",
dcsj: date,
pzmx: ItemData
}
}
return newObj
})
const exportForm = {
pzzbJson: exportData,
crklx: '11111CRKLX2',
gznd: '2023',
jsdwguid: 1,
}
await importData(exportForm)
}
})
promptAction.showDialog({
title: '提示',
message: '出库作业单据已同步至业务系统,请以保管员身份登录业务系统,在菜单“作业项目——物资出库”里刷新查看。',
buttons: [{
text: '已知晓',
color: '#0fa983',
}],
})
onExportSubmit() {
Logger.info(this,"导出数据"+JSON.stringify(this.exportData))
}
@Builder renderEmpty() {
......@@ -299,12 +251,7 @@ struct WzPositionPage {
ForEach(this.dataSource, (item) => {
ListItem() {
WzPositionList({ wzposition: item }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail', params: {
wzcrk: item,
isUpdate: true
} })
})
}
})
}.padding(18)
}
......
import { DividerTitle } from '../../../../view/DividerTitle/DividerTitle';
import { Logger, KfInfo, Gldw, WzPositionClass,SearchData } from '@ohos/common';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
/*导出落位数据包*/
@CustomDialog
@Component
export struct ExportPositionDialog{
@Link searchData: SearchData
confirm: () => void
controller: CustomDialogController
build() {
Column() {
Flex({ justifyContent:FlexAlign.SpaceBetween,alignItems: ItemAlign.Start }) {
DividerTitle({ title: "落位导出信息" })
Text("年度:"+new Date().getFullYear().toString())
.fontWeight(FontWeight.Medium)
.fontSize(16)
.fontColor("#000")
.textAlign(TextAlign.Start)
}.padding({top:10,bottom:10 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("管理单位:").fontSize(16).lineHeight(18)
Text(this.searchData.gldwmc).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("库房:").fontSize(16).lineHeight(18)
Text(this.searchData.kfmc).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("账目类型:").fontSize(16).lineHeight(18)
Text(this.searchData.zmmc).fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
// this.container()
Flex({ justifyContent:FlexAlign.SpaceBetween,alignItems: ItemAlign.Start }) {
DividerTitle({ title: "落位导出数据" })
Text("导出数量:1")
.fontWeight(FontWeight.Medium)
.fontSize(16)
.fontColor("#000")
.textAlign(TextAlign.Start)
}.padding({top:10,bottom:10 })
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('覆盖导出')
.onClick(() => {
this.controller.close()
this.confirm()
}).CommonButtonStyle()
Button('合并导出')
.onClick(() => {
this.controller.close()
this.confirm()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.padding({left:10,right:10})
.width('100%')
.borderRadius(5)
.backgroundColor('#fff')
}
}
\ No newline at end of file
import { DividerTitle } from '../../../../view/DividerTitle/DividerTitle'
import IdentifyService from '../../../../identify/IdentifySerivce'
@CustomDialog
@Component
......
......@@ -65,7 +65,7 @@ export struct Pack {
// 获取包裹列表
async getPackList() {
const res = await bgglModel.query({ ddh: this.ddh, bgzt: this.bgzt })
const res = await bgglModel.queryNewDara({ ddh: this.ddh, bgzt: this.bgzt })
Logger.info('获取到包裹数据', JSON.stringify(res))
this.packList = res
}
......
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import { Bggl } from '@ohos/common/src/main/ets/entity/Bggl'
import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo'
import { Logger } from '@ohos/common/src/main/ets/utils/Logger'
......@@ -6,22 +7,7 @@ import kfModel from '../../model/KfModel'
@Entry
@Component
export struct PackList {
private item: Bggl
@State kfList: KfInfo[] = []
async aboutToAppear() {
const res = await kfModel.query({})
Logger.info('获取到库房名称》》', JSON.stringify(res))
this.kfList = res
}
renderKfdm(kfdm) {
if(!kfdm) {
return ''
}
const res = this.kfList.find(v => v.kfdm == kfdm)
return res ? res.kfmc : ''
}
private item: newBgglDto
build() {
Column() {
......@@ -31,18 +17,20 @@ export struct PackList {
})
.margin({ right: 10, left: 10 })
Column() {
Text('订单号:' + this.item.ddh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('库房:' + this.renderKfdm(this.item.kfdm)).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('订单号:' + this.item.ddh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 }).fontSize(12)
Text(`库房: ${this.item.kfmc || '暂无库房'} `).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
}.width('30%')
Column() {
Text('货位:' + this.item.hwh).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text(`货位: ${this.item.hwh || '暂无货位'}`).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('箱数:' + this.item.xs).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
}.width('30%').margin({ left: 10 })
Column() {
Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text('未导出' + this.item.sfdc).alignSelf(ItemAlign.Start).padding({ top: 5, bottom: 5 })
Text(`未导出 ${this.item.sfdc == '0' ? '未导出' : '已导出'}`)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
}.width('30%').margin({ left: 10 })
}
}
......
import { Bggl, Logger, SQLiteContext, Wzcrkmx, WzcrkmxDao } from '@ohos/common'
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
import bgglModel from '../../model/BgglModel'
import wzcrkModel from '../../model/WzcrkModel'
import wzcrkmxModel from '../../model/WzcrkmxModel'
import { BasicTable } from '../../view/BasicTable/BasicTable'
import { TitleBar } from '../../view/title/TitleBar'
import { PackList } from './PackList'
import { YqjList } from '../PageManagement/YqjList'
import { PickList } from './listview/PickList'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
......@@ -21,16 +20,17 @@ import { PackList } from './PackList'
export struct Pick {
controller: SearchController = new SearchController()
wzcrkmxDao: WzcrkmxDao = SQLiteContext.with(WzcrkmxDao)
@State showList: boolean = false
@State ddh: string = ''
@State packList: Bggl[] = []
@State packList: newBgglDto[] = []
onPageShow() {
aboutToAppear() {
this.getPackList()
}
// 获取包裹列表
async getPackList() {
const res = await bgglModel.query({ ddh: this.ddh, bgzt: '未领取' })
const res = await bgglModel.queryNewDara({ ddh: this.ddh, bgzt: '未领取' })
Logger.info('获取到包裹数据', JSON.stringify(res))
this.packList = res
}
......@@ -61,6 +61,9 @@ export struct Pick {
})
.onChange((value: string) => {
})
Image($r("app.media.menu")).width(30).height(30).onClick(() => {
this.showList = !this.showList
})
}
}.margin({ top: 20 })
......@@ -69,14 +72,19 @@ export struct Pick {
if (this.packList.length == 0) {
this.renderEmpty()
} else {
if (this.showList) {
YqjList({ dataSource: $packList })
} else {
List() {
ForEach(this.packList, (item) => {
ListItem() {
PackList({ item })
PickList({ item })
}
})
}.divider({ strokeWidth: 1, color: "#bbbbb1" }).backgroundColor('#fff')
}
}
}.flexGrow(1).padding(15)
Row() {
......
import { DividerTitle } from '../../../view/DividerTitle/DividerTitle';
import { Logger, KfInfo, Gldw, WzPositionClass,SearchData } from '@ohos/common';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
export struct PickDetailDialog{
build() {
Column() {
Flex({ justifyContent:FlexAlign.SpaceBetween,alignItems: ItemAlign.Start }) {
DividerTitle({ title: "订单信息" })
}.padding({top:10,bottom:10 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("订单号:").fontSize(16).lineHeight(18)
Text('JD288242733482X').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("申领人:").fontSize(16).lineHeight(18)
Text('张三').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("手机号:").fontSize(16).lineHeight(18)
Text('18100000262').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("库房:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("发物单位:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("货位号:").fontSize(16).lineHeight(18)
Text('A-1-1-1').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("箱数:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("批次:").fontSize(16).lineHeight(18)
Text('1').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("包裹状态:").fontSize(16).lineHeight(18)
Text('未领取').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("是否到付:").fontSize(16).lineHeight(18)
Text('否').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("到付金额:").fontSize(16).lineHeight(18)
Text('暂无到付金额').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("取件码:").fontSize(16).lineHeight(18)
Text('WC6794').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text("接收时间:").fontSize(16).lineHeight(18)
Text('2024-01-25 20:53:22').fontSize(16).fontColor("#000").fontWeight(700)
}.padding(5)
Divider()
.vertical(false)
.height(14)
.strokeWidth(1.5)
.color('#f1f1f1')
.opacity(0.6)
.margin({ left: 8, right: 8 })
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取件')
.onClick(() => {
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.padding({left:10,right:10})
.width('100%')
.borderRadius(5)
.backgroundColor('#fff')
}
}
\ No newline at end of file
import { newBgglDto } from '@ohos/common/src/main/ets/bean/dto/BgglDto'
@Component
export struct PickList {
item: newBgglDto
build() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
})
.margin({ right: 10, left: 10 })
Column() {
Text('订单号:' + this.item.ddh)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.fontSize(12)
.padding({ top: 5, bottom: 5 })
Text('库房:' + this.item.kfmc)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('张三:' + this.item.slr)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
}.width('40%')
Column() {
Text(`货位: ${this.item.hwh || '暂无货位'}`)
.alignSelf(ItemAlign.Start)
.padding({ top: 5, bottom: 5 })
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('箱数:' + this.item.xs)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
Text('取件码:' + this.item.qjm)
.alignSelf(ItemAlign.Start)
.fontColor("#000")
.padding({ top: 5, bottom: 5 })
.fontSize(13)
}.width('30%').margin({ left: 10 })
Column() {
Text('批次:' + this.item.pc).alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 })
Text('未取件').alignSelf(ItemAlign.Start).fontColor("#000").padding({ top: 5, bottom: 5 })
}.width('20%').margin({ left: 10 })
}
}.width("100%")
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import {
@Entry
@Component
export struct MaterialManagement {
@State liseModel:boolean=true
build(){
Column() {
Flex({ direction: FlexDirection.Column }) {
......@@ -23,22 +24,38 @@ export struct MaterialManagement {
.fontColor('#fff')
Image($r("app.media.menu")).size({ width: 55, height: 55 }).padding(15)
.onClick(()=>{
router.pushUrl({
url: 'identify/demo_page/ScanDemo',
})
// router.pushUrl({
// url: 'identify/demo_page/ScanDemo',
// })
this.liseModel=!this.liseModel
})
}.padding({top: `${StatusBarManager.get().getSystemBarOffset()}px`})
}.margin({ top: 15 })
if(this.liseModel){
this.gridView()
}else{
this.ListView()
}
}.margin({
left:20,
right:20
})
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
@Builder gridView(){
Column(){
Grid() {
ForEach(gridWordModel.getGridWorkData(), (secondItem: ItemData) => {
GridItem() {
Column() {
Image(secondItem.img).borderRadius(12)
.height("72%")
.onClick(() => {
// router.pushUrl({ url: CommonConstants.PLAY_PAGE });
this.onGridItemClick(secondItem.others);
})
Text(secondItem.title).width('94.4%')
.fontSize(21)
.fontWeight(500)
......@@ -50,7 +67,10 @@ export struct MaterialManagement {
.padding(10)
.width("100%")
.height('100%')
}
}.onClick(() => {
// router.pushUrl({ url: CommonConstants.PLAY_PAGE });
this.onGridItemClick(secondItem.others);
})
.padding({ top: $r('app.float.home_list_padding'), left: $r('app.float.home_list_padding') })
.borderRadius($r('app.float.home_backgroundImage_borderRadius'))
.align(Alignment.TopStart)
......@@ -66,16 +86,40 @@ export struct MaterialManagement {
.columnsGap($r('app.float.home_grid_columnsGap'))
.rowsGap($r('app.float.home_grid_rowGap'))
.margin({ bottom: $r('app.float.setting_account_fontSize') })
}.margin({
left:20,
right:20
}
}
@Builder ListView(){
Column(){
List({ space: 2 }) {
ForEach(gridWordModel.getGridWorkData(), (secondItem: ItemData) => {
ListItem() {
Row() {
Row() {
Image(secondItem?.img)
.width(24)
.height(24)
.margin({ right: 8 })
Text(secondItem?.title).fontSize(20).fontColor('#3b4144')
}
.width('60%')
Blank()
.layoutWeight(1)
Image($r('app.media.right_grey')).width(8).height(16)
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 12, right: 18 ,top:10,bottom:10})
}.onClick(() => {
// router.pushUrl({ url: CommonConstants.PLAY_PAGE });
this.onGridItemClick(secondItem.others);
})
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
.width('100%')
.backgroundColor('#fff')
.divider({ strokeWidth: 1, color: 'rgb(242,242,242)' }) // 每行之间的分界线
}
}
onGridItemClick(type?:string):void {
switch (type) {
......
export { PageManagement } from './src/main/ets/pages/PageManagement'
export { PageManagement } from '../../entry/src/main/ets/pages/PageManagement/PageManagement'
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论