Commit d863d867 authored by 李苏's avatar 李苏 💬

拣货按照出库开

parent 921f3472
<template> <template>
<DefaultDialog :app='app'> <DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 78vh;">
<div slot="form" style="display: flex;height: 74vh;">
<Jhr @save='finSave' :app='this' v-if="showDialog" />
<div class="full"> <div class="full">
<el-tabs class="full" v-model="activeName"> <el-tabs class="full" v-model="activeName">
<el-tab-pane class="full" label="出库单" name="first"> <el-tab-pane class="full" label="出库单" name="first">
...@@ -23,10 +25,12 @@ ...@@ -23,10 +25,12 @@
<script> <script>
import Rkd from './rkd.vue' import Rkd from './rkd.vue'
import Rkqd from './rkqd.vue' import Rkqd from './rkqd.vue'
import Jhr from './jhr.vue'
export default { export default {
components: { components: {
Rkd, Rkd,
Rkqd Rkqd,
Jhr
}, },
props: { props: {
app: { app: {
...@@ -42,15 +46,49 @@ ...@@ -42,15 +46,49 @@
}, },
data() { data() {
return { return {
showDialog:false,
DialogTitle:'选择拣货人',
DialogWidth:'30vw',
row:{}, row:{},
activeName: 'first' activeName: 'first'
} }
}, },
methods: { methods: {
finSave(form){
let map=this.$refs.rkqd.detailList
let keyList= Object.keys(map)
let datas=[]
keyList.forEach(key=>{
map[key].forEach(item=>{
// item.lydjid=item.id
// delete item.id
datas.push(item)
})
})
let params={
cktzid:this.$refs.rkqd.$refs.basePage.queryParams.mid,
datas:datas,
jhrid:form.jhrid
}
this.$post('test',params).then(res=>{
if(res.success){
this.$success('操作成功')
this.app.showDialog=false
this.app.refresh()
}
})
},
save() { save() {
let list=this.$refs.rkqd.detailList let map=this.$refs.rkqd.detailList
console.log(list) let keyList= Object.keys(map)
if(keyList.length==0){
this.$warning('请先选择明细')
return
}
this.showDialog=true
}, },
getRow(val) { getRow(val) {
this.row=val this.row=val
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="">
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20" :app="this" class="editRow">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
:prop='item.prop' :key="item.prop" :type="item.type"
:typeConfig='item.typeConfig' :rule="item.rule" />
<!-- 额外数据 -->
</el-row>
</el-form>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="app.showDialog=false">取 消</el-button> -->
<el-button type="primary" @click="save()">确 定</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
editMixin,
editMixin_expand
} from 'common'
export default {
mixins: [editMixin, editMixin_expand],
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
/* 初始化数据 */
},
data() {
return {
readonly: false,
editColItemList: [
{
label: '拣货人',
prop: 'jhrid',
span: 24,
type: 'AuxInput',
typeConfig: {
code: 'USER',
label: 'jhrName',
transform: {
value: 'id',
label: 'username'
}
},
"required": true,
},
// {
// label: '退货单号',
// prop: 'ddh',
// span: 24,
// type: 'input',
// value: '',
// }
]
}
},
methods: {
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.app.showDialog = false
// this.app.DialogWidth='80vw'
this.$emit('save',this.form)
}
})
}
}
}
</script>
<style scoped>
::v-deep .el-icon-close{
/* display: none; */
}
</style>
...@@ -118,7 +118,12 @@ ...@@ -118,7 +118,12 @@
editTableTitle:[ editTableTitle:[
{ {
label: '仓库', label: '仓库',
prop: 'ckName', prop: 'ckid',
width: 130,
},
{
label: '批号',
prop: 'wlph',
width: 130, width: 130,
}, },
{ {
...@@ -144,6 +149,7 @@ ...@@ -144,6 +149,7 @@
type: 'inputNumber', type: 'inputNumber',
blur: toFixed(null), blur: toFixed(null),
change: (row) => { change: (row) => {
row.jhsl=parseInt(row.jhsl)
/*row.oldJhsl /*row.oldJhsl
row.kcsl row.kcsl
*/ */
...@@ -152,8 +158,8 @@ ...@@ -152,8 +158,8 @@
row.jhsl=row.oldJhsl row.jhsl=row.oldJhsl
return return
} }
if(row.jhsl>row.kcsl){ if(row.jhsl>row.oldKcsl){
this.$warning('数量不能大于库存数量') this.$warning('数量不能大于库存数量')
row.jhsl=row.oldJhsl row.jhsl=row.oldJhsl
return return
} }
...@@ -183,6 +189,7 @@ ...@@ -183,6 +189,7 @@
pageQueryFinally(list){ pageQueryFinally(list){
console.log('清空明细list') console.log('清空明细list')
this.detailList={} this.detailList={}
this.editTableConfig.editTableData=[]
list.forEach((item)=>{ list.forEach((item)=>{
/* 剩余拣货数量==yfsl*/ /* 剩余拣货数量==yfsl*/
let alljhsl=item.yfsl let alljhsl=item.yfsl
...@@ -196,6 +203,7 @@ ...@@ -196,6 +203,7 @@
let kcList=this.detailList[item.id] let kcList=this.detailList[item.id]
/* 开始扣除库存 kcsl*/ /* 开始扣除库存 kcsl*/
kcList.forEach(kcitem=>{ kcList.forEach(kcitem=>{
kcitem.oldKcsl=kcitem.kcsl
kcitem.jhsl=0 kcitem.jhsl=0
kcitem.oldJhsl=0 kcitem.oldJhsl=0
if(alljhsl==0){ if(alljhsl==0){
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
methods: { methods: {
ackdk(ctx) { ackdk(ctx) {
ctx.DialogWidth = '70vw' ctx.DialogWidth = '70vw'
ctx.DialogTitle = '按出库单开' ctx.DialogTitle = '按出库单开(选择出库单明细会自动分配拣货数量)'
ctx.showDialog = true ctx.showDialog = true
}, },
jhtj(ctx) { jhtj(ctx) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment