update 解决辅材出库确认备货、出库按钮报错问题
This commit is contained in:
parent
b2dd57bbf6
commit
b4373530d7
@ -63,7 +63,7 @@ export function bpelAuxiliary(ChangeParams: any) {
|
|||||||
|
|
||||||
export function AuxiliaryReserve(ChangeParams: any) {
|
export function AuxiliaryReserve(ChangeParams: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Auxiliary/AuxiliaryReserve',
|
url: '/api/api/Auxiliary/auxiliaryAssign',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ChangeParams,
|
data: ChangeParams,
|
||||||
});
|
});
|
||||||
@ -124,4 +124,12 @@ export function allocateStockInCommit(data: any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function auxiliaryStockOut(ChangeParams: any) {
|
||||||
|
return request({
|
||||||
|
url: '/api/api/Auxiliary/auxiliaryStockOut',
|
||||||
|
method: 'post',
|
||||||
|
data: ChangeParams,
|
||||||
|
});
|
||||||
}
|
}
|
@ -68,7 +68,7 @@
|
|||||||
<div class="page-table-title"></div>
|
<div class="page-table-title"></div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" :disabled="state.button_state" @click="cancelHandleFn">取消备货</el-button>
|
<el-button type="primary" :disabled="state.button_state" @click="cancelHandleFn">取消备货</el-button>
|
||||||
<el-button type="primary" :disabled="state.button_state" @click="handleFn">确认备货</el-button>
|
<el-button type="primary" :disabled="state.button_state" @click="confimStockUp">确认备货</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="vue-element-page-table">
|
<div class="vue-element-page-table">
|
||||||
@ -102,7 +102,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-search-btns">
|
<div class="page-search-btns">
|
||||||
<el-button type="primary" @click="handleStockOut" :disabled="state.button_state">出库</el-button>
|
<el-button type="primary" @click="confimStockOut" :disabled="state.button_state">出库</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -117,10 +117,11 @@ export default {
|
|||||||
<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, ElMessage, ElNotification } from "element-plus";
|
import { ElForm, ElMessageBox, ElTable, ElMessage, ElNotification } from "element-plus";
|
||||||
import { getQueryList, bpelAuxiliary,AuxiliaryReserve,AuxiliaryDessign } from '@/api/common'
|
import { getQueryList, bpelAuxiliary,AuxiliaryReserve,AuxiliaryDessign,auxiliaryStockOut } from '@/api/common'
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { bTableHeight } from "../../../composables/calcTableHeight";
|
import { bTableHeight } from "../../../composables/calcTableHeight";
|
||||||
import { areAllNotEmpty } from "@/utils/CommonUtil"
|
import { areAllNotEmpty } from "@/utils/CommonUtil"
|
||||||
|
import { localStorage } from '@/utils/storage'
|
||||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(500);
|
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(500);
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref(ElForm);
|
||||||
const operateFormRef = ref(ElForm);
|
const operateFormRef = ref(ElForm);
|
||||||
@ -192,7 +193,7 @@ const state: any = reactive({
|
|||||||
ChangeParams: {
|
ChangeParams: {
|
||||||
header: {
|
header: {
|
||||||
MESSAGENAME: '',
|
MESSAGENAME: '',
|
||||||
EventUser: localStorage.getItem('userId') ,
|
EventUser: localStorage.get('userId') ,
|
||||||
LANGUAGE: 'Chinese',
|
LANGUAGE: 'Chinese',
|
||||||
Flag: 'LK'//立库标志
|
Flag: 'LK'//立库标志
|
||||||
},
|
},
|
||||||
@ -259,7 +260,7 @@ onMounted(() => {
|
|||||||
{ header: "物料编号", field: "MATERIALSPECNAME", hide: false },
|
{ header: "物料编号", field: "MATERIALSPECNAME", hide: false },
|
||||||
{ header: "品名", field: "DESC_CN", hide: false },
|
{ header: "品名", field: "DESC_CN", hide: false },
|
||||||
{ header: "物料规格", field: "SDK_ID", hide: true },
|
{ header: "物料规格", field: "SDK_ID", hide: true },
|
||||||
{ header: "物料规格", field: "SPECNAME", hide: false },
|
{ header: "物料规格", field: "DESCRIPTION", hide: false },
|
||||||
{ header: "组织", field: "ERPFACTORY", hide: false },
|
{ header: "组织", field: "ERPFACTORY", hide: false },
|
||||||
{ header: "仓库", field: "ERPLOCATION", hide: false },
|
{ header: "仓库", field: "ERPLOCATION", hide: false },
|
||||||
{ header: "货位", field: "LOCATIONNAME", hide: false },
|
{ header: "货位", field: "LOCATIONNAME", hide: false },
|
||||||
@ -267,7 +268,9 @@ onMounted(() => {
|
|||||||
{ header: "单位", field: "MATERIALUNIT", hide: false },
|
{ header: "单位", field: "MATERIALUNIT", hide: false },
|
||||||
{ header: "入库日期", field: "RECEIVETIME", hide: false },
|
{ header: "入库日期", field: "RECEIVETIME", hide: false },
|
||||||
{ header: "生产日期", field: "MAKEDATE", hide: false },
|
{ header: "生产日期", field: "MAKEDATE", hide: false },
|
||||||
{ header: "过期时间", field: "EXPIRINGDATE", hide: false }
|
{ header: "过期时间", field: "EXPIRINGDATE", hide: false },
|
||||||
|
{ header: "阶段", field: "PHASE", hide: false },
|
||||||
|
|
||||||
];
|
];
|
||||||
updateTableHeight();
|
updateTableHeight();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
@ -380,7 +383,7 @@ function handleQuery() {
|
|||||||
let flag = true;
|
let flag = true;
|
||||||
if ((state.queryParams.params.SHIPREQUESTNAME != '') && (state.queryParams.params.SHIPREQUESTNAME != null) && (state.queryParams.params.SHIPREQUESTNAME != undefined)) {
|
if ((state.queryParams.params.SHIPREQUESTNAME != '') && (state.queryParams.params.SHIPREQUESTNAME != null) && (state.queryParams.params.SHIPREQUESTNAME != undefined)) {
|
||||||
state.queryParams.queryId = 'GetShipRequestDetailList';
|
state.queryParams.queryId = 'GetShipRequestDetailList';
|
||||||
state.queryParams.version = '00054';
|
state.queryParams.version = '00055';
|
||||||
getQueryList(state.queryParams).then((res: any) => {
|
getQueryList(state.queryParams).then((res: any) => {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
state.ShipList = res.data;
|
state.ShipList = res.data;
|
||||||
@ -400,7 +403,7 @@ function handleQuery() {
|
|||||||
|
|
||||||
if ((state.queryParams.params.SHIPREQUESTNAME != '') && (state.queryParams.params.SHIPREQUESTNAME != null) && (state.queryParams.params.SHIPREQUESTNAME != undefined)) {
|
if ((state.queryParams.params.SHIPREQUESTNAME != '') && (state.queryParams.params.SHIPREQUESTNAME != null) && (state.queryParams.params.SHIPREQUESTNAME != undefined)) {
|
||||||
state.queryParams.queryId = 'GetPackingRow';
|
state.queryParams.queryId = 'GetPackingRow';
|
||||||
state.queryParams.version = '00054';
|
state.queryParams.version = '00056';
|
||||||
getQueryList(state.queryParams).then((res: any) => {
|
getQueryList(state.queryParams).then((res: any) => {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
state.MaterialPackingList = res.data;
|
state.MaterialPackingList = res.data;
|
||||||
@ -450,6 +453,45 @@ function handleFn () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function confimStockUp () {
|
||||||
|
if (state.ShipList.length <= 0) {
|
||||||
|
ElMessageBox.alert('没有单据明细,请确认')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.loading = true
|
||||||
|
state.button_state = true
|
||||||
|
/* state.ReserveParams.SITENAME = localStorage.getItem("siteName") == null ? "SDK" : localStorage.getItem("siteName");
|
||||||
|
state.ReserveParams.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME //单据
|
||||||
|
state.ReserveParams.user = localStorage.getItem('userId')
|
||||||
|
state.ReserveParams.boxList = state.ShipList*/
|
||||||
|
AuxiliaryReserve({
|
||||||
|
commitDate : state.commitDate,
|
||||||
|
USER : localStorage.get("userId"),
|
||||||
|
SITENAME: localStorage.get('siteName') || 'SDK',
|
||||||
|
SHIPREQUESTNAME: state.queryParams.params.SHIPREQUESTNAME,
|
||||||
|
BOXLIST: state.ShipList
|
||||||
|
}).then((res: any) => {
|
||||||
|
if (res.success){
|
||||||
|
state.button_state = false;
|
||||||
|
state.loading = false;
|
||||||
|
handleQuery();
|
||||||
|
} else {
|
||||||
|
state.button_state = false;
|
||||||
|
state.loading = false;
|
||||||
|
ElMessageBox.alert(res.message, '', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((error: any) => {
|
||||||
|
ElMessageBox.alert(error, '提示框', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
state.loading = false
|
||||||
|
state.button_state = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消备货
|
* 取消备货
|
||||||
*/
|
*/
|
||||||
@ -460,7 +502,7 @@ function cancelHandleFn() {
|
|||||||
}
|
}
|
||||||
state.loading = true
|
state.loading = true
|
||||||
state.button_state = true
|
state.button_state = true
|
||||||
state.ReserveParams.SITENAME = localStorage.getItem("siteName") == null ? "SDK" : localStorage.getItem("siteName");
|
state.ReserveParams.SITENAME = localStorage.get("siteName") == null ? "SDK" : localStorage.get("siteName");
|
||||||
state.ReserveParams.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME //单据
|
state.ReserveParams.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME //单据
|
||||||
state.ReserveParams.user = localStorage.getItem('userId')
|
state.ReserveParams.user = localStorage.getItem('userId')
|
||||||
state.ReserveParams.boxList = state.ShipList
|
state.ReserveParams.boxList = state.ShipList
|
||||||
@ -540,6 +582,60 @@ function handleStockOut() {
|
|||||||
state.button_state2 = true
|
state.button_state2 = true
|
||||||
state.loading = false;
|
state.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function confimStockOut() {
|
||||||
|
console.log(state.commitDate)
|
||||||
|
if(state.commitDate == null){
|
||||||
|
ElMessageBox.alert('辅材出库失败,过账时间不可清空', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (state.ShipList.length <= 0) {
|
||||||
|
ElMessageBox.alert('辅材出库失败,没有出库明细,请确认')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.loading = true
|
||||||
|
state.button_state = true
|
||||||
|
/*
|
||||||
|
state.ReserveParams.SITENAME = localStorage.getItem("siteName") == null ? "SDK" : localStorage.getItem("siteName");
|
||||||
|
state.ReserveParams.SHIPREQUESTDETAILNAME = state.queryParams.params.SHIPREQUESTDETAILNAME
|
||||||
|
state.ReserveParams.SHIPREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME //单据
|
||||||
|
state.ReserveParams.SHIPREQUESTTYPE = state.ShipList[0]['SHIPREQUESTTYPE'] //发货类型
|
||||||
|
state.ReserveParams.user = localStorage.getItem('userId')
|
||||||
|
state.ReserveParams.commitDate = state.commitDate
|
||||||
|
state.MaterialPackingList.key = {}
|
||||||
|
state.ReserveParams.MaterialPackingList = state.MaterialPackingList
|
||||||
|
*/
|
||||||
|
auxiliaryStockOut({
|
||||||
|
commitDate : state.commitDate,
|
||||||
|
USER : localStorage.get("userId"),
|
||||||
|
SITENAME: localStorage.get('siteName') || 'SDK',
|
||||||
|
SHIPREQUESTNAME: state.queryParams.params.SHIPREQUESTNAME,
|
||||||
|
BOXLIST: state.MaterialPackingList
|
||||||
|
}).then((res: any) => {
|
||||||
|
if (res.success){
|
||||||
|
handleQuery();
|
||||||
|
ElMessageBox.alert('辅材出库完成', '提示框', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
/*state.button_state = false;
|
||||||
|
state.loading = false;*/
|
||||||
|
ElMessageBox.alert('辅材出库失败,' + res.message, '', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((error: any) => {
|
||||||
|
ElMessageBox.alert('辅材出库失败,' + error, '提示框', {
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
})
|
||||||
|
state.button_state = false;
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
state.button_state = false;
|
||||||
|
state.loading = false;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -376,10 +376,10 @@ function getStorageSpec(value: any) {
|
|||||||
state.POCreateLocationList = []
|
state.POCreateLocationList = []
|
||||||
getQueryList({
|
getQueryList({
|
||||||
queryId: "GetLocationForCreatePO",
|
queryId: "GetLocationForCreatePO",
|
||||||
version: "00001",
|
version: "00002",
|
||||||
params: {
|
params: {
|
||||||
SITENAME: "SDK",
|
SITENAME: "SDK",
|
||||||
ERPLOCATION: value//PO
|
//ERPLOCATION: value
|
||||||
} as any,
|
} as any,
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
state.POCreateLocationList = res.data
|
state.POCreateLocationList = res.data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user