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
dfeccf20
Commit
dfeccf20
authored
Jan 29, 2024
by
陈桂东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
4f664e8c
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
990 行增加
和
508 行删除
+990
-508
WzDetail.ets
entry/src/main/ets/pages/metailmange/Common/WzDetail.ets
+9
-10
WzinsertDetail.ets
entry/src/main/ets/pages/metailmange/Common/WzinsertDetail.ets
+8
-9
WzConversionPage.ets
entry/src/main/ets/pages/metailmange/WzConversionPage/WzConversionPage.ets
+125
-53
WzExchangePage.ets
entry/src/main/ets/pages/metailmange/WzExchangePage/WzExchangePage.ets
+336
-88
AddWzin.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/AddWzin.ets
+73
-46
PzInfo.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/PzInfo.ets
+16
-15
WzInvPage.ets
entry/src/main/ets/pages/metailmange/WzInvPage/WzInvPage.ets
+60
-143
WzOutPage.ets
entry/src/main/ets/pages/metailmange/WzOutPage/WzOutPage.ets
+300
-96
WzReversePage.ets
entry/src/main/ets/pages/metailmange/WzReversePage/WzReversePage.ets
+63
-48
没有找到文件。
entry/src/main/ets/pages/metailmange/Common/WzDetail.ets
View file @
dfeccf20
...
...
@@ -36,7 +36,6 @@ struct WzinDetail {
@State fontColor: string = '#0FA983'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
@State dataType: boolean = false
@State isHaveButton: boolean = false // 完成状态, 未完成是true, 其他false
@State pageType: string = '入库'
...
...
@@ -82,7 +81,7 @@ struct WzinDetail {
break;
case '5':
this.pageType = '倒库'
// this.currentModel = true
// this.currentModel = true
break;
case 'HW44':
this.pageType = '换位'
...
...
@@ -134,7 +133,7 @@ struct WzinDetail {
if (testDkSql && testDkSql.length > 0) {
const testDkSqlData = testDkSql.map(item => item.crksl)
var statistics = 0
statistics = testDkSqlData.reduce(function(prev, cur, index, array) {
statistics = testDkSqlData.reduce(function
(prev, cur, index, array) {
return Number(prev) + Number(cur);
})
console.log('倒库验证', statistics)
...
...
@@ -194,9 +193,6 @@ struct WzinDetail {
}
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
...
...
@@ -248,11 +244,14 @@ struct WzinDetail {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("射频扫码").CommonButtonStyle().width("50%").onClick(() => {
router.pushUrl({ url: 'pages/metailmange/UHFScanPage', params: { wzcrkItem: this.wzcrk } })
})
Button("保存").CommonButtonStyle().width("50%")
if (['入库', '出库'].includes(this.pageType)) {
Button("射频扫码").CommonButtonStyle().width("50%").onClick(() => {
router.pushUrl({ url: 'pages/metailmange/UHFScanPage', params: { wzcrkItem: this.wzcrk } })
})
}
Button("保存").CommonButtonStyle().width(['入库', '出库'].includes(this.pageType) ? '50%' : '90%')
.onClick(async () => {
try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
...
...
entry/src/main/ets/pages/metailmange/Common/WzinsertDetail.ets
View file @
dfeccf20
...
...
@@ -93,9 +93,9 @@ struct WzinsertDetail {
newType = 'wzhw'
this.wzcrk.pzlx = 'HW44'
this.hanleGetDefaultPzh(this.wzcrk.pzlx)
// uni.setNavigationBarTitle({
// title: '物资换位', // 设置页签名称
// });
// uni.setNavigationBarTitle({
// title: '物资换位', // 设置页签名称
// });
break;
default:
this.pageType = '入库'
...
...
@@ -313,8 +313,8 @@ struct WzinsertDetail {
if (testRk && testRk.length > 0) {
testRk.forEach(async (tItem) => {
await wzcrkModel.updateRkWz({
...data[count],
hwguid: tItem.guid
...data[count],
hwguid: tItem.guid
})
// await createOrFindSQL("GY_M_PMV3",
// updateRkWzSql({
...
...
@@ -355,8 +355,8 @@ struct WzinsertDetail {
const zsParams = {
wzcrkguid: this.uuId
}
wzcrkModel.selectZs(zsParams).then(async
(hjData) => {
// selectInformationType("GY_M_PMV3", selectZs(zsParams)).then((hjData) => {
wzcrkModel.selectZs(zsParams).then(async (hjData) => {
// selectInformationType("GY_M_PMV3", selectZs(zsParams)).then((hjData) => {
if (hjData && hjData.length > 0) {
const {
crksl,
...
...
@@ -379,7 +379,6 @@ struct WzinsertDetail {
}, 1500)
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
...
...
@@ -401,7 +400,7 @@ struct WzinsertDetail {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
Column() {
AddWzin({ wzcrk: this.wzcrk })
AddWzin({ wzcrk: this.wzcrk
, pageType: this.pageType
})
}.width("100%")
}.tabBar(this.TabBuilder(0, '凭证信息'))
...
...
entry/src/main/ets/pages/metailmange/WzConversionPage/WzConversionPage.ets
View file @
dfeccf20
...
...
@@ -10,16 +10,19 @@ 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';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({
top:1,bottom:1,right:7,left:7
})
.padding({
top: 1, bottom: 1, right: 7, left: 7
})
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(7)
.type(ButtonType.Normal)
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
...
...
@@ -27,7 +30,7 @@ interface SearchData {
@Entry
@Component
struct Wz
ConversionPage
{
struct Wz
ReversePage
{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
...
...
@@ -38,24 +41,53 @@ struct WzConversionPage{
pzh: '',
wczt: '未完成'
}
@State page: number = 1
@State rows: number = 10
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
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
})
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
aboutToAppear() {
this.getWzcrkList()
}
async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = []
const res = await wzcrkModel.query({
pzlx: "HW44",
pzh: this.searchData.pzh,
wczt: this.searchData.wczt,
sjlx: this.currentIndex === 0 ? "导入" : "临时调号" })
wczt: this.currentIndex === 0 ? "未完成" : "完成" })
res.forEach(element => {
this.dataSource.push(new WzClass(element))
});
Logger.info('数量是' + JSON.stringify(this.dataSource))
}
@Builder container() {
Column() {
Row() {
...
...
@@ -82,58 +114,35 @@ struct WzConversionPage{
Divider().strokeWidth(1).color('rgb(242,242,242)')
}
}
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onSubmit() {
try{
this.checkedList.forEach(async (element)
=>
{
try
{
this.checkedList.forEach(async (element)
=>
{
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成'))
if(num) {
if
(num) {
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
}
})
}
catch(e)
{
}
catch (e)
{
}
finally
{
}
finally
{
this.checkedList = []
}
}
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() {
this.checkedList.forEach(async element => {
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '17'
})
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')
...
...
@@ -162,7 +171,7 @@ struct WzConversionPage{
...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b
},0),
},
0),
scjid: "863576927543400,863576927543400",
cjmc: "普华",
imei: "863576927543400,863576927543400",
...
...
@@ -192,6 +201,22 @@ struct WzConversionPage{
}],
})
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
...
...
@@ -200,14 +225,16 @@ struct WzConversionPage{
}
}.height('70%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("新建换位")
.bottomBtnSty()
.onClick(
() => {
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddConversionPage",
url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '新建换位', pzlx: 'HW44' }
})
})
.fontColor("#0fa983")
...
...
@@ -215,28 +242,56 @@ struct WzConversionPage{
Button("设置状态")
.bottomBtnSty()
.onClick(() => {
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请至少选择一条单据'
})
} else {
if (this.dialogController != undefined) {
this.dialogController.open()
}
}
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
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")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
.bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid)
})
Button("清空选择")
.bottomBtnSty()
.onClick(() =>{
}).fontColor("#0fa983")
.fontSize("14vp")
.onClick(() =>
{
this.checkedList = []
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(80)
}
build(){
build() {
Column() {
Flex({
direction:FlexDirection.Column})
{
TitleBar({ title:"物资换位" })
Row(){
Flex({
direction: FlexDirection.Column })
{
TitleBar({ title:
"物资换位" })
Row()
{
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
...
...
@@ -256,6 +311,22 @@ struct WzConversionPage{
}
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '未完成'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '完成'))
}
.height(80)
.margin({ top: -15 })
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
})
// 列表
Column() {
...
...
@@ -267,10 +338,11 @@ struct WzConversionPage{
ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/
WzConversionPage/WzConversionDetailPage/WzConversionDetailPage
', params: {
router.pushUrl({ url: 'pages/metailmange/
Common/WzDetail
', params: {
wzcrk: item,
isUpdate:true
} },)
pzlx: 'HW44',
tab: (this.currentIndex === 0 ? "导入" : "新建换位"),
} })
})
})
}.padding(18)
...
...
@@ -278,8 +350,7 @@ struct WzConversionPage{
}.flexGrow(1).alignSelf(ItemAlign.Center)
Row(){
Row() {
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
...
...
@@ -287,7 +358,7 @@ struct WzConversionPage{
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]]
// 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzExchangePage/WzExchangePage.ets
View file @
dfeccf20
import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common';
import { WzClass } from '../Common/Wzcrk.data';
import { WzList } from '../Common/WzcrkList';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { getDefaultPzh, WzClass } from '../Common/Wzcrk.data'
import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import {
dateUtils } from '@ohos/common/src/main/ets/utils/util
';
import {
ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog
';
import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import { MatchingOfDocumentsDialog } from '../Common/Dialog/MatchingOfDocumentsDialog';
import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { DjcxDto } from '@ohos/common/src/main/ets/bean/dto/RecommendHwDto.ts';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({
top:1,bottom:1,right:7,left:7
})
.padding({
top: 1, bottom: 1, right: 7, left: 7
})
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
...
...
@@ -21,13 +24,15 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
.type(ButtonType.Normal)
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
}
@Entry
@Component
struct WzExchangePage
{
export struct WzInPage
{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
...
...
@@ -38,24 +43,85 @@ struct WzExchangePage{
pzh: '',
wczt: '未完成'
}
@State defaultSelectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }]
@State selectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }]
@State page: number = 1
@State rows: number = 10
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
// 单据匹配数据
@State modList: Array<DjcxDto> = []
@State bdguid: string = ''
params = {
pzh: this.pzh,
page: this.page,
rows: this.rows,
sjlx: this.currentIndex === 0 ? "导入" : "临时调号",
wczt: "未完成"
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
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
})
matchingOfDocumentsDialog: CustomDialogController = new CustomDialogController({
builder: MatchingOfDocumentsDialog({
modList: $modList,
checkedList: $checkedList,
bdguid: $bdguid,
confirm: this.matchingOfDocumentsSubmit,
}),
autoCancel: true,
alignment: DialogAlignment.Center,
customStyle: true
})
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
aboutToAppear() {
itemClick() {
router.pushUrl({ url: 'pages/order_detail/PzInOutDetailPage' })
}
onPageShow() {
this.getWzcrkList()
}
async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = []
const res = await wzcrkModel.query({
pzlx: "41",
pzh: Number(this.searchData.pzh),
wczt: this.searchData.wczt,
sjlx: this.currentIndex === 0 ? "导入" : "临时调号" })
sjlx: this.currentIndex === 0 ? "导入" : "临时调号"
})
Logger.info('出入库数据>>:', JSON.stringify(res))
Logger.info('出入库数据长度>>:', JSON.stringify(res.length))
res.forEach(element => {
this.dataSource.push(new WzClass(element))
});
Logger.info('数量是' + JSON.stringify(this.dataSource))
}
@Builder container() {
Column() {
Row() {
...
...
@@ -82,57 +148,35 @@ struct WzExchangePage{
Divider().strokeWidth(1).color('rgb(242,242,242)')
}
}
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onSubmit() {
try{
this.checkedList.forEach(async (element)
=>
{
try
{
this.checkedList.forEach(async (element)
=>
{
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成'))
if(num) {
if
(num) {
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
}
})
}
catch(e)
{
}
catch (e)
{
}
finally
{
}
finally
{
this.checkedList = []
}
}
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() {
this.checkedList.forEach(async element => {
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '17'
})
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '14'
})
const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before')
...
...
@@ -161,7 +205,7 @@ struct WzExchangePage{
...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b
},0),
},
0),
scjid: "863576927543400,863576927543400",
cjmc: "普华",
imei: "863576927543400,863576927543400",
...
...
@@ -192,14 +236,167 @@ struct WzExchangePage{
})
}
async openMatchingOfDocumentsDialog() {
const res = await wzcrkModel.getDjcx()
this.modList = res
if (this.matchingOfDocumentsDialog != undefined) {
this.matchingOfDocumentsDialog.open()
}
}
async matchingOfDocumentsSubmit() {
try {
if (!this.bdguid) {
promptAction.showToast({
message: '请选择绑定单据'
})
return
}
// 绑定主表
var guidStr = []
this.checkedList.forEach((item) => {
const str = item
guidStr.push(str)
})
// 1.绑定单据主表 新建状态 完成已绑定
const params = {
// pzzbguid: data.pzzbguid,
guid: guidStr.join(','),
bdguid: this.bdguid
}
console.log(">>>>>>>>>>>显示bgguid:", this.bdguid)
await wzcrkModel.binding(params)
// 2.设置被绑定的表状态
const wzcrkActiveParams = {
active: "完成",
guid: this.bdguid,
bdguid: guidStr.join(','),
// ydh: this.dataSource.find(i => i.guid == this.checkedList[0]).ydh
}
await wzcrkModel.setActiveAndBdguid(wzcrkActiveParams)
// 绑定物资明细
// 1.导入表查询
const bbParams = {
guid: this.bdguid
}
const exportWzData = await wzcrkModel.getWzmx(bbParams)
// 2.临时收发物查询
const lssfwParams = {
guid: this.checkedList[0]
}
const lssfwWzData = await wzcrkModel.getWzmx(lssfwParams)
// 3. 对比物资明细数据
var result = [];
lssfwWzData.forEach((item1, index1) => {
let checkBool = false
exportWzData.forEach((item2, index2) => {
if (item1.pmdmcode === item2.pmdmcode) {
checkBool = true
}
})
if (!checkBool) {
result.push(item1);
}
})
result.forEach(async (item) => {
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: new Date().getFullYear() + '',
// pzmxguid: item.mxguid,
...item
}
await wzcrkmxModel.insertWzBing(insertParams)
})
const insertPmdm = [...new Set(result.map((item) => item.pmdmcode))]
console.log('insertPmdm', insertPmdm)
var itPmdm = []
lssfwWzData.forEach((item1, index1) => {
if (!insertPmdm.includes(item1.pmdmcode)) {
itPmdm.push(item1)
}
})
console.log('itPmdm', itPmdm)
const itPmdmList = [...new Set(itPmdm.map(item => item.pmdmcode))]
console.log('itPmdmList', itPmdmList)
var dataObj = {}
lssfwWzData.forEach((item) => {
if (itPmdmList.includes(item.pmdmcode)) {
if (dataObj[item.pmdmcode] && dataObj[item.pmdmcode].length > 0) {
dataObj[item.pmdmcode].push(item)
} else {
dataObj[item.pmdmcode] = [item]
}
}
})
console.log('dataObj', dataObj)
for (let j in dataObj) {
const [filterData] = exportWzData.filter((item) => item.pmdmcode === j)
dataObj[j].forEach(async (item, index) => {
item.mxguid = filterData.mxguid
})
}
console.log('dataObj', dataObj)
for (let j in dataObj) {
dataObj[j].forEach(async (item, index) => {
console.log('index', index)
if (index == 0) {
const updateParams = {
crksl: item.crksl,
hwh: item.hwh,
mxguid: item.mxguid
}
console.log('updateParams', updateParams)
// 更新
await wzcrkmxModel.updateWzmx(updateParams)
} else {
// 新增
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: new Date().getFullYear() + '',
pzmxguid: item.mxguid,
...item
}
console.log('insertParams', insertParams)
await wzcrkmxModel.insertWzBing(insertParams)
}
})
}
// // 4. 同品种合并绑定数据
// const exportDataparams = {
// wzcrkguid: data.guid,
// guid: guidStr.join(',')
// }
// await database.createOrFindSQL("GY_M_PMV3", bindingExportDataSql(exportDataparams))
promptAction.showToast({
message: '绑定成功'
})
} catch (e) {
promptAction.showToast({
message: '绑定失败'
})
}
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({
top: 17,
bottom: 7 })
.margin({ bottom: 7 })
Divider()
.strokeWidth(1)
.color('rgb(242,242,242)')
.strokeWidth(2)
.color('#fff')
.width(50)
...
...
@@ -207,23 +404,16 @@ struct WzExchangePage{
}.width('100%')
}
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Image($r("app.media.empty")).width("42%")
Text("暂无数据").fontSize(22).fontColor("#fff").margin({ top: 5 })
}
}.height('70%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时调号")
.visibility(this.currentIndex === 1 ? Visibility.Visible
:
Visibility.None)
.visibility(this.currentIndex === 1 ? Visibility.Visible
:
Visibility.None)
.bottomBtnSty()
.onClick( () => {
.onClick(
async
() => {
router.pushUrl({
url: "pages/metailmange/AddAdjustModelPage",
url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '临时调号', pzlx: '4' }
})
})
.fontColor("#0fa983")
...
...
@@ -243,6 +433,32 @@ struct WzExchangePage{
})
.fontColor("#0fa983")
.fontSize("14vp")
// Button("单据匹配")
// .visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
// .bottomBtnSty()
// .onClick(() => {
// if (this.checkedList.length == 0) {
// promptAction.showToast({
// message: '请选择操作的凭证'
// })
// return
// }
// else if (this.checkedList.length > 1) {
// promptAction.showToast({
// message: '仅支持单选数据绑定'
// })
// return
// }
// else if (this.dataSource.filter(i => i.wczt == '未完成').length > 0) {
// promptAction.showToast({
// message: '请选择完成状态进行单据匹配'
// })
// } else {
// this.openMatchingOfDocumentsDialog()
// }
// })
// .fontColor("#0fa983")
// .fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
...
...
@@ -259,7 +475,11 @@ struct WzExchangePage{
this.exportDialogController.open()
}
}
}).fontColor("#0fa983") .fontSize("14vp")
})
.fontColor("#0fa983")
.fontSize("14vp")
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => {
...
...
@@ -273,11 +493,36 @@ struct WzExchangePage{
}
}.height(80)
}
build(){
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Image($r("app.media.empty")).width("42%")
Text("暂无数据").fontSize(22).fontColor("#fff").margin({ top: 5 })
}
}.height('70%')
}
build() {
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资调号" })
Row(){
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "临时调号" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时调号'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
})
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
...
...
@@ -286,33 +531,39 @@ struct WzExchangePage{
.textAlign(TextAlign.Center)
.placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 })
.width('
10
0%')
.width('
6
0%')
.onSubmit((value: string) => {
this.pzh = value
})
.onChange((value: string) => {
this.searchData.pzh = value
this.getWzcrkList()
})
.borderRadius(5)
Select(this.currentIndex === 1 ? this.selectValue : this.defaultSelectValue)
.value('未完成')
.selected(0)
.borderWidth(1)
.borderRadius(6)
.height(42)
.margin({ left: 10 })
.borderColor("#454545")
.onSelect(async (index: number, value?: string) => {
if (value == this.searchData.wczt) {
} else {
this.searchData.wczt = value
this.getWzcrkList()
}
})
.width(120)
.padding({
right: 15
})
}
}.width("100%")
}.margin({ top: -20 })
.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时调号'))
}
.height(80)
.margin({top:-15})
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
})
// 列表
Column() {
...
...
@@ -325,30 +576,28 @@ struct WzExchangePage{
ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/
WzExchangePage/WzExchangeDetailPage/WzExchangeDetailPage
', params: {
router.pushUrl({ url: 'pages/metailmange/
Common/WzDetail
', params: {
wzcrk: item,
isUpdate:true
} },)
pzlx: '4',
tab: (this.currentIndex === 0 ? "导入" : "临时调号"),
} })
})
})
}.padding(1
8
)
}.padding(1
5
)
}
}.flexGrow(1).alignSelf(ItemAlign.Center)
Row(){
// 底部按钮
// 底部按钮
Row() {
this.bottomButtons();
}.
backgroundColor("#97c6a6").width("100%").height(80
)
}.
width("100%"
)
}
}.linearGradient({
}.
width("100%").
linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]]
// 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/AddWzin.ets
View file @
dfeccf20
...
...
@@ -23,6 +23,7 @@ class Form {
enabled: boolean
required: boolean
type: 'input' | 'select'
typeList: string[]
options?: Options[]
constructor(data: {
...
...
@@ -31,12 +32,14 @@ class Form {
enabled: boolean
type: 'input' | 'select',
required: boolean,
typeList: string[],
options?: Options[]
}) {
this.title = data.title
this.key = data.key
this.enabled = data.enabled
this.type = data.type
this.typeList = data.typeList || []
this.required = data.required || false
this.options = data.options
}
...
...
@@ -47,9 +50,16 @@ class Form {
export struct AddWzin {
@ObjectLink wzcrk: WzClass
@State form: Form[] = []
pageType: string
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false, type: 'input' },
{ title: "凭证号", key: 'pzh', enabled: false, type: 'input' },
{ title: "收支类型", key: 'pzszlx', enabled: false, type: 'input' },
{
title: "收支类型",
key: 'pzszlx',
enabled: false,
type: 'input',
typeList: ['出库', '入库', '调号']
},
{
title: "库房",
key: 'kfdm',
...
...
@@ -90,7 +100,20 @@ export struct AddWzin {
options: [],
required: true
},
{ title: "运单号", key: 'ydh', enabled: true, type: 'input' },
{
title: "运单号",
key: 'ydh',
enabled: true,
type: 'input',
typeList: ['出库', '入库']
},
{
title: "调号单位",
key: 'sfdw',
enabled: false,
type: 'input',
typeList: ['调号']
},
{ title: "备注", key: 'dec', enabled: true, type: 'input' }
]
...
...
@@ -189,55 +212,59 @@ export struct AddWzin {
List() {
ForEach(this.form, (item) => {
ListItem() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
if (item.typeList.length == 0 || item.typeList.includes[this.pageType]) {
ListItem() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Row() {
if (item.required) {
Text('*').fontColor('red').margin({ right: 5 })
Row() {
if (item.required) {
Text('*').fontColor('red').margin({ right: 5 })
}
Text(item.title)
.fontSize(14)
.height(40)
.fontColor($r("app.color.item_color_black"))
}.width("35%")
if (item.type == 'select') {
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
console.log('>>>>>>>>>选择了+', JSON.stringify(this.wzcrk))
})
}
Text(item.title)
.fontSize(14)
.height(40)
.fontColor($r("app.color.item_color_black"))
}.width("35%")
if (item.type == 'select') {
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
console.log('>>>>>>>>>选择了+', JSON.stringify(this.wzcrk))
})
}
if (item.type == 'input') {
TextInput({ text: this.handleText(item.key) })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
.borderRadius(5)
.height(40)
.padding(10)
.flexGrow(1)
.borderColor('#bcc5d7')
.borderWidth(1)
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled)
.onChange((value: string) => {
if (item.enabled) {
this.wzcrk[item.key] = value
}
})
if (item.type == 'input') {
TextInput({ text: this.handleText(item.key) })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
.borderRadius(5)
.height(40)
.padding(10)
.flexGrow(1)
.borderColor('#bcc5d7')
.borderWidth(1)
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled)
.onChange((value: string) => {
if (item.enabled) {
this.wzcrk[item.key] = value
}
})
}
}
}
}
}.padding(15)
}.padding(15)
}
})
}.margin({ bottom: 40 })
}.backgroundColor('#fff')
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzinDetail/PzInfo.ets
View file @
dfeccf20
import gldwModel from '../../../../model/GldwModel'
import kfModel from '../../../../model/KfModel'
import { renderPzlx, renderSzlx, renderZmlx, WzClass } from '../../Common/Wzcrk.data'
@Component
// 物资信息
export struct PzInfo {
...
...
@@ -8,11 +9,11 @@ export struct PzInfo {
@State fwgldw: string = ''
@State swgldw: string = ''
@ObjectLink wzcrk: WzClass
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false },
{ title: "凭证号", key: 'pzh', enabled: false },
{ title: "库房", key: 'kfguid', enabled: false },
{ title: "收支类型", key: 'pzszlx', enabled: false },
{ title: "调号单位", key: 'pzszlx', enabled: false },
{ title: "运单号", key: 'ydh', enabled: true },
{ title: "发物管理单位", key: 'fwgldwdm', enabled: false },
{ title: "收物管理单位", key: 'swgldwdm', enabled: false },
...
...
@@ -20,22 +21,21 @@ export struct PzInfo {
{ title: "备注", key: 'dec', enabled: true }
]
aboutToAppear(){
aboutToAppear()
{
this.getData()
}
async getData() {
const res = await kfModel.query({
guid: this.wzcrk.kfguid
})
const res = await kfModel.query({
guid: this.wzcrk.kfguid
})
this.kfmc = res[0].kfmc ?? ''
const res1 = await gldwModel.queryByData({
dwdm:this.wzcrk.fwgldwdm
})
const res1 = await gldwModel.queryByData({
dwdm: this.wzcrk.fwgldwdm
})
this.fwgldw = res1[0].dwfh ?? ''
const res2 = await gldwModel.queryByData({
dwdm:this.wzcrk.swgldwdm
})
const res2 = await gldwModel.queryByData({
dwdm: this.wzcrk.swgldwdm
})
this.swgldw = res2[0].dwfh ?? ''
}
handleText(key: string): string {
switch (key) {
case 'pzlx':
...
...
@@ -61,8 +61,8 @@ export struct PzInfo {
}
}
build(){
Column(){
build()
{
Column()
{
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
Divider()
.vertical(true)
...
...
@@ -74,17 +74,18 @@ export struct PzInfo {
Text("凭证信息")
.fontSize(16)
}.height('8%')
List(){
ForEach(this.arr,(item) => {
ListItem(){
Column(){
List() {
ForEach(this.arr, (item) => {
ListItem() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Text(item.title)
.fontSize(14)
.width("30%")
.height(40)
.fontColor($r("app.color.item_color_black"))
TextInput({ text: this.handleText(item.key),placeholder: `请输入${item.title}` })
TextInput({ text: this.handleText(item.key),
placeholder: `请输入${item.title}` })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
.borderRadius(5)
...
...
@@ -96,7 +97,7 @@ export struct PzInfo {
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled)
.onChange((value: string) => {
if(item.enabled) {
if
(item.enabled) {
this.wzcrk[item.key] = value
}
})
...
...
@@ -104,7 +105,7 @@ export struct PzInfo {
}
}.padding(15)
})
}.margin({
bottom:40
})
}.margin({
bottom: 40
})
}.backgroundColor('#fff')
}
...
...
entry/src/main/ets/pages/metailmange/WzInvPage/WzInvPage.ets
View file @
dfeccf20
import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router';
import { WzList } from '../Common/WzcrkList';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { WzClass, getDefaultPzh } from '../Common/Wzcrk.data'
import { Logger } from '@ohos/common';
import { WzClass } from '../Common/Wzcrk.data';
import { WzList } from '../Common/WzcrkList';
import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import {
ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog
';
import {
dateUtils } from '@ohos/common/src/main/ets/utils/util
';
import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api';
import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({ top: 1, bottom: 1, right: 7, left: 7 })
...
...
@@ -19,14 +20,17 @@ import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
.borderRadius(7)
.type(ButtonType.Normal)
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
}
@Entry
@Component
struct Wz
InvPage
{
struct Wz
ReversePage
{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
...
...
@@ -37,26 +41,39 @@ struct WzInvPage{
pzh: '',
wczt: '未完成'
}
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State page: number = 1
@State rows: number = 10
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
params = {
pzh: this.pzh,
page: this.page,
rows: this.rows,
sjlx: this.currentIndex === 0 ? "未完成" : "完成",
wczt: "未完成"
}
itemClick() {
router.pushUrl({ url: 'pages/order_detail/PzInOutDetailPage' })
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
exportDialogController: CustomDialogController = new CustomDialogController({
builder: ExportOrderDialog({
checkedList: $checkedList,
dataSource: $dataSource,
container: this.exportContainer
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
aboutToAppear() {
this.getWzcrkList()
}
async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = []
const res = await wzcrkModel.query({
...
...
@@ -68,6 +85,7 @@ struct WzInvPage{
});
Logger.info('数量是' + JSON.stringify(this.dataSource))
}
@Builder container() {
Column() {
Row() {
...
...
@@ -94,114 +112,28 @@ struct WzInvPage{
Divider().strokeWidth(1).color('rgb(242,242,242)')
}
}
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onSubmit() {
try{
this.checkedList.forEach(async (element)
=>
{
try
{
this.checkedList.forEach(async (element)
=>
{
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成'))
if(num) {
if
(num) {
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
}
})
}
catch(e)
{
}
catch (e)
{
}
finally
{
}
finally
{
this.checkedList = []
}
}
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() {
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
})
}
})
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',
}],
})
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
...
...
@@ -216,6 +148,7 @@ struct WzInvPage{
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
...
...
@@ -224,6 +157,7 @@ struct WzInvPage{
}
}.height('70%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
...
...
@@ -242,26 +176,8 @@ struct WzInvPage{
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.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")
Button("全选")
.bottomBtnSty().fontColor("#0fa983")
.fontSize("14vp")
.bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid)
})
...
...
@@ -269,15 +185,16 @@ struct WzInvPage{
.bottomBtnSty()
.onClick(() => {
this.checkedList = []
}).fontColor("#0fa983")
.fontSize("14vp")
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(80)
}
build(){
build() {
Column() {
Flex({
direction:FlexDirection.Column})
{
TitleBar({ title:"物资盘库" })
Row(){
Flex({
direction: FlexDirection.Column })
{
TitleBar({ title:
"物资盘库" })
Row()
{
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
...
...
@@ -297,6 +214,7 @@ struct WzInvPage{
}
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
...
...
@@ -307,7 +225,7 @@ struct WzInvPage{
}.tabBar(this.TabBuilder(1, '完成'))
}
.height(80)
.margin({
top:-15
})
.margin({
top: -15
})
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
...
...
@@ -323,9 +241,11 @@ struct WzInvPage{
ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzInvPage/WzInvDetail/WzInvDetail', params: {
wzcrk: item
} },)
router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item,
pzlx: '3',
tab: '导入',
} })
})
})
}.padding(18)
...
...
@@ -333,8 +253,7 @@ struct WzInvPage{
}.flexGrow(1).alignSelf(ItemAlign.Center)
Row(){
Row() {
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
...
...
@@ -342,8 +261,7 @@ struct WzInvPage{
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]]
// 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzOutPage/WzOutPage.ets
View file @
dfeccf20
import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common';
import { WzClass } from '../Common/Wzcrk.data';
import { WzList } from '../Common/WzcrkList';
import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { getDefaultPzh, WzClass } from '../Common/Wzcrk.data'
import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import {
dateUtils } from '@ohos/common/src/main/ets/utils/util
';
import {
ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog
';
import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import { MatchingOfDocumentsDialog } from '../Common/Dialog/MatchingOfDocumentsDialog';
import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { DjcxDto } from '@ohos/common/src/main/ets/bean/dto/RecommendHwDto.ts';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({
top:1,bottom:1,right:7,left:7
})
.padding({
top: 1, bottom: 1, right: 7, left: 7
})
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(7)
.type(ButtonType.Normal)
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
}
@Entry
@Component
export struct Wz
Out
Page {
export struct Wz
In
Page {
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
...
...
@@ -39,13 +43,62 @@ export struct WzOutPage {
pzh: '',
wczt: '未完成'
}
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State defaultSelectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }]
@State selectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }, { value: "完成已绑定" }]
@State page: number = 1
@State rows: number = 10
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
// 单据匹配数据
@State modList: Array<DjcxDto> = []
@State bdguid: string = ''
params = {
pzh: this.pzh,
page: this.page,
rows: this.rows,
sjlx: this.currentIndex === 0 ? "导入" : "临时发物",
wczt: "未完成"
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
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
})
matchingOfDocumentsDialog: CustomDialogController = new CustomDialogController({
builder: MatchingOfDocumentsDialog({
modList: $modList,
checkedList: $checkedList,
bdguid: $bdguid,
confirm: this.matchingOfDocumentsSubmit,
}),
autoCancel: true,
alignment: DialogAlignment.Center,
customStyle: true
})
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
itemClick() {
router.pushUrl({
url:'pages/order_detail/PzInOutDetailPage'
})
router.pushUrl({
url: 'pages/order_detail/PzInOutDetailPage'
})
}
onPageShow() {
...
...
@@ -53,12 +106,16 @@ export struct WzOutPage {
}
async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = []
const res = await wzcrkModel.query({
pzlx: "17",
pzh:
this.searchData.pzh
,
pzh:
Number(this.searchData.pzh)
,
wczt: this.searchData.wczt,
sjlx: this.currentIndex === 0 ? "导入" : "临时发物" })
sjlx: this.currentIndex === 0 ? "导入" : "临时发物"
})
Logger.info('出入库数据>>:', JSON.stringify(res))
Logger.info('出入库数据长度>>:', JSON.stringify(res.length))
res.forEach(element => {
this.dataSource.push(new WzClass(element))
});
...
...
@@ -98,54 +155,28 @@ export struct WzOutPage {
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onSubmit() {
try{
this.checkedList.forEach(async (element)
=>
{
try
{
this.checkedList.forEach(async (element)
=>
{
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成'))
if(num) {
if
(num) {
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
}
})
}
catch(e)
{
}
catch (e)
{
}
finally
{
}
finally
{
this.checkedList = []
}
}
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() {
this.checkedList.forEach(async element => {
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '17'
})
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '14'
})
const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before')
...
...
@@ -174,7 +205,7 @@ export struct WzOutPage {
...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b
},0),
},
0),
scjid: "863576927543400,863576927543400",
cjmc: "普华",
imei: "863576927543400,863576927543400",
...
...
@@ -197,7 +228,7 @@ export struct WzOutPage {
})
promptAction.showDialog({
title: '提示',
message: '
出库作业单据已同步至业务系统,请以保管员身份登录业务系统,在菜单“作业项目——物资出
库”里刷新查看。',
message: '
入库作业单据已同步至业务系统,请以保管员身份登录业务系统,在菜单“作业项目--物资入
库”里刷新查看。',
buttons: [{
text: '已知晓',
color: '#0fa983',
...
...
@@ -205,14 +236,167 @@ export struct WzOutPage {
})
}
async openMatchingOfDocumentsDialog() {
const res = await wzcrkModel.getDjcx()
this.modList = res
if (this.matchingOfDocumentsDialog != undefined) {
this.matchingOfDocumentsDialog.open()
}
}
async matchingOfDocumentsSubmit() {
try {
if (!this.bdguid) {
promptAction.showToast({
message: '请选择绑定单据'
})
return
}
// 绑定主表
var guidStr = []
this.checkedList.forEach((item) => {
const str = item
guidStr.push(str)
})
// 1.绑定单据主表 新建状态 完成已绑定
const params = {
// pzzbguid: data.pzzbguid,
guid: guidStr.join(','),
bdguid: this.bdguid
}
console.log(">>>>>>>>>>>显示bgguid:", this.bdguid)
await wzcrkModel.binding(params)
// 2.设置被绑定的表状态
const wzcrkActiveParams = {
active: "完成",
guid: this.bdguid,
bdguid: guidStr.join(','),
// ydh: this.dataSource.find(i => i.guid == this.checkedList[0]).ydh
}
await wzcrkModel.setActiveAndBdguid(wzcrkActiveParams)
// 绑定物资明细
// 1.导入表查询
const bbParams = {
guid: this.bdguid
}
const exportWzData = await wzcrkModel.getWzmx(bbParams)
// 2.临时收发物查询
const lssfwParams = {
guid: this.checkedList[0]
}
const lssfwWzData = await wzcrkModel.getWzmx(lssfwParams)
// 3. 对比物资明细数据
var result = [];
lssfwWzData.forEach((item1, index1) => {
let checkBool = false
exportWzData.forEach((item2, index2) => {
if (item1.pmdmcode === item2.pmdmcode) {
checkBool = true
}
})
if (!checkBool) {
result.push(item1);
}
})
result.forEach(async (item) => {
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: new Date().getFullYear() + '',
// pzmxguid: item.mxguid,
...item
}
await wzcrkmxModel.insertWzBing(insertParams)
})
const insertPmdm = [...new Set(result.map((item) => item.pmdmcode))]
console.log('insertPmdm', insertPmdm)
var itPmdm = []
lssfwWzData.forEach((item1, index1) => {
if (!insertPmdm.includes(item1.pmdmcode)) {
itPmdm.push(item1)
}
})
console.log('itPmdm', itPmdm)
const itPmdmList = [...new Set(itPmdm.map(item => item.pmdmcode))]
console.log('itPmdmList', itPmdmList)
var dataObj = {}
lssfwWzData.forEach((item) => {
if (itPmdmList.includes(item.pmdmcode)) {
if (dataObj[item.pmdmcode] && dataObj[item.pmdmcode].length > 0) {
dataObj[item.pmdmcode].push(item)
} else {
dataObj[item.pmdmcode] = [item]
}
}
})
console.log('dataObj', dataObj)
for (let j in dataObj) {
const [filterData] = exportWzData.filter((item) => item.pmdmcode === j)
dataObj[j].forEach(async (item, index) => {
item.mxguid = filterData.mxguid
})
}
console.log('dataObj', dataObj)
for (let j in dataObj) {
dataObj[j].forEach(async (item, index) => {
console.log('index', index)
if (index == 0) {
const updateParams = {
crksl: item.crksl,
hwh: item.hwh,
mxguid: item.mxguid
}
console.log('updateParams', updateParams)
// 更新
await wzcrkmxModel.updateWzmx(updateParams)
} else {
// 新增
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: new Date().getFullYear() + '',
pzmxguid: item.mxguid,
...item
}
console.log('insertParams', insertParams)
await wzcrkmxModel.insertWzBing(insertParams)
}
})
}
// // 4. 同品种合并绑定数据
// const exportDataparams = {
// wzcrkguid: data.guid,
// guid: guidStr.join(',')
// }
// await database.createOrFindSQL("GY_M_PMV3", bindingExportDataSql(exportDataparams))
promptAction.showToast({
message: '绑定成功'
})
} catch (e) {
promptAction.showToast({
message: '绑定失败'
})
}
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({
top: 17,
bottom: 7 })
.margin({ bottom: 7 })
Divider()
.strokeWidth(1)
.color('rgb(242,242,242)')
.strokeWidth(2)
.color('#fff')
.width(50)
...
...
@@ -220,24 +404,16 @@ export struct WzOutPage {
}.width('100%')
}
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Image($r("app.media.empty")).width("42%")
Text("暂无数据").fontSize(22).fontColor("#fff").margin({ top: 5 })
}
}.height('70%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时
收
物")
Button("临时
发
物")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
.onClick(
async
() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '临时发物', pzlx: '2' }
})
})
.fontColor("#0fa983")
...
...
@@ -261,9 +437,25 @@ export struct WzOutPage {
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
})
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请选择操作的凭证'
})
return
}
else if (this.checkedList.length > 1) {
promptAction.showToast({
message: '仅支持单选数据绑定'
})
return
}
else if (this.dataSource.filter(i => i.wczt == '未完成').length > 0) {
promptAction.showToast({
message: '请选择完成状态进行单据匹配'
})
} else {
this.openMatchingOfDocumentsDialog()
}
})
.fontColor("#0fa983")
.fontSize("14vp")
...
...
@@ -284,7 +476,9 @@ export struct WzOutPage {
this.exportDialogController.open()
}
}
}).fontColor("#0fa983").fontSize("14vp")
})
.fontColor("#0fa983")
.fontSize("14vp")
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选")
...
...
@@ -301,11 +495,35 @@ export struct WzOutPage {
}.height(80)
}
build(){
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Image($r("app.media.empty")).width("42%")
Text("暂无数据").fontSize(22).fontColor("#fff").margin({ top: 5 })
}
}.height('70%')
}
build() {
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资出库" })
Row(){
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "物资出库" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时发物'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
})
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
...
...
@@ -316,6 +534,7 @@ export struct WzOutPage {
.textFont({ size: 14, weight: 400 })
.width('60%')
.onSubmit((value: string) => {
this.pzh = value
})
.onChange((value: string) => {
this.searchData.pzh = value
...
...
@@ -343,24 +562,9 @@ export struct WzOutPage {
right: 15
})
}
}.width("100%")
}.margin({ top: -20 })
.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时发物'))
}
.height(80)
.margin({top:-15})
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
})
// 列表
Column() {
...
...
@@ -373,29 +577,28 @@ export struct WzOutPage {
ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/
WzOutPage/WzOutDetail/WzOut
Detail', params: {
router.pushUrl({ url: 'pages/metailmange/
Common/Wz
Detail', params: {
wzcrk: item,
isUpdate:true
}})
pzlx: '2',
tab: (this.currentIndex === 0 ? "导入" : "临时发物"),
} })
})
})
}.padding(1
8
)
}.padding(1
5
)
}
}.flexGrow(1).alignSelf(ItemAlign.Center)
Row(){
// 底部按钮
// 底部按钮
Row() {
this.bottomButtons();
}.
backgroundColor("#97c6a6").width("100%").height(80
)
}.
width("100%"
)
}
}.linearGradient({
}.
width("100%").
linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]]
// 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
entry/src/main/ets/pages/metailmange/WzReversePage/WzReversePage.ets
View file @
dfeccf20
...
...
@@ -13,7 +13,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.padding({
top:1,bottom:1,right:7,left:7
})
.padding({
top: 1, bottom: 1, right: 7, left: 7
})
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
...
...
@@ -22,6 +22,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
.stateEffect(true)
}
interface SearchData {
pzh?: string;
wczt?: string;
...
...
@@ -29,7 +30,7 @@ interface SearchData {
@Entry
@Component
struct WzReversePage{
struct WzReversePage
{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
...
...
@@ -40,16 +41,41 @@ struct WzReversePage{
pzh: '',
wczt: '未完成'
}
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State page: number = 1
@State rows: number = 10
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
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
})
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
aboutToAppear() {
this.getWzcrkList()
}
async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = []
const res = await wzcrkModel.query({
...
...
@@ -61,6 +87,7 @@ struct WzReversePage{
});
Logger.info('数量是' + JSON.stringify(this.dataSource))
}
@Builder container() {
Column() {
Row() {
...
...
@@ -87,56 +114,35 @@ struct WzReversePage{
Divider().strokeWidth(1).color('rgb(242,242,242)')
}
}
@Builder exportContainer() {
Column() {
Text('请选择导出单据模式')
}.height(40)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
container: this.container
}),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true
})
onSubmit() {
try{
this.checkedList.forEach(async (element)
=>
{
try
{
this.checkedList.forEach(async (element)
=>
{
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成'))
if(num) {
if
(num) {
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
}
})
}
catch(e)
{
}
catch (e)
{
}
finally
{
}
finally
{
this.checkedList = []
}
}
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() {
this.checkedList.forEach(async element => {
let res = await ViewdrdcModel.queryExport({
guid: element, wczt: '完成', pzlx: '17'
})
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')
...
...
@@ -165,7 +171,7 @@ struct WzReversePage{
...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b
},0),
},
0),
scjid: "863576927543400,863576927543400",
cjmc: "普华",
imei: "863576927543400,863576927543400",
...
...
@@ -195,6 +201,7 @@ struct WzReversePage{
}],
})
}
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
...
...
@@ -209,6 +216,7 @@ struct WzReversePage{
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
...
...
@@ -217,6 +225,7 @@ struct WzReversePage{
}
}.height('70%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
...
...
@@ -252,9 +261,11 @@ struct WzReversePage{
this.exportDialogController.open()
}
}
}).fontColor("#0fa983") .fontSize("14vp")
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983")
.fontSize("14vp")
.bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid)
})
...
...
@@ -262,15 +273,16 @@ struct WzReversePage{
.bottomBtnSty()
.onClick(() => {
this.checkedList = []
}).fontColor("#0fa983")
.fontSize("14vp")
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(80)
}
build(){
build() {
Column() {
Flex({
direction:FlexDirection.Column})
{
TitleBar({ title:"物资倒库" })
Row(){
Flex({
direction: FlexDirection.Column })
{
TitleBar({ title:
"物资倒库" })
Row()
{
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40)
...
...
@@ -290,6 +302,7 @@ struct WzReversePage{
}
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
...
...
@@ -300,7 +313,7 @@ struct WzReversePage{
}.tabBar(this.TabBuilder(1, '完成'))
}
.height(80)
.margin({
top:-15
})
.margin({
top: -15
})
.onChange((index: number) => {
this.currentIndex = index
this.getWzcrkList()
...
...
@@ -316,9 +329,11 @@ struct WzReversePage{
ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzReversePage/WzReverseDetailPage/WzReverseDetailPage', params: {
wzcrk: item
} },)
router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item,
pzlx: '5',
tab: '导入',
} })
})
})
}.padding(18)
...
...
@@ -326,8 +341,7 @@ struct WzReversePage{
}.flexGrow(1).alignSelf(ItemAlign.Center)
Row(){
Row() {
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
...
...
@@ -335,7 +349,7 @@ struct WzReversePage{
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]]
// 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论