E库存更新页面调整,盘盈盘亏

This commit is contained in:
王帅 2025-05-27 10:42:13 +08:00
parent 9b515d03f6
commit a91ae7971f
3 changed files with 310 additions and 10 deletions

View File

@ -174,3 +174,16 @@ export function UpdateDeliveryStates(ChangeParams: any) {
});
}
/**
*
* @param data
* @returns
*/
export function confirm(data: any) {
return request({
url: '/api/MaterialReceiveAct/confirm',
method: 'post',
data: data,
});
}

View File

@ -0,0 +1,277 @@
<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.params" :rules="rulesParam" :inline="true" label-position="left">
<el-row :gutter="20">
<el-col :span="6" class="col_height">
<el-form-item label="盘点类型" prop="checkType">
<el-select v-model="queryParams.params.checkType" placeholder="选择盘点类型" clearable>
<el-option value="盘盈" label="盘盈"></el-option>
<el-option value="盘亏" label="盘亏"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="组织" prop="erpFactory">
<el-select filterable v-model="queryParams.params.erpFactory" placeholder="下拉选择组织" @change="ERPLocationQuery">
<el-option v-for="item in ERPFactoryList" :key="item.ERPFACTORY" :label="item.DESCRIPTION" :value="item.ERPFACTORY"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="仓库" prop="erpLocation">
<el-select v-model="queryParams.params.erpLocation" clearable collapse-tags placeholder="请选择仓库"
popper-class="custom-header" :max-collapse-tags="1"
@visible-change="GetLocationListForSomeERPLocation" filterable>
<template #header>
</template>
<el-option v-for="item in state.ERPLocationList" :key="item.ENUMVALUE" :label="item.DESCRIPTION"
:value="item.ENUMVALUE" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="货位" prop="location">
<el-select v-model="queryParams.params.location" clearable collapse-tags placeholder="请选择货位"
popper-class="custom-header" :max-collapse-tags="1"
remote :remote-method="handleInput" filterable>
<template #header>
</template>
<el-option v-for="item in state.LocationList" :key="item.storageName" :label="item.storageName"
:value="item.storageName" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="物料编号" prop="materialSpecName">
<el-Input v-model="queryParams.params.materialSpecName" placeholder="输入物料编号" clearable/>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="差异数量" prop="nums">
<el-Input-number min="0" v-model="queryParams.params.nums" placeholder="输入差异数量" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="page-search-btns">
<el-button type="primary" @click="handleConfirm" v-loading="state.loadingC">确认</el-button>
</div>
</el-row>
<!-- table 区域-->
<div class="vue-element-page-table">
<div class="page-table-operate">
<div class="page-table-title">
<div class="page-table-title-left">
<span>生成信息</span>
</div>
</div>
</div>
<el-table :height="tableHeight" border v-loading="loading" :default-sort="{ prop: 'MATERIALSPECNAME', order: 'descending' }"
:data="state.dataList" highlight-current-row row-key="id" style="width: 100%">
<template v-for="(col, index) in tableConfig.column" :key="index">
<el-table-column v-if="!col.hide" :label="col.header" :prop="col.field" show-overflow-tooltip
:width="col.width" :sort-orders="['descending', 'ascending']" :sortable="true"/>
</template>
</el-table>
<div>
<el-form :model="state.updateParams" ref="formDataRef" label-position="left" :rules="rules" style="margin-top: 10px;">
<el-row :gutter="22">
<el-col :span="5">
<el-form-item label="成本中心" prop="costName">
<el-select v-model="state.updateParams.costName" placeholder="选择成本中心" clearable>
<el-option value="1010103000" label="财务部中心"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button type="primary" @click="submit" v-loading="state.loadings">提交</el-button>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
</template>
<script lang="ts">
export default {
name: 'auxiliaryOutIn'
}
</script>
<script lang="ts" setup>
import { reactive, ref, onMounted, toRefs, getCurrentInstance } from 'vue'
import { ElForm, ElMessageBox, ElTable } from 'element-plus'
import { getQueryPageList,getQueryList } from '@/api/common'
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil';
import { localStorage } from '@/utils/storage'
import { confirm } from '@/api/StockIn'
import { bTableHeight } from '@/composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { search } from '@/api/wareHouse'
//
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310)
const { proxy }: any = getCurrentInstance()
const tableConfig = ref({
loading: false,
column: [] as any,
data: []
})
const queryFormRef = ref()
const formDataRef = ref()
//
const state = reactive({
dataList: [] as any, //
loadings: false, //
loadingC: false,
loading: false, //
//
ERPFactoryList: [] as any,
//
ERPLocationList: [] as any,
//
LocationList: [] as any,
//
queryParams: {
queryId: 'NotPosted',
version: 'G5001',
params: {
siteName: localStorage.get('siteName') || 'SDK',
user: localStorage.get('userName'),
materialSpecName: '', //
location: '',//
erpLocation: '',
erpFactory: '',
CHARGE: '',
ERPLOCATION: '',
LOCATIONNAME: '',
PHASE: '',
DESC_CN: '',
REMARK: '',
checkType: '',
nums: 0,
},
pageNum: 1,
pageSize: 10
},
queryParamsERPLocation: {
queryId: "GetErpLocationList",
version: "WEB00001",
params: {
SITENAME: localStorage.get("siteName") || 'SDK',
ERPFACTORYNAME: '',
},
pageNum: 1,
pageSize: 10
},
//
updateParams: {
costName: '',
},
//
rules: {
costName: [{required: true, message: '请选择成本中心', trigger: 'blur'}],
},
rulesParam: {
checkType: [{required: true, message: '请选择盘点类型', trigger: 'blur'}],
erpFactory: [{required: true, message: '请选择组织', trigger: 'blur'}],
erpLocation: [{required: true, message: '请选择仓库', trigger: 'blur'}],
location: [{required: true, message: '请选择货位', trigger: 'blur'}],
materialSpecName: [{required: true, message: '请输入料号', trigger: 'blur'}],
nums: [{required: true, message: '请输入数量', trigger: 'blur'}],
},
})
const { queryParams, loading, ERPFactoryList, rules, rulesParam } = toRefs(state)
//
onMounted(() => {
tableConfig.value.column = [
{ header: '二维码', field: 'SITENAME', hide: true },
{ header: '组织', field: 'ERPFACTORY', hide: false },
// { header: '(CN)', field: 'ERPFACTORYDESC', hide: false, width: 100 },
{ header: '仓库编码', field: 'ERPLOCATION', hide: false, width: 100 },
// { header: "", field: "ERPLOCATIONDESC", hide: false, width: 100 },
{ header: '货位', field: 'LOCATIONNAME', hide: false },
// { header: '', field: 'LOCATIONNAMEDESC', hide: false, width: 100 },
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false, width: 140 },
{ header: '差异数量', field: 'MATERIALQUANTITY', hide: false, width: 140 },
{ header: '批次号', field: 'CHARGE', hide: false, width: 180 },
]
getErpFactory()
updateTableHeight()
window.addEventListener('resize', handleResize)
})
//
function submit() {
}
//
function getErpFactory() {
getORG({ orgNo: null }).then((res: any) => {
state.ERPFactoryList = res.resultObj
state.ERPFactoryList.unshift({
ERPFACTORY: ''
})
})
}
//ERP
function ERPLocationQuery() {
state.queryParamsERPLocation.params.ERPFACTORYNAME = state.queryParams.params.erpFactory
getQueryList(state.queryParamsERPLocation).then((res: any) => {
state.ERPLocationList = res.data;
});
}
function GetLocationListForSomeERPLocation(value: any) {
if (!areAllNotEmpty(state.queryParams.params.erpFactory)) {
proxy.$ElMessage.warning('当前还未选择组织');
state.queryParams.params.ERPLOCATION = ''
state.ERPLocationList = []
return
}
if (!areAllNotEmpty(state.queryParams.params.ERPLOCATION)) {
return
}
}
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.get('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
function handleConfirm(){
queryFormRef.value.validate((valid: any) => {
if (!valid) {
return
}
})
let param = {
...state.queryParams.params,
}
state.loadingC = true
confirm(state.queryParams.params).then(res => {
if(res.success){
state.dataList = res.resultObj;
} else {
proxy.$ElMessage.error(res.message);
}
state.loadingC = false
})
}
</script>
<style>
.col_height {
padding-top: 3.5px;
padding-bottom: 3.5px;
}
</style>

View File

@ -17,7 +17,6 @@
filterable
v-model="queryParams.params.ERPFACTORY"
placeholder="下拉选择组织"
style="width: 240px"
@change="GetERPLocationForList"
>
<el-option
@ -47,7 +46,6 @@
placeholder="请选择仓库"
popper-class="custom-header"
:max-collapse-tags="1"
style="width: 240px"
@visible-change="GetLocationListForSomeERPLocation"
filterable
>
@ -72,7 +70,6 @@
placeholder="请选择货位"
popper-class="custom-header"
:max-collapse-tags="1"
style="width: 240px"
remote
:remote-method="handleInput"
filterable
@ -101,7 +98,6 @@
<el-select
v-model="queryParams.params.PHASE"
placeholder="输入阶段"
style="width: 160px"
>
<el-option
v-for="item in state.PhaseList"
@ -146,6 +142,15 @@
/>
</el-form-item>
</el-col>
<el-col :span="6" class="col_height">
<el-form-item label="销售订单" prop="params.SALESHIPREQUESTNAME">
<el-Input
v-model="queryParams.params.SALESHIPREQUESTNAME"
placeholder="输入销售订单"
clearable
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="page-search-btns">
@ -194,6 +199,7 @@
v-if="!col.hide"
:label="col.header"
:prop="col.field"
:width="col.width"
show-overflow-tooltip
:sort-orders="['descending', 'ascending']"
:sortable="true"
@ -418,7 +424,8 @@ const state = reactive({
CAREER_ASSISTANCE: '',
DESC_CN: '',
OQARESULTSTATE: '',
PACKINGGRADE: ''
PACKINGGRADE: '',
SALESHIPREQUESTNAME: ''
},
pageNum: 1,
pageSize: 10
@ -548,12 +555,12 @@ onMounted(() => {
// { header: "", field: "MATERIALQUANTITY", hide: false },
// { header: "", field: "FNAME", hide: false },
// { header: "", field: "ERPLOCATION", hide: false },
{ header: '仓库名称', field: 'ERPLOCATIONDESC', hide: false },
{ header: '仓库名称', field: 'ERPLOCATIONDESC', hide: false, width: 120 },
// { header: "", field: "LOCATIONNAME", hide: false },
{ header: '货位名称', field: 'LOCATIONNAMEDESC', hide: false },
{ header: '货位名称', field: 'LOCATIONNAMEDESC', hide: false, width: 150 },
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false },
{ header: '品名', field: 'DESC_CN', hide: false },
{ header: '批次号', field: 'CHARGE', hide: false },
{ header: '品名', field: 'DESC_CN', hide: false, width: 120 },
{ header: '批次号', field: 'CHARGE', hide: false, width: 180 },
{ header: '阶段', field: 'PHASE', hide: false },
{ header: '系统规格', field: 'DESCRIPTION', hide: false },
{ header: 'SDK规格', field: 'SPECNAME', hide: false },
@ -570,6 +577,7 @@ onMounted(() => {
// { header: "", field: "SUPPLIERNAME", hide: false },
{ header: '业助', field: 'CAREER_ASSISTANCE', hide: false },
{ header: '客户', field: 'CUSTOMNO', hide: false },
{ header: '销售订单', field: 'SALESHIPREQUESTNAME', hide: false },
{ header: '业务', field: 'SALESPERSON', hide: false },
{ header: '事业部', field: 'BUSINESS_UNIT', hide: false }
// { header: "", field: "DURABLETYPE", hide: false },
@ -667,6 +675,7 @@ function modifiedRemark() {
return
}
console.log(state.multipleSelection)
state.loadings = true
// return
let boxLists = []
for (var i = 0; i < state.multipleSelection.length; ++i) {
@ -695,13 +704,14 @@ function modifiedRemark() {
updateCareerAssistance(PRINT)
.then((res: any) => {
console.log(res.success)
state.loadings = false
// state.COUSTOMNO = ''
if (res.success) {
state.SALESHIPREQUESTNAME = ''
state.SALESHIPREQUESTDETAILNAME = ''
state.CAREER_ASSISTANCE = ''
// proxy.$ElMessage.success('');
ElMessageBox.alert('业助更新成功', '提醒框', {
ElMessageBox.alert('E库存更新成功', '提醒框', {
confirmButtonText: 'OK'
})
handleQuery()