领料出库修改

dev-scheduling
zhangdi 4 weeks ago
parent 752f7e709c
commit 537b85c505
  1. 282
      src/views/inboundOutboundManagement/components/editMaterial.vue
  2. 979
      src/views/inboundOutboundManagement/materialIssuing.vue

@ -1,216 +1,94 @@
<template> <template>
<el-dialog title="出库" append-to-body :modelValue="openShow" width="80%" @close="closeDialog"> <el-dialog title="出库" append-to-body :modelValue="openShow" fullscreen @close="closeDialog">
<el-table :data="tableData"> <el-table :data="tableData" highlight-current-row @current-change="handleCurrentChange">
<el-table-column label="提请物料" prop="goodsCode" align="center"></el-table-column> <el-table-column label="提请物料" prop="goodsCode" align="center"></el-table-column>
<el-table-column label="材料名称" prop="goodsName" align="center"></el-table-column> <el-table-column label="材料名称" prop="goodsName" align="center"></el-table-column>
<el-table-column label="规格" prop="specifications" align="center"></el-table-column> <el-table-column label="规格" prop="specifications" align="center"></el-table-column>
<el-table-column label="库房" prop="shId" align="center"> <el-table-column label="库房" prop="shName" align="center"> </el-table-column>
<template #default="scope"> <el-table-column label="出库库位" prop="location" align="center"> </el-table-column>
<el-select v-model="scope.row.shId" @change="(val) => changeWare(val,scope.$index)"> <el-table-column label="批次号" prop="piNo" align="center"> </el-table-column>
<el-option v-for="item in wareList" :key="item.id" :label="item.shName" :value="item.id"></el-option> <el-table-column label="库存数量" prop="usableQuantity" align="center"></el-table-column>
</el-select> <el-table-column label="出库数量" prop="currentOutQty" align="center">
</template> <template #default="scope">
</el-table-column> <el-input-number
<el-table-column label="出库库位" prop="slId" align="center"> controls-position="right"
<template #default="scope"> :max="scope.row.usableQuantity"
<el-select v-model="scope.row.slId" @change="(val) => changeLocation(val,scope.$index)"> v-model="scope.row.currentOutQty"
<el-option v-for="item in locationList" :key="item.id" :label="item.location" :value="item.slId"></el-option> ></el-input-number>
</el-select>
</template>
</el-table-column>
<el-table-column label="批次号" prop="piNo" align="center">
<template #default="scope">
<el-select v-model="scope.row.piNo" @change="val => changePiNo(val,scope.$index)">
<el-option v-for="item in scope.row.piNoList" :key="item.id" :label="item.piNo" :value="item.piNo"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="可出库数量" prop="availableQty" align="center"></el-table-column>
<el-table-column label="出库数量" prop="currentOutQty" align="center">
<template #default="scope">
<el-input-number controls-position="right" :max="scope.row.availableQty" v-model="scope.row.currentOutQty"></el-input-number>
</template>
</el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template> </template>
</el-dialog> </el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
</template> </template>
<script> <script>
import {getLocationData,editIssue,getWarehouseList,batchIssue} from "@/api/storeManagement/materialIssuing" import { getStockByStorehouseAndGoods } from '@/api/storeManagement/otherIssuing';
export default { export default {
props:{ props: {
showDialog: { showDialog: {
type: Boolean, type: Boolean,
default: false default: false,
},
row:{
type: Object,
default: {}
},
list:{
type: Array,
default: []
}
}, },
data() { row: {
return { type: Object,
openShow: false, default: {},
tableData:[],
locationList:[],
piNoList:[],
wareList:[]
}
}, },
mounted(){ checkIndex: {
this.openShow = this.showDialog type: Number,
if(JSON.stringify(this.row) != '{}'){ default: 0,
this.tableData = [{
...this.row,
shId:this.row.shId == -1 ? '':this.row.shId,
slId:this.row.slId == -1 ? '':this.row.slId,
piNo:this.row.piNo == -1 ? '':this.row.piNo,
availableQty:this.row.availableQty == -1 ? '':this.row.availableQty,
currentOutQty:this.row.currentOutQty == -1 ? '':this.row.currentOutQty,
rlsId:this.row.rlsId == -1 ? '':this.row.rlsId,
}]
this.getWare()
this.getLocation()
}else if(this.list.length > 0){
this.tableData = this.list
this.tableData.map(item =>{
item.shId = item.shId == -1 ? '':item.shId
item.slId = item.slId == -1 ? '':item.slId
item.piNo = item.piNo == -1 ? '':item.piNo
item.availableQty = item.availableQty == -1 ? '': item.availableQty,
item.currentOutQty = item.currentOutQty == -1 ? '': item.currentOutQty,
this.getWare(item.goodsCode)
if(item.shId != '' && item.goodsId != '' && item.slId != ''){
this.getLocation(item.shId,item.goodsId,item.slId)
}
})
}
console.log('tableData============',this.tableData)
}, },
methods:{ list: {
closeDialog(val){ type: Array,
this.openShow = false default: [],
this.$emit('closeDialog',val) },
}, },
getWare(val){ data() {
getWarehouseList({ return {
goodsCode:val ? val : this.row.goodsCode openShow: false,
}).then(res =>{ tableData: [],
console.log('res-----------',res) currentRow: null,
this.wareList = res.data.data };
}) },
}, mounted() {
uniqueById(arr) { this.openShow = this.showDialog;
const seen = new Map(); this.init();
for (const item of arr) { },
if (!seen.has(item.slId)) { methods: {
seen.set(item.slId, item); handleCurrentChange(val) {
} this.currentRow = val;
} },
return Array.from(seen.values()); init() {
}, getStockByStorehouseAndGoods({ goodsCode: this.row.goodsCode }).then(res => {
getLocation(shId,goodsId,slId){ this.tableData = res.data.data;
getLocationData({ });
shId:shId ? shId : this.row.shId, },
goodsId:goodsId ? goodsId : this.row.goodsId closeDialog(val) {
}).then(res =>{ this.openShow = false;
let data = this.uniqueById(res.data.data.records) let query={
this.locationList = data ...val,
index: this.checkIndex,
getLocationData({ }
shId:shId ? shId : this.row.shId, this.$emit('closeDialog', query);
goodsId:goodsId ? goodsId : this.row.goodsId, },
slId:slId ? slId : this.row.slId submit() {
}).then(res =>{ console.log('this.currentRow', this.currentRow);
this.tableData[0].piNoList = res.data.data.records if (this.currentRow.currentOutQty >= 0) {
}) this.closeDialog(this.currentRow);
}) } else {
}, this.$message.error('请输入出库数量');
changeWare(val,index){ }
this.tableData[index].slId = ''
this.tableData[index].piNo = ''
this.tableData[index].availableQty = null
getLocationData({
shId:val,
goodsId:this.tableData[index].goodsId
}).then(res =>{
let data = this.uniqueById(res.data.data.records)
this.locationList = data
})
},
//
changeLocation(val,index){
// let tmp = this.locationList.find(item => item.location == val)
// this.tableData[index].currentStock = tmp.currentStock
this.tableData[index].piNo = ""
this.tableData[index].availableQty = null
getLocationData({
shId:this.tableData[index].shId,
goodsId:this.tableData[index].goodsId,
slId:val
}).then(res =>{
this.tableData[index].piNoList = res.data.data.records
})
},
//
changePiNo(val,index){
this.tableData[index].availableQty = null
let tmp = this.tableData[index].piNoList.find(item => item.piNo == val)
this.tableData[index].availableQty = tmp.quantity
this.tableData[index].rlsId = tmp.id
},
submit(){
// this.tableData.map(item =>{
// if(item.outQuantity > item.availableQty){
// this.$message.error('')
// return
// }
// })
//
const submitData = this.tableData.map(row => {
const { piNoList, ...validData } = row; //
return validData;
});
console.log(submitData)
let data = []
submitData.map(item =>{
data.push({
crId:item.id,
currentOutQty:item.currentOutQty,
rlsId:item.rlsId
})
})
console.log('data-----------',data)
batchIssue(data).then(res =>{
if(res.data.code === 200){ },
this.$message.success('出库成功') },
this.closeDialog(true) };
}
})
// editIssue(submitData).then(res =>{
// if(res.data.code === 200){
// this.$message.success('')
// this.closeDialog(true)
// }
// })
},
}
}
</script> </script>
<style> <style>
</style> </style>

@ -1,546 +1,453 @@
<template> <template>
<basic-container> <basic-container>
<!-- 领料出库 --> <!-- 领料出库 -->
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" <avue-crud
v-model:search="searchForm" :option="option"
@search-change="searchChange" @search-reset="searchReset" :before-open="beforeOpen" :table-loading="loading"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" :data="data"
@refresh-change="refreshChange" @on-load="onLoad" @row-save="rowSave"> v-model="form"
<template #menu-left> v-model:page="page"
<el-input v-model="checkCode" style="width: 240px;margin-right:24px" ref="crud"
@keyup.enter.native="changeCode" placeholder="请扫描提请单号" /> v-model:search="searchForm"
<el-button type="primary" @click="handleOut">出库</el-button> @search-change="searchChange"
</template> @search-reset="searchReset"
<template #menu="scope"> :before-open="beforeOpen"
<el-button type="text" @click="editRow(scope.row)">出库</el-button> @selection-change="selectionChange"
<el-button type="text" @click="completeRow(scope.row)">完成</el-button> @current-change="currentChange"
<el-button type="text" @click="deleteRow(scope.row)">删除</el-button> @size-change="sizeChange"
</template> @refresh-change="refreshChange"
<!-- <template #mtltmrk="{ row }">{{ row.coGoods.mtltmrk }}</template> @on-load="onLoad"
<template #checkoutCode="{ row }">{{ row.coGoods.checkoutCode }}</template> @row-save="rowSave"
<template #stRealtimeStock="{ row }">{{ row.stRealtimeStock.quantity }}</template> >
<template #userName="{ row }">{{ row.crMan.userName }}</template> <template #menu-left>
<template #unitName="{ row }">{{ row.coGoods.unitName }}</template> --> <el-input
</avue-crud> v-model="checkCode"
<editMaterial v-if="editDialog" :checkCode="checkCode" :show-dialog="editDialog" :row="checkRow" style="width: 240px; margin-right: 24px"
:list="selectionList" @closeDialog="closeDialog"></editMaterial> @keyup.enter.native="changeCode"
</basic-container> placeholder="请扫描提请单号"
/>
<el-button type="primary" @click="handleOut">出库</el-button>
</template>
<template #menu="scope">
<el-button type="text" @click="outRow(scope.row)">出库</el-button>
<el-button type="text" @click="completeRow(scope.row)">完成</el-button>
<el-button type="text" @click="deleteRow(scope.row)">删除</el-button>
</template>
<template #location="scope">
<el-button type="text" @click="editRow(scope.row, scope.row.$index)">{{
scope.row.location == '' ? '请选择库位' : scope.row.location
}}</el-button>
</template>
</avue-crud>
<editMaterial
v-if="editDialog"
:checkCode="checkCode"
:show-dialog="editDialog"
:row="checkRow"
:checkIndex="checkIndex"
:list="selectionList"
@closeDialog="closeDialog"
></editMaterial>
</basic-container>
</template> </template>
<script> <script>
import { getList,addIssue,delIssue,completeIssue } from "@/api/storeManagement/materialIssuing" import {
import editMaterial from "./components/editMaterial.vue" getList,
delIssue,
completeIssue,
batchIssue,
} from '@/api/storeManagement/materialIssuing';
import editMaterial from './components/editMaterial.vue';
export default { export default {
components:{ components: {
editMaterial editMaterial,
}, },
data() { data() {
return { return {
loading: false, loading: false,
editDialog:false, editDialog: false,
checkCode:"", checkCode: '',
tableData:[], tableData: [],
checkRow:{}, checkRow: {},
query:{}, checkIndex: 0,
data: [], query: {},
form: {}, data: [],
page: { form: {},
pageSize: 10, page: {
currentPage: 1, pageSize: 10,
total: 0, currentPage: 1,
}, total: 0,
selectionList: [], },
option: { selectionList: [],
columnSort: true, option: {
tip: false, columnSort: true,
height: 'auto', tip: false,
align: 'center', height: 'auto',
calcHeight: 32, align: 'center',
simplePage: false, calcHeight: 32,
searchShow: true, simplePage: false,
searchMenuSpan: 6, searchShow: true,
searchIcon: true, searchMenuSpan: 6,
searchIndex: 3, searchIcon: true,
tree: false, searchIndex: 3,
border: true, tree: false,
index: false, border: true,
selection: true, index: false,
viewBtn: false, selection: true,
delBtn: false, viewBtn: false,
editBtn: false, delBtn: false,
editBtnText: '修改', editBtn: false,
addBtn: false, editBtnText: '修改',
labelWidth: 140, addBtn: false,
menu: true, labelWidth: 140,
menuWidth: 150, menu: true,
dialogWidth: 1200, menuWidth: 150,
dialogClickModal: false, dialogWidth: 1200,
searchEnter: true, dialogClickModal: false,
excelBtn: true, searchEnter: true,
gridBtn: false, excelBtn: true,
searchShowBtn: false, gridBtn: false,
showOverflowTooltip: true, searchShowBtn: false,
searchLabelPosition: 'left', showOverflowTooltip: true,
searchLabelWidth: 'auto', searchLabelPosition: 'left',
searchGutter: 24, searchLabelWidth: 'auto',
searchSpan: 6, searchGutter: 24,
menuAlign: 'left', searchSpan: 6,
gridBtn: false, menuAlign: 'left',
searchMenuPosition: 'right', gridBtn: false,
addBtnIcon: ' ', searchMenuPosition: 'right',
viewBtnIcon: ' ', addBtnIcon: ' ',
delBtnIcon: ' ', viewBtnIcon: ' ',
editBtnIcon: ' ', delBtnIcon: ' ',
searchShowBtn: false, editBtnIcon: ' ',
searchShowBtn: false,
column: [
{
label: '提请单号',
prop: 'crCode',
span: 8,
overflow: true,
search: false,
width: 160,
},
{
label: '物料编号',
prop: 'goodsCode',
span: 8,
overflow: true,
search: true,
width: 160,
},
{
label: '物料名称',
prop: 'goodsName',
span: 8,
overflow: true,
width: 150,
search: true,
},
{
label: '型号/牌号',
prop: 'materialModel',
span: 8,
width: 100,
overflow: true,
search: false,
},
{
label: '规格',
prop: 'specifications',
span: 8,
overflow: true,
search: false,
width: 100,
},
{
label: '质量编号',
prop: 'checkCode',
span: 8,
overflow: true,
width: 150,
search: false,
},
{
label: '出库库位',
prop: 'location',
span: 8,
overflow: true,
width: 150,
search: false,
},
{
label: '库房',
prop: 'shName',
span: 8,
overflow: true,
width: 150,
search: false,
},
column: [ {
{ label: '批次号',
label: '提请单号', prop: 'piNo',
// addDisabled: true, span: 8,
prop: 'crCode', overflow: true,
span: 8, width: 150,
overflow: true, search: false,
search: false, },
// hide: false, {
// order: 17, label: '出库数量',
width:160, prop: 'currentOutQty',
rules: [ span: 8,
{ overflow: true,
required: true, width: 150,
message: '请输入提请单号', search: false,
trigger: 'blur', },
}, {
], label: '总库存',
}, prop: 'currentStock',
{ width: 100,
label: '物料编号', span: 8,
// addDisabled: true, overflow: true,
prop: 'goodsCode', search: false,
span: 8, },
overflow: true, {
search: true, label: '提请数量',
// hide: false, width: 100,
// order: 17, prop: 'quantity',
width:160, span: 8,
rules: [ overflow: true,
{ search: false,
required: true, },
message: '请输入物料编号', {
trigger: 'blur', label: '计量单位',
}, prop: 'unitName',
], width: 100,
}, span: 8,
{ overflow: true,
label: '物料名称', search: false,
prop: 'goodsName', },
span: 8,
overflow: true,
width:150,
search: true,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入物料名称',
trigger: 'blur',
},
],
},
{
label: '型号/牌号',
prop: 'materialModel',
span: 8,
width:100,
overflow: true,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入型号/牌号',
trigger: 'blur',
},
],
},
{
label: '规格',
prop: 'specifications',
span: 8,
overflow: true,
search: false,
width:100,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入规格',
trigger: 'blur',
},
],
},
{
label: '质量编号',
prop: 'checkCode',
span: 8,
overflow: true,
width:150,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入质量编号',
trigger: 'blur',
},
],
},
{
label: '总库存',
prop: 'currentStock',
width:100,
span: 8,
overflow: true,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入总库存',
trigger: 'blur',
},
],
},
{
label: '提请数量',
width:100,
prop: 'quantity',
span: 8,
overflow: true,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入提请数量',
trigger: 'blur',
},
],
},
{
label: '计量单位',
prop: 'unitName',
width:100,
span: 8,
overflow: true,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入单位',
trigger: 'blur',
},
],
},
// {
// label: '',
// prop: 'shName',
// span: 8,
// overflow: true,
// search: false,
// width:100,
// // hide: false,
// // order: 17,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// },
// {
// label: '',
// prop: 'location',
// span: 8,
// overflow: true,
// search: false,
// width:100,
// // hide: false,
// // order: 17,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// },
// {
// label: '',
// prop: 'piNo',
// span: 8,
// overflow: true,
// width:100,
// search: false,
// // hide: false,
// // order: 17,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// },
{
label: '待提请数量',
prop: 'pendingApplyQty',
span: 8,
overflow: true,
width:100,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入出库数量',
trigger: 'blur',
},
],
},
{
label: '已提请数量',
prop: 'outQuantity',
span: 8,
overflow: true,
width:100,
search: false,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入出库数量',
trigger: 'blur',
},
],
},
// {
// label: '',
// prop: 'currentOutQty',
// span: 8,
// overflow: true,
// width:120,
// search: false,
// // hide: false,
// // order: 17,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// },
{
label: '提请人',
prop: 'crManName',
span: 8,
overflow: true,
width:100,
search: true,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入提请人',
trigger: 'blur',
},
],
},
{
label: '提请日期',
prop: 'crDate',
type: 'date',
valueFormat:"YYYY-MM-DD",
format:"YYYY-MM-DD",
searchRange: true,
startPlaceholder: '开始时间',
endPlaceholder: "结束时间",
span: 8,
overflow: true,
search: true,
width:180,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入提请日期',
trigger: 'blur',
},
],
},
{
label: '备注',
prop: 'memo',
span: 8,
overflow: true,
search: false,
width:130,
// hide: false,
// order: 17,
rules: [
{
required: true,
message: '请输入备注',
trigger: 'blur',
},
],
},
] {
}, label: '待提请数量',
searchForm:{} prop: 'pendingApplyQty',
} span: 8,
overflow: true,
width: 100,
search: false,
},
{
label: '已提请数量',
prop: 'outQuantity',
span: 8,
overflow: true,
width: 100,
search: false,
},
{
label: '提请人',
prop: 'crManName',
span: 8,
overflow: true,
width: 100,
search: true,
},
{
label: '提请日期',
prop: 'crDate',
type: 'date',
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
searchRange: true,
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
span: 8,
overflow: true,
search: true,
width: 180,
},
{
label: '备注',
prop: 'memo',
span: 8,
overflow: true,
search: false,
width: 130,
},
],
},
searchForm: {},
};
},
created() {
if (JSON.stringify(this.$store.state.client.exchangeOutParams) !== '{}') {
this.query = this.$store.state.client.exchangeOutParams;
this.searchForm = this.$store.state.client.exchangeOutParams;
}
},
methods: {
changeCode(val) {
if (this.checkCode == '') return;
this.query.crCode = this.checkCode;
this.onLoad();
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.$store.dispatch('changeSetting', {
title: 'exchangeOutParams',
form: this.query,
});
this.onLoad();
done();
},
searchReset() {
this.query = {};
this.$store.dispatch('changeSetting', {
title: 'exchangeOutParams',
form: this.query,
});
this.onLoad();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
}, },
created() { //
if (JSON.stringify(this.$store.state.client.exchangeOutParams) !== "{}") { selectionChange(list) {
this.query = this.$store.state.client.exchangeOutParams; this.selectionList = list;
this.searchForm = this.$store.state.client.exchangeOutParams;
}
}, },
methods: { //
changeCode(val){ editRow(row, index) {
if(this.checkCode == "") return this.checkIndex = index;
this.query.crCode = this.checkCode this.selectionList = [];
this.onLoad() this.checkRow = row;
}, this.editDialog = true;
searchChange(params, done){ },
this.query = params //
this.page.currentPage = 1 outRow(row) {
this.$store.dispatch("changeSetting", { if (row.rlsId == -1 || row.rlsId == null) {
title: "exchangeOutParams", this.$message.error('请先选择需要出库的库位信息!');
form: this.query, return false;
}); }
this.onLoad() this.$confirm('确定此条数据是否出库?', {
done() confirmButtonText: '确定',
}, cancelButtonText: '取消',
searchReset(){ type: 'warning',
this.query = {} }).then(() => {
this.$store.dispatch("changeSetting", { let query = [
title: "exchangeOutParams", {
form: this.query, crId: row.id,
}); currentOutQty: row.currentOutQty,
this.onLoad() rlsId: row.rlsId,
}, },
currentChange(currentPage){ ];
this.page.currentPage = currentPage batchIssue(query).then(res => {
}, this.$message.success('出库成功');
sizeChange(pageSize){ this.onLoad(this.page, this.query);
this.page.pageSize = pageSize });
}, });
// },
selectionChange(list) { //
this.selectionList = list; completeRow(row) {
}, this.$confirm('确定完成此条数据?', {
// confirmButtonText: '确定',
editRow(row){ cancelButtonText: '取消',
this.selectionList = [] type: 'warning',
this.checkRow = row }).then(() => {
this.editDialog = true completeIssue({ id: row.id }).then(res => {
}, if (res.data.code == 200) {
// this.$message.success('完成成功');
completeRow(row){ this.onLoad();
this.$confirm('确定完成此条数据?', { }
confirmButtonText: '确定', });
cancelButtonText: '取消', });
type: 'warning', },
}).then(() => { //
completeIssue({id:row.id}).then(res =>{ deleteRow(row) {
if(res.data.code == 200){ this.$confirm('确定删除此条数据?', {
this.$message.success('完成成功') confirmButtonText: '确定',
this.onLoad() cancelButtonText: '取消',
} type: 'warning',
}) }).then(() => {
}) delIssue({ ids: row.id }).then(res => {
}, if (res.data.code == 200) {
// this.$message.success('删除成功');
deleteRow(row){ this.onLoad();
this.$confirm('确定删除此条数据?', { }
confirmButtonText: '确定', });
cancelButtonText: '取消', });
type: 'warning', },
}).then(() => { //
delIssue({ids:row.id}).then(res =>{ handleOut() {
if(res.data.code == 200){ if (this.selectionList.length == 0) {
this.$message.success('删除成功') this.$message.error('请至少选择一条数据');
this.onLoad() return;
} }
}) const unselectedItem = this.selectionList.find(
}) item => !item.rlsId || item.rlsId === -1 || item.rlsId === ''
}, );
//
handleOut() {
if(this.selectionList.length == 0){
this.$message.error('请至少选择一条数据')
return
}
let tmp = this.selectionList.find(item => item.已出库数量 > item.quantity)
if(tmp){
this.$message.error('已出库数量大于提请数量,不能出库')
return
}
this.checkRow = {}
this.editDialog = true
// this.$confirm('?', { if (unselectedItem) {
// confirmButtonText: '', this.$message.error(`物料【${unselectedItem.goodsName}】未选择出库库位,请先选择!`);
// cancelButtonText: '', return;
// type: 'warning', }
// }).then(() => { // 🔥 3.
// addIssue(this.selectionList.map(item => item.id)).then(res =>{ const params = this.selectionList.map(item => ({
// if(res.data.code == 200){ crId: item.id, // ID
// this.$message.success('') currentOutQty: item.currentOutQty, //
// this.onLoad() rlsId: item.rlsId, // ID
// } }));
// }) this.$confirm(`确定对选中的 ${this.selectionList.length} 条数据进行出库操作?`, {
// }) confirmButtonText: '确定',
}, cancelButtonText: '取消',
closeDialog(val){ type: 'warning',
this.editDialog = false }).then(() => {
if(val){ batchIssue(params).then(res => {
this.onLoad() this.$message.success('批量出库成功');
} this.onLoad(); //
}, this.selectionList = []; // ( avue-crud )
onLoad() { });
this.loading = true });
console.log('query==============',this.query) },
let params = { closeDialog(val) {
...this.query, this.editDialog = false;
startCrDate:this.query && this.query.crDate && this.query.crDate.length > 0 && this.query.crDate[0], this.data[val.index].shId = val.shId;
endCrDate:this.query && this.query.crDate && this.query.crDate.length > 0 && this.query.crDate[1], this.data[val.index].shName = val.shName;
} this.data[val.index].slId = val.slId;
if(params.crDate) delete params.crDate this.data[val.index].location = val.location;
getList({ this.data[val.index].piNo = val.piNo;
current:this.page.currentPage, this.data[val.index].currentOutQty = val.currentOutQty;
size:this.page.pageSize, this.data[val.index].rlsId = val.id;
...params
}).then(res =>{ },
this.data = res.data.data.records onLoad() {
this.page.total = res.data.data.total this.loading = true;
this.loading = false let params = {
}) ...this.query,
} startCrDate:
} this.query && this.query.crDate && this.query.crDate.length > 0 && this.query.crDate[0],
} endCrDate:
this.query && this.query.crDate && this.query.crDate.length > 0 && this.query.crDate[1],
};
if (params.crDate) delete params.crDate;
getList({
current: this.page.currentPage,
size: this.page.pageSize,
...params,
}).then(res => {
this.data = res.data.data.records;
this.data.forEach((item, index) => {
item.currentOutQty = item.pendingApplyQty;
});
this.page.total = res.data.data.total;
this.loading = false;
});
},
},
};
</script> </script>
Loading…
Cancel
Save