|
|
|
|
@ -1,46 +1,76 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<!-- 领料出库 --> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
|
|
|
|
<avue-crud |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="page" |
|
|
|
|
ref="crud" |
|
|
|
|
v-model:search="searchForm" |
|
|
|
|
@search-change="searchChange" @search-reset="searchReset" :before-open="beforeOpen" |
|
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" @on-load="onLoad" @row-save="rowSave"> |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-input v-model="checkCode" style="width: 240px;margin-right:24px" |
|
|
|
|
@keyup.enter.native="changeCode" placeholder="请扫描提请单号" /> |
|
|
|
|
<el-input |
|
|
|
|
v-model="checkCode" |
|
|
|
|
style="width: 240px; margin-right: 24px" |
|
|
|
|
@keyup.enter.native="changeCode" |
|
|
|
|
placeholder="请扫描提请单号" |
|
|
|
|
/> |
|
|
|
|
<el-button type="primary" @click="handleOut">出库</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="scope"> |
|
|
|
|
<el-button type="text" @click="editRow(scope.row)">出库</el-button> |
|
|
|
|
<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 #mtltmrk="{ row }">{{ row.coGoods.mtltmrk }}</template> |
|
|
|
|
<template #checkoutCode="{ row }">{{ row.coGoods.checkoutCode }}</template> |
|
|
|
|
<template #stRealtimeStock="{ row }">{{ row.stRealtimeStock.quantity }}</template> |
|
|
|
|
<template #userName="{ row }">{{ row.crMan.userName }}</template> |
|
|
|
|
<template #unitName="{ row }">{{ row.coGoods.unitName }}</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" |
|
|
|
|
:list="selectionList" @closeDialog="closeDialog"></editMaterial> |
|
|
|
|
<editMaterial |
|
|
|
|
v-if="editDialog" |
|
|
|
|
:checkCode="checkCode" |
|
|
|
|
:show-dialog="editDialog" |
|
|
|
|
:row="checkRow" |
|
|
|
|
:checkIndex="checkIndex" |
|
|
|
|
:list="selectionList" |
|
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
></editMaterial> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { getList,addIssue,delIssue,completeIssue } from "@/api/storeManagement/materialIssuing" |
|
|
|
|
import editMaterial from "./components/editMaterial.vue" |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
delIssue, |
|
|
|
|
completeIssue, |
|
|
|
|
batchIssue, |
|
|
|
|
} from '@/api/storeManagement/materialIssuing'; |
|
|
|
|
import editMaterial from './components/editMaterial.vue'; |
|
|
|
|
export default { |
|
|
|
|
components:{ |
|
|
|
|
editMaterial |
|
|
|
|
components: { |
|
|
|
|
editMaterial, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
editDialog:false, |
|
|
|
|
checkCode:"", |
|
|
|
|
tableData:[], |
|
|
|
|
checkRow:{}, |
|
|
|
|
query:{}, |
|
|
|
|
editDialog: false, |
|
|
|
|
checkCode: '', |
|
|
|
|
tableData: [], |
|
|
|
|
checkRow: {}, |
|
|
|
|
checkIndex: 0, |
|
|
|
|
query: {}, |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
page: { |
|
|
|
|
@ -95,73 +125,35 @@ export default { |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '提请单号', |
|
|
|
|
// addDisabled: true, |
|
|
|
|
prop: 'crCode', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
width:160, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入提请单号', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
width: 160, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '物料编号', |
|
|
|
|
// addDisabled: true, |
|
|
|
|
prop: 'goodsCode', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
width:160, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入物料编号', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
width: 160, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '物料名称', |
|
|
|
|
prop: 'goodsName', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width:150, |
|
|
|
|
width: 150, |
|
|
|
|
search: true, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入物料名称', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '型号/牌号', |
|
|
|
|
prop: 'materialModel', |
|
|
|
|
span: 8, |
|
|
|
|
width:100, |
|
|
|
|
width: 100, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入型号/牌号', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '规格', |
|
|
|
|
@ -169,226 +161,112 @@ export default { |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
width:100, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入规格', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
width: 100, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '质量编号', |
|
|
|
|
prop: 'checkCode', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width:150, |
|
|
|
|
width: 150, |
|
|
|
|
search: false, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入质量编号', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
label: '出库库位', |
|
|
|
|
prop: 'location', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width: 150, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
{ |
|
|
|
|
label: '库房', |
|
|
|
|
prop: 'shName', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width: 150, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
label: '总库存', |
|
|
|
|
prop: 'currentStock', |
|
|
|
|
width:100, |
|
|
|
|
label: '批次号', |
|
|
|
|
prop: 'piNo', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width: 150, |
|
|
|
|
search: false, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入总库存', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
label: '出库数量', |
|
|
|
|
prop: 'currentOutQty', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width: 150, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
{ |
|
|
|
|
label: '总库存', |
|
|
|
|
prop: 'currentStock', |
|
|
|
|
width: 100, |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '提请数量', |
|
|
|
|
width:100, |
|
|
|
|
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, |
|
|
|
|
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, |
|
|
|
|
width: 100, |
|
|
|
|
search: false, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入出库数量', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '已提请数量', |
|
|
|
|
prop: 'outQuantity', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
width:100, |
|
|
|
|
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, |
|
|
|
|
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", |
|
|
|
|
valueFormat: 'YYYY-MM-DD', |
|
|
|
|
format: 'YYYY-MM-DD', |
|
|
|
|
searchRange: true, |
|
|
|
|
startPlaceholder: '开始时间', |
|
|
|
|
endPlaceholder: "结束时间", |
|
|
|
|
endPlaceholder: '结束时间', |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
width:180, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入提请日期', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
width: 180, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
@ -396,151 +274,180 @@ export default { |
|
|
|
|
span: 8, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
width:130, |
|
|
|
|
// hide: false, |
|
|
|
|
// order: 17, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入备注', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
width: 130, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
searchForm:{} |
|
|
|
|
} |
|
|
|
|
searchForm: {}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
if (JSON.stringify(this.$store.state.client.exchangeOutParams) !== "{}") { |
|
|
|
|
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", |
|
|
|
|
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() |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset(){ |
|
|
|
|
this.query = {} |
|
|
|
|
this.$store.dispatch("changeSetting", { |
|
|
|
|
title: "exchangeOutParams", |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.$store.dispatch('changeSetting', { |
|
|
|
|
title: 'exchangeOutParams', |
|
|
|
|
form: this.query, |
|
|
|
|
}); |
|
|
|
|
this.onLoad() |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage){ |
|
|
|
|
this.page.currentPage = currentPage |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
}, |
|
|
|
|
sizeChange(pageSize){ |
|
|
|
|
this.page.pageSize = pageSize |
|
|
|
|
sizeChange(pageSize) { |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
}, |
|
|
|
|
// 多选 |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
// 修改 |
|
|
|
|
editRow(row){ |
|
|
|
|
this.selectionList = [] |
|
|
|
|
this.checkRow = row |
|
|
|
|
this.editDialog = true |
|
|
|
|
// 选择库存数据 |
|
|
|
|
editRow(row, index) { |
|
|
|
|
this.checkIndex = index; |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.checkRow = row; |
|
|
|
|
this.editDialog = true; |
|
|
|
|
}, |
|
|
|
|
// 出库 |
|
|
|
|
outRow(row) { |
|
|
|
|
if (row.rlsId == -1 || row.rlsId == null) { |
|
|
|
|
this.$message.error('请先选择需要出库的库位信息!'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
this.$confirm('确定此条数据是否出库?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
let query = [ |
|
|
|
|
{ |
|
|
|
|
crId: row.id, |
|
|
|
|
currentOutQty: row.currentOutQty, |
|
|
|
|
rlsId: row.rlsId, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
batchIssue(query).then(res => { |
|
|
|
|
this.$message.success('出库成功'); |
|
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 完成 |
|
|
|
|
completeRow(row){ |
|
|
|
|
completeRow(row) { |
|
|
|
|
this.$confirm('确定完成此条数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
completeIssue({id:row.id}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('完成成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
completeIssue({ id: row.id }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('完成成功'); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 删除 |
|
|
|
|
deleteRow(row){ |
|
|
|
|
deleteRow(row) { |
|
|
|
|
this.$confirm('确定删除此条数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
delIssue({ids:row.id}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
delIssue({ ids: row.id }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 批量出库 |
|
|
|
|
handleOut() { |
|
|
|
|
if(this.selectionList.length == 0){ |
|
|
|
|
this.$message.error('请至少选择一条数据') |
|
|
|
|
return |
|
|
|
|
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 |
|
|
|
|
const unselectedItem = this.selectionList.find( |
|
|
|
|
item => !item.rlsId || item.rlsId === -1 || item.rlsId === '' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// this.$confirm('确定对已选择的数据进行出库?', { |
|
|
|
|
// confirmButtonText: '确定', |
|
|
|
|
// cancelButtonText: '取消', |
|
|
|
|
// type: 'warning', |
|
|
|
|
// }).then(() => { |
|
|
|
|
// addIssue(this.selectionList.map(item => item.id)).then(res =>{ |
|
|
|
|
// if(res.data.code == 200){ |
|
|
|
|
// this.$message.success('出库成功') |
|
|
|
|
// this.onLoad() |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
closeDialog(val){ |
|
|
|
|
this.editDialog = false |
|
|
|
|
if(val){ |
|
|
|
|
this.onLoad() |
|
|
|
|
if (unselectedItem) { |
|
|
|
|
this.$message.error(`物料【${unselectedItem.goodsName}】未选择出库库位,请先选择!`); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 🔥 3. 构造批量提交参数 |
|
|
|
|
const params = this.selectionList.map(item => ({ |
|
|
|
|
crId: item.id, // 提请单明细ID |
|
|
|
|
currentOutQty: item.currentOutQty, // 本次出库数量 |
|
|
|
|
rlsId: item.rlsId, // 库位库存ID |
|
|
|
|
})); |
|
|
|
|
this.$confirm(`确定对选中的 ${this.selectionList.length} 条数据进行出库操作?`, { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
batchIssue(params).then(res => { |
|
|
|
|
this.$message.success('批量出库成功'); |
|
|
|
|
this.onLoad(); // 刷新列表 |
|
|
|
|
this.selectionList = []; // 清空选中状态 (如果 avue-crud 支持自动清空可省略) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
closeDialog(val) { |
|
|
|
|
this.editDialog = false; |
|
|
|
|
this.data[val.index].shId = val.shId; |
|
|
|
|
this.data[val.index].shName = val.shName; |
|
|
|
|
this.data[val.index].slId = val.slId; |
|
|
|
|
this.data[val.index].location = val.location; |
|
|
|
|
this.data[val.index].piNo = val.piNo; |
|
|
|
|
this.data[val.index].currentOutQty = val.currentOutQty; |
|
|
|
|
this.data[val.index].rlsId = val.id; |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
this.loading = true |
|
|
|
|
console.log('query==============',this.query) |
|
|
|
|
this.loading = true; |
|
|
|
|
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 |
|
|
|
|
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.page.total = res.data.data.total |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
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> |