Commit f7a8f5b4 by huangqy

插入数据

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