辅材盘盈盘亏
This commit is contained in:
parent
84d109761d
commit
633557de35
@ -47,18 +47,6 @@ export function getBarCode(ChangeParams: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 无单据入库确定
|
|
||||||
* @param ChangeParams
|
|
||||||
*/
|
|
||||||
export function QTRCommit(ChangeParams: any) {
|
|
||||||
return request({
|
|
||||||
url: '/api/NoInvoice/QTRCommit',
|
|
||||||
method: 'post',
|
|
||||||
data: ChangeParams
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CreateBox(ChangeParams: any) {
|
export function CreateBox(ChangeParams: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/MaterialReceiveAct/TrackOutBox',
|
url: '/api/MaterialReceiveAct/TrackOutBox',
|
||||||
@ -187,3 +175,29 @@ export function confirm(data: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘盈入库
|
||||||
|
* @param data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function QTRCommit(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/api/MaterialReceiveAct/QTRCommit',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘亏出库
|
||||||
|
* @param data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function QTCCommit(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/api/MaterialReceiveAct/QTCCommit',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -47,12 +47,13 @@ export function createCheckPlan(data: any) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取成本中心
|
* 获取成本中心
|
||||||
* @param data
|
* @param params
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getCostCenter() {
|
export function getCostCenter(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/CostCenter/getCostCenter',
|
url: '/api/CostCenter/getCostCenter',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -217,7 +217,7 @@ function audit() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
function getCost(){
|
function getCost(){
|
||||||
getCostCenter().then((res: any) => {
|
getCostCenter({erpFactory: JSON.parse(localStorage.get('orgNo'))}).then((res: any) => {
|
||||||
state.costCenterList = res.data;
|
state.costCenterList = res.data;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -49,12 +49,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6" class="col_height">
|
<el-col :span="6" class="col_height">
|
||||||
<el-form-item label="差异数量" prop="nums">
|
<el-form-item label="差异数量" prop="nums">
|
||||||
<el-Input-number min="0" v-model="queryParams.params.nums" placeholder="输入差异数量" clearable/>
|
<el-Input-number min="1" v-model="queryParams.params.nums" placeholder="输入差异数量" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- <el-col :span="6" class="col_height">
|
||||||
|
<el-form-item label="批次号" prop="CHARGE">
|
||||||
|
<el-Input v-model="queryParams.params.CHARGE" placeholder="输入批次号" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="page-search-btns">
|
<div class="page-search-btns">
|
||||||
|
<!-- <el-button type="primary" @click="handleSearch">搜索</el-button> -->
|
||||||
|
<!-- <el-button type="primary" @click="resetQuery">重置</el-button> -->
|
||||||
<el-button type="primary" @click="handleConfirm" v-loading="state.loadingC">确认</el-button>
|
<el-button type="primary" @click="handleConfirm" v-loading="state.loadingC">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -67,7 +74,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table :height="tableHeight" border v-loading="loading" :default-sort="{ prop: 'MATERIALSPECNAME', order: 'descending' }"
|
<el-table :height="tableHeight" border v-loading="loading"
|
||||||
:data="state.dataList" highlight-current-row row-key="id" style="width: 100%">
|
:data="state.dataList" highlight-current-row row-key="id" style="width: 100%">
|
||||||
<template v-for="(col, index) in tableConfig.column" :key="index">
|
<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
|
<el-table-column v-if="!col.hide" :label="col.header" :prop="col.field" show-overflow-tooltip
|
||||||
@ -79,8 +86,9 @@
|
|||||||
<el-row :gutter="22">
|
<el-row :gutter="22">
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-form-item label="成本中心" prop="costName">
|
<el-form-item label="成本中心" prop="costName">
|
||||||
<el-select v-model="state.updateParams.costName" placeholder="选择成本中心" clearable>
|
<el-select filterable v-model="state.updateParams.costName" placeholder="下拉选择成本" size="small">
|
||||||
<el-option value="1010103000" label="财务部中心"></el-option>
|
<el-option v-for="item in state.costCenterList" :key="item.costCode"
|
||||||
|
:label="item.costName" :value="item.costCode" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -104,10 +112,11 @@ import { ElForm, ElMessageBox, ElTable } from 'element-plus'
|
|||||||
import { getQueryPageList,getQueryList } from '@/api/common'
|
import { getQueryPageList,getQueryList } from '@/api/common'
|
||||||
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil';
|
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil';
|
||||||
import { localStorage } from '@/utils/storage'
|
import { localStorage } from '@/utils/storage'
|
||||||
import { confirm } from '@/api/StockIn'
|
import { confirm,QTRCommit,QTCCommit } from '@/api/StockIn'
|
||||||
import { bTableHeight } from '@/composables/calcTableHeight'
|
import { bTableHeight } from '@/composables/calcTableHeight'
|
||||||
import { getORG } from '@/api/auth'
|
import { getORG } from '@/api/auth'
|
||||||
import { search } from '@/api/wareHouse'
|
import { search } from '@/api/wareHouse'
|
||||||
|
import { getCostCenter } from '@/api/check'
|
||||||
// 公共变量
|
// 公共变量
|
||||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310)
|
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310)
|
||||||
const { proxy }: any = getCurrentInstance()
|
const { proxy }: any = getCurrentInstance()
|
||||||
@ -121,6 +130,7 @@ const formDataRef = ref()
|
|||||||
// 变量
|
// 变量
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
dataList: [] as any, // 表格数据
|
dataList: [] as any, // 表格数据
|
||||||
|
costCenterList: [],
|
||||||
loadings: false, // 更新按钮
|
loadings: false, // 更新按钮
|
||||||
loadingC: false,
|
loadingC: false,
|
||||||
loading: false, // 表格
|
loading: false, // 表格
|
||||||
@ -130,10 +140,11 @@ const state = reactive({
|
|||||||
ERPLocationList: [] as any,
|
ERPLocationList: [] as any,
|
||||||
// 货位
|
// 货位
|
||||||
LocationList: [] as any,
|
LocationList: [] as any,
|
||||||
|
commitDate: '',
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
queryId: 'NotPosted',
|
queryId: 'AuxiliaryOutIn',
|
||||||
version: 'G5001',
|
version: '00001',
|
||||||
params: {
|
params: {
|
||||||
siteName: localStorage.get('siteName') || 'SDK',
|
siteName: localStorage.get('siteName') || 'SDK',
|
||||||
user: localStorage.get('userName'),
|
user: localStorage.get('userName'),
|
||||||
@ -175,7 +186,6 @@ const state = reactive({
|
|||||||
checkType: [{required: true, message: '请选择盘点类型', trigger: 'blur'}],
|
checkType: [{required: true, message: '请选择盘点类型', trigger: 'blur'}],
|
||||||
erpFactory: [{required: true, message: '请选择组织', trigger: 'blur'}],
|
erpFactory: [{required: true, message: '请选择组织', trigger: 'blur'}],
|
||||||
erpLocation: [{required: true, message: '请选择仓库', trigger: 'blur'}],
|
erpLocation: [{required: true, message: '请选择仓库', trigger: 'blur'}],
|
||||||
location: [{required: true, message: '请选择货位', trigger: 'blur'}],
|
|
||||||
materialSpecName: [{required: true, message: '请输入料号', trigger: 'blur'}],
|
materialSpecName: [{required: true, message: '请输入料号', trigger: 'blur'}],
|
||||||
nums: [{required: true, message: '请输入数量', trigger: 'blur'}],
|
nums: [{required: true, message: '请输入数量', trigger: 'blur'}],
|
||||||
},
|
},
|
||||||
@ -184,8 +194,16 @@ const { queryParams, loading, ERPFactoryList, rules, rulesParam } = toRefs(state
|
|||||||
|
|
||||||
// 加载
|
// 加载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
var newDate = new Date()
|
||||||
|
var year = newDate.getFullYear()
|
||||||
|
var moth = newDate.getMonth() + 1
|
||||||
|
if (moth < 10) moth = '0' + moth
|
||||||
|
var day = newDate.getDate()
|
||||||
|
if (day < 10) day = '0' + day
|
||||||
|
state.commitDate = year + '-' + moth + '-' + day;
|
||||||
|
|
||||||
tableConfig.value.column = [
|
tableConfig.value.column = [
|
||||||
{ header: '二维码', field: 'SITENAME', hide: true },
|
{ header: '二维码', field: 'MATERIALPACKINGNAME', hide: false },
|
||||||
{ header: '组织', field: 'ERPFACTORY', hide: false },
|
{ header: '组织', field: 'ERPFACTORY', hide: false },
|
||||||
// { header: '组织(CN)', field: 'ERPFACTORYDESC', hide: false, width: 100 },
|
// { header: '组织(CN)', field: 'ERPFACTORYDESC', hide: false, width: 100 },
|
||||||
{ header: '仓库编码', field: 'ERPLOCATION', hide: false, width: 100 },
|
{ header: '仓库编码', field: 'ERPLOCATION', hide: false, width: 100 },
|
||||||
@ -194,16 +212,29 @@ onMounted(() => {
|
|||||||
// { header: '货位名称', field: 'LOCATIONNAMEDESC', hide: false, width: 100 },
|
// { header: '货位名称', field: 'LOCATIONNAMEDESC', hide: false, width: 100 },
|
||||||
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false, width: 140 },
|
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false, width: 140 },
|
||||||
{ header: '差异数量', field: 'MATERIALQUANTITY', hide: false, width: 140 },
|
{ header: '差异数量', field: 'MATERIALQUANTITY', hide: false, width: 140 },
|
||||||
|
{ header: '规格', field: 'TRUEGG', hide: false, width: 100 },
|
||||||
{ header: '批次号', field: 'CHARGE', hide: false, width: 180 },
|
{ header: '批次号', field: 'CHARGE', hide: false, width: 180 },
|
||||||
]
|
]
|
||||||
getErpFactory()
|
getErpFactory()
|
||||||
updateTableHeight()
|
updateTableHeight()
|
||||||
|
getCost()
|
||||||
window.addEventListener('resize', handleResize)
|
window.addEventListener('resize', handleResize)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新
|
function getCost(){
|
||||||
function submit() {
|
getCostCenter({erpFactory: JSON.parse(localStorage.get('orgNo'))}).then((res: any) => {
|
||||||
|
state.costCenterList = res.data;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetQuery() {
|
||||||
|
// queryFormRef.value.resetFields();
|
||||||
|
state.queryParams.params.erpFactory = ''
|
||||||
|
state.queryParams.params.erpLocation = ''
|
||||||
|
state.queryParams.params.location = ''
|
||||||
|
state.queryParams.params.materialSpecName = ''
|
||||||
|
}
|
||||||
|
|
||||||
// 加载组织
|
// 加载组织
|
||||||
function getErpFactory() {
|
function getErpFactory() {
|
||||||
getORG({ orgNo: null }).then((res: any) => {
|
getORG({ orgNo: null }).then((res: any) => {
|
||||||
@ -219,6 +250,7 @@ function ERPLocationQuery() {
|
|||||||
state.queryParamsERPLocation.params.ERPFACTORYNAME = state.queryParams.params.erpFactory
|
state.queryParamsERPLocation.params.ERPFACTORYNAME = state.queryParams.params.erpFactory
|
||||||
getQueryList(state.queryParamsERPLocation).then((res: any) => {
|
getQueryList(state.queryParamsERPLocation).then((res: any) => {
|
||||||
state.ERPLocationList = res.data;
|
state.ERPLocationList = res.data;
|
||||||
|
state.ERPLocationList.push({DESCRIPTION:'6101',ENUMVALUE: '6101'}) ;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function GetLocationListForSomeERPLocation(value: any) {
|
function GetLocationListForSomeERPLocation(value: any) {
|
||||||
@ -249,25 +281,103 @@ function handleInput(val: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handleSearch(){
|
||||||
|
if(!state.queryParams.params.CHARGE){
|
||||||
|
proxy.$ElMessage.warning("请输入批次号");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getQueryPageList(state.queryParams).then(res => {
|
||||||
|
if(res.code == '200'){
|
||||||
|
state.dataList = res.data.list;
|
||||||
|
} else {
|
||||||
|
proxy.$ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
function handleConfirm(){
|
function handleConfirm(){
|
||||||
queryFormRef.value.validate((valid: any) => {
|
queryFormRef.value.validate((valid: any) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
state.loadingC = true
|
||||||
let param = {
|
confirm(state.queryParams.params).then(res => {
|
||||||
...state.queryParams.params,
|
if(res.success){
|
||||||
}
|
state.dataList = res.resultObj;
|
||||||
state.loadingC = true
|
resetQuery();
|
||||||
confirm(state.queryParams.params).then(res => {
|
} else {
|
||||||
if(res.success){
|
proxy.$ElMessage.error(res.message);
|
||||||
state.dataList = res.resultObj;
|
}
|
||||||
} else {
|
state.loadingC = false
|
||||||
proxy.$ElMessage.error(res.message);
|
})
|
||||||
}
|
|
||||||
state.loadingC = false
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
function submit() {
|
||||||
|
formDataRef.value.validate((valid: any) => {
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (state.dataList.length == 0){
|
||||||
|
proxy.$ElMessage.warning("列表没有数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(!state.queryParams.params.checkType){
|
||||||
|
proxy.$ElMessage.warning("请选择盘点类型");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let param = {
|
||||||
|
boxList: state.dataList,
|
||||||
|
user: localStorage.get("userId"),
|
||||||
|
commitDate: state.commitDate,
|
||||||
|
opcode: '',
|
||||||
|
qtc: 'Z06',
|
||||||
|
costName: state.updateParams.costName,
|
||||||
|
siteName: 'SDK'
|
||||||
|
}
|
||||||
|
// todo, STOCKSTATE
|
||||||
|
state.loadings = true
|
||||||
|
if (state.queryParams.params.checkType == "盘盈") {
|
||||||
|
let hasEven = state.dataList.some(item =>
|
||||||
|
item.STOCKSTATE != 'Created'
|
||||||
|
)
|
||||||
|
if(hasEven){
|
||||||
|
proxy.$ElMessage.warning("列表中含有状态不是Created的数据,不能进行盘盈");
|
||||||
|
state.loadings = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
QTRCommit(param).then(res => {
|
||||||
|
if(res.success){
|
||||||
|
proxy.$ElMessage.success(res.message);
|
||||||
|
state.dataList = [];
|
||||||
|
} else {
|
||||||
|
proxy.$ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
state.loadings = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
let hasEven = state.dataList.some(item =>
|
||||||
|
item.STOCKSTATE != 'Stocked'
|
||||||
|
)
|
||||||
|
if(hasEven){
|
||||||
|
proxy.$ElMessage.warning("列表中含有状态不是Stocked的数据,不能进行盘亏");
|
||||||
|
state.loadings = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
param.qtc = 'Z05'
|
||||||
|
QTCCommit(param).then(res => {
|
||||||
|
if(res.success){
|
||||||
|
proxy.$ElMessage.success(res.message);
|
||||||
|
state.dataList = [];
|
||||||
|
} else {
|
||||||
|
proxy.$ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
state.loadings = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.col_height {
|
.col_height {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user