Commit 51fe3548 by huangqy

临时单据的凭证号

parent 21fdadeb
......@@ -84,5 +84,9 @@ export interface WzmxDto {
hwh: string,
mxguid: string,
pzmxguid: string
}
export interface PzhDto {
pzh: number
}
\ No newline at end of file
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 { Wzcrk } from '../../entity/Wzcrk';
import { Wzcrkmx } from '../../entity/Wzcrkmx';
......@@ -319,5 +319,30 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
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
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 {
let res = await SQLiteContext.with(WzcrkDao).getWzmx(params)
return res
}
// 获取临时单据的凭证号
async getLhPzh(params) {
let res = await SQLiteContext.with(WzcrkDao).getPzh(params)
return res
}
// 清空表
async clear() {
......
......@@ -11,6 +11,7 @@ import { uuid } from '@ohos/common/src/main/ets/utils/util';
import IdentifyService from '../../../../identify/IdentifySerivce'
import emitter from '@ohos.events.emitter';
import { WzInsertInfo } from '../../Common/WzInsertInfo';
import { zmlx_dict } from '@ohos/common/src/main/ets/utils/dict';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
......@@ -61,20 +62,20 @@ struct WzinsertDetail {
if (data.sjlx) {
this.currentSjlx = data.sjlx
}
this.pzForm.zmlx = this.zmlx_dict[0].value
var newType = 'rkd'
// this.pzForm.zmlx = zmlx_dict[0].value
let newType = 'rkd'
switch (data.pzlx) {
case '1':
this.pageType = '入库'
newType = 'rkd'
this.pzForm.pzlx = 14
this.pzForm.pzlx = '14'
this.pzForm.pzszlx = 'DR'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
case '2':
this.pageType = '出库'
newType = 'ckd'
this.pzForm.pzlx = 17
this.pzForm.pzlx = '17'
this.pzForm.pzszlx = 'DC'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
......@@ -85,8 +86,8 @@ struct WzinsertDetail {
case '4':
this.pageType = '调号'
newType = 'thd'
this.pzFrom.pzlx = 41
this.pzFrom.pzszlx = 'HXTH'
this.pzForm.pzlx = '41'
this.pzForm.pzszlx = 'HXTH'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
case 'HW44':
......@@ -101,12 +102,11 @@ struct WzinsertDetail {
default:
this.pageType = '入库'
newType = 'rkd'
this.pzForm.pzlx = 14
this.pzForm.pzlx = '14'
this.pzForm.pzszlx = 'DR'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
}
this.pzlxOption = pzlxOption.filter((item) => item.type == newType)
}
/***
......@@ -120,21 +120,11 @@ struct WzinsertDetail {
pzlx: pzlx,
sjlx: this.currentSjlx || '新建'
}
const res = await getDefaultPzh(pzlx)
this.pzForm.pzh = res
// if (res && res.length > 0) {
// this.pzhOption = res.map((item) => {
// return {
// text: item.pzh,
// value: item.pzh
// }
// })
// this.pzForm.pzh = res[0].pzh
// } else {
// this.pzhOption = []
// this.pzForm.pzh = ''
// }
},
const res = await wzcrkModel.getLhPzh(params)
if (res && res.length > 0) {
this.pzForm.pzh = res[0].pzh
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论