Commit f7a8f5b4 by huangqy

插入数据

parent 65f8d38f
......@@ -362,12 +362,15 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
}
}
async updateWzmx(params) {
async updateWzmx(params): Promise<number> {
try {
let val_sql = NativeSql.updateWzmxSql(params)
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
return rs;
let valueBucket = {
hwh: params.hwh,
crksl: params.crksl
}
let wp = this.getPredicates()
wp.equalTo('guid', params.mxguid)
return this.updateData(valueBucket, wp)
} catch (e) {
throw new Error('[更新异常]|' + e)
}
......
import { uuid } from '../../utils/util';
import { Logger } from '../../utils/Logger';
export class NativeSql {
/**
* 构建出入库明细查询语句
......@@ -173,7 +171,6 @@ WHERE
if (hjh) {
sql_val += ` where hjh = '${hjh}'`
}
Logger.info('sql_val>>', sql_val)
return sql_val
}
......
......@@ -106,7 +106,7 @@ export struct WzInfo {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
ForEach(this.currentWZInfo, item => {
Text(item.pmdmcode).width("25%").textAlign(TextAlign.Start).fontSize(14)
Text(item.pmdmsix).width("25%").textAlign(TextAlign.Start).fontSize(14)
Text(item.wzpm).width("25%").textAlign(TextAlign.Center).fontSize(14)
Text(item.hxmc).width("25%").textAlign(TextAlign.Center).fontSize(14)
Text(item.crksl + '')
......@@ -134,7 +134,6 @@ export struct WzInfo {
// 页面初始化
aboutToAppear() {
this.pzxqGuild = this.wzcrk.guid
this.historicalInformation = this.wzmx
this.getData()
this.scanCodeListen();
}
......@@ -372,7 +371,7 @@ export struct WzInfo {
const [data] = this.historicalInformation.filter((item, index) => item
.pmdmcode == ITEM.pmdmcode && item.hwh == this.pzForm.hwh)
console.log('data', data)
console.log('---过滤后的data---', JSON.stringify(data))
if (this.pageType == '调号') {
if (data && data.currentModel !== this.currentModel) {
const model = data.currentModel ? '调出' : '调入'
......@@ -386,7 +385,7 @@ export struct WzInfo {
if (!!this.currentPmdmcode && this.currentPmdmcode.slice(0, 6) == ITEM
.pmdmcode
.slice(0, 6)) {
console.log('同品名数据时')
console.log('同品名数据时', JSON.stringify(res), JSON.stringify(ITEM))
this.handleSetInsertOrUpdate(res, ITEM)
// this.setDkScan(ITEM)
} else {
......@@ -484,7 +483,9 @@ export struct WzInfo {
hwh: testPmdmCodeSql[0].hwh || this.pzForm.hwh,
crksl: update_crksl
}
await wzcrkmxModel.updateWzmx(updateParams)
console.log("updateParams", JSON.stringify(updateParams))
let s = await wzcrkmxModel.updateWzmx(updateParams)
console.log("updateParams执行成功或者失败:" + s)
} else {
var insert_crksl = 0
if (this.pageType == '倒库' || this.pageType == '调号' || this.pageType == '换位') {
......@@ -1136,7 +1137,7 @@ export struct WzInfo {
.borderRadius(5)
Button("查看状态").CommonButtonStyle().width("25%").margin({ left: 5, right: 5 }).onClick(() => {
router.pushUrl({ url: 'pages/metailmange/WzStatus', params: {
wzmx: this.wzmx
wzmx: this.historicalInformation
} })
})
}.width("100%")
......@@ -1144,7 +1145,7 @@ export struct WzInfo {
Column() {
List() {
ForEach(this.wzmx, (item) => {
ForEach(this.historicalInformation, (item) => {
ListItem() {
WzList({ wzmx: item })
}
......
......@@ -169,7 +169,7 @@ export class WzmxClass {
/**
* 品名代码
*/
// pmdmcode: string
pmdmcode: string
/**
* 凭证数量
*/
......@@ -211,10 +211,14 @@ export class WzmxClass {
*/
wczt: string
currentModel?: boolean
constructor(data: {
guid?: string,
// gznd: string,
// pmdmcode: string,
pmdmcode: string,
pzsl: number,
crksl: number,
wzcrkguid: string,
......@@ -224,11 +228,12 @@ export class WzmxClass {
xh: string,
wzpm: string,
pmdmSix: string,
wczt: string
wczt: string,
currentModel?: boolean
}) {
this.guid = data.guid;
// this.gznd = data.gznd;
// this.pmdmcode = data.pmdmcode;
this.pmdmcode = data.pmdmcode;
this.pzsl = data.pzsl;
this.crksl = data.crksl;
this.wzcrkguid = data.wzcrkguid;
......@@ -239,6 +244,7 @@ export class WzmxClass {
this.wzpm = data.wzpm;
this.pmdmSix = data.pmdmSix;
this.wczt = data.wczt;
this.currentModel = data.currentModel
}
}
......
......@@ -108,15 +108,8 @@ struct WzinDetail {
// pageType必传 入库 出库 盘库 调号 倒库 换位
// dataType必传 导入是true, 其他为false
// isHaveButton 必传 完成状态 未完成是true, 其他为false
WzInfo({
wzmx: this.wzmx,
wzcrk: this.wzcrk,
getDetail: this.getWzmxList,
pageType: "入库",
pzForm: $pzForm,
dataType: this.isUpdate ? true : false,
isHaveButton: this.wzcrk.wczt == '未完成' ? true : false
})
WzInfo({ historicalInformation: this.wzmx, wzcrk: this.wzcrk, getDetail: this.getWzmxList,
pageType: "入库", pzForm: this.pzForm, dataType: this.isUpdate ? true : false, isHaveButton: this.wzcrk.wczt == '未完成' ? true : false})
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
......
......@@ -85,7 +85,7 @@ struct WzInvDetail{
TabContent() {
Column() {
WzInfo({ wzmx: this.wzmx, wzcrk: this.wzcrk, getDetail: this.getDetail })
WzInfo({ historicalInformation: this.wzmx, wzcrk: this.wzcrk, getDetail: this.getDetail })
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
......
......@@ -92,7 +92,7 @@ struct WzOutDetail {
TabContent() {
Column() {
WzInfo({ wzmx: this.wzmx, wzcrk: this.wzcrk, getDetail: this.getDetail, pageType: "出库" })
WzInfo({ historicalInformation: this.wzmx, wzcrk: this.wzcrk, getDetail: this.getDetail, pageType: "出库" })
}.width("100%")
}.tabBar(this.TabBuilder(1, '物资信息'))
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论