Commit eda5555c by 毛勇泽

盘库修改crksl更新

parent 1230a082
...@@ -103,7 +103,7 @@ struct WzExchangeDetailPage{ ...@@ -103,7 +103,7 @@ struct WzExchangeDetailPage{
Button("保存").CommonButtonStyle().width("100%") Button("保存").CommonButtonStyle().width("100%")
.onClick(async () => { .onClick(async () => {
try { try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.wzmx)) Logger.info('保存的明细数据>>', JSON.stringify(this.wzmx))
if(this.isUpdate) { if(this.isUpdate) {
await wzcrkModel.updateWcztByData(this.wzcrk.guid, { await wzcrkModel.updateWcztByData(this.wzcrk.guid, {
...@@ -117,7 +117,7 @@ struct WzExchangeDetailPage{ ...@@ -117,7 +117,7 @@ struct WzExchangeDetailPage{
this.wzcrk.gznd = new Date().getFullYear() + '' this.wzcrk.gznd = new Date().getFullYear() + ''
this.wzcrk.sjlx = '新建' this.wzcrk.sjlx = '新建'
await wzcrkModel.setOne(this.wzcrk) await wzcrkModel.setOne(this.wzcrk)
Logger.info('添加的入库数据>>', JSON.stringify(this.wzcrk)) Logger.info('添加的数据>>', JSON.stringify(this.wzcrk))
} }
// for (let index = 0; index < this.wzmx.length; index++) { // for (let index = 0; index < this.wzmx.length; index++) {
...@@ -143,11 +143,11 @@ struct WzExchangeDetailPage{ ...@@ -143,11 +143,11 @@ struct WzExchangeDetailPage{
// }) // })
// //
promptAction.showToast({ promptAction.showToast({
message: '保存入库数据成功', message: '保存数据成功',
bottom: 300 bottom: 300
}) })
setTimeout(() => { setTimeout(() => {
router.replaceUrl({ url: 'pages/metailmange/WzInPage/WzInPage' }) router.back({ url: 'pages/metailmange/WzExchangePage/WzExchangePage' })
}, 300) }, 300)
} catch (e) { } catch (e) {
promptAction.showToast({ promptAction.showToast({
......
...@@ -242,9 +242,9 @@ struct WzExchangePage{ ...@@ -242,9 +242,9 @@ struct WzExchangePage{
message: '请至少选择一条单据' message: '请至少选择一条单据'
}) })
} else { } else {
// if (this.dialogController != undefined) { if (this.dialogController != undefined) {
// this.dialogController.open() this.dialogController.open()
// } }
} }
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -261,9 +261,9 @@ struct WzExchangePage{ ...@@ -261,9 +261,9 @@ struct WzExchangePage{
message: '请选择已完成的单据' message: '请选择已完成的单据'
}) })
} else { } else {
// if (this.exportDialogController != undefined) { if (this.exportDialogController != undefined) {
// this.exportDialogController.open() this.exportDialogController.open()
// } }
} }
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983") .fontSize("14vp")
Button("全选") Button("全选")
...@@ -316,6 +316,7 @@ struct WzExchangePage{ ...@@ -316,6 +316,7 @@ struct WzExchangePage{
.margin({top:-15}) .margin({top:-15})
.onChange((index: number) => { .onChange((index: number) => {
this.currentIndex = index this.currentIndex = index
this.getWzcrkList()
}) })
......
...@@ -100,50 +100,27 @@ struct WzInvDetail{ ...@@ -100,50 +100,27 @@ struct WzInvDetail{
.onClick(async () => { .onClick(async () => {
try { try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.wzmx)) Logger.info('保存的入库明细数据>>', JSON.stringify(this.wzmx))
const crksl = this.wzmx.map(v => Number(v.crksl)).reduce((a, b) => a + b, 0)
if(this.isUpdate) {
await wzcrkModel.updateWcztByData(this.wzcrk.guid, { await wzcrkModel.updateWcztByData(this.wzcrk.guid, {
dec: this.wzcrk.dec, dec: this.wzcrk.dec,
ydh: this.wzcrk.ydh, ydh: this.wzcrk.ydh,
crksl
}) })
}
else { for (let index = 0; index < this.wzmx.length; index++) {
this.wzcrk.guid = uuid() const element = this.wzmx[index];
this.wzcrk.gznd = new Date().getFullYear() + '' try {
this.wzcrk.sjlx = '新建' let val1 = await wzcrkmxModel.updateWcztmxByData(element.guid, {crksl:element.crksl})
await wzcrkModel.setOne(this.wzcrk) } catch (e) {
Logger.info('添加的入库数据>>', JSON.stringify(this.wzcrk)) Logger.error(this, '保存失败了>>' + JSON.stringify(e))
}
} }
// for (let index = 0; index < this.wzmx.length; index++) {
// const element = this.wzmx[index];
// try {
// Logger.error(this, '更新数据参数' + JSON.stringify({
// 'guid': element.guid,
// 'crksl': element.crksl
// }))
// let val1 = await this.wzcrkmxDao.update({ 'guid': element.guid, 'crksl': element.crksl } as Wzcrkmx)
// Logger.error(this, '更新查询的入库数据>>' + JSON.stringify(val1));
// } catch (e) {
// Logger.error(this, '保存失败了>>' + JSON.stringify(e))
// }
// }
//
// const crksl = this.wzmx.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
// })
//
promptAction.showToast({ promptAction.showToast({
message: '保存入库数据成功', message: '保存入库数据成功',
bottom: 300 bottom: 300
}) })
setTimeout(() => { setTimeout(() => {
router.replaceUrl({ url: 'pages/metailmange/WzInPage/WzInPage' }) router.back({ url: 'pages/metailmange/WzInvPage/WzInvPage' })
}, 300) }, 300)
} catch (e) { } catch (e) {
promptAction.showToast({ promptAction.showToast({
......
...@@ -239,9 +239,9 @@ struct WzInvPage{ ...@@ -239,9 +239,9 @@ struct WzInvPage{
message: '请至少选择一条单据' message: '请至少选择一条单据'
}) })
} else { } else {
// if (this.dialogController != undefined) { if (this.dialogController != undefined) {
// this.dialogController.open() this.dialogController.open()
// } }
} }
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -259,9 +259,9 @@ struct WzInvPage{ ...@@ -259,9 +259,9 @@ struct WzInvPage{
message: '请选择已完成的单据' message: '请选择已完成的单据'
}) })
} else { } else {
// if (this.exportDialogController != undefined) { if (this.exportDialogController != undefined) {
// this.exportDialogController.open() this.exportDialogController.open()
// } }
} }
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983") .fontSize("14vp")
Button("全选") Button("全选")
......
...@@ -144,7 +144,7 @@ struct WzReverseDetailPage{ ...@@ -144,7 +144,7 @@ struct WzReverseDetailPage{
bottom: 300 bottom: 300
}) })
setTimeout(() => { setTimeout(() => {
router.replaceUrl({ url: 'pages/metailmange/WzInPage/WzInPage' }) router.back({ url: 'pages/metailmange/WzReversePage/WzReversePage' })
}, 300) }, 300)
} catch (e) { } catch (e) {
promptAction.showToast({ promptAction.showToast({
......
...@@ -232,9 +232,9 @@ struct WzReversePage{ ...@@ -232,9 +232,9 @@ struct WzReversePage{
message: '请至少选择一条单据' message: '请至少选择一条单据'
}) })
} else { } else {
// if (this.dialogController != undefined) { if (this.dialogController != undefined) {
// this.dialogController.open() this.dialogController.open()
// } }
} }
}) })
.fontColor("#0fa983") .fontColor("#0fa983")
...@@ -252,9 +252,9 @@ struct WzReversePage{ ...@@ -252,9 +252,9 @@ struct WzReversePage{
message: '请选择已完成的单据' message: '请选择已完成的单据'
}) })
} else { } else {
// if (this.exportDialogController != undefined) { if (this.exportDialogController != undefined) {
// this.exportDialogController.open() this.exportDialogController.open()
// } }
} }
}).fontColor("#0fa983") .fontSize("14vp") }).fontColor("#0fa983") .fontSize("14vp")
Button("全选") Button("全选")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论