parent
752f7e709c
commit
537b85c505
2 changed files with 523 additions and 738 deletions
@ -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, |
||||||
|
}, |
||||||
|
|
||||||
|
{ |
||||||
|
label: '批次号', |
||||||
|
prop: 'piNo', |
||||||
|
span: 8, |
||||||
|
overflow: true, |
||||||
|
width: 150, |
||||||
|
search: false, |
||||||
|
}, |
||||||
|
{ |
||||||
|
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, |
||||||
|
prop: 'quantity', |
||||||
|
span: 8, |
||||||
|
overflow: true, |
||||||
|
search: false, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '计量单位', |
||||||
|
prop: 'unitName', |
||||||
|
width: 100, |
||||||
|
span: 8, |
||||||
|
overflow: true, |
||||||
|
search: false, |
||||||
|
}, |
||||||
|
|
||||||
column: [ |
{ |
||||||
{ |
label: '待提请数量', |
||||||
label: '提请单号', |
prop: 'pendingApplyQty', |
||||||
// addDisabled: true, |
span: 8, |
||||||
prop: 'crCode', |
overflow: true, |
||||||
span: 8, |
width: 100, |
||||||
overflow: true, |
search: false, |
||||||
search: false, |
}, |
||||||
// hide: false, |
{ |
||||||
// order: 17, |
label: '已提请数量', |
||||||
width:160, |
prop: 'outQuantity', |
||||||
rules: [ |
span: 8, |
||||||
{ |
overflow: true, |
||||||
required: true, |
width: 100, |
||||||
message: '请输入提请单号', |
search: false, |
||||||
trigger: 'blur', |
}, |
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '物料编号', |
|
||||||
// addDisabled: true, |
|
||||||
prop: 'goodsCode', |
|
||||||
span: 8, |
|
||||||
overflow: true, |
|
||||||
search: true, |
|
||||||
// hide: false, |
|
||||||
// order: 17, |
|
||||||
width:160, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入物料编号', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '物料名称', |
|
||||||
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: '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; |
||||||
|
}, |
||||||
|
// 多选 |
||||||
|
selectionChange(list) { |
||||||
|
this.selectionList = list; |
||||||
}, |
}, |
||||||
created() { |
// 选择库存数据 |
||||||
if (JSON.stringify(this.$store.state.client.exchangeOutParams) !== "{}") { |
editRow(row, index) { |
||||||
this.query = this.$store.state.client.exchangeOutParams; |
this.checkIndex = index; |
||||||
this.searchForm = this.$store.state.client.exchangeOutParams; |
this.selectionList = []; |
||||||
} |
this.checkRow = row; |
||||||
|
this.editDialog = true; |
||||||
}, |
}, |
||||||
methods: { |
// 出库 |
||||||
changeCode(val){ |
outRow(row) { |
||||||
if(this.checkCode == "") return |
if (row.rlsId == -1 || row.rlsId == null) { |
||||||
this.query.crCode = this.checkCode |
this.$message.error('请先选择需要出库的库位信息!'); |
||||||
this.onLoad() |
return false; |
||||||
}, |
} |
||||||
searchChange(params, done){ |
this.$confirm('确定此条数据是否出库?', { |
||||||
this.query = params |
confirmButtonText: '确定', |
||||||
this.page.currentPage = 1 |
cancelButtonText: '取消', |
||||||
this.$store.dispatch("changeSetting", { |
type: 'warning', |
||||||
title: "exchangeOutParams", |
}).then(() => { |
||||||
form: this.query, |
let query = [ |
||||||
}); |
{ |
||||||
this.onLoad() |
crId: row.id, |
||||||
done() |
currentOutQty: row.currentOutQty, |
||||||
}, |
rlsId: row.rlsId, |
||||||
searchReset(){ |
}, |
||||||
this.query = {} |
]; |
||||||
this.$store.dispatch("changeSetting", { |
batchIssue(query).then(res => { |
||||||
title: "exchangeOutParams", |
this.$message.success('出库成功'); |
||||||
form: this.query, |
this.onLoad(this.page, this.query); |
||||||
}); |
}); |
||||||
this.onLoad() |
}); |
||||||
}, |
}, |
||||||
currentChange(currentPage){ |
// 完成 |
||||||
this.page.currentPage = currentPage |
completeRow(row) { |
||||||
}, |
this.$confirm('确定完成此条数据?', { |
||||||
sizeChange(pageSize){ |
confirmButtonText: '确定', |
||||||
this.page.pageSize = pageSize |
cancelButtonText: '取消', |
||||||
}, |
type: 'warning', |
||||||
// 多选 |
}).then(() => { |
||||||
selectionChange(list) { |
completeIssue({ id: row.id }).then(res => { |
||||||
this.selectionList = list; |
if (res.data.code == 200) { |
||||||
}, |
this.$message.success('完成成功'); |
||||||
// 修改 |
this.onLoad(); |
||||||
editRow(row){ |
} |
||||||
this.selectionList = [] |
}); |
||||||
this.checkRow = row |
}); |
||||||
this.editDialog = true |
}, |
||||||
}, |
// 删除 |
||||||
// 完成 |
deleteRow(row) { |
||||||
completeRow(row){ |
this.$confirm('确定删除此条数据?', { |
||||||
this.$confirm('确定完成此条数据?', { |
confirmButtonText: '确定', |
||||||
confirmButtonText: '确定', |
cancelButtonText: '取消', |
||||||
cancelButtonText: '取消', |
type: 'warning', |
||||||
type: 'warning', |
}).then(() => { |
||||||
}).then(() => { |
delIssue({ ids: row.id }).then(res => { |
||||||
completeIssue({id:row.id}).then(res =>{ |
if (res.data.code == 200) { |
||||||
if(res.data.code == 200){ |
this.$message.success('删除成功'); |
||||||
this.$message.success('完成成功') |
this.onLoad(); |
||||||
this.onLoad() |
} |
||||||
} |
}); |
||||||
}) |
}); |
||||||
}) |
}, |
||||||
}, |
// 批量出库 |
||||||
// 删除 |
handleOut() { |
||||||
deleteRow(row){ |
if (this.selectionList.length == 0) { |
||||||
this.$confirm('确定删除此条数据?', { |
this.$message.error('请至少选择一条数据'); |
||||||
confirmButtonText: '确定', |
return; |
||||||
cancelButtonText: '取消', |
} |
||||||
type: 'warning', |
const unselectedItem = this.selectionList.find( |
||||||
}).then(() => { |
item => !item.rlsId || item.rlsId === -1 || item.rlsId === '' |
||||||
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 |
|
||||||
} |
|
||||||
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…
Reference in new issue