1.库存管理,出入库流水

master
董哲奇 4 weeks ago
parent 0718967219
commit 36096bdee1

@ -91,10 +91,10 @@ const init=function (that){
const useStatus=[
{label:'未使用',value:'0'},
{label:'未打印',value:'1'},
{label:'已打印',value:'2'},
{label:'已切割',value:'3'},
{label:'未使用',value:'1'},
{label:'未打印',value:'2'},
{label:'已打印',value:'3'},
{label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@ -123,7 +123,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
status:'0',
status:'1',
xqch:'',
xqpl:'',
},
@ -136,12 +136,12 @@ const init=function (that){
},
{span: 12,
children:[
{ span: 15,align:'right',itemRender: {
{ span: 16,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
name: '$button', props: {content:'核对',status:'success'},events:{click:核对}
}
},
{ align:'right',itemRender: {
@ -149,7 +149,7 @@ const init=function (that){
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
name: '$button', props: {content:'打印',status:'success'},events:{click:打印}
}
},
{ align:'right',itemRender: {

@ -91,10 +91,10 @@ const init=function (that){
const useStatus=[
{label:'未使用',value:'0'},
{label:'未打印',value:'1'},
{label:'已打印',value:'2'},
{label:'已切割',value:'3'},
{label:'未使用',value:'1'},
{label:'未打印',value:'2'},
{label:'已打印',value:'3'},
{label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@ -123,7 +123,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
status:'0',
status:'1',
xqch:'',
xqpl:'',
},
@ -136,12 +136,12 @@ const init=function (that){
},
{span: 12,
children:[
{ span: 15,align:'right',itemRender: {
{ span: 16,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
name: '$button', props: {content:'核对',status:'success'},events:{click:核对}
}
},
{ align:'right',itemRender: {
@ -149,7 +149,7 @@ const init=function (that){
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
name: '$button', props: {content:'打印',status:'success'},events:{click:打印}
}
},
{ align:'right',itemRender: {

@ -26,10 +26,10 @@ const init=function (that){
}
const useStatus=[
{label:'未使用',value:'0'},
{label:'未打印',value:'1'},
{label:'已打印',value:'2'},
{label:'已切割',value:'3'},
{label:'未使用',value:'1'},
{label:'未打印',value:'2'},
{label:'已打印',value:'3'},
{label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@ -58,7 +58,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
status:'0',
status:'1',
},
items:[
{ field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },

@ -1,14 +1,20 @@
<template>
<vxe-modal>
<VxeGrid v-bind="gridOptions" v-on="gridEvents"/>
<vxe-modal v-model="showFlag" :width="1200" :height="800">
<VxeGrid ref="vGrid" v-bind="gridOptions" v-on="gridEvents">
<template #name_czbh="{ data }">
<ProjectSelect ref="projectSelectRef" clearable :_style="{width:'100%'}" />
</template>
</VxeGrid>
</vxe-modal>
</template>
<script>
import init from '../lib/ylmodal'
import init from '../js/ylmodal'
import ProjectSelect from "@/components/ProjectSelect/index.vue";
export default {
name:'YlModal',
components: {ProjectSelect},
data(){
return {
showFlag:false,

@ -1,6 +1,5 @@
<template>
<el-container>
<el-container style="padding-top: 10">
<el-container>
<el-main>
<VxeGrid ref="vGrid" :scroll-y="{enabled: true}" :scroll-x="{enabled: true}" v-bind="gridOptions">
@ -10,7 +9,6 @@
</VxeGrid>
</el-main>
</el-container>
</el-container>
<YlModal ref="ylModal"/>
</el-container>
</template>
@ -18,7 +16,7 @@
<script>
import ProjectSelect from "@/components/ProjectSelect/index.vue";
import YlModal from "@/views/ylgl/comp/ylmodal.vue";
import init from './lib/dw'
import init from './js/dw'
export default {
name:'YlDwgl',
@ -38,3 +36,57 @@ export default {
}
}
</script>
<style lang="scss" scoped >
.el-container{padding: 0;margin:0;}
.el-main{padding: 0;}
.el-col{padding: 0;height: 32px;}
.el-aside{background: #fff;padding: 0}
.el-container{padding: 0}
.el-row {}
.el-row:last-child {margin-bottom: 0; }
.tableStyles{
background: #0a76a4;
}
.my-dropdown {
width: 400px;
height: 400px;
background-color: #fff;
border: 1px solid #dcdfe6;
box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
font-size: 12px;
}
.vxe-input {
display: inline-block !important;
position: relative !important;
width: auto;
}
.el-input {
display: inline-block !important;
position: relative !important;
width: auto;
}
.keyword-lighten {
color: #000;
background-color: #FFFF00;
}
.vxe-textarea--inner {
line-height: inherit;
}
.el-form-item__label-wrap {
margin-left: 0 !important;
float: left;
}
.fontClass{
font-size: 12px;
font-weight: bold;
}
</style>

@ -1,6 +1,6 @@
import request from '@/utils/request'
import { VXETable } from 'vxe-table'
import XLSX from 'xlsx'
import {EventBus} from "@/event-bus";
const init=function (that){
const butClick=function (){
@ -14,92 +14,58 @@ const init=function (that){
})
}
const 核对=function (){
const dcCh=that.$refs.xqProjectSelectRef.getDcch();
const dcPl=data.options.formConfig.data.xqpl
if (!dcCh||!dcPl){
VXETable.modal.message({ content: '请选择需求船号和批量', status: 'warning' })
return
}
const table=that.$refs.vGrid
const list=table.getCheckboxRecords()
if (list.length===0){
VXETable.modal.message({ content: '请选择数据', status: 'warning' })
return
const 入库=()=>{
const {insertRecords,updateRecords}=that.$refs.vGrid.getRecordset()
const data=[]
if (insertRecords.length>=0){
data.push(...insertRecords)
}
const _data={
dcCh:dcCh,
dcPl:dcPl,
ylList:list
if (updateRecords.length>=0){
data.push(...updateRecords)
}
核对数据(_data).then(res=>{
const data=res.data
VXETable.modal.message({ content: `核对结束,匹配${data.length}张套料图`, status: 'warning' })
for (const item of data) {
for (let it of list) {
if (it.id===item.id){
it=Object.assign(it,item)
break;
}
if (!item.垛位){
that.$refs.vGrid.setCurrentRow(item)
VXETable.modal.message({ content: `${item.余料编号}请选择摆放位置`, status: 'warning' })
return
}
if (!item.入库日期){
that.$refs.vGrid.setCurrentRow(item)
VXETable.modal.message({ content: `${item.余料编号}请选择入库日期`, status: 'warning' })
return
}
})
}
const 保存=()=>{
const list=that.$refs.vGrid.getCheckboxRecords()
if (list.length>0){
edit(list).then(res=>{
rk(data).then(res=>{
VXETable.modal.message({ content: '成功', status: 'success' })
butClick()
})
}
}
const 打印=()=>{
const list=that.$refs.vGrid.getCheckboxRecords()
if (list.length>0){
print(list).then(res=>{
const workBook = XLSX.utils.book_new();
const _data=list.map(item=>{
return {
船号:item.使用船号,
批量:item.使用批量,
图纸编号:item.使用图纸,
余料编号:item.余料编号,
垛位:item.垛位
}
})
const sheet=XLSX.utils.json_to_sheet(_data)
XLSX.utils.book_append_sheet(workBook, sheet, "sheet");
XLSX.writeFile(workBook, `${data.options.formConfig.dcCh}-${data.options.formConfig.dcPl}余料上料计划.xlsx`)
butClick()
const 移垛=()=>{
const data=that.$refs.vGrid.getCheckboxRecords()
if (data.length>0){
const list=data.map(item=>{
return {id:item.id,垛位:item.垛位,层数:item.层数}
})
}
}
const 退回=()=>{
const list=that.$refs.vGrid.getCheckboxRecords()
if(list.length>0){
rollback(list).then(()=>{
edit(list).then(res=>{
VXETable.modal.message({ content: '成功', status: 'success' })
butClick()
})
}
}
const 提取=()=>{
that.$refs.ylModal.show()
}
const useStatus=[
{label:'未使用',value:'0'},
{label:'未打印',value:'1'},
{label:'已打印',value:'2'},
{label:'已切割',value:'3'},
{label:'未使用',value:'1'},
{label:'未出库',value:'2'},
]
const formatUseStatus=({cellValue})=>{
for (const item of useStatus) {
if(item.value===cellValue){
if(item.value===cellValue+''){
return item.label
}
}
@ -116,6 +82,7 @@ const init=function (that){
size:'mini',
showOverflow: true,
showHeaderOverflow:true,
scrollY:{enable:true},
editConfig:{trigger: 'click', mode: 'cell', showStatus: true},
highlightCurrentRow:true,
formConfig:{
@ -123,49 +90,40 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
status:'0',
xqch:'',
xqpl:'',
status:'1',
},
items:[
{ field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },
{ field: 'dcPl', title: '来源批量', span: 3 ,itemRender: {name: '$input'}},
{ field: 'tzbh', title: '来源图号', span: 3 ,itemRender: {name: '$input'}},
{ field: 'dcCh', title: '来源船只', span: 4,slots: { default: 'name_czbh' } },
{ field: 'dcPl', title: '来源批量', span: 4 ,itemRender: {name: '$input'}},
{ field: 'tzbh', title: '来源图号', span: 4 ,itemRender: {name: '$input'}},
{ field: 'status', title: '使用状态', span: 3 ,
itemRender: {name: '$select',props:{options:useStatus}}
},
{span: 12,
{span: 9,
children:[
{ span: 15,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'保存',status:'primary'},events:{click:保存}
name: '$button', props: {content:'提取',status:'success'},events:{click:提取}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
name: '$button', props: {content:'入库',status:'primary'},events:{click:入库}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'退回',status:'primary'},events:{click:退回}
name: '$button', props: {content:'移垛',status:'warning'},events:{click:移垛}
}
},
]
},
{ field: 'xqch', title: '需求船只', span: 3,slots: { default: 'name_xqch' } },
{ field: 'xqpl', title: '需求批量', span: 3 ,itemRender: {name: '$input'}},
],
},
columns:[
{type:'checkbox',title:'序号'},
{type:'seq',title:''},
// { field: 'id', title: 'ID', width: 150 },
{ field: '余料编号', title: '余料编号', width: 150,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@ -198,38 +156,21 @@ const init=function (that){
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '垛位', title: '垛位', width: 100,
{ field: '入库日期', title: '入库日期', width: 150,
editRender:{name:'$input',props: {type:'date', labelFormat:'yyyy/MM/dd',valueFormat:'yyyy/MM/dd',placeholder: '请选择日期' }},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '层数', title: '层数', width: 80,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '使用船号', title: '使用船号', width: 120,
editRender:{name:'$input'},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '使用批量', title: '使用批量', width: 120,
editRender:{name:'$input'},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '使用分段', title: '使用分段', width: 120,
editRender:{name:'$input'},
{ field: '垛位', title: '垛位', width: 100,
editRender:{name:'$select',options:[]},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '使用图纸', title: '使用图纸', width: 150,
{ field: '层数', title: '层数', width: 80,
editRender:{name:'$input'},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '使用日期', title: '使用日期', width: 150,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
{ field: '来源船号', title: '来源船号', width: 120,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@ -260,6 +201,23 @@ const init=function (that){
},
}
getDw().then(res=>{
const 垛位=that.$refs.vGrid.getColumnByField('垛位')
垛位.editRender.options=res.data.map(item=>{
return {label:item.bmsm,value:item.bm}
})
})
const tmpSelectId=[]
EventBus.$on('ylrkSelect', _data=>{
_data.forEach(item=>{
if (tmpSelectId.includes(item.id)){
return
}
tmpSelectId.push(item.id)
that.$refs.vGrid.insert(item)
})
})
return data
}
@ -271,9 +229,9 @@ const getData=(data)=>{
});
}
const 核对数据=(data)=>{
const rk=(data)=>{
return request({
url: "/yl/gdsl",
url: "/yl/rk",
method: "post",
data,
});
@ -287,19 +245,11 @@ const edit=(data)=>{
});
}
const print=(data)=>{
const getDw=()=>{
return request({
url: "/yl/print",
url: "/api/sy/getZhbmList",
method: "post",
data,
});
}
const rollback=(data)=>{
return request({
url: "/yl/rollback",
method: "post",
data,
data:{bmlb:'yldw'}
});
}

@ -1,5 +1,7 @@
import request from '@/utils/request'
import { VXETable } from 'vxe-table'
import {EventBus} from "@/event-bus";
const init=function (that){
const butClick=function (){
@ -13,32 +15,10 @@ const init=function (that){
})
}
const 保存=()=>{
const list=that.$refs.vGrid.getCheckboxRecords()
if (list.length>0){
edit(list).then(res=>{
VXETable.modal.message({ content: '成功', status: 'success' })
butClick()
})
}
}
const 退回=()=>{
const list=that.$refs.vGrid.getCheckboxRecords()
if(list.length>0){
rollback(list).then(()=>{
VXETable.modal.message({ content: '成功', status: 'success' })
butClick()
})
}
}
const useStatus=[
{label:'未使用',value:'0'},
{label:'未打印',value:'1'},
{label:'已打印',value:'2'},
{label:'已切割',value:'3'},
{label:'未入库',value:'0'},
{label:'未使用',value:'1'},
{label:'未出库',value:'2'},
]
const formatUseStatus=({cellValue})=>{
@ -50,9 +30,19 @@ const init=function (that){
return cellValue
}
const 提取=()=>{
const data=that.$refs.vGrid.getCheckboxRecords()
if (data.length===0){
VXETable.modal.message({ content: '请选择入库余料', status: 'warning' })
return
}
EventBus.$emit('ylrkSelect', data)
that.showFlag=false
}
const data={
options:{
height:830,
height:730,
align:'center',
border: true,
resizable: true,
@ -60,6 +50,7 @@ const init=function (that){
size:'mini',
showOverflow: true,
showHeaderOverflow:true,
scrollY:{enable:true},
editConfig:{trigger: 'click', mode: 'cell', showStatus: true},
highlightCurrentRow:true,
formConfig:{
@ -67,26 +58,25 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
status:'0',
xqch:'',
xqpl:'',
},
items:[
{ field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },
{ field: 'dcPl', title: '来源批量', span: 3 ,itemRender: {name: '$input'}},
{ field: 'tzbh', title: '来源图号', span: 3 ,itemRender: {name: '$input'}},
{ field: 'status', title: '使用状态', span: 3 ,
itemRender: {name: '$select',props:{options:useStatus}}
{ field: 'dcCh', title: '来源船只', span: 5,slots: { default: 'name_czbh' } },
{ field: 'dcPl', title: '来源批量', span: 4 ,itemRender: {name: '$input'}},
{ field: 'tzbh', title: '来源图号', span: 5 ,itemRender: {name: '$input'}},
{ field: 'status', span: 3 ,
itemRender: {name: '$select',props:{options:useStatus,disabled:true}}
},
{span: 12,
{span: 7,
children:[
{ span: 18,align:'right',itemRender: {
{ span: 19,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'保存',status:'primary'},events:{click:保存}
}
},
{ align:'right',itemRender: {
name: '$button', props: {content:'退回',status:'primary'},events:{click:退回}
name: '$button', props: {content:'提取',status:'success'},events:{click:提取}
}
},
]
@ -96,6 +86,7 @@ const init=function (that){
columns:[
{type:'checkbox',title:'序号'},
{type:'seq',title:''},
// { field: 'id', title: 'ID', width: 150 },
{ field: '余料编号', title: '余料编号', width: 150,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@ -201,6 +192,14 @@ const getData=(data)=>{
});
}
const 核对数据=(data)=>{
return request({
url: "/yl/gdsl",
method: "post",
data,
});
}
const edit=(data)=>{
return request({
url: "/yl/edit",
@ -209,6 +208,14 @@ const edit=(data)=>{
});
}
const print=(data)=>{
return request({
url: "/yl/print",
method: "post",
data,
});
}
const rollback=(data)=>{
return request({
url: "/yl/rollback",

@ -1,16 +1,14 @@
<template>
<el-container>
<el-container style="padding-top: 10">
<el-container>
<el-main>
<VxeGrid ref="vGrid" :scroll-y="{enabled: true}" :scroll-x="{enabled: true}" v-bind="gridOptions">
<template #name_czbh="{ data }">
<ProjectSelect ref="projectSelectRef" clearable :_style="{width:'150px'}" />
<ProjectSelect ref="projectSelectRef" clearable :_style="{width:'100%'}" />
</template>
</VxeGrid>
</el-main>
</el-container>
</el-container>
<YlModal ref="ylModal"/>
</el-container>
</template>
@ -18,7 +16,7 @@
<script>
import ProjectSelect from "@/components/ProjectSelect/index.vue";
import YlModal from "@/views/ylgl/comp/ylmodal.vue";
import init from './lib/kc'
import init from '@/views/ylgl/js/kc'
export default {
name:'ylkc',
@ -39,3 +37,59 @@ export default {
}
}
</script>
<style lang="scss" scoped >
.el-container{padding: 0;margin:0;}
.el-main{padding: 0;}
.el-col{padding: 0;height: 32px;}
.el-aside{background: #fff;padding: 0}
.el-container{padding: 0}
.el-row {}
.el-row:last-child {margin-bottom: 0; }
.tableStyles{
background: #0a76a4;
}
.my-dropdown {
width: 400px;
height: 400px;
background-color: #fff;
border: 1px solid #dcdfe6;
box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
font-size: 12px;
}
.vxe-input {
display: inline-block !important;
position: relative !important;
width: auto;
}
.el-input {
display: inline-block !important;
position: relative !important;
width: auto;
}
.keyword-lighten {
color: #000;
background-color: #FFFF00;
}
.vxe-textarea--inner {
line-height: inherit;
}
.el-form-item__label-wrap {
margin-left: 0 !important;
float: left;
}
.fontClass{
font-size: 12px;
font-weight: bold;
}
</style>

Loading…
Cancel
Save