Commit c8b9d353 by 陈桂东

提交代码

parent bcacdcb7
......@@ -137,9 +137,9 @@ export struct WzInfo {
// 在自定义组件即将析构销毁时将dialogController置空
aboutToDisappear() {
this.scanInfoDialog = undefined // 将dialogController置空
Logger.info('Aaaaa>>', JSON.stringify(this.historicalInformation))
}
scanCodeListen() {
var innerEvent = { eventId: 3 }
emitter.on(innerEvent, (eventQRData) => {
......@@ -158,11 +158,6 @@ export struct WzInfo {
// 获取库房名称
const res = await kfModel.query({ guid: this.wzcrk.kfguid })
this.kfmc = res[0].kfmc ?? ''
const pzmxRes = await wzcrkModel.getPzMx({guid : this.wzcrk.guid})
pzmxRes.forEach((element) => {
this.historicalInformation.push(new historicalInformationClass(element))
})
}
/***
......@@ -273,7 +268,7 @@ export struct WzInfo {
console.log(">>>>>>>>扫描物资>>>>>>>" + JSON.stringify(res.data))
let isNumber = false
res.data.forEach(element => {
if (/^\d+$/.test(element.srsl)) {// 判断扫描的物资的srsl一定是数字才会通过校验不是就报错
if (/^\d+$/.test(element.srsl)) { // 判断扫描的物资的srsl一定是数字才会通过校验不是就报错
isNumber = true
}
});
......@@ -505,7 +500,7 @@ export struct WzInfo {
}
console.log("updateParams", JSON.stringify(updateParams))
let s = await wzcrkmxModel.updateWzmx(updateParams)
console.log("updateParams执行成功或者失败:" + s)
console.log("updateParams执行成功或者失败:" + JSON.stringify(this.historicalInformation))
} else {
var insert_crksl = 0
if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') {
......
......@@ -5,7 +5,7 @@ import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk';
import { WzInfo } from '../../Common/WzInfo'
import { PzInfo } from './PzInfo'
import wzcrkmxModel from '../../../../model/WzcrkmxModel';
import { PzFormClass, WzClass, WzmxClass } from '../../Common/Wzcrk.data';
import { historicalInformationClass, PzFormClass, WzClass, WzmxClass } from '../../Common/Wzcrk.data';
import promptAction from '@ohos.promptAction';
import wzcrkModel from '../../../../model/WzcrkModel';
import { AddWzin } from './AddWzin'
......@@ -37,7 +37,7 @@ struct WzinDetail {
@State currentIndex: number = 0
@State isUpdate: boolean = false
@State wzcrk: WzClass = null // 物资出入库单据信息
@State wzmx: WzmxClass[] = [] // 物资出入库明细
@State historicalInformation: historicalInformationClass[] = [] // 物资出入库明细
@State pzForm: PzFormClass = null // 物资出入库表单详情
private controller: TabsController = new TabsController()
......@@ -62,13 +62,11 @@ struct WzinDetail {
// 获取物资列表详情信息
async getWzmxList(wzpm?) {
this.wzmx = []
const res = await wzcrkmxModel.query(this.wzcrk.guid, wzpm)
res.forEach(i => {
// @ts-ignore
this.wzmx.push(new WzmxClass(i))
const pzmxRes = await wzcrkModel.getPzMx({ guid: this.wzcrk.guid })
pzmxRes.forEach((element) => {
this.historicalInformation.push(new historicalInformationClass(element))
})
Logger.info('接收到出入库物资明细信息>>', JSON.stringify(res))
Logger.info('接收到出入库物资明细信息>>', JSON.stringify(pzmxRes))
}
@Builder TabBuilder(index: number, name: string) {
......@@ -108,8 +106,15 @@ struct WzinDetail {
// pageType必传 入库 出库 盘库 调号 倒库 换位
// dataType必传 导入是true, 其他为false
// isHaveButton 必传 完成状态 未完成是true, 其他为false
WzInfo({ wzcrk: this.wzcrk, getDetail: this.getWzmxList,
pageType: "入库", pzForm: this.pzForm, dataType: this.isUpdate ? true : false, isHaveButton: this.wzcrk.wczt == '未完成' ? true : false})
WzInfo({
wzcrk: this.wzcrk,
getDetail: this.getWzmxList,
pageType: "入库",
pzForm: this.pzForm,
historicalInformation: this.historicalInformation,
dataType: this.isUpdate ? true : false,
isHaveButton: this.wzcrk.wczt == '未完成' ? true : false
})
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
......@@ -128,20 +133,20 @@ struct WzinDetail {
Button("保存").CommonButtonStyle().width("50%")
.onClick(async () => {
try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.wzmx))
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
if (this.isUpdate) {
const crksl = this.wzmx.map(v => Number(v.crksl)).reduce((a, b) => a + b, 0)
const crksl = this.historicalInformation.map(v => Number(v.crksl)).reduce((a, b) => a + b, 0)
await wzcrkModel.updateWcztByData(this.wzcrk.guid, {
dec: this.wzcrk.dec,
ydh: this.wzcrk.ydh,
crksl
})
for (let index = 0; index < this.wzmx.length; index++) {
const element = this.wzmx[index];
for (let index = 0; index < this.historicalInformation.length; index++) {
const element = this.historicalInformation[index];
try {
let val1 = await wzcrkmxModel.updateWcztmxByData(element.guid, { crksl: element.crksl })
let val1 = await wzcrkmxModel.updateWcztmxByData(element.mxguid, { crksl: element.crksl })
} catch (e) {
Logger.error(this, '保存失败了>>' + JSON.stringify(e))
}
......
......@@ -97,7 +97,9 @@ export struct Pack {
this.ddh = value
this.getPackList()
})
Button("接收").CommonButtonStyle()
Button("接收").CommonButtonStyle().onClick(() => {
router.pushUrl({ url: 'pages/package/ReceivePack' })
})
Button("上架").CommonButtonStyle()
}
......
import { TitleBar } from '../../view/title/TitleBar'
@Entry
@Component
export struct ReceivePack {
build() {
Column() {
TitleBar({ title: "新增包裹" })
Column() {
Text("请扫描包裹").fontColor('#fff').fontSize(26).margin({ top: 300 })
}
.alignItems(HorizontalAlign.Center)
.flexGrow(1)
.width('88%')
.borderWidth(3)
.border({ style: BorderStyle.Dotted })
.borderColor('#fff')
}.height('100%')
.width('100%')
.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
}).padding({ bottom: 20 })
}
}
\ No newline at end of file
......@@ -4,12 +4,24 @@ import kfModel from '../../../model/KfModel'
@Component
export struct HouseList {
@Link dataSource: KfInfo[]
@Link searchValue: string
@Styles commonPadding() {
.padding({ top: 4, bottom: 4 })
.alignSelf(ItemAlign.Start)
}
async handleChange(record) {
await kfModel.update(record.guid)
this.getWarehouseList()
}
// 获取库房数据
async getWarehouseList() {
const res = await kfModel.query({ kfmc: this.searchValue })
this.dataSource = res
}
@Builder renderList() {
Column() {
List() {
......@@ -38,7 +50,7 @@ export struct HouseList {
Text("优先级:").commonPadding()
Text(item.yxj + '').commonPadding()
}
}.width('40%')
}.width('35%')
Column() {
Radio({ value: item.guid, group: 'radioGroup' })
......@@ -47,13 +59,13 @@ export struct HouseList {
.width(18)
.onChange((isChecked: boolean) => {
if (isChecked) {
kfModel.update(item.guid)
this.handleChange(item)
}
})
if (item.isdefault == '1') {
Text('默认库房').fontColor('#3672cf')
Text('默认库房').fontColor('#3672cf').fontSize(12)
}
}.width('10%')
}.width('20%')
}.commonPadding()
}
})
......
import { HouseList } from './HouseList'
import { TitleBar } from '../../../view/title/TitleBar'
import kfModel from '../../../model/KfModel'
import { Logger } from '@ohos/common'
import { KfInfo } from '@ohos/common'
import { KfInfo, Logger } from '@ohos/common'
@Entry
@Component
export struct Warehouse {
......@@ -10,13 +10,13 @@ export struct Warehouse {
controller: SearchController = new SearchController()
@State dataSource: KfInfo[] = []
aboutToAppear(){
this.getWarehouseList()
aboutToAppear() {
this.getWarehouseList()
}
// 获取库房数据
async getWarehouseList(kfmc?: string ) {
const res = await kfModel.query({kfmc})
async getWarehouseList(kfmc?: string) {
const res = await kfModel.query({ kfmc })
this.dataSource = res
Logger.info(this, "库房数据>" + JSON.stringify(res));
}
......@@ -32,18 +32,21 @@ export struct Warehouse {
.placeholderColor(Color.Grey)
.placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 })
.onChange((value) => this.getWarehouseList(value))
.onChange((value) => {
this.searchValue = value
this.getWarehouseList(value)
})
.borderRadius(5)
}.width('100%')
Column() {
HouseList({ dataSource: $dataSource })
}.margin({top:20}).borderRadius(2)
HouseList({ dataSource: $dataSource,searchValue:$searchValue })
}.margin({ top: 20 }).borderRadius(2)
}
}.linearGradient({
direction: GradientDirection.RightBottom,
repeating: true,
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]]
}).padding({bottom:40,left:20,right:20})
}).padding({ bottom: 40, left: 20, right: 20 })
}
}
\ No newline at end of file
......@@ -51,6 +51,7 @@
"identify/demo_page/ScanDemo",
"pages/metailmange/GoodsSelectHwPage",
"pages/metailmange/GoodsSelectRfidTools",
"pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail"
"pages/metailmange/WzOutPage/WzOutDetail/WzOutDetail",
"pages/package/ReceivePack"
]
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论