Commit dfeccf20 by 陈桂东

提交代码

parent 4f664e8c
...@@ -36,7 +36,6 @@ struct WzinDetail { ...@@ -36,7 +36,6 @@ struct WzinDetail {
@State fontColor: string = '#0FA983' @State fontColor: string = '#0FA983'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
@State dataType: boolean = false @State dataType: boolean = false
@State isHaveButton: boolean = false // 完成状态, 未完成是true, 其他false @State isHaveButton: boolean = false // 完成状态, 未完成是true, 其他false
@State pageType: string = '入库' @State pageType: string = '入库'
...@@ -82,7 +81,7 @@ struct WzinDetail { ...@@ -82,7 +81,7 @@ struct WzinDetail {
break; break;
case '5': case '5':
this.pageType = '倒库' this.pageType = '倒库'
// this.currentModel = true // this.currentModel = true
break; break;
case 'HW44': case 'HW44':
this.pageType = '换位' this.pageType = '换位'
...@@ -134,7 +133,7 @@ struct WzinDetail { ...@@ -134,7 +133,7 @@ struct WzinDetail {
if (testDkSql && testDkSql.length > 0) { if (testDkSql && testDkSql.length > 0) {
const testDkSqlData = testDkSql.map(item => item.crksl) const testDkSqlData = testDkSql.map(item => item.crksl)
var statistics = 0 var statistics = 0
statistics = testDkSqlData.reduce(function(prev, cur, index, array) { statistics = testDkSqlData.reduce(function (prev, cur, index, array) {
return Number(prev) + Number(cur); return Number(prev) + Number(cur);
}) })
console.log('倒库验证', statistics) console.log('倒库验证', statistics)
...@@ -194,9 +193,6 @@ struct WzinDetail { ...@@ -194,9 +193,6 @@ struct WzinDetail {
} }
} }
@Builder TabBuilder(index: number, name: string) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
...@@ -248,11 +244,14 @@ struct WzinDetail { ...@@ -248,11 +244,14 @@ struct WzinDetail {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { 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 () => { .onClick(async () => {
try { try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation)) Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
......
...@@ -93,9 +93,9 @@ struct WzinsertDetail { ...@@ -93,9 +93,9 @@ struct WzinsertDetail {
newType = 'wzhw' newType = 'wzhw'
this.wzcrk.pzlx = 'HW44' this.wzcrk.pzlx = 'HW44'
this.hanleGetDefaultPzh(this.wzcrk.pzlx) this.hanleGetDefaultPzh(this.wzcrk.pzlx)
// uni.setNavigationBarTitle({ // uni.setNavigationBarTitle({
// title: '物资换位', // 设置页签名称 // title: '物资换位', // 设置页签名称
// }); // });
break; break;
default: default:
this.pageType = '入库' this.pageType = '入库'
...@@ -313,8 +313,8 @@ struct WzinsertDetail { ...@@ -313,8 +313,8 @@ struct WzinsertDetail {
if (testRk && testRk.length > 0) { if (testRk && testRk.length > 0) {
testRk.forEach(async (tItem) => { testRk.forEach(async (tItem) => {
await wzcrkModel.updateRkWz({ await wzcrkModel.updateRkWz({
...data[count], ...data[count],
hwguid: tItem.guid hwguid: tItem.guid
}) })
// await createOrFindSQL("GY_M_PMV3", // await createOrFindSQL("GY_M_PMV3",
// updateRkWzSql({ // updateRkWzSql({
...@@ -355,8 +355,8 @@ struct WzinsertDetail { ...@@ -355,8 +355,8 @@ struct WzinsertDetail {
const zsParams = { const zsParams = {
wzcrkguid: this.uuId wzcrkguid: this.uuId
} }
wzcrkModel.selectZs(zsParams).then(async (hjData) => { wzcrkModel.selectZs(zsParams).then(async (hjData) => {
// selectInformationType("GY_M_PMV3", selectZs(zsParams)).then((hjData) => { // selectInformationType("GY_M_PMV3", selectZs(zsParams)).then((hjData) => {
if (hjData && hjData.length > 0) { if (hjData && hjData.length > 0) {
const { const {
crksl, crksl,
...@@ -379,7 +379,6 @@ struct WzinsertDetail { ...@@ -379,7 +379,6 @@ struct WzinsertDetail {
}, 1500) }, 1500)
} }
@Builder TabBuilder(index: number, name: string) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
...@@ -401,7 +400,7 @@ struct WzinsertDetail { ...@@ -401,7 +400,7 @@ struct WzinsertDetail {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() { TabContent() {
Column() { Column() {
AddWzin({ wzcrk: this.wzcrk }) AddWzin({ wzcrk: this.wzcrk, pageType: this.pageType })
}.width("100%") }.width("100%")
}.tabBar(this.TabBuilder(0, '凭证信息')) }.tabBar(this.TabBuilder(0, '凭证信息'))
......
...@@ -10,16 +10,19 @@ import { dateUtils } from '@ohos/common/src/main/ets/utils/util'; ...@@ -10,16 +10,19 @@ import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import ViewdrdcModel from '../../../model/ViewdrdcModel'; import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api'; import { importData } from '../Common/Wzcrk.api';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog'; import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
@Extend(Button) function bottomBtnSty() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({top:1,bottom:1,right:7,left:7}) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
.borderColor('#0fa983') .borderColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')
.fontColor('#0fa983') .fontColor('#0fa983')
.borderRadius(7) .borderRadius(7)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.stateEffect(true) .stateEffect(true)
} }
interface SearchData { interface SearchData {
pzh?: string; pzh?: string;
wczt?: string; wczt?: string;
...@@ -27,7 +30,7 @@ interface SearchData { ...@@ -27,7 +30,7 @@ interface SearchData {
@Entry @Entry
@Component @Component
struct WzConversionPage{ struct WzReversePage {
@State fontColor: string = '#182431' @State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
...@@ -38,24 +41,53 @@ struct WzConversionPage{ ...@@ -38,24 +41,53 @@ struct WzConversionPage{
pzh: '', pzh: '',
wczt: '未完成' 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 controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController() private searchcontroller: SearchController = new SearchController()
aboutToAppear() { aboutToAppear() {
this.getWzcrkList() this.getWzcrkList()
} }
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = [] this.dataSource = []
const res = await wzcrkModel.query({ const res = await wzcrkModel.query({
pzlx: "HW44", pzlx: "HW44",
pzh: this.searchData.pzh, pzh: this.searchData.pzh,
wczt: this.searchData.wczt, wczt: this.currentIndex === 0 ? "未完成" : "完成" })
sjlx: this.currentIndex === 0 ? "导入" : "临时调号" })
res.forEach(element => { res.forEach(element => {
this.dataSource.push(new WzClass(element)) this.dataSource.push(new WzClass(element))
}); });
Logger.info('数量是' + JSON.stringify(this.dataSource)) Logger.info('数量是' + JSON.stringify(this.dataSource))
} }
@Builder container() { @Builder container() {
Column() { Column() {
Row() { Row() {
...@@ -82,58 +114,35 @@ struct WzConversionPage{ ...@@ -82,58 +114,35 @@ struct WzConversionPage{
Divider().strokeWidth(1).color('rgb(242,242,242)') Divider().strokeWidth(1).color('rgb(242,242,242)')
} }
} }
@Builder exportContainer() { @Builder exportContainer() {
Column() { Column() {
Text('请选择导出单据模式') Text('请选择导出单据模式')
}.height(40) }.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() { onSubmit() {
try{ try {
this.checkedList.forEach(async (element)=>{ this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成')) 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) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
}catch(e){ } catch (e) {
}finally{ } finally {
this.checkedList = [] 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() { onExportCancel() {
} }
onExportSubmit() { onExportSubmit() {
this.checkedList.forEach(async element => { 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) const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) { if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before') const date = dateUtils.formatDateTime(new Date(), 'before')
...@@ -162,7 +171,7 @@ struct WzConversionPage{ ...@@ -162,7 +171,7 @@ struct WzConversionPage{
...filterData, ...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => { crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b return a + b
},0), }, 0),
scjid: "863576927543400,863576927543400", scjid: "863576927543400,863576927543400",
cjmc: "普华", cjmc: "普华",
imei: "863576927543400,863576927543400", imei: "863576927543400,863576927543400",
...@@ -192,6 +201,22 @@ struct WzConversionPage{ ...@@ -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() { @Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() { Column() {
...@@ -200,14 +225,16 @@ struct WzConversionPage{ ...@@ -200,14 +225,16 @@ struct WzConversionPage{
} }
}.height('70%') }.height('70%')
} }
@Builder bottomButtons() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("新建换位") Button("新建换位")
.bottomBtnSty() .bottomBtnSty()
.onClick( () => { .onClick(() => {
router.pushUrl({ router.pushUrl({
url: "pages/metailmange/AddConversionPage", url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '新建换位', pzlx: 'HW44' }
}) })
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -215,28 +242,56 @@ struct WzConversionPage{ ...@@ -215,28 +242,56 @@ struct WzConversionPage{
Button("设置状态") Button("设置状态")
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请至少选择一条单据'
})
} else {
if (this.dialogController != undefined) {
this.dialogController.open()
}
}
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
.fontSize("14vp") .fontSize("14vp")
Button("导出数据包") Button("导出数据包")
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .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("全选") Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp") .bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid)
})
Button("清空选择") Button("清空选择")
.bottomBtnSty() .bottomBtnSty()
.onClick(() =>{ .onClick(() => {
this.checkedList = []
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
} }
}.height(80) }.height(80)
} }
build(){
build() {
Column() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资换位" }) TitleBar({ title: "物资换位" })
Row(){ Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
...@@ -256,6 +311,22 @@ struct WzConversionPage{ ...@@ -256,6 +311,22 @@ struct WzConversionPage{
} }
}.width("100%") }.width("100%")
.padding('15vp') .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() { Column() {
...@@ -267,10 +338,11 @@ struct WzConversionPage{ ...@@ -267,10 +338,11 @@ struct WzConversionPage{
ListItem() { ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff') WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => { }.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzConversionPage/WzConversionDetailPage/WzConversionDetailPage', params: { router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item, wzcrk: item,
isUpdate:true pzlx: 'HW44',
} },) tab: (this.currentIndex === 0 ? "导入" : "新建换位"),
} })
}) })
}) })
}.padding(18) }.padding(18)
...@@ -278,8 +350,7 @@ struct WzConversionPage{ ...@@ -278,8 +350,7 @@ struct WzConversionPage{
}.flexGrow(1).alignSelf(ItemAlign.Center) }.flexGrow(1).alignSelf(ItemAlign.Center)
Row() {
Row(){
// 底部按钮 // 底部按钮
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.backgroundColor("#97c6a6").width("100%").height(80)
...@@ -287,7 +358,7 @@ struct WzConversionPage{ ...@@ -287,7 +358,7 @@ struct WzConversionPage{
}.linearGradient({ }.linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 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
import { TitleBar } from '../../../view/title/TitleBar' import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router'; 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 { 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 promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog'; 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 ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api'; 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() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({top:1,bottom:1,right:7,left:7}) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
.borderColor('#0fa983') .borderColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')
.fontColor('#0fa983') .fontColor('#0fa983')
...@@ -21,13 +24,15 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi ...@@ -21,13 +24,15 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
.type(ButtonType.Normal) .type(ButtonType.Normal)
.stateEffect(true) .stateEffect(true)
} }
interface SearchData { interface SearchData {
pzh?: string; pzh?: string;
wczt?: string; wczt?: string;
} }
@Entry @Entry
@Component @Component
struct WzExchangePage{ export struct WzInPage {
@State fontColor: string = '#182431' @State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
...@@ -38,24 +43,85 @@ struct WzExchangePage{ ...@@ -38,24 +43,85 @@ struct WzExchangePage{
pzh: '', pzh: '',
wczt: '未完成' 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 controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController() private searchcontroller: SearchController = new SearchController()
aboutToAppear() { itemClick() {
router.pushUrl({ url: 'pages/order_detail/PzInOutDetailPage' })
}
onPageShow() {
this.getWzcrkList() this.getWzcrkList()
} }
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = [] this.dataSource = []
const res = await wzcrkModel.query({ const res = await wzcrkModel.query({
pzlx: "41", pzlx: "41",
pzh: Number(this.searchData.pzh), pzh: Number(this.searchData.pzh),
wczt: this.searchData.wczt, 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 => { res.forEach(element => {
this.dataSource.push(new WzClass(element)) this.dataSource.push(new WzClass(element))
}); });
Logger.info('数量是' + JSON.stringify(this.dataSource)) Logger.info('数量是' + JSON.stringify(this.dataSource))
} }
@Builder container() { @Builder container() {
Column() { Column() {
Row() { Row() {
...@@ -82,57 +148,35 @@ struct WzExchangePage{ ...@@ -82,57 +148,35 @@ struct WzExchangePage{
Divider().strokeWidth(1).color('rgb(242,242,242)') Divider().strokeWidth(1).color('rgb(242,242,242)')
} }
} }
@Builder exportContainer() { @Builder exportContainer() {
Column() { Column() {
Text('请选择导出单据模式') Text('请选择导出单据模式')
}.height(40) }.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() { onSubmit() {
try{ try {
this.checkedList.forEach(async (element)=>{ this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成')) 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) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
}catch(e){ } catch (e) {
}finally{ } finally {
this.checkedList = [] 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() { onExportCancel() {
} }
onExportSubmit() { onExportSubmit() {
this.checkedList.forEach(async element => { 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) const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) { if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before') const date = dateUtils.formatDateTime(new Date(), 'before')
...@@ -161,7 +205,7 @@ struct WzExchangePage{ ...@@ -161,7 +205,7 @@ struct WzExchangePage{
...filterData, ...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => { crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b return a + b
},0), }, 0),
scjid: "863576927543400,863576927543400", scjid: "863576927543400,863576927543400",
cjmc: "普华", cjmc: "普华",
imei: "863576927543400,863576927543400", imei: "863576927543400,863576927543400",
...@@ -192,14 +236,167 @@ struct WzExchangePage{ ...@@ -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) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16) .fontSize(16)
.lineHeight(22) .lineHeight(22)
.margin({ top: 17, bottom: 7 }) .margin({ bottom: 7 })
Divider() Divider()
.strokeWidth(1)
.color('rgb(242,242,242)')
.strokeWidth(2) .strokeWidth(2)
.color('#fff') .color('#fff')
.width(50) .width(50)
...@@ -207,23 +404,16 @@ struct WzExchangePage{ ...@@ -207,23 +404,16 @@ struct WzExchangePage{
}.width('100%') }.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() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时调号") Button("临时调号")
.visibility(this.currentIndex === 1 ? Visibility.Visible:Visibility.None) .visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty() .bottomBtnSty()
.onClick( () => { .onClick(async () => {
router.pushUrl({ router.pushUrl({
url: "pages/metailmange/AddAdjustModelPage", url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '临时调号', pzlx: '4' }
}) })
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -243,6 +433,32 @@ struct WzExchangePage{ ...@@ -243,6 +433,32 @@ struct WzExchangePage{
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
.fontSize("14vp") .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("导出数据包") Button("导出数据包")
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
...@@ -259,7 +475,11 @@ struct WzExchangePage{ ...@@ -259,7 +475,11 @@ struct WzExchangePage{
this.exportDialogController.open() this.exportDialogController.open()
} }
} }
}).fontColor("#0fa983") .fontSize("14vp") })
.fontColor("#0fa983")
.fontSize("14vp")
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选") Button("全选")
.bottomBtnSty().fontColor("#0fa983").fontSize("14vp") .bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => { .onClick(() => {
...@@ -273,11 +493,36 @@ struct WzExchangePage{ ...@@ -273,11 +493,36 @@ struct WzExchangePage{
} }
}.height(80) }.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() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资调号" }) TitleBar({ title: "临时调号" })
Row(){ 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 }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
...@@ -286,33 +531,39 @@ struct WzExchangePage{ ...@@ -286,33 +531,39 @@ struct WzExchangePage{
.textAlign(TextAlign.Center) .textAlign(TextAlign.Center)
.placeholderFont({ size: 14, weight: 400 }) .placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 }) .textFont({ size: 14, weight: 400 })
.width('100%') .width('60%')
.onSubmit((value: string) => { .onSubmit((value: string) => {
this.pzh = value
}) })
.onChange((value: string) => { .onChange((value: string) => {
this.searchData.pzh = value this.searchData.pzh = value
this.getWzcrkList() this.getWzcrkList()
}) })
.borderRadius(5) .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') .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() { Column() {
...@@ -325,30 +576,28 @@ struct WzExchangePage{ ...@@ -325,30 +576,28 @@ struct WzExchangePage{
ListItem() { ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff') WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => { }.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzExchangePage/WzExchangeDetailPage/WzExchangeDetailPage', params: { router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item, wzcrk: item,
isUpdate:true pzlx: '4',
} },) tab: (this.currentIndex === 0 ? "导入" : "临时调号"),
} })
}) })
}) })
}.padding(18) }.padding(15)
} }
}.flexGrow(1).alignSelf(ItemAlign.Center) }.flexGrow(1).alignSelf(ItemAlign.Center)
// 底部按钮
Row() {
Row(){
// 底部按钮
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.width("100%")
} }
}.linearGradient({ }.width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 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
...@@ -23,6 +23,7 @@ class Form { ...@@ -23,6 +23,7 @@ class Form {
enabled: boolean enabled: boolean
required: boolean required: boolean
type: 'input' | 'select' type: 'input' | 'select'
typeList: string[]
options?: Options[] options?: Options[]
constructor(data: { constructor(data: {
...@@ -31,12 +32,14 @@ class Form { ...@@ -31,12 +32,14 @@ class Form {
enabled: boolean enabled: boolean
type: 'input' | 'select', type: 'input' | 'select',
required: boolean, required: boolean,
typeList: string[],
options?: Options[] options?: Options[]
}) { }) {
this.title = data.title this.title = data.title
this.key = data.key this.key = data.key
this.enabled = data.enabled this.enabled = data.enabled
this.type = data.type this.type = data.type
this.typeList = data.typeList || []
this.required = data.required || false this.required = data.required || false
this.options = data.options this.options = data.options
} }
...@@ -47,9 +50,16 @@ class Form { ...@@ -47,9 +50,16 @@ class Form {
export struct AddWzin { export struct AddWzin {
@ObjectLink wzcrk: WzClass @ObjectLink wzcrk: WzClass
@State form: Form[] = [] @State form: Form[] = []
pageType: string
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false, type: 'input' }, arr = [{ title: "凭证类型", key: 'pzlx', enabled: false, type: 'input' },
{ title: "凭证号", key: 'pzh', 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: "库房", title: "库房",
key: 'kfdm', key: 'kfdm',
...@@ -90,7 +100,20 @@ export struct AddWzin { ...@@ -90,7 +100,20 @@ export struct AddWzin {
options: [], options: [],
required: true 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' } { title: "备注", key: 'dec', enabled: true, type: 'input' }
] ]
...@@ -189,55 +212,59 @@ export struct AddWzin { ...@@ -189,55 +212,59 @@ export struct AddWzin {
List() { List() {
ForEach(this.form, (item) => { ForEach(this.form, (item) => {
ListItem() { if (item.typeList.length == 0 || item.typeList.includes[this.pageType]) {
Column() { ListItem() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Row() { Row() {
if (item.required) { if (item.required) {
Text('*').fontColor('red').margin({ right: 5 }) 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') { if (item.type == 'input') {
TextInput({ text: this.handleText(item.key) })
.enterKeyType(EnterKeyType.Search) TextInput({ text: this.handleText(item.key) })
.borderColor("#454545") .enterKeyType(EnterKeyType.Search)
.borderRadius(5) .borderColor("#454545")
.height(40) .borderRadius(5)
.padding(10) .height(40)
.flexGrow(1) .padding(10)
.borderColor('#bcc5d7') .flexGrow(1)
.borderWidth(1) .borderColor('#bcc5d7')
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor") .borderWidth(1)
.enabled(item.enabled) .backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.onChange((value: string) => { .enabled(item.enabled)
if (item.enabled) { .onChange((value: string) => {
this.wzcrk[item.key] = value if (item.enabled) {
} this.wzcrk[item.key] = value
}) }
})
}
} }
} }
} }.padding(15)
}.padding(15) }
}) })
}.margin({ bottom: 40 }) }.margin({ bottom: 40 })
}.backgroundColor('#fff') }.backgroundColor('#fff')
......
import gldwModel from '../../../../model/GldwModel' import gldwModel from '../../../../model/GldwModel'
import kfModel from '../../../../model/KfModel' import kfModel from '../../../../model/KfModel'
import { renderPzlx, renderSzlx, renderZmlx, WzClass } from '../../Common/Wzcrk.data' import { renderPzlx, renderSzlx, renderZmlx, WzClass } from '../../Common/Wzcrk.data'
@Component @Component
// 物资信息 // 物资信息
export struct PzInfo { export struct PzInfo {
...@@ -8,11 +9,11 @@ export struct PzInfo { ...@@ -8,11 +9,11 @@ export struct PzInfo {
@State fwgldw: string = '' @State fwgldw: string = ''
@State swgldw: string = '' @State swgldw: string = ''
@ObjectLink wzcrk: WzClass @ObjectLink wzcrk: WzClass
arr = [{ title: "凭证类型", key: 'pzlx', enabled: false }, arr = [{ title: "凭证类型", key: 'pzlx', enabled: false },
{ title: "凭证号", key: 'pzh', enabled: false }, { title: "凭证号", key: 'pzh', enabled: false },
{ title: "库房", key: 'kfguid', enabled: false }, { title: "库房", key: 'kfguid', enabled: false },
{ title: "收支类型", key: 'pzszlx', enabled: false }, { title: "收支类型", key: 'pzszlx', enabled: false },
{ title: "调号单位", key: 'pzszlx', enabled: false },
{ title: "运单号", key: 'ydh', enabled: true }, { title: "运单号", key: 'ydh', enabled: true },
{ title: "发物管理单位", key: 'fwgldwdm', enabled: false }, { title: "发物管理单位", key: 'fwgldwdm', enabled: false },
{ title: "收物管理单位", key: 'swgldwdm', enabled: false }, { title: "收物管理单位", key: 'swgldwdm', enabled: false },
...@@ -20,22 +21,21 @@ export struct PzInfo { ...@@ -20,22 +21,21 @@ export struct PzInfo {
{ title: "备注", key: 'dec', enabled: true } { title: "备注", key: 'dec', enabled: true }
] ]
aboutToAppear(){ aboutToAppear() {
this.getData() this.getData()
} }
async 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 ?? '' 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 ?? '' 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 ?? '' this.swgldw = res2[0].dwfh ?? ''
} }
handleText(key: string): string { handleText(key: string): string {
switch (key) { switch (key) {
case 'pzlx': case 'pzlx':
...@@ -61,8 +61,8 @@ export struct PzInfo { ...@@ -61,8 +61,8 @@ export struct PzInfo {
} }
} }
build(){ build() {
Column(){ Column() {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
Divider() Divider()
.vertical(true) .vertical(true)
...@@ -74,17 +74,18 @@ export struct PzInfo { ...@@ -74,17 +74,18 @@ export struct PzInfo {
Text("凭证信息") Text("凭证信息")
.fontSize(16) .fontSize(16)
}.height('8%') }.height('8%')
List(){
ForEach(this.arr,(item) => { List() {
ListItem(){ ForEach(this.arr, (item) => {
Column(){ ListItem() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Text(item.title) Text(item.title)
.fontSize(14) .fontSize(14)
.width("30%") .width("30%")
.height(40) .height(40)
.fontColor($r("app.color.item_color_black")) .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) .enterKeyType(EnterKeyType.Search)
.borderColor("#454545") .borderColor("#454545")
.borderRadius(5) .borderRadius(5)
...@@ -96,7 +97,7 @@ export struct PzInfo { ...@@ -96,7 +97,7 @@ export struct PzInfo {
.backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor") .backgroundColor(item.enabled ? '#fff' : "app.color.disabledColor")
.enabled(item.enabled) .enabled(item.enabled)
.onChange((value: string) => { .onChange((value: string) => {
if(item.enabled) { if (item.enabled) {
this.wzcrk[item.key] = value this.wzcrk[item.key] = value
} }
}) })
...@@ -104,7 +105,7 @@ export struct PzInfo { ...@@ -104,7 +105,7 @@ export struct PzInfo {
} }
}.padding(15) }.padding(15)
}) })
}.margin({bottom:40}) }.margin({ bottom: 40 })
}.backgroundColor('#fff') }.backgroundColor('#fff')
} }
......
import { TitleBar } from '../../../view/title/TitleBar' import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router'; import router from '@ohos.router';
import { WzList } from '../Common/WzcrkList';
import wzcrkModel from '../../../model/WzcrkModel'; import wzcrkModel from '../../../model/WzcrkModel';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger'; import { Logger } from '@ohos/common';
import { WzClass, getDefaultPzh } from '../Common/Wzcrk.data' import { WzClass } from '../Common/Wzcrk.data';
import { WzList } from '../Common/WzcrkList';
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog'; import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog'; import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import ViewdrdcModel from '../../../model/ViewdrdcModel'; import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api'; 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() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({ top: 1, bottom: 1, right: 7, left: 7 }) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
...@@ -19,14 +20,17 @@ import { dateUtils } from '@ohos/common/src/main/ets/utils/util'; ...@@ -19,14 +20,17 @@ import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
.borderRadius(7) .borderRadius(7)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.stateEffect(true) .stateEffect(true)
} }
interface SearchData { interface SearchData {
pzh?: string; pzh?: string;
wczt?: string; wczt?: string;
} }
@Entry @Entry
@Component @Component
struct WzInvPage{ struct WzReversePage {
@State fontColor: string = '#182431' @State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
...@@ -37,26 +41,39 @@ struct WzInvPage{ ...@@ -37,26 +41,39 @@ struct WzInvPage{
pzh: '', pzh: '',
wczt: '未完成' wczt: '未完成'
} }
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State page: number = 1 @State page: number = 1
@State rows: number = 10 @State rows: number = 10
@State sjlx: string = "0" @State sjlx: string = "0"
@State wczt: string = "" @State wczt: string = ""
@State pzh: string = "" @State pzh: string = ""
params = { dialogController: CustomDialogController = new CustomDialogController({
pzh: this.pzh, builder: SetStatusDialog({
page: this.page, confirm: this.onSubmit,
rows: this.rows, checkedList: $checkedList,
sjlx: this.currentIndex === 0 ? "未完成" : "完成", dataSource: $dataSource,
wczt: "未完成" container: this.container
} }),
itemClick() { autoCancel: true,
router.pushUrl({ url: 'pages/order_detail/PzInOutDetailPage' }) 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() { aboutToAppear() {
this.getWzcrkList() this.getWzcrkList()
} }
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = [] this.dataSource = []
const res = await wzcrkModel.query({ const res = await wzcrkModel.query({
...@@ -68,6 +85,7 @@ struct WzInvPage{ ...@@ -68,6 +85,7 @@ struct WzInvPage{
}); });
Logger.info('数量是' + JSON.stringify(this.dataSource)) Logger.info('数量是' + JSON.stringify(this.dataSource))
} }
@Builder container() { @Builder container() {
Column() { Column() {
Row() { Row() {
...@@ -94,114 +112,28 @@ struct WzInvPage{ ...@@ -94,114 +112,28 @@ struct WzInvPage{
Divider().strokeWidth(1).color('rgb(242,242,242)') Divider().strokeWidth(1).color('rgb(242,242,242)')
} }
} }
@Builder exportContainer() { @Builder exportContainer() {
Column() { Column() {
Text('请选择导出单据模式') Text('请选择导出单据模式')
}.height(40) }.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() { onSubmit() {
try{ try {
this.checkedList.forEach(async (element)=>{ this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成')) 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) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
}catch(e){ } catch (e) {
}finally{ } finally {
this.checkedList = [] 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) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
...@@ -216,6 +148,7 @@ struct WzInvPage{ ...@@ -216,6 +148,7 @@ struct WzInvPage{
.opacity(this.currentIndex === index ? 1 : 0) .opacity(this.currentIndex === index ? 1 : 0)
}.width('100%') }.width('100%')
} }
@Builder renderEmpty() { @Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() { Column() {
...@@ -224,6 +157,7 @@ struct WzInvPage{ ...@@ -224,6 +157,7 @@ struct WzInvPage{
} }
}.height('70%') }.height('70%')
} }
@Builder bottomButtons() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
...@@ -242,26 +176,8 @@ struct WzInvPage{ ...@@ -242,26 +176,8 @@ struct WzInvPage{
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
.fontSize("14vp") .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("全选") Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp") .bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => { .onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid) this.checkedList = this.dataSource.map((item) => item.guid)
}) })
...@@ -269,15 +185,16 @@ struct WzInvPage{ ...@@ -269,15 +185,16 @@ struct WzInvPage{
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
this.checkedList = [] this.checkedList = []
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
} }
}.height(80) }.height(80)
} }
build(){
build() {
Column() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资盘库" }) TitleBar({ title: "物资盘库" })
Row(){ Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
...@@ -297,6 +214,7 @@ struct WzInvPage{ ...@@ -297,6 +214,7 @@ struct WzInvPage{
} }
}.width("100%") }.width("100%")
.padding('15vp') .padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() { TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87') // Column().width('100%').height('100%').backgroundColor('#00CB87')
...@@ -307,7 +225,7 @@ struct WzInvPage{ ...@@ -307,7 +225,7 @@ struct WzInvPage{
}.tabBar(this.TabBuilder(1, '完成')) }.tabBar(this.TabBuilder(1, '完成'))
} }
.height(80) .height(80)
.margin({top:-15}) .margin({ top: -15 })
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
this.getWzcrkList() this.getWzcrkList()
...@@ -323,9 +241,11 @@ struct WzInvPage{ ...@@ -323,9 +241,11 @@ struct WzInvPage{
ListItem() { ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff') WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => { }.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzInvPage/WzInvDetail/WzInvDetail', params: { router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item wzcrk: item,
} },) pzlx: '3',
tab: '导入',
} })
}) })
}) })
}.padding(18) }.padding(18)
...@@ -333,8 +253,7 @@ struct WzInvPage{ ...@@ -333,8 +253,7 @@ struct WzInvPage{
}.flexGrow(1).alignSelf(ItemAlign.Center) }.flexGrow(1).alignSelf(ItemAlign.Center)
Row() {
Row(){
// 底部按钮 // 底部按钮
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.backgroundColor("#97c6a6").width("100%").height(80)
...@@ -342,8 +261,7 @@ struct WzInvPage{ ...@@ -342,8 +261,7 @@ struct WzInvPage{
}.linearGradient({ }.linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 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
import { TitleBar } from '../../../view/title/TitleBar' import { TitleBar } from '../../../view/title/TitleBar'
import router from '@ohos.router'; 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 { 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 promptAction from '@ohos.promptAction';
import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog'; 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 ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api'; 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() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({top:1,bottom:1,right:7,left:7}) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
.borderColor('#0fa983') .borderColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')
.fontColor('#0fa983') .fontColor('#0fa983')
.borderRadius(7) .borderRadius(7)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.stateEffect(true) .stateEffect(true)
} }
interface SearchData { interface SearchData {
pzh?: string; pzh?: string;
wczt?: string; wczt?: string;
} }
@Entry @Entry
@Component @Component
export struct WzOutPage { export struct WzInPage {
@State fontColor: string = '#182431' @State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
...@@ -39,13 +43,62 @@ export struct WzOutPage { ...@@ -39,13 +43,62 @@ export struct WzOutPage {
pzh: '', pzh: '',
wczt: '未完成' wczt: '未完成'
} }
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State defaultSelectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }] @State defaultSelectValue: Array<SelectOption> = [{ value: "未完成" }, { value: "完成" }]
@State selectValue: Array<SelectOption> = [{ value: "未完成" }, { 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() { itemClick() {
router.pushUrl({url:'pages/order_detail/PzInOutDetailPage'}) router.pushUrl({ url: 'pages/order_detail/PzInOutDetailPage' })
} }
onPageShow() { onPageShow() {
...@@ -53,12 +106,16 @@ export struct WzOutPage { ...@@ -53,12 +106,16 @@ export struct WzOutPage {
} }
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = [] this.dataSource = []
const res = await wzcrkModel.query({ const res = await wzcrkModel.query({
pzlx: "17", pzlx: "17",
pzh: this.searchData.pzh, pzh: Number(this.searchData.pzh),
wczt: this.searchData.wczt, 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 => { res.forEach(element => {
this.dataSource.push(new WzClass(element)) this.dataSource.push(new WzClass(element))
}); });
...@@ -98,54 +155,28 @@ export struct WzOutPage { ...@@ -98,54 +155,28 @@ export struct WzOutPage {
}.height(40) }.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() { onSubmit() {
try{ try {
this.checkedList.forEach(async (element)=>{ this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成')) 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) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
}catch(e){ } catch (e) {
}finally{ } finally {
this.checkedList = [] 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() { onExportCancel() {
} }
onExportSubmit() { onExportSubmit() {
this.checkedList.forEach(async element => { 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) const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) { if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before') const date = dateUtils.formatDateTime(new Date(), 'before')
...@@ -174,7 +205,7 @@ export struct WzOutPage { ...@@ -174,7 +205,7 @@ export struct WzOutPage {
...filterData, ...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => { crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b return a + b
},0), }, 0),
scjid: "863576927543400,863576927543400", scjid: "863576927543400,863576927543400",
cjmc: "普华", cjmc: "普华",
imei: "863576927543400,863576927543400", imei: "863576927543400,863576927543400",
...@@ -197,7 +228,7 @@ export struct WzOutPage { ...@@ -197,7 +228,7 @@ export struct WzOutPage {
}) })
promptAction.showDialog({ promptAction.showDialog({
title: '提示', title: '提示',
message: '出库作业单据已同步至业务系统,请以保管员身份登录业务系统,在菜单“作业项目——物资出库”里刷新查看。', message: '入库作业单据已同步至业务系统,请以保管员身份登录业务系统,在菜单“作业项目--物资入库”里刷新查看。',
buttons: [{ buttons: [{
text: '已知晓', text: '已知晓',
color: '#0fa983', color: '#0fa983',
...@@ -205,14 +236,167 @@ export struct WzOutPage { ...@@ -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) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16) .fontSize(16)
.lineHeight(22) .lineHeight(22)
.margin({ top: 17, bottom: 7 }) .margin({ bottom: 7 })
Divider() Divider()
.strokeWidth(1)
.color('rgb(242,242,242)')
.strokeWidth(2) .strokeWidth(2)
.color('#fff') .color('#fff')
.width(50) .width(50)
...@@ -220,24 +404,16 @@ export struct WzOutPage { ...@@ -220,24 +404,16 @@ export struct WzOutPage {
}.width('100%') }.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() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("临时物") Button("临时物")
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None) .visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(async () => {
router.pushUrl({ router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage", url: "pages/metailmange/Common/WzinsertDetail",
params: { sjlx: '临时发物', pzlx: '2' }
}) })
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -261,9 +437,25 @@ export struct WzOutPage { ...@@ -261,9 +437,25 @@ export struct WzOutPage {
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None) .visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
router.pushUrl({ if (this.checkedList.length == 0) {
url: "pages/metailmange/AddTemporaryInPage", 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") .fontColor("#0fa983")
.fontSize("14vp") .fontSize("14vp")
...@@ -284,7 +476,9 @@ export struct WzOutPage { ...@@ -284,7 +476,9 @@ export struct WzOutPage {
this.exportDialogController.open() this.exportDialogController.open()
} }
} }
}).fontColor("#0fa983").fontSize("14vp") })
.fontColor("#0fa983")
.fontSize("14vp")
.fontColor("#0fa983") .fontColor("#0fa983")
.fontSize("14vp") .fontSize("14vp")
Button("全选") Button("全选")
...@@ -301,11 +495,35 @@ export struct WzOutPage { ...@@ -301,11 +495,35 @@ export struct WzOutPage {
}.height(80) }.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() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资出库" }) TitleBar({ title: "物资出库" })
Row(){ 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 }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
...@@ -316,6 +534,7 @@ export struct WzOutPage { ...@@ -316,6 +534,7 @@ export struct WzOutPage {
.textFont({ size: 14, weight: 400 }) .textFont({ size: 14, weight: 400 })
.width('60%') .width('60%')
.onSubmit((value: string) => { .onSubmit((value: string) => {
this.pzh = value
}) })
.onChange((value: string) => { .onChange((value: string) => {
this.searchData.pzh = value this.searchData.pzh = value
...@@ -343,24 +562,9 @@ export struct WzOutPage { ...@@ -343,24 +562,9 @@ export struct WzOutPage {
right: 15 right: 15
}) })
} }
}.width("100%") }.margin({ top: -20 })
.width("100%")
.padding('15vp') .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() { Column() {
...@@ -373,29 +577,28 @@ export struct WzOutPage { ...@@ -373,29 +577,28 @@ export struct WzOutPage {
ListItem() { ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff') WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => { }.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail', params: { router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item, wzcrk: item,
isUpdate:true pzlx: '2',
}}) tab: (this.currentIndex === 0 ? "导入" : "临时发物"),
} })
}) })
}) })
}.padding(18) }.padding(15)
} }
}.flexGrow(1).alignSelf(ItemAlign.Center) }.flexGrow(1).alignSelf(ItemAlign.Center)
// 底部按钮
Row() {
Row(){
// 底部按钮
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.width("100%")
} }
}.linearGradient({ }.width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 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
...@@ -13,7 +13,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi ...@@ -13,7 +13,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
@Extend(Button) function bottomBtnSty() { @Extend(Button) function bottomBtnSty() {
.borderWidth(1) .borderWidth(1)
.padding({top:1,bottom:1,right:7,left:7}) .padding({ top: 1, bottom: 1, right: 7, left: 7 })
.borderColor('#0fa983') .borderColor('#0fa983')
.backgroundColor('#fff') .backgroundColor('#fff')
.fontColor('#0fa983') .fontColor('#0fa983')
...@@ -22,6 +22,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi ...@@ -22,6 +22,7 @@ import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDi
.stateEffect(true) .stateEffect(true)
} }
interface SearchData { interface SearchData {
pzh?: string; pzh?: string;
wczt?: string; wczt?: string;
...@@ -29,7 +30,7 @@ interface SearchData { ...@@ -29,7 +30,7 @@ interface SearchData {
@Entry @Entry
@Component @Component
struct WzReversePage{ struct WzReversePage {
@State fontColor: string = '#182431' @State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff' @State selectedFontColor: string = '#fff'
@State currentIndex: number = 0 @State currentIndex: number = 0
...@@ -40,16 +41,41 @@ struct WzReversePage{ ...@@ -40,16 +41,41 @@ struct WzReversePage{
pzh: '', pzh: '',
wczt: '未完成' wczt: '未完成'
} }
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
@State page: number = 1 @State page: number = 1
@State rows: number = 10 @State rows: number = 10
@State sjlx: string = "0" @State sjlx: string = "0"
@State wczt: string = "" @State wczt: string = ""
@State pzh: 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() { aboutToAppear() {
this.getWzcrkList() this.getWzcrkList()
} }
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
this.dataSource = [] this.dataSource = []
const res = await wzcrkModel.query({ const res = await wzcrkModel.query({
...@@ -61,6 +87,7 @@ struct WzReversePage{ ...@@ -61,6 +87,7 @@ struct WzReversePage{
}); });
Logger.info('数量是' + JSON.stringify(this.dataSource)) Logger.info('数量是' + JSON.stringify(this.dataSource))
} }
@Builder container() { @Builder container() {
Column() { Column() {
Row() { Row() {
...@@ -87,56 +114,35 @@ struct WzReversePage{ ...@@ -87,56 +114,35 @@ struct WzReversePage{
Divider().strokeWidth(1).color('rgb(242,242,242)') Divider().strokeWidth(1).color('rgb(242,242,242)')
} }
} }
@Builder exportContainer() { @Builder exportContainer() {
Column() { Column() {
Text('请选择导出单据模式') Text('请选择导出单据模式')
}.height(40) }.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() { onSubmit() {
try{ try {
this.checkedList.forEach(async (element)=>{ this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, (this.radioChecked == undefined || this.radioChecked ? '完成' : '未完成')) 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) this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
}catch(e){ } catch (e) {
}finally{ } finally {
this.checkedList = [] 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() { onExportCancel() {
} }
onExportSubmit() { onExportSubmit() {
this.checkedList.forEach(async element => { 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) const jhguidArr = res.map((item) => item.guid)
if (jhguidArr && jhguidArr.length > 0) { if (jhguidArr && jhguidArr.length > 0) {
const date = dateUtils.formatDateTime(new Date(), 'before') const date = dateUtils.formatDateTime(new Date(), 'before')
...@@ -165,7 +171,7 @@ struct WzReversePage{ ...@@ -165,7 +171,7 @@ struct WzReversePage{
...filterData, ...filterData,
crksl: ItemData.map(i => i.sjsl).reduce((a, b) => { crksl: ItemData.map(i => i.sjsl).reduce((a, b) => {
return a + b return a + b
},0), }, 0),
scjid: "863576927543400,863576927543400", scjid: "863576927543400,863576927543400",
cjmc: "普华", cjmc: "普华",
imei: "863576927543400,863576927543400", imei: "863576927543400,863576927543400",
...@@ -195,6 +201,7 @@ struct WzReversePage{ ...@@ -195,6 +201,7 @@ struct WzReversePage{
}], }],
}) })
} }
@Builder TabBuilder(index: number, name: string) { @Builder TabBuilder(index: number, name: string) {
Column() { Column() {
Text(name) Text(name)
...@@ -209,6 +216,7 @@ struct WzReversePage{ ...@@ -209,6 +216,7 @@ struct WzReversePage{
.opacity(this.currentIndex === index ? 1 : 0) .opacity(this.currentIndex === index ? 1 : 0)
}.width('100%') }.width('100%')
} }
@Builder renderEmpty() { @Builder renderEmpty() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() { Column() {
...@@ -217,6 +225,7 @@ struct WzReversePage{ ...@@ -217,6 +225,7 @@ struct WzReversePage{
} }
}.height('70%') }.height('70%')
} }
@Builder bottomButtons() { @Builder bottomButtons() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
...@@ -252,9 +261,11 @@ struct WzReversePage{ ...@@ -252,9 +261,11 @@ struct WzReversePage{
this.exportDialogController.open() this.exportDialogController.open()
} }
} }
}).fontColor("#0fa983") .fontSize("14vp") })
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选") Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp") .bottomBtnSty().fontColor("#0fa983").fontSize("14vp")
.onClick(() => { .onClick(() => {
this.checkedList = this.dataSource.map((item) => item.guid) this.checkedList = this.dataSource.map((item) => item.guid)
}) })
...@@ -262,15 +273,16 @@ struct WzReversePage{ ...@@ -262,15 +273,16 @@ struct WzReversePage{
.bottomBtnSty() .bottomBtnSty()
.onClick(() => { .onClick(() => {
this.checkedList = [] this.checkedList = []
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983").fontSize("14vp")
} }
}.height(80) }.height(80)
} }
build(){
build() {
Column() { Column() {
Flex({direction:FlexDirection.Column}){ Flex({ direction: FlexDirection.Column }) {
TitleBar({ title:"物资倒库" }) TitleBar({ title: "物资倒库" })
Row(){ Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Search({ placeholder: '请输入凭证号', controller: this.searchcontroller }) Search({ placeholder: '请输入凭证号', controller: this.searchcontroller })
.height(40) .height(40)
...@@ -290,6 +302,7 @@ struct WzReversePage{ ...@@ -290,6 +302,7 @@ struct WzReversePage{
} }
}.width("100%") }.width("100%")
.padding('15vp') .padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() { TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87') // Column().width('100%').height('100%').backgroundColor('#00CB87')
...@@ -300,7 +313,7 @@ struct WzReversePage{ ...@@ -300,7 +313,7 @@ struct WzReversePage{
}.tabBar(this.TabBuilder(1, '完成')) }.tabBar(this.TabBuilder(1, '完成'))
} }
.height(80) .height(80)
.margin({top:-15}) .margin({ top: -15 })
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
this.getWzcrkList() this.getWzcrkList()
...@@ -316,9 +329,11 @@ struct WzReversePage{ ...@@ -316,9 +329,11 @@ struct WzReversePage{
ListItem() { ListItem() {
WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff') WzList({ item, checkedList: $checkedList }).width('100%').backgroundColor('#fff')
}.onClick(() => { }.onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzReversePage/WzReverseDetailPage/WzReverseDetailPage', params: { router.pushUrl({ url: 'pages/metailmange/Common/WzDetail', params: {
wzcrk: item wzcrk: item,
} },) pzlx: '5',
tab: '导入',
} })
}) })
}) })
}.padding(18) }.padding(18)
...@@ -326,8 +341,7 @@ struct WzReversePage{ ...@@ -326,8 +341,7 @@ struct WzReversePage{
}.flexGrow(1).alignSelf(ItemAlign.Center) }.flexGrow(1).alignSelf(ItemAlign.Center)
Row() {
Row(){
// 底部按钮 // 底部按钮
this.bottomButtons(); this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80) }.backgroundColor("#97c6a6").width("100%").height(80)
...@@ -335,7 +349,7 @@ struct WzReversePage{ ...@@ -335,7 +349,7 @@ struct WzReversePage{
}.linearGradient({ }.linearGradient({
direction: GradientDirection.Right, // 渐变方向 direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论