fix:修改移库接口

This commit is contained in:
郭飞 2025-03-18 13:41:40 +08:00
parent a927687b64
commit c5d127a02f
3 changed files with 444 additions and 270 deletions

View File

@ -114,3 +114,11 @@ export function RejectsAndExpCheck(data: any) {
data: data,
});
}
export function AllCommitMoveInInvoice(data: any) {
return request({
url: '/api/MoveIn/AllCommitMoveInInvoice',
method: 'post',
data: data,
});
}

View File

@ -12,11 +12,21 @@
<template>
<div class="vue-element-page-wrap" ref="tableContainer">
<el-row class="page-search" justify="space-between" align="bottom">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px" label-position="left">
<el-form
ref="queryFormRef"
:model="queryParams"
:inline="true"
label-width="80px"
label-position="left"
>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="移库单号" prop="params.SHIPREQUESTNAME">
<el-Input v-model="queryParams.params.SHIPREQUESTNAME" clearable placeholder="请输入移库单号" />
<el-Input
v-model="queryParams.params.SHIPREQUESTNAME"
clearable
placeholder="请输入移库单号"
/>
</el-form-item>
</el-col>
</el-row>
@ -33,8 +43,15 @@
</div>
</div>
</div>
<el-table border style="min-height: 50px;" v-loading="loading" :data="state.MoveLibraryList" highlight-current-row row-key="id"
@row-click="handle">
<el-table
border
style="min-height: 50px"
v-loading="loading"
:data="state.MoveLibraryList"
highlight-current-row
row-key="id"
@row-click="handle"
>
<template v-for="(col, index) in column" :key="index">
<el-table-column v-if="!col.hide" :label="col.header" show-overflow-tooltip>
<template #default="scope">
@ -43,8 +60,13 @@
</el-table-column>
</template>
</el-table>
<pagination v-if="state.total > 0" :total="state.total" v-model:pageNumTo="state.queryParams.pageNum"
v-model:pageSizeTo="state.queryParams.pageSize" @pagination="handleQuery" />
<pagination
v-if="state.total > 0"
:total="state.total"
v-model:pageNumTo="state.queryParams.pageNum"
v-model:pageSizeTo="state.queryParams.pageSize"
@pagination="handleQuery"
/>
</div>
<!-- 左右结构 -->
<div class="vue-element-page-table">
@ -58,8 +80,16 @@
</div>
</div>
</div>
<el-table :height="tableHeight" border v-loading="loading" :data="state.MaterialPackingList" highlight-current-row row-key="id"
style="width: 100%;min-height: 50px;" @selection-change="handleSelectionChange">
<el-table
:height="tableHeight"
border
v-loading="loading"
:data="state.MaterialPackingList"
highlight-current-row
row-key="id"
style="width: 100%; min-height: 50px"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<template v-for="(col, index) in column1" :key="index">
<el-table-column v-if="!col.hide" :label="col.header" show-overflow-tooltip>
@ -72,12 +102,12 @@
</div>
</el-col>
<el-col :span="2" class="transfer-switch">
<el-button type="primary" @click="LeftIn" v-loading="loading3"><el-icon>
<ArrowRight />
</el-icon></el-button>
<el-button type="primary" @click="RightIn" v-loading="state.loading2"><el-icon>
<ArrowLeft />
</el-icon></el-button>
<el-button type="primary" @click="LeftIn" v-loading="loading3"
><el-icon> <ArrowRight /> </el-icon
></el-button>
<el-button type="primary" @click="RightIn" v-loading="state.loading2"
><el-icon> <ArrowLeft /> </el-icon
></el-button>
</el-col>
<el-col :span="11">
<div class="vue-element-page-table">
@ -88,8 +118,16 @@
</div>
</div>
</div>
<el-table :height="tableHeight" border v-loading="state.loading" :data="state.MaterialPackingUsername" highlight-current-row
row-key="id" style="width: 100%;min-height: 50px;" @selection-change="handleSelectionChange2">
<el-table
:height="tableHeight"
border
v-loading="state.loading"
:data="state.MaterialPackingUsername"
highlight-current-row
row-key="id"
style="width: 100%; min-height: 50px"
@selection-change="handleSelectionChange2"
>
<el-table-column type="selection" width="40" />
<template v-for="(col, index) in column2" :key="index">
<el-table-column v-if="!col.hide" :label="col.header" show-overflow-tooltip>
@ -105,51 +143,73 @@
</div>
<el-row class="page-search" justify="end" align="middle">
<el-col :span="20">
<el-col :span="6">
<el-form-item label="目的货位" prop="portFormRefData.SEARCHTYPE">
<el-cascader @visible-change="handleOuterClick" v-model="state.StorageSelect"
<el-cascader
@visible-change="handleOuterClick"
v-model="state.StorageSelect"
:options="state.StorageSelectList"
:props="{ checkStrictly: true, label: 'ERPLOCATION', value: 'ERPLOCATION', children: 'children' }" />
:props="{
checkStrictly: true,
label: 'ERPLOCATION',
value: 'ERPLOCATION',
children: 'children'
}"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<div class="block" style="float: right">
<el-form-item label="过账日期" prop="state.commitDate">
<el-date-picker :clearable="true" :editable="true" v-model="state.commitDate" type="date" placeholder="选择过账时间" value-format="YYYY-MM-DD"/>
</el-form-item>
</div>
</el-col>
<el-col :span="4">
<div class="page-search-btns">
<el-button type="primary" @click="handleReserve" :disabled="state.Button_state" v-loading="state.button_loading">确定</el-button>
<el-button
type="primary"
@click="handleReserve"
:disabled="state.Button_state"
v-loading="state.button_loading"
>确定</el-button
>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts">
export default {
name: "MoveLibrary",
};
name: 'MoveLibrary'
}
</script>
<script lang="ts" setup>
import { reactive, ref, onMounted, toRefs, getCurrentInstance, nextTick } from "vue";
import { ElForm, ElMessageBox, ElTable } from "element-plus";
import { getQueryList, getQueryPageList, BpelEvent } from "@/api/common";
import { useRouter } from "vue-router";
import { waitForDebugger } from "inspector";
import { FirstInFirstOut, IFTRUE } from "@/utils/CommonUtil"
import { bTableHeight } from "../../../composables/calcTableHeight";
import { reactive, ref, onMounted, toRefs, getCurrentInstance, nextTick } from 'vue'
import { ElForm, ElMessageBox, ElTable } from 'element-plus'
import { getQueryList, getQueryPageList, BpelEvent } from '@/api/common'
import { useRouter } from 'vue-router'
import { waitForDebugger } from 'inspector'
import { FirstInFirstOut, IFTRUE } from '@/utils/CommonUtil'
import { bTableHeight } from '../../../composables/calcTableHeight'
import { AssignShipRequest, DeAssignShipRequest, AllCommitMoveInInvoice } from '@/api/StockOut'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(480);
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(480)
const queryFormRef = ref(ElForm);
const operateFormRef = ref(ElForm);
const queryFormRef = ref(ElForm)
const operateFormRef = ref(ElForm)
const formDataRef = ref(ElForm);
const { proxy }: any = getCurrentInstance();
const formDataRef = ref(ElForm)
const { proxy }: any = getCurrentInstance()
const router = useRouter();
const router = useRouter()
const state = reactive({
commitDate:'',
button_loading: false,
rsa: "",
rsa: '',
Button_state: false,
total: 0,
total2: 0,
@ -159,32 +219,34 @@ const state = reactive({
MaterialPackingUsername: [] as any,
StorageSelect: [] as any,
StorageSelectList: [] as any,
lineRow: [] as any,
queryParams: {
queryId: "",
version: "",
queryId: '',
version: '',
params: {
SITENAME: 'SDK',
AREANAME: '',
SHIPREQUESTNAME: "",
RECEIVEACTNO: "",
DELIVERYTYPE: "", //
SUPPLIERNAME: "",
SHIPREQUESTNAME: '',
RECEIVEACTNO: '',
DELIVERYTYPE: '', //
SUPPLIERNAME: '',
//handle
MATERIALSPECNAME: "",
MATERIALSPECNAME: '',
ERPLOCATION: '',
ERPFACTORY: '',
SHIPREQUESTDETAILNAME: '',
}, pageNum: 1,
SHIPREQUESTDETAILNAME: ''
},
pageNum: 1,
pageSize: 12
},
RightqueryParams: {
queryId: "",
version: "",
queryId: '',
version: '',
params: {
SITENAME: 'SDK', //localStorage.getItem("siteName"),
DELIVERYTYPE: "", //
SUPPLIERNAME: "",
SHIPREQUESTNAME: "",
DELIVERYTYPE: '', //
SUPPLIERNAME: '',
SHIPREQUESTNAME: '',
MATERIALSPECNAME: '',
AREANAME: '',
MATERIALPACKING: '',
@ -195,8 +257,8 @@ const state = reactive({
SDK_ID: '',
PHASE: '',
ERPFACTORY: '',
SHIPREQUESTDETAILNAME: '',
},
SHIPREQUESTDETAILNAME: ''
}
},
ChangeParams: {
header: {
@ -216,23 +278,23 @@ const state = reactive({
BOXList: [] as any,
objPara: [] as any,
ERPLOCATION: '',
INERPLOCATION: '',
INERPLOCATION: ''
}
},
operateParams: {
date: new Date(),
date: new Date()
},
operateOptions: [] as any, //
actNoOptions: [] as any, //
checkResultOptions: [
{
label: "OK",
value: "OK",
label: 'OK',
value: 'OK'
},
{
label: "NG",
value: "NG",
},
label: 'NG',
value: 'NG'
}
], //
loading: false,
loading2: false,
@ -247,91 +309,109 @@ const state = reactive({
RightSelection: [], //
column3: [] as any,
column4: [] as any,
column5: [] as any,
});
const { rsa, queryParams, loading3, loading, column, column1, column2, operateParams, operateOptions, actNoOptions, checkResultOptions } = toRefs(state);
column5: [] as any
})
const {
rsa,
queryParams,
loading3,
loading,
column,
column1,
column2,
lineRow,
operateParams,
operateOptions,
actNoOptions,
checkResultOptions,
commitDate
} = toRefs(state)
onMounted(() => {
state.column = [
{ header: "工厂", field: "SITENAME", hide: false },
{ header: "转库单号", field: "SHIPREQUESTNAME", hide: false },
{ header: "行项", field: "SHIPREQUESTDETAILNAME", hide: false },
{ header: "库存组织", field: "ERPFACTORYNAME", hide: false },
{ header: "单据类型", field: "SHIPREQUESTTYPE", hide: false },
{ header: "转入仓库", field: "INERPLOCATION", hide: false },
{ header: "数量", field: "REQUESTQUANTITY", hide: false },
{ header: "单位", field: "UNIT", hide: false },
{ header: "物料编码", field: "MATERIALSPECNAME", hide: false },
{ header: "物料名(中文)", field: "DESC_EN", hide: false },
{ header: "阶段", field: "PHASE", hide: false },
{ header: "SDK规格", field: "SPECNAME", hide: false },
{ header: "仓库", field: "ERPLOCATION", hide: false },
];
{ header: '工厂', field: 'SITENAME', hide: false },
{ header: '转库单号', field: 'SHIPREQUESTNAME', hide: false },
{ header: '行项', field: 'SHIPREQUESTDETAILNAME', hide: false },
{ header: '库存组织', field: 'ERPFACTORYNAME', hide: false },
{ header: '单据类型', field: 'SHIPREQUESTTYPE', hide: false },
{ header: '转入仓库', field: 'INERPLOCATION', hide: false },
{ header: '数量', field: 'REQUESTQUANTITY', hide: false },
{ header: '单位', field: 'UNIT', hide: false },
{ header: '物料编码', field: 'MATERIALSPECNAME', hide: false },
{ header: '物料名(中文)', field: 'DESC_EN', hide: false },
{ header: '阶段', field: 'PHASE', hide: false },
{ header: 'SDK规格', field: 'SPECNAME', hide: false },
{ header: '仓库', field: 'ERPLOCATION', hide: false }
]
state.column1 = [
{ header: "工厂", field: "SITENAME", hide: false },
{ header: "标签编号", field: "MATERIALPACKINGNAME", hide: false },
{ header: "物料编号", field: "MATERIALSPECNAME", hide: false },
{ header: "物料名(中文)", field: "DESC_EN", hide: false },
{ header: "数量", field: "REQUESTQUANTITY", hide: false },
{ header: "单位", field: "UNIT", hide: false },
{ header: "位置", field: "STORAGENAME", hide: false },
{ header: "库区", field: "AREANAME", hide: false },
{ header: "仓库", field: "ERPFACTORYNAME", hide: false },
];
{ header: '工厂', field: 'SITENAME', hide: false },
{ header: '标签编号', field: 'MATERIALPACKINGNAME', hide: false },
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false },
{ header: '物料名(中文)', field: 'DESC_EN', hide: false },
{ header: '数量', field: 'REQUESTQUANTITY', hide: false },
{ header: '单位', field: 'UNIT', hide: false },
{ header: '位置', field: 'STORAGENAME', hide: false },
{ header: '库区', field: 'AREANAME', hide: false },
{ header: '仓库', field: 'ERPFACTORYNAME', hide: false }
]
state.column2 = [
{ header: "工厂", field: "SITENAME", hide: false },
{ header: "标签编号", field: "MATERIALPACKINGNAME", hide: false },
{ header: "物料编号", field: "MATERIALSPECNAME", hide: false },
{ header: "物料名(中文)", field: "DESC_EN", hide: false },
{ header: "数量", field: "REQUESTQUANTITY", hide: false },
{ header: "单位", field: "UNIT", hide: false },
{ header: "位置", field: "STORAGENAME", hide: false },
{ header: "库区", field: "AREANAME", hide: false },
{ header: "仓库", field: "ERPFACTORYNAME", hide: false },
];
{ header: '工厂', field: 'SITENAME', hide: false },
{ header: '标签编号', field: 'MATERIALPACKINGNAME', hide: false },
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false },
{ header: '物料名(中文)', field: 'DESC_EN', hide: false },
{ header: '数量', field: 'REQUESTQUANTITY', hide: false },
{ header: '单位', field: 'UNIT', hide: false },
{ header: '位置', field: 'STORAGENAME', hide: false },
{ header: '库区', field: 'AREANAME', hide: false },
{ header: '仓库', field: 'ERPFACTORYNAME', hide: false }
]
updateTableHeight();
window.addEventListener('resize', handleResize);
});
updateTableHeight()
window.addEventListener('resize', handleResize)
})
//
function updateList(col: any) {
state.column = col;
state.column = col
}
async function handleQuery() {
if ((state.queryParams.params.SHIPREQUESTNAME != '') && (state.queryParams.params.SHIPREQUESTNAME != null) && state.queryParams.params.SHIPREQUESTNAME != undefined) {
state.queryParams.queryId = 'GetMessageForMove';
state.queryParams.version = '00001';
if (
state.queryParams.params.SHIPREQUESTNAME != '' &&
state.queryParams.params.SHIPREQUESTNAME != null &&
state.queryParams.params.SHIPREQUESTNAME != undefined
) {
state.queryParams.queryId = 'GetMessageForMove'
state.queryParams.version = '00001'
state.MoveLibraryList = []
await getQueryPageList(state.queryParams).then((res: any) => {
await getQueryPageList(state.queryParams)
.then((res: any) => {
console.log(res)
console.log(res.data)
console.log(res.data.list)
if (res.data.list.length == 0) {
ElMessageBox.alert('查无数据!', '提醒框', {
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
} else {
state.MoveLibraryList = res.data.list;
state.total = res.data.total;
state.MoveLibraryList = res.data.list
state.total = res.data.total
}
}).catch((error: any) => {
})
.catch((error: any) => {
ElMessageBox.alert('系统内部错误请找IT', '提醒框', {
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
})
} else {
ElMessageBox.alert('查询条件不为空!', '提醒框', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
}
}
function resetQuery() {
queryFormRef.value.resetFields();
handleQuery();
queryFormRef.value.resetFields()
handleQuery()
}
async function handleReserve() {
@ -342,25 +422,57 @@ async function handleReserve() {
if (state.column3.length > 0 || state.column4.length > 0) {
state.ChangeParams.header.EVENTUSER = localStorage.getItem('userId') || '10975133'
state.ChangeParams.header.MESSAGENAME = 'ModifyERPLocation'
state.ChangeParams.body.AREANAME = state.StorageSelect[0];
state.ChangeParams.body.LOCATIONNAME = state.StorageSelect[1];
state.ChangeParams.body.AREANAME = state.StorageSelect[0]
state.ChangeParams.body.LOCATIONNAME = state.StorageSelect[1]
for (let item = 0; item < state.column3.length; item++) {
state.BoxList.push({ "BoxL": state.column3[item].MATERIALPACKINGNAME })
state.BoxList.push({ BoxL: state.column3[item].MATERIALPACKINGNAME })
}
state.ChangeParams.body.BOXList = state.BoxList
await BpelEvent(state.ChangeParams).then((res: any) => {
// await BpelEvent(state.ChangeParams)
// .then((res: any) => {
// state.Button_state = false
// state.button_loading = false
// })
// .catch((error: any) => {
// ElMessageBox.alert(error, '', {
// confirmButtonText: 'OK'
// })
// state.Button_state = false
// state.button_loading = false
// })
console.log(state.StorageSelect)
AllCommitMoveInInvoice({
ShipRequestName: state.queryParams.params.SHIPREQUESTNAME,
commitDate:state.commitDate,
boxList: state.column3,
user: localStorage.getItem('userId'),
locationName: state.StorageSelect[0]
})
.then((res: any) => {
if (res.success) {
state.Button_state = false
state.button_loading = false
}).catch((error: any) => {
ElMessageBox.alert(error, '提醒框', {
confirmButtonText: 'OK',
ElMessageBox.alert(res.message, '提醒框', {
confirmButtonText: 'OK'
})
} else {
ElMessageBox.alert('操作失败:' + res.message, '提醒框', {
confirmButtonText: 'OK'
})
state.Button_state = false
state.button_loading = false
}
})
.catch((err: any) => {
ElMessageBox.alert('操作失败:' + err.response.data.message, '提醒框', {
confirmButtonText: 'OK'
})
state.Button_state = false
state.button_loading = false
})
} else {
ElMessageBox.alert('请按照规范操作', '提醒框', {
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
state.Button_state = false
state.button_loading = false
@ -377,156 +489,211 @@ function handleSelectionChange2(selection: any) {
state.column3 = selection
}
async function LeftIn() {
if (state.MaterialPackingList.length > 0 && state.column4.length > 0) {
if (FirstInFirstOut(state.MaterialPackingList, state.column4)) {
state.loading3 = true;
state.ChangeParams.header.MESSAGENAME = 'AssignShipRequestToBoxForSDK';
state.ChangeParams.body.SHIPREQUESTDETAILNAME = state.queryParams.params.SHIPREQUESTDETAILNAME
// state.ChangeParams.body.SHIPREQUESTDETAILNAME = "0001"
state.ChangeParams.body.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME
state.ChangeParams.body.MATERIALQUANTITY = 0
// state.column4 MATERIALPACKINGNAME packingNames
state.ChangeParams.body.objPara = []
// state.loading3 = true
// state.ChangeParams.header.MESSAGENAME = 'AssignShipRequestToBoxForSDK'
// state.ChangeParams.body.SHIPREQUESTDETAILNAME = state.queryParams.params.SHIPREQUESTDETAILNAME
// // state.ChangeParams.body.SHIPREQUESTDETAILNAME = "0001"
// state.ChangeParams.body.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME
// state.ChangeParams.body.MATERIALQUANTITY = 0
// // state.column4 MATERIALPACKINGNAME packingNames
// state.ChangeParams.body.objPara = []
// for (const item of state.column4) {
// state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME)
// state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY
// }
// // packingNames
// if (state.ChangeParams.body.objPara.length > 0) {
// state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(';')
// } else {
// // packingNames
// state.ChangeParams.body.MATERIALPACKINGNAME = ''
// }
// await BpelEvent(state.ChangeParams).then((res: any) => {
// if (IFTRUE(res)) {
// handle(tempRow, tempevent, tempcolumn);
// handleQuery();
// state.loading = false;
// } else {
// ElMessageBox.alert(res.data.RETURNCODE + '->' + res.data.RETURNMESSAGE, '', {
// confirmButtonText: 'OK',
// })
// }
// })
// .catch(() => {
// state.loading3 = false;
// });
let boxId = ''
for (const item of state.column4) {
state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME);
state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY;
}
// packingNames
if (state.ChangeParams.body.objPara.length > 0) {
state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(";");
} else {
// packingNames
state.ChangeParams.body.MATERIALPACKINGNAME = "";
}
await BpelEvent(state.ChangeParams).then((res: any) => {
if (IFTRUE(res)) {
handle(tempRow, tempevent, tempcolumn);
handleQuery();
state.loading = false;
} else {
ElMessageBox.alert(res.data.RETURNCODE + '->' + res.data.RETURNMESSAGE, '', {
confirmButtonText: 'OK',
})
boxId += item.MATERIALPACKINGNAME + ';'
}
const params = {
materialPackingName: boxId,
user: localStorage.getItem('userId'),
shipRequestName: state.queryParams.params.SHIPREQUESTNAME,
materialSpecName: state.queryParams.params.MATERIALSPECNAME,
phase: state.lineRow.PHASE,
sdk_id: state.lineRow.SDK_ID
}
state.loading3 = true
AssignShipRequest(params)
.then((res: any) => {
if (res.success) {
// handleQuery()
handle(tempRow, tempevent, tempcolumn)
state.loading3 = false
} else {
ElMessageBox.alert('操作失败:' + res.message, '提醒框', {
confirmButtonText: 'OK'
})
state.loading3 = false
}
})
.catch((err: any) => {
ElMessageBox.alert('操作失败:' + err.response.data.message, '提醒框', {
confirmButtonText: 'OK'
})
state.loading3 = false
})
.catch(() => {
state.loading3 = false;
});
} else {
ElMessageBox.alert('不符合先进先出', '提示框', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
}
} else {
ElMessageBox.alert('提示框', '备货数据不能为空!', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
}
state.loading3 = false;
state.loading3 = false
}
async function RightIn() {
if (state.column3.length > 0) {
state.loading2 = true;
state.ChangeParams.header.MESSAGENAME = 'DeassignShipRequestFromBox';
state.ChangeParams.body.SHIPREQUESTDETAILNAME = state.RightqueryParams.params.SHIPREQUESTDETAILNAME
state.ChangeParams.body.SHIPREQUESTNAME = state.RightqueryParams.params.SHIPREQUESTNAME
state.ChangeParams.body.MATERIALQUANTITY = 0
// state.column4 MATERIALPACKINGNAME packingNames
state.ChangeParams.body.objPara = []
let boxId = ''
for (const item of state.column3) {
state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME);
state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY;
boxId += item.MATERIALPACKINGNAME + ';'
}
// packingNames
if (state.ChangeParams.body.objPara.length > 0) {
state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(";");
} else {
// packingNames
state.ChangeParams.body.MATERIALPACKINGNAME = "";
const params = {
materialPackingName: boxId,
user: localStorage.getItem('userId'),
shipRequestName: state.queryParams.params.SHIPREQUESTNAME,
materialSpecName: state.queryParams.params.MATERIALSPECNAME
}
await BpelEvent(state.ChangeParams).then((res: any) => {
handle(tempRow, tempevent, tempcolumn);
handleQuery();
state.loading2 = false;
state.loading2 = true
// state.ChangeParams.header.MESSAGENAME = 'DeassignShipRequestFromBox';
// state.ChangeParams.body.SHIPREQUESTDETAILNAME = state.RightqueryParams.params.SHIPREQUESTDETAILNAME
// state.ChangeParams.body.SHIPREQUESTNAME = state.RightqueryParams.params.SHIPREQUESTNAME
// state.ChangeParams.body.MATERIALQUANTITY = 0
// // state.column4 MATERIALPACKINGNAME packingNames
// state.ChangeParams.body.objPara = []
// for (const item of state.column3) {
// state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME);
// state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY;
// }
// // packingNames
// if (state.ChangeParams.body.objPara.length > 0) {
// state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(";");
// } else {
// // packingNames
// state.ChangeParams.body.MATERIALPACKINGNAME = "";
// }
// await BpelEvent(state.ChangeParams).then((res: any) => {
// handle(tempRow, tempevent, tempcolumn);
// handleQuery();
// state.loading2 = false;
// })
// .catch(() => {
// state.loading2 = false;
// });
DeAssignShipRequest(params)
.then((res: any) => {
if (res.success) {
// handleQuery()
handle(tempRow, tempevent, tempcolumn)
state.loading2 = false
} else {
ElMessageBox.alert('操作失败:' + res.message, '提醒框', {
confirmButtonText: 'OK'
})
state.loading2 = false
}
})
.catch((err: any) => {
ElMessageBox.alert('操作失败:' + err.response.data.message, '提醒框', {
confirmButtonText: 'OK'
})
state.loading2 = false
})
.catch(() => {
state.loading2 = false;
});
} else {
ElMessageBox.alert('提示框', '备货数据不能为空!', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
confirmButtonText: 'OK'
})
}
}
let tempRow: any = null;
let tempevent: any = null;
let tempcolumn: any = null;
let tempRow: any = null
let tempevent: any = null
let tempcolumn: any = null
async function handle(row: any, event: any, column: any) {
tempRow = row;
tempevent = event;
tempcolumn = column;
state.queryParams.queryId = 'GetPackingRow';
state.queryParams.version = 'WP008';
state.queryParams.params.MATERIALSPECNAME = row.MATERIALSPECNAME;
state.queryParams.params.ERPLOCATION = row.ERPLOCATION;
state.queryParams.params.ERPFACTORY = row.ERPFACTORYNAME;
tempRow = row
tempevent = event
tempcolumn = column
state.lineRow = row
state.queryParams.queryId = 'GetPackingRow'
state.queryParams.version = 'WP008'
state.queryParams.params.MATERIALSPECNAME = row.MATERIALSPECNAME
state.queryParams.params.ERPLOCATION = row.ERPLOCATION
state.queryParams.params.ERPFACTORY = row.ERPFACTORYNAME
state.queryParams.params.SHIPREQUESTDETAILNAME = row.SHIPREQUESTDETAILNAME
state.ChangeParams.body.SHIPREQUESTNAME = row.SHIPREQUESTNAME
state.ChangeParams.body.SHIPREQUESTDETAILNAME = row.SHIPREQUESTDETAILNAME
state.ChangeParams.body.ERPLOCATION = row.ERPLOCATION
state.ChangeParams.body.INERPLOCATION = row.INERPLOCATION
if(await getQueryList(state.queryParams).then((res: any) => {
await getQueryList(state.queryParams).then((res: any) => {
if (res.data.length == 0) {
ElMessageBox.alert('查无数据', '提示框!', {
confirmButtonText: 'OK',
})
return true;
// ElMessageBox.alert('', '', {
// confirmButtonText: 'OK'
// })
state.MaterialPackingList = []
return true
} else {
state.MaterialPackingList = res.data;
return false;
}
})){
return
state.MaterialPackingList = res.data
return false
}
})
state.RightqueryParams.queryId = 'GetPackingRow';
state.RightqueryParams.version = '00002';
state.RightqueryParams.params.MATERIALSPECNAME = row.MATERIALSPECNAME;
state.RightqueryParams.params.SHIPREQUESTNAME = row.SHIPREQUESTNAME;
state.RightqueryParams.params.SHIPREQUESTDETAILNAME = row.SHIPREQUESTDETAILNAME;
state.RightqueryParams.queryId = 'GetPackingRow'
state.RightqueryParams.version = '00002'
state.RightqueryParams.params.MATERIALSPECNAME = row.MATERIALSPECNAME
state.RightqueryParams.params.SHIPREQUESTNAME = row.SHIPREQUESTNAME
state.RightqueryParams.params.SHIPREQUESTDETAILNAME = row.SHIPREQUESTDETAILNAME
await getQueryList(state.RightqueryParams).then((res: any) => {
if (res.data.length == 0) {
ElMessageBox.alert('查无数据', '提示框!', {
confirmButtonText: 'OK',
})
// ElMessageBox.alert('', '', {
// confirmButtonText: 'OK'
// })
state.MaterialPackingUsername = []
return
} else {
state.MaterialPackingUsername = res.data;
state.MaterialPackingUsername = res.data
}
});
})
//
state.firstLocation = row.ERPLOCATION
}
@ -537,34 +704,33 @@ function handleOuterClick() {
async function StorageList(firstLocation: any) {
try {
try {
state.queryParams.queryId = 'Get2stAreaName';
state.queryParams.version = '00002';
state.queryParams.params.ERPLOCATION = firstLocation;
const res = await getQueryList(state.queryParams);
state.StorageSelectList = res.data;
state.queryParams.queryId = 'Get2stAreaName'
state.queryParams.version = '00002'
state.queryParams.params.ERPLOCATION = firstLocation
const res = await getQueryList(state.queryParams)
state.StorageSelectList = res.data
if (state.StorageSelectList.length == 0) {
proxy.$ElMessage.info('目的货位为空!');
return;
proxy.$ElMessage.info('目的货位为空!')
return
}
for (let i = 0; i < state.StorageSelectList.length; i++) {
state.queryParams.queryId = 'Get3stStorageName';
state.queryParams.version = '00002';
state.queryParams.params.AREANAME = state.StorageSelectList[i].ERPLOCATION;
const childrenRes = await getQueryList(state.queryParams);
state.StorageSelectList[i].children = childrenRes.data;
state.queryParams.queryId = 'Get3stStorageName'
state.queryParams.version = '00002'
state.queryParams.params.AREANAME = state.StorageSelectList[i].ERPLOCATION
const childrenRes = await getQueryList(state.queryParams)
state.StorageSelectList[i].children = childrenRes.data
}
} catch (error) {
console.error(`Error fetching children for item `, error);
console.error(`Error fetching children for item `, error)
//
}
console.log("StorageSelectList", state.StorageSelectList);
console.log('StorageSelectList', state.StorageSelectList)
} catch (error) {
console.error('Error fetching initial data', error);
console.error('Error fetching initial data', error)
// state
}
}
</script>
<style scoped lang="scss">