包材领料新增转储过账和反冲过账

master
FCD 2 weeks ago
parent 9ce92ddd31
commit 73a4a6732e

@ -248,3 +248,19 @@ export function batchSapTl(data) {
data: data
});
}
export function submitTransferPosting(data) {
return request({
url: '/wms/outorder/submitTransferPosting',
method: 'post',
data: data
});
}
export function submitReversePosting(data) {
return request({
url: '/wms/outorder/submitReversePosting',
method: 'post',
data: data
});
}

@ -731,7 +731,7 @@ export default {
this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false
this.generateBarcode(this.printData.productDate); //
this.generateBarcode("ZC_"+this.printData.productDate); //
})
},
}

@ -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,7 +175,40 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
<!-- 过账列表对话框 -->
<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>
<script>
@ -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,7 +745,83 @@ 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 = []
}
}
};
</script>

Loading…
Cancel
Save