Commit 9b85400f by huangqy

那个步进器

parent 7ec63a31
...@@ -91,7 +91,6 @@ struct WzinDetail { ...@@ -91,7 +91,6 @@ struct WzinDetail {
} }
this.getWzFormDetail() this.getWzFormDetail()
// this.getWzmxList()
this.scanCodeListen() this.scanCodeListen()
IdentifyService.openScanPort() IdentifyService.openScanPort()
} }
......
...@@ -13,7 +13,6 @@ import wzcrkmxModel from '../../../model/WzcrkmxModel'; ...@@ -13,7 +13,6 @@ import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util'; import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import wzcrkModel from '../../../model/WzcrkModel'; import wzcrkModel from '../../../model/WzcrkModel';
import xtpzInfoModel from '../../../model/XtpzInfoModel';
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
...@@ -498,6 +497,51 @@ export struct WzInfo { ...@@ -498,6 +497,51 @@ export struct WzInfo {
/*** /***
* @description: 切换总数
* @param {*}
* @return {*}
* @author: 王弘钢
*/
async handleNumberBoxChangeValue(row) {
console.log('event,element,count', JSON.stringify(this))
try {
const updateParams = {
mxguid: row.mxguid,
hwh: row.hwh || this.pzForm.hwh,
crksl: row.crksl
}
if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') {
if (row.currentModel) {
if (row.crksl < 0) {
promptAction.showToast({
message: '当前模式不支持修改为负数'
})
updateParams.crksl = 0
}
} else {
if (row.crksl > 0) {
promptAction.showToast({
message: '当前模式不支持修改为正数'
})
updateParams.crksl = 0
}
}
}
await wzcrkmxModel.updateWzmx(updateParams)
// createOrFindSQL("GY_M_PMV3", updateWzmx(updateParams))
this.pageInit(row, 'update')
} catch (e) {
console.log("更新数字报错了!!!!!!" + e.stack)
//TODO handle the exception
promptAction.showToast({
message: '更新数据失败'
})
}
}
/***
* @description: 单据明细新增/修改 * @description: 单据明细新增/修改
*/ */
async handleSetInsertOrUpdate(res, ITEM) { async handleSetInsertOrUpdate(res, ITEM) {
...@@ -1213,7 +1257,7 @@ export struct WzInfo { ...@@ -1213,7 +1257,7 @@ export struct WzInfo {
List() { List() {
ForEach(this.historicalInformation, (item) => { ForEach(this.historicalInformation, (item) => {
ListItem() { ListItem() {
WzList({ wzmx: item }) WzList({ wzmx: item, handleNumberBoxChangeValue: this.handleNumberBoxChangeValue })
} }
}) })
} }
......
...@@ -3,6 +3,7 @@ import { historicalInformationClass, WzmxClass } from './Wzcrk.data' ...@@ -3,6 +3,7 @@ import { historicalInformationClass, WzmxClass } from './Wzcrk.data'
@Component @Component
export struct WzList { export struct WzList {
@ObjectLink wzmx: historicalInformationClass @ObjectLink wzmx: historicalInformationClass
handleNumberBoxChangeValue: (wzmx: historicalInformationClass) => void
build() { build() {
Column() { Column() {
...@@ -32,12 +33,14 @@ export struct WzList { ...@@ -32,12 +33,14 @@ export struct WzList {
.width(120) .width(120)
.onInc(() => { .onInc(() => {
this.wzmx.crksl = this.wzmx.crksl + 1 this.wzmx.crksl = this.wzmx.crksl + 1
this.handleNumberBoxChangeValue(this.wzmx)
}) })
.onDec(() => { .onDec(() => {
if( this.wzmx.crksl == 0) { if( this.wzmx.crksl == 0) {
return return
} }
this.wzmx.crksl = this.wzmx.crksl - 1 this.wzmx.crksl = this.wzmx.crksl - 1
this.handleNumberBoxChangeValue(this.wzmx)
}) })
}.alignSelf(ItemAlign.End) }.alignSelf(ItemAlign.End)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论