Commit e8225d69 by huangqy

临时单据

parent 84ec63f4
......@@ -61,4 +61,28 @@ export interface PzMxDto {
hwh: string,
mxguid: string,
pzmxguid: string
}
\ No newline at end of file
}
export interface DjcxDto {
guid: string,
crkrq: string,
pzlx: string,
pzh: string,
wczt: string,
sl: string,
sfdw: string,
pzzbguid: string
}
export interface WzmxDto {
wzpm: string,
pmdmsix: string,
pmdmcode: string,
hxmc: string,
pzsl: number,
crksl: number,
hwh: string,
mxguid: string,
pzmxguid: string
}
import relationalStore from '@ohos.data.relationalStore';
import { PzMxDto } from '../../bean/dto/RecommendHwDto.ts';
import { DjcxDto, PzMxDto, WzmxDto } from '../../bean/dto/RecommendHwDto.ts';
import { WzcrkDetailDto } from '../../bean/dto/WzcrkMxRefWzDto';
import { Wzcrk } from '../../entity/Wzcrk';
import { Wzcrkmx } from '../../entity/Wzcrkmx';
......@@ -238,4 +238,86 @@ export class WzcrkDao extends BaseTable<Wzcrk> {
};
return info;
}
async getDjcx() : Promise<DjcxDto[]> {
try {
let val_sql = NativeSql.djcxSql();
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toDjcx(rs))
} while (rs.goToNextRow())
}
Logger.info(this, 'queryAll items22=' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toDjcx(cursor: relationalStore.ResultSet): DjcxDto {
let info: DjcxDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
crkrq: cursor.getString(cursor.getColumnIndex('crkrq')),
pzlx: cursor.getString(cursor.getColumnIndex('PZLX')),
pzh: cursor.getString(cursor.getColumnIndex('PZH')),
wczt: cursor.getString(cursor.getColumnIndex('WCZT')),
sl: cursor.getString(cursor.getColumnIndex('sl')),
sfdw: cursor.getString(cursor.getColumnIndex('sfdw')),
pzzbguid: cursor.getString(cursor.getColumnIndex('pzzbguid'))
};
return info;
}
// 绑定
async binding(params) {
let val_sql = NativeSql.bindingSql(params);
let db = await this.futureDb;
return await db.executeSql(val_sql);
}
//设置状态及绑定guid
async setActiveAndBdguid(params) {
let val_sql = NativeSql.setActiveAndBdguidSql(params);
let db = await this.futureDb;
return await db.executeSql(val_sql)
}
//物资明细查询
async getWzmx(params) : Promise<WzmxDto[]> {
try {
let val_sql = NativeSql.getWzmxSql(params);
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toWzmx(rs))
} while (rs.goToNextRow())
}
Logger.info(this, 'queryAll items22=' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toWzmx(cursor: relationalStore.ResultSet): WzmxDto {
let info: WzmxDto = {
wzpm: cursor.getString(cursor.getColumnIndex('wzpm')),
pmdmsix: cursor.getString(cursor.getColumnIndex('pmdmsix')),
pmdmcode: cursor.getString(cursor.getColumnIndex('pmdmcode')),
hxmc: cursor.getString(cursor.getColumnIndex('hxmc')),
pzsl: cursor.getLong(cursor.getColumnIndex('pzsl')),
crksl: cursor.getLong(cursor.getColumnIndex('crksl')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
mxguid: cursor.getString(cursor.getColumnIndex('mxguid')),
pzmxguid: cursor.getString(cursor.getColumnIndex('pzmxguid'))
};
return info;
}
}
\ No newline at end of file
......@@ -417,6 +417,16 @@ export class WzcrkmxDao extends BaseTable<Wzcrkmx> {
throw new Error('[插入异常]|' + e)
}
}
// 物资出入库表明细:
async insertWzBing(params) {
try {
let val_sql = NativeSql.insertWz(params)
let db = await this.futureDb;
let rs = await db.executeSql(val_sql);
return rs;
} catch (e) {
throw new Error('[插入异常]|' + e)
}
}
}
\ No newline at end of file
......@@ -97,7 +97,7 @@ WHERE
// 出入盘库
// 入库修改
static updateWzmxSql(params): string {
return `update tab_bzgl_knzy_app_wzcrkmx set crksl = '${params.crksl}' , hwh = '${params.hwh}' where guid = '${params.mxguid}'`
return `update tab_bzgl_knzy_app_wzcrkmx set crksl = ${params.crksl} , hwh = '${params.hwh}' where guid = '${params.mxguid}'`
}
// 不存在物资,进行物资新增
......@@ -112,6 +112,30 @@ WHERE
return sql
}
// 单据查询(单据匹配)
static djcxSql(): string {
return `select * from( select crk.guid, STRFTIME('%Y-%m-%d', crk.crkrq) crkrq, PZLX, PZH, WCZT, mx.sl, crk.sfdw, crk.pzzbguid from tab_bzgl_knzy_app_wzcrk crk left join(select wzcrkguid, sum(pzsl) || '/' || sum(crksl) sl from tab_bzgl_knzy_app_wzcrkmx kmx join tab_xtwh_jcsj_bzhx hx on kmx.pmdmcode = hx.pmdmten group by wzcrkguid) mx on mx.wzcrkguid = crk.guid where crk.sjlx = '导入' and crk.pzlx in ('14') and crk.WCZT = '未完成')`
}
// 绑定(单据匹配)
static bindingSql(params): string {
return `update tab_bzgl_knzy_app_wzcrk set WCZT = '完成已绑定',BDGUID = '${params.bdguid}' where guid in ('${params.guid}');`
}
// 设置状态及绑定guid
static setActiveAndBdguidSql(params): string {
return `update tab_bzgl_knzy_app_wzcrk set WCZT = '${(params.active)}',BDGUID = '${params.bdguid}' where guid in ('${(params.guid)}');`
}
//物资明细查询
static getWzmxSql(params): string {
const sql = `select hx.wzpm wzpm, hx.pmdmsix pmdmsix,hx.pmdmten pmdmcode, hx.hxmc hxmc, mx.pzsl pzsl, mx.crksl crksl, mx.hwh hwh, mx.guid mxguid ,mx.pzmxguid from tab_bzgl_knzy_app_wzcrk crk left join tab_bzgl_knzy_app_wzcrkmx mx on crk.GUID = mx.wzcrkguid left join tab_xtwh_jcsj_bzhx hx on mx.pmdmcode = hx.pmdmten where crk.guid = '${params.guid}' order by hx.PMDMSIX, hx.XH`
return sql
}
// 物资出入库表明细:
static insertWz(params): string {
const sql =
`insert into tab_bzgl_knzy_app_wzcrkmx (guid, gznd, pmdmcode, pzsl, crksl, wzcrkguid, hwh, pzmxguid)values ('${params.guid}', '${params.gznd}', '${params.pmdmcode}', ${params.pzsl}, ${params.crksl}, '${params.wzcrkguid}', '${params.hwh}','${params.pzmxguid}');`;
return sql
}
/**
* 包裹管理表
*/
......
......@@ -90,6 +90,27 @@ class WzcrkModel {
return res
}
// 获取单据明细(单据匹配)
async getDjcx() {
let res = await SQLiteContext.with(WzcrkDao).getDjcx()
return res
}
// 绑定(单据匹配)
async binding(params) {
let res = await SQLiteContext.with(WzcrkDao).binding(params)
return res
}
async setActiveAndBdguid(params) {
let res = await SQLiteContext.with(WzcrkDao).setActiveAndBdguid(params)
return res
}
// 物资明细
async getWzmx(params) {
let res = await SQLiteContext.with(WzcrkDao).getWzmx(params)
return res
}
// 清空表
async clear() {
......
......@@ -84,6 +84,11 @@ class WzcrkmxModel {
let res = await SQLiteContext.with(WzcrkmxDao).insertWzcshSql(params)
return res
}
// 物资出入库表明细
async insertWzBing(params) {
let res = await SQLiteContext.with(WzcrkmxDao).insertWzBing(params)
return res
}
// 清空表
async clear() {
await SQLiteContext.with(WzcrkmxDao).clearTable()
......
import { DjcxDto } from '@ohos/common/src/main/ets/bean/dto/RecommendHwDto.ts'
import promptAction from '@ohos.promptAction'
import { DividerTitle } from '../../../../view/DividerTitle/DividerTitle'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@CustomDialog
@Component
export struct MatchingOfDocumentsDialog {
@Link modList: Array<DjcxDto>
@Link bdguid: string
@Link checkedList: Array<string>
controller: CustomDialogController
confirm: () => void
build() {
Column() {
Flex({ direction: FlexDirection.Column ,justifyContent: FlexAlign.Center }) {
List({ space: 2 }) {
ForEach(this.modList, (item) => {
ListItem() {
Row() {
Radio({ value: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
if(value) {
this.bdguid = item.guid
}
}).margin({ right: 10 })
Column() {
Text("凭证号:"+ item.pzh).alignSelf(ItemAlign.Start).width("50%")
Text("收物单").alignSelf(ItemAlign.Start).width("50%")
}
Blank()
.layoutWeight(1)
Column() {
Text('收发单位:' + (item.sfdw || '暂无')).align(Alignment.End).margin({ right: 8 }).width("40%")
Text('数量:' + item.sl).align(Alignment.End).margin({ right: 8 }).width("40%")
}
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 12, right: 18 })
}
.height(80)
})
}
.width('100%')
.backgroundColor('#fff')
.divider({ strokeWidth: 1, color: 'rgb(242,242,242)' }) // 每行之间的分界线
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('绑定')
.onClick(() => {
this.controller.close()
this.confirm()
}).CommonButtonStyle()
Button('取消')
.onClick(() => {
this.controller.close()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}.padding(15)
}
.width('80%')
.height('60%')
.borderRadius(5)
.backgroundColor('#fff')
}
}
\ No newline at end of file
......@@ -41,7 +41,6 @@ export struct WzInsertInfo {
@State currentPmdmcode: string = '' //当前扫描pmdm10位
@State defaultHwh: string = this.convertionDefaultHwh()
@State hjsl: string = this.convertionHjsl()
@State currentDw: string = ''
@State kfmc: string = ''
@ObjectLink wzcrk: PzFormClass
......@@ -70,7 +69,7 @@ export struct WzInsertInfo {
convertionHjsl(): string {
var newData = this.historicalInformation
newData.forEach((item, index) => {
this.historicalInformation.forEach((item, index) => {
if (this.pageType == '调号') {
if (item.currentModel) {
// 调出
......@@ -115,8 +114,6 @@ export struct WzInsertInfo {
if (this.pageType == '调号' || this.pageType == '换位') {
return (res1 || 0).toString()
} else {
console.log(".......---计算的数量1---", JSON.stringify(this.historicalInformation))
console.log(".......---计算的数量2---", (res1 || 0 + '/' + res2 || 0))
return (res1 || 0 + '/' + res2 || 0).toString()
}
// const srslList = this.historicalInformation.map(item => {
......@@ -1225,7 +1222,7 @@ export struct WzInsertInfo {
Text("品种个数:")
Text(this.historicalInformation.length + '' || '0').fontColor("#0fa983").fontSize(20).fontWeight(700)
Text("合计数量:")
Text(this.hjsl).fontColor("#0fa983").fontSize(20).fontWeight(700)
Text(this.convertionHjsl()).fontColor("#0fa983").fontSize(20).fontWeight(700)
}
}.padding({ left: 2, right: 10 })
.width("100%")
......
......@@ -89,7 +89,6 @@ struct WzConversionPage{
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -100,10 +99,6 @@ struct WzConversionPage{
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
......
......@@ -89,7 +89,6 @@ struct WzExchangePage{
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -100,11 +99,6 @@ struct WzExchangePage{
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
this.checkedList.forEach(async (element)=>{
......
......@@ -9,7 +9,10 @@ import { SetStatusDialog } from '../../../view/SetStatusDialog/SetStatusDialog';
import { ExportOrderDialog } from '../../../view/ExportOrderDialog/ExportOrderDialog';
import ViewdrdcModel from '../../../model/ViewdrdcModel';
import { importData } from '../Common/Wzcrk.api';
import { dateUtils } from '@ohos/common/src/main/ets/utils/util';
import { dateUtils, uuid } from '@ohos/common/src/main/ets/utils/util';
import { MatchingOfDocumentsDialog } from '../Common/Dialog/MatchingOfDocumentsDialog';
import wzcrkmxModel from '../../../model/WzcrkmxModel';
import { DjcxDto } from '@ohos/common/src/main/ets/bean/dto/RecommendHwDto.ts';
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
......@@ -49,6 +52,9 @@ export struct WzInPage {
@State sjlx: string = "0"
@State wczt: string = ""
@State pzh: string = ""
// 单据匹配数据
@State modList: Array<DjcxDto> = []
@State bdguid: string = ''
params = {
pzh: this.pzh,
page: this.page,
......@@ -112,7 +118,6 @@ export struct WzInPage {
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -123,11 +128,6 @@ export struct WzInPage {
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
this.checkedList.forEach(async (element)=>{
......@@ -222,6 +222,166 @@ export struct WzInPage {
})
}
matchingOfDocumentsDialog: CustomDialogController = new CustomDialogController({
builder: MatchingOfDocumentsDialog({
modList: $modList,
checkedList: $checkedList,
bdguid: $bdguid,
confirm: this.matchingOfDocumentsSubmit,
}),
autoCancel: true,
alignment: DialogAlignment.Center,
customStyle: true
})
async openMatchingOfDocumentsDialog() {
const res = await wzcrkModel.getDjcx()
this.modList = res
if (this.matchingOfDocumentsDialog != undefined) {
this.matchingOfDocumentsDialog.open()
}
}
async matchingOfDocumentsSubmit() {
try {
if (!this.bdguid) {
promptAction.showToast({
message: '请选择绑定单据'
})
return
}
// 绑定主表
var guidStr = []
this.checkedList.forEach((item) => {
const str = item
guidStr.push(str)
})
// 1.绑定单据主表 新建状态 完成已绑定
const params = {
// pzzbguid: data.pzzbguid,
guid: guidStr.join(','),
bdguid: this.bdguid
}
await wzcrkModel.binding(params)
// 2.设置被绑定的表状态
const wzcrkActiveParams = {
active: "完成",
guid: this.bdguid,
bdguid: guidStr.join(',')
}
await wzcrkModel.setActiveAndBdguid(wzcrkActiveParams)
// 绑定物资明细
// 1.导入表查询
const bbParams = {
guid: this.bdguid
}
const exportWzData = await wzcrkModel.getWzmx(bbParams)
// 2.临时收发物查询
const lssfwParams = {
guid: this.checkedList[0]
}
const lssfwWzData = await wzcrkModel.getWzmx(lssfwParams)
// 3. 对比物资明细数据
var result = [];
lssfwWzData.forEach((item1, index1) => {
let checkBool = false
exportWzData.forEach((item2, index2) => {
if (item1.pmdmcode === item2.pmdmcode) {
checkBool = true
}
})
if (!checkBool) {
result.push(item1);
}
})
result.forEach(async (item) => {
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: '2023',
// pzmxguid: item.mxguid,
...item
}
await wzcrkmxModel.insertWzBing(insertParams)
})
const insertPmdm = [...new Set(result.map((item) => item.pmdmcode))]
console.log('insertPmdm', insertPmdm)
var itPmdm = []
lssfwWzData.forEach((item1, index1) => {
if (!insertPmdm.includes(item1.pmdmcode)) {
itPmdm.push(item1)
}
})
console.log('itPmdm', itPmdm)
const itPmdmList = [...new Set(itPmdm.map(item => item.pmdmcode))]
console.log('itPmdmList', itPmdmList)
var dataObj = {}
lssfwWzData.forEach((item) => {
if (itPmdmList.includes(item.pmdmcode)) {
if (dataObj[item.pmdmcode] && dataObj[item.pmdmcode].length > 0) {
dataObj[item.pmdmcode].push(item)
} else {
dataObj[item.pmdmcode] = [item]
}
}
})
console.log('dataObj', dataObj)
for (let j in dataObj) {
const [filterData] = exportWzData.filter((item) => item.pmdmcode === j)
dataObj[j].forEach(async (item, index) => {
item.mxguid = filterData.mxguid
})
}
console.log('dataObj', dataObj)
for (let j in dataObj) {
dataObj[j].forEach(async (item, index) => {
console.log('index', index)
if (index == 0) {
const updateParams = {
crksl: item.crksl,
hwh: item.hwh,
mxguid: item.mxguid
}
console.log('updateParams', updateParams)
// 更新
await wzcrkmxModel.updateWzmx(updateParams)
} else {
// 新增
const insertParams = {
guid: uuid(),
wzcrkguid: this.bdguid,
gznd: '2023',
pzmxguid: item.mxguid,
...item
}
console.log('insertParams', insertParams)
await wzcrkmxModel.insertWzBing(insertParams)
}
})
}
// // 4. 同品种合并绑定数据
// const exportDataparams = {
// wzcrkguid: data.guid,
// guid: guidStr.join(',')
// }
// await database.createOrFindSQL("GY_M_PMV3", bindingExportDataSql(exportDataparams))
promptAction.showToast({
message: '绑定成功'
})
} catch (e) {
promptAction.showToast({
message: '绑定失败'
})
}
}
@Builder TabBuilder(index: number, name: string) {
......@@ -248,11 +408,9 @@ export struct WzInPage {
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(async () => {
// 获取凭证号
const pzh = await getDefaultPzh('14')
router.pushUrl({
url: "pages/metailmange/WzInPage/WzinDetail/WzinsertDetail",
params: { currentSjlx: '临时收物', wzcrk: { pzlx: '14', pzszlx: "DR", pzh,crklx: '2', wczt:"未完成" } }
params: { sjlx: '临时收物', pzlx: 1 }
})
})
.fontColor("#0fa983")
......@@ -276,9 +434,25 @@ export struct WzInPage {
.visibility(this.currentIndex === 1 ? Visibility.Visible : Visibility.None)
.bottomBtnSty()
.onClick(() => {
router.pushUrl({
url: "pages/metailmange/AddTemporaryInPage",
})
if (this.checkedList.length == 0) {
promptAction.showToast({
message: '请选择操作的凭证'
})
return
}
else if (this.checkedList.length > 1) {
promptAction.showToast({
message: '仅支持单选数据绑定'
})
return
}
else if (this.dataSource.filter(i => i.wczt == '未完成').length > 0) {
promptAction.showToast({
message: '请选择完成状态进行单据匹配'
})
} else {
this.openMatchingOfDocumentsDialog()
}
})
.fontColor("#0fa983")
.fontSize("14vp")
......
......@@ -2,17 +2,14 @@ import { TitleBar } from '../../../../view/title/TitleBar'
import router from '@ohos.router';
import { Logger } from '@ohos/common/src/main/ets/utils/Logger';
import { Wzcrk } from '@ohos/common/src/main/ets/entity/Wzcrk';
import { WzInfo } from '../../Common/WzInfo'
import { PzInfo } from './PzInfo'
import wzcrkmxModel from '../../../../model/WzcrkmxModel';
import { historicalInformationClass, PzFormClass, WzClass, WzmxClass } from '../../Common/Wzcrk.data';
import { getDefaultPzh, historicalInformationClass, PzFormClass, WzClass } from '../../Common/Wzcrk.data';
import promptAction from '@ohos.promptAction';
import wzcrkModel from '../../../../model/WzcrkModel';
import { AddWzin } from './AddWzin'
import { uuid } from '@ohos/common/src/main/ets/utils/util';
import IdentifyService from '../../../../identify/IdentifySerivce'
import emitter from '@ohos.events.emitter';
import { WzcrkDetailDto } from '@ohos/common/src/main/ets/bean/dto/WzcrkMxRefWzDto';
import { WzInsertInfo } from '../../Common/WzInsertInfo';
@Extend(Button) function CommonButtonStyle() {
......@@ -26,8 +23,8 @@ import { WzInsertInfo } from '../../Common/WzInsertInfo';
}
interface params {
wzcrk: Wzcrk,
currentSjlx: string
pzlx: number,
sjlx: string
}
......@@ -38,6 +35,7 @@ struct WzinsertDetail {
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
@State currentSjlx: string = '临时收物'
@State pageType: string = "入库"
@State wzcrk: WzClass = null // 物资出入库单据信息
@State historicalInformation: historicalInformationClass[] = [] // 物资出入库明细
@State pzForm: PzFormClass = null // 物资出入库表单详情
......@@ -45,23 +43,101 @@ struct WzinsertDetail {
onPageShow() {
const params = router.getParams() as params
this.currentSjlx = params.currentSjlx
this.wzcrk = new WzClass(params.wzcrk)
// if (this.isUpdate) {
// this.getWzFormDetail()
// }
// this.getWzmxList()
this.setMilitaryGoodsType(params)
// 获取凭证号
//
// this.wzcrk = new WzClass(params.wzcrk)
this.scanCodeListen()
IdentifyService.openScanPort()
}
// 获取物资表单详情
async getWzFormDetail() {
Logger.info('获取物资表单详情>>', JSON.stringify(this.wzcrk.guid))
const res = await wzcrkModel.queryByCrkDetailGuid(this.wzcrk.guid)
this.pzForm = new PzFormClass(res[0])
/***
* @description: 设置单据种类
* @param {*}
* @return {*}
* @author: 王弘钢
*/
setMilitaryGoodsType(data) {
if (data.sjlx) {
this.currentSjlx = data.sjlx
}
this.pzForm.zmlx = this.zmlx_dict[0].value
var newType = 'rkd'
switch (data.pzlx) {
case '1':
this.pageType = '入库'
newType = 'rkd'
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.pzszlx = 'DC'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
case '3':
this.pageType = '盘库'
newType = 'pkd'
break;
case '4':
this.pageType = '调号'
newType = 'thd'
this.pzFrom.pzlx = 41
this.pzFrom.pzszlx = 'HXTH'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
case 'HW44':
this.pageType = '换位'
newType = 'wzhw'
this.pzForm.pzlx = 'HW44'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
// uni.setNavigationBarTitle({
// title: '物资换位', // 设置页签名称
// });
break;
default:
this.pageType = '入库'
newType = 'rkd'
this.pzForm.pzlx = 14
this.pzForm.pzszlx = 'DR'
this.hanleGetDefaultPzh(this.pzForm.pzlx)
break;
}
this.pzlxOption = pzlxOption.filter((item) => item.type == newType)
}
/***
* @description: 设置默认凭证号
* @param {*}
* @return {*}
* @author: 王弘钢
*/
async hanleGetDefaultPzh(pzlx) {
const params = {
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 = ''
// }
},
// 获取物资列表详情信息
async getWzmxList(wzpm?) {
const pzmxRes = await wzcrkModel.getPzMx({ guid: this.wzcrk.guid })
......@@ -129,25 +205,6 @@ struct WzinsertDetail {
try {
Logger.info('保存的入库明细数据>>', JSON.stringify(this.historicalInformation))
// if (this.isUpdate) {
// const crksl = this.historicalInformation.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
// })
//
// for (let index = 0; index < this.historicalInformation.length; index++) {
// const element = this.historicalInformation[index];
// try {
// let val1 = await wzcrkmxModel.updateWcztmxByData(element.mxguid, { crksl: element.crksl })
// } catch (e) {
// Logger.error(this, '保存失败了>>' + JSON.stringify(e))
// }
// }
// }
// else {
const uid = uuid()
this.wzcrk.guid = uid
this.wzcrk.gznd = new Date().getFullYear() + ''
......@@ -169,14 +226,13 @@ struct WzinsertDetail {
}))
await wzcrkmxModel.set(data)
// }
promptAction.showToast({
message: '保存入库数据成功',
bottom: 300
})
// setTimeout(() => {
// router.back({ url: 'pages/metailmange/WzInPage/WzInPage' })
// }, 300)
setTimeout(() => {
router.back({ url: 'pages/metailmange/WzInPage/WzInPage' })
}, 300)
} catch (e) {
promptAction.showToast({
message: '保存入库数据失败',
......
......@@ -101,7 +101,6 @@ struct WzInvPage{
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -112,9 +111,6 @@ struct WzInvPage{
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
this.checkedList.forEach(async (element)=>{
......
......@@ -100,7 +100,6 @@ export struct WzOutPage {
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -111,10 +110,6 @@ export struct WzOutPage {
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
......
......@@ -94,7 +94,6 @@ struct WzReversePage{
}
dialogController: CustomDialogController = new CustomDialogController({
builder: SetStatusDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
checkedList: $checkedList,
dataSource: $dataSource,
......@@ -105,9 +104,6 @@ struct WzReversePage{
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
try{
this.checkedList.forEach(async (element)=>{
......
......@@ -35,7 +35,6 @@ export struct SetStatusDialog {
@Link dataSource: WzClass[]
@Link checkedList: Array<string>
controller: CustomDialogController
cancel: () => void
confirm: () => void
@BuilderParam container: () => void
......@@ -68,7 +67,6 @@ export struct SetStatusDialog {
Button('取消')
.onClick(() => {
this.controller.close()
this.cancel()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论