Commit dfeccf20 by 陈桂东

提交代码

parent 4f664e8c
......@@ -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 = '入库'
......@@ -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 }) {
if (['入库', '出库'].includes(this.pageType)) {
Button("射频扫码").CommonButtonStyle().width("50%").onClick(() => {
router.pushUrl({ url: 'pages/metailmange/UHFScanPage', params: { wzcrkItem: this.wzcrk } })
})
}
Button("保存").CommonButtonStyle().width("50%")
Button("保存").CommonButtonStyle().width(['入库', '出库'].includes(this.pageType) ? '50%' : '90%')
.onClick(async () => {
try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
......
......@@ -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, '凭证信息'))
......
......@@ -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,6 +212,7 @@ export struct AddWzin {
List() {
ForEach(this.form, (item) => {
if (item.typeList.length == 0 || item.typeList.includes[this.pageType]) {
ListItem() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
......@@ -218,6 +242,7 @@ export struct AddWzin {
}
if (item.type == 'input') {
TextInput({ text: this.handleText(item.key) })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
......@@ -238,6 +263,8 @@ export struct AddWzin {
}
}
}.padding(15)
}
})
}.margin({ bottom: 40 })
}.backgroundColor('#fff')
......
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')
}
......
......@@ -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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论