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, data: data,
}); });
} }
export function AllCommitMoveInInvoice(data: any) {
return request({
url: '/api/MoveIn/AllCommitMoveInInvoice',
method: 'post',
data: data,
});
}

View File

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