Commit 51fe3548 by huangqy

临时单据的凭证号

parent 21fdadeb
...@@ -84,5 +84,9 @@ export interface WzmxDto { ...@@ -84,5 +84,9 @@ export interface WzmxDto {
hwh: string, hwh: string,
mxguid: string, mxguid: string,
pzmxguid: string pzmxguid: string
} }
export interface PzhDto {
pzh: number
}
\ No newline at end of file
import relationalStore from '@ohos.data.relationalStore'; import relationalStore from '@ohos.data.relationalStore';
import { DjcxDto, PzMxDto, WzmxDto } from '../../bean/dto/RecommendHwDto.ts'; import { DjcxDto, PzhDto, PzMxDto, WzmxDto } from '../../bean/dto/RecommendHwDto.ts';
import { WzcrkDetailDto } from '../../bean/dto/WzcrkMxRefWzDto'; import { WzcrkDetailDto } from '../../bean/dto/WzcrkMxRefWzDto';
import { Wzcrk } from '../../entity/Wzcrk'; import { Wzcrk } from '../../entity/Wzcrk';
import { Wzcrkmx } from '../../entity/Wzcrkmx'; import { Wzcrkmx } from '../../entity/Wzcrkmx';
...@@ -319,5 +319,30 @@ export class WzcrkDao extends BaseTable<Wzcrk> { ...@@ -319,5 +319,30 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
return info; return info;
} }
//获取临时单据的凭证号
async getPzh(params) : Promise<PzhDto[]> {
try {
let val_sql = NativeSql.getPzhSql(params);
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toPzh(rs))
} while (rs.goToNextRow())
}
Logger.info(this, 'queryAll items22=' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toPzh(cursor: relationalStore.ResultSet): PzhDto {
let info: PzhDto = {
pzh: cursor.getLong(cursor.getColumnIndex('pzh')),
};
return info;
}
} }
\ No newline at end of file
...@@ -138,6 +138,13 @@ WHERE ...@@ -138,6 +138,13 @@ WHERE
return sql return sql
} }
// 临时凭证号查询
static getPzhSql(params): string {
const sql =
`select 'LS' || (count(1) + 1) pzh from tab_bzgl_knzy_app_wzcrk where sjlx = '${params.sjlx}' and pzlx = ${params.pzlx}`
return sql
}
/** /**
* 包裹管理表 * 包裹管理表
*/ */
......
...@@ -111,6 +111,11 @@ class WzcrkModel { ...@@ -111,6 +111,11 @@ class WzcrkModel {
let res = await SQLiteContext.with(WzcrkDao).getWzmx(params) let res = await SQLiteContext.with(WzcrkDao).getWzmx(params)
return res return res
} }
// 获取临时单据的凭证号
async getLhPzh(params) {
let res = await SQLiteContext.with(WzcrkDao).getPzh(params)
return res
}
// 清空表 // 清空表
async clear() { async clear() {
......
...@@ -11,6 +11,7 @@ import { uuid } from '@ohos/common/src/main/ets/utils/util'; ...@@ -11,6 +11,7 @@ import { uuid } from '@ohos/common/src/main/ets/utils/util';
import IdentifyService from '../../../../identify/IdentifySerivce' import IdentifyService from '../../../../identify/IdentifySerivce'
import emitter from '@ohos.events.emitter'; import emitter from '@ohos.events.emitter';
import { WzInsertInfo } from '../../Common/WzInsertInfo'; import { WzInsertInfo } from '../../Common/WzInsertInfo';
import { zmlx_dict } from '@ohos/common/src/main/ets/utils/dict';
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
.borderWidth(2) .borderWidth(2)
...@@ -61,20 +62,20 @@ struct WzinsertDetail { ...@@ -61,20 +62,20 @@ struct WzinsertDetail {
if (data.sjlx) { if (data.sjlx) {
this.currentSjlx = data.sjlx this.currentSjlx = data.sjlx
} }
this.pzForm.zmlx = this.zmlx_dict[0].value // this.pzForm.zmlx = zmlx_dict[0].value
var newType = 'rkd' let newType = 'rkd'
switch (data.pzlx) { switch (data.pzlx) {
case '1': case '1':
this.pageType = '入库' this.pageType = '入库'
newType = 'rkd' newType = 'rkd'
this.pzForm.pzlx = 14 this.pzForm.pzlx = '14'
this.pzForm.pzszlx = 'DR' this.pzForm.pzszlx = 'DR'
this.hanleGetDefaultPzh(this.pzForm.pzlx) this.hanleGetDefaultPzh(this.pzForm.pzlx)
break; break;
case '2': case '2':
this.pageType = '出库' this.pageType = '出库'
newType = 'ckd' newType = 'ckd'
this.pzForm.pzlx = 17 this.pzForm.pzlx = '17'
this.pzForm.pzszlx = 'DC' this.pzForm.pzszlx = 'DC'
this.hanleGetDefaultPzh(this.pzForm.pzlx) this.hanleGetDefaultPzh(this.pzForm.pzlx)
break; break;
...@@ -85,8 +86,8 @@ struct WzinsertDetail { ...@@ -85,8 +86,8 @@ struct WzinsertDetail {
case '4': case '4':
this.pageType = '调号' this.pageType = '调号'
newType = 'thd' newType = 'thd'
this.pzFrom.pzlx = 41 this.pzForm.pzlx = '41'
this.pzFrom.pzszlx = 'HXTH' this.pzForm.pzszlx = 'HXTH'
this.hanleGetDefaultPzh(this.pzForm.pzlx) this.hanleGetDefaultPzh(this.pzForm.pzlx)
break; break;
case 'HW44': case 'HW44':
...@@ -101,12 +102,11 @@ struct WzinsertDetail { ...@@ -101,12 +102,11 @@ struct WzinsertDetail {
default: default:
this.pageType = '入库' this.pageType = '入库'
newType = 'rkd' newType = 'rkd'
this.pzForm.pzlx = 14 this.pzForm.pzlx = '14'
this.pzForm.pzszlx = 'DR' this.pzForm.pzszlx = 'DR'
this.hanleGetDefaultPzh(this.pzForm.pzlx) this.hanleGetDefaultPzh(this.pzForm.pzlx)
break; break;
} }
this.pzlxOption = pzlxOption.filter((item) => item.type == newType)
} }
/*** /***
...@@ -120,21 +120,11 @@ struct WzinsertDetail { ...@@ -120,21 +120,11 @@ struct WzinsertDetail {
pzlx: pzlx, pzlx: pzlx,
sjlx: this.currentSjlx || '新建' sjlx: this.currentSjlx || '新建'
} }
const res = await getDefaultPzh(pzlx) const res = await wzcrkModel.getLhPzh(params)
this.pzForm.pzh = res if (res && res.length > 0) {
// if (res && res.length > 0) { this.pzForm.pzh = res[0].pzh
// this.pzhOption = res.map((item) => { }
// return { }
// text: item.pzh,
// value: item.pzh
// }
// })
// this.pzForm.pzh = res[0].pzh
// } else {
// this.pzhOption = []
// this.pzForm.pzh = ''
// }
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论