|
|
|
|
@ -40,9 +40,16 @@
|
|
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
|
|
v-hasPermi="['wms:outorder:export']">导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="success" plain icon="el-icon-edit" size="mini" @click="clickShowPostingList('ZC')">转储过账</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="success" plain icon="el-icon-edit" size="mini" @click="clickShowPostingList('X')">反冲过账</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table v-loading="loading" :data="outorderList" @selection-change="handleSelectionChange"
|
|
|
|
|
:selectable="checkSelectable"
|
|
|
|
|
:tree-props="{ children: 'list', hasChildren: 'hasChildren' }" row-key="id" border :default-expand-all="false">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="序号" type="index" v-if="false" />
|
|
|
|
|
@ -168,6 +175,39 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 过账列表对话框 -->
|
|
|
|
|
<el-dialog title="过账" :visible.sync="showPostingList" width="1200px" append-to-body>
|
|
|
|
|
<el-table :data="orderList" row-key="id" border >
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="materialCode" width="150">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ formatProductCode(scope.row.materialCode) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="materialDesc"/>
|
|
|
|
|
<el-table-column label="计划数量" align="center" prop="planNumber" width="150"/>
|
|
|
|
|
<el-table-column label="出库数量" align="center" prop="outNumber" width="150" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.outNumber" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="反冲标识" align="center" prop="userDefined3" width="150"/>
|
|
|
|
|
<el-table-column label="操作" align="center" prop="option" width="180">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="mini" type="danger" @click="deletePosting(scope.$index)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitPostingForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelPostingForm">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -182,7 +222,7 @@ import {
|
|
|
|
|
OutboundPostingSAP,
|
|
|
|
|
OutboundPostingzcSAP,
|
|
|
|
|
listOutorderZC,
|
|
|
|
|
listOutorderZU
|
|
|
|
|
listOutorderZU, submitReversePosting, submitTransferPosting
|
|
|
|
|
} from '@/api/wms/outorderfc'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
@ -438,6 +478,9 @@ export default {
|
|
|
|
|
stationNo: '',
|
|
|
|
|
addoutorderList: [],
|
|
|
|
|
produceCodeTEM: '',
|
|
|
|
|
orderList:[],
|
|
|
|
|
postingType:undefined,
|
|
|
|
|
showPostingList:false
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -702,6 +745,82 @@ export default {
|
|
|
|
|
this.download('wms/outorder/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `outorder_${new Date().getTime()}.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
checkSelectable(item){
|
|
|
|
|
return item.userDefined10 !== '2'
|
|
|
|
|
},
|
|
|
|
|
clickShowPostingList(postingType){
|
|
|
|
|
const orderList = this.selectabletrows
|
|
|
|
|
//只取未过账物料
|
|
|
|
|
for (const order of orderList){
|
|
|
|
|
if (order.userDefined10 !== '2'){
|
|
|
|
|
this.orderList.push(order)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.orderList.length === 0){
|
|
|
|
|
this.$modal.msgError("请选择物料!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.postingType = postingType
|
|
|
|
|
this.showPostingList = true
|
|
|
|
|
},
|
|
|
|
|
deletePosting(index){
|
|
|
|
|
this.orderList.splice(index, 1);
|
|
|
|
|
this.$message.success("删除成功!");
|
|
|
|
|
},
|
|
|
|
|
submitPostingForm(){
|
|
|
|
|
|
|
|
|
|
if (this.orderList.length === 0){
|
|
|
|
|
this.$message.error("请选择过账物料!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const item of this.orderList){
|
|
|
|
|
if (!item.outNumber || item.outNumber+"" === "0"){
|
|
|
|
|
this.$message.error("物料名称:"+item.materialDesc+"的出库数量为0!");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.userDefined3 !== this.postingType){
|
|
|
|
|
if (this.postingType === "ZC"){
|
|
|
|
|
this.$message.error("物料名称:"+item.materialDesc+"为反冲物料!");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.postingType === "X"){
|
|
|
|
|
this.$message.error("物料名称:"+item.materialDesc+"不是反冲物料!");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.postingType === "ZC"){
|
|
|
|
|
submitTransferPosting(this.orderList).then(res=>{
|
|
|
|
|
if (res.code === 200){
|
|
|
|
|
this.$message.success("操作成功!");
|
|
|
|
|
}
|
|
|
|
|
}).finally(()=>{
|
|
|
|
|
this.showPostingList = false;
|
|
|
|
|
this.orderList = []
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.postingType === "X"){
|
|
|
|
|
submitReversePosting(this.orderList).then(res=>{
|
|
|
|
|
if (res.code === 200){
|
|
|
|
|
this.$message.success("操作成功!");
|
|
|
|
|
}
|
|
|
|
|
}).finally(()=>{
|
|
|
|
|
this.showPostingList = false;
|
|
|
|
|
this.orderList = []
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
cancelPostingForm(){
|
|
|
|
|
this.showPostingList = false;
|
|
|
|
|
this.orderList = []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|