报工页面的sap收货按钮,和成品入库页面的过账按钮修改

yangwl
mengjiao 1 year ago
parent 602238af10
commit c10ab0052d

@ -191,6 +191,23 @@ export function getReportList(query) {
params: query
});
}
// 查询报工详细列表
export function getCKList(data) {
return request({
url: '/wms/order/listCKT',
method: 'post',
params: data
});
}
//查询报工详细列表+SAP收货状态
export function getReportSAPList(query) {
return request({
url: '/wms/put/getReportListSap',
method: 'get',
params: query
});
}
// 提交报工详细列表
export function submitReportPS(data) {
return request({
@ -199,7 +216,14 @@ export function submitReportPS(data) {
data: data
});
}
// SAP收货
export function submitReportPSSAP(data) {
return request({
url: '/wms/put/addReportListSap',
method: 'post',
data: data
});
}
// 查询物料管理列表
export function getPrepareList(query) {
return request({

@ -71,6 +71,7 @@
v-hasPermi="['mes:reportWork:add']"
>新增</el-button>
</el-col>
<!--<el-col :span="1.5">
<el-button
type="success"
@ -137,6 +138,17 @@
v-hasPermi="['mes:reportWork:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddSAP"
>SAP收货</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -213,7 +225,7 @@
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="批次编码" prop="batch">
@ -273,7 +285,7 @@
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-col>
<el-col :span="6">
<el-form-item label="结束报工" prop="endReport">
<el-radio v-model="form.endReport" label="0"></el-radio>
@ -429,13 +441,13 @@
<el-table-column label="id" align="center" prop="id" v-if="false"/>
<el-table-column label="工单编码" width="150" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="工时数" align="center" prop="workTime">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.workTime" @change="handleEdit(scope.$index,scope.row)"></el-input>
@ -458,13 +470,13 @@
<el-table-column label="id" align="center" prop="id" v-if="false"/>
<el-table-column label="工单编码" width="150" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="工时数" align="center" prop="workTime">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.workTime" @change="handleEdit(scope.$index,scope.row)"></el-input>
@ -493,9 +505,9 @@
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="recordId" align="center" prop="recordId" v-if="false"/>
<el-table-column label="工单编码" width="140" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="消耗数量" width="120" align="left" prop="quantity" :show-overflow-tooltip="true" >
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="消耗数量" width="120" align="left" prop="quantity" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantity" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
@ -510,9 +522,9 @@
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="recordId" align="center" prop="recordId" v-if="false"/>
<el-table-column label="工单编码" width="140" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="消耗数量" width="120" align="left" prop="quantity" :show-overflow-tooltip="true" >
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="消耗数量" width="120" align="left" prop="quantity" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantity" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
@ -524,13 +536,69 @@
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button>
<el-button type="primary" @click="submitConsume" v-else> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--母工单---->
<!-- SAP收货 -->
<el-dialog :title="titleReport" :visible.sync="openReportSAP" width="1200px">
<el-select v-model="selectedWarehouse" placeholder="请选择仓库">
<el-option v-for="warehouse in warehouseList" :key="warehouse.warehouseCode" :label="warehouse.warehouseName" :value="warehouse.warehouseCode"></el-option>
</el-select>
<el-tabs v-model="activeName" >
<el-tab-pane label="母工单报工信息" name="pOrder">
<el-table v-loading="loading" :data="pOrderTableList" ref="myPOrderTable" @selection-change="pReportSelection"
:summary-method="getSummaries"
show-summary
>
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="id" align="center" prop="id" v-if="false"/>
<el-table-column label="SAP工单编码" width="250" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true" />
<el-table-column label="工单编码" width="150" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="产品编码" width="350" align="center" prop="productCode"/>
<el-table-column label="产品名称" width="350" align="center" prop="productName"/>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="入库数量" width="100" align="left" prop="quantityQualified" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityQualified" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<!-- <el-table-column label="用人数" align="center" prop="useMan">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input type="number" size="small" v-model="scope.row.useMan" @change="handleEdit(scope.$index,scope.row)"></el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="计划日期" width="100" align="center" prop="productDate"/>
<el-table-column label="SAP过账状态" width="100" align="center" prop="sapstatus">
<template slot-scope="scope">
<span v-if="scope.row.sapstatus === '1'"></span>
<span v-else-if="scope.row.sapstatus ==='2'">失败</span>
</template>
</el-table-column>
<el-table-column label="SAP过账信息" width="350" align="center" prop="sapmessage"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
</el-table>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button>
<el-button type="primary" @click="submitReportSAP" v-else> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--母工单---->
<!--人员选择弹窗-->
<ItemSelectUser
ref="itemSelectUser"
@ -546,20 +614,21 @@
ref="itemSelectEquip"
@onSelected="onSelectEquip"
></ItemSelectEquip>
<!--母工单---->
<!--母工单---->
</div>
</template>
<script>
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,
updateReportWork,reportSap,getBatchList,
getReportList,submitReportPS} from "@/api/mes/reportWork";
getReportList,getReportSAPList,submitReportPS,submitReportPSSAP,getCKList} from "@/api/mes/reportWork";
import { getConsumeList,submitConsumePS,submitReportInfo} from "@/api/mes/reportWorkConsume";
import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue";
import ItemSelectWorkOrder from "./selectWorkOrder.vue";
import ItemSelectEquip from "./selectEquip.vue";
import moment from 'moment';
import { getlistCK } from '@/api/wms/outorder'
export default {
name: "ReportWork",
dicts: ['report_type'],
@ -590,6 +659,9 @@ export default {
activeName0: 'first',
activeName: 'pOrder',
activeName2: 'pConsume',
selectedWarehouse:'0004',
warehouseList: [],
// SAPCD:"",
reportRows:[],
pReportRows:[],
sReportRows:[],
@ -604,6 +676,7 @@ export default {
//
open: false,
openReport: false,
openReportSAP: false,
openConsume: false,
consumeQueryParams:{
consumePageNum:1,
@ -642,7 +715,7 @@ export default {
attr2: null,
attr3: null,
attr4: null,
workorderCode: null,
workorderCodeSap: null,
parentOrder:null,
uploadStatus:"0"
},
@ -702,7 +775,7 @@ export default {
},
methods: {
getWorkcenterList(){
getWorkcenterList().then(data => {
this.options1 = data;
});
@ -727,7 +800,7 @@ export default {
var m = dd.getMonth() + 1;//
var d = dd.getDate();
return y + "-" + m + "-" + d;
},
/** 查询报工报表列表 */
getList() {
@ -763,6 +836,7 @@ export default {
cancel() {
this.open = false;
this.openReport = false;
this.openReportSAP=false;
this.openConsume = false;
this.reset();
},
@ -868,6 +942,42 @@ export default {
this.title = "添加报工记录";
this.optType = "add";
},
handleAddSAP(row) {
this.reset();
let sr = this.selectRow[0];
if(sr.uploadStatus =='sap报工成功'){
this.optType = 'view'
}else{
this.optType = ''
}
this.queryParams.workorderCode = sr.workorderCode;
// this.SAPCD=sr.workorderCodeSap;
//
this.queryParams.parentOrder = '0';
getReportSAPList(this.queryParams).then(response => {
this.pOrderTableList = response;
this.openReportSAP = true;
this.titleReport = "SAP收货";
});
// let factoryCode = localStorage.getItem('USER_POOL_NAME_CURRENT').substring(3)
// let params = { factoryCode: factoryCode }; //
// let requestBody = JSON.stringify(params)// JSON
// getCKList(requestBody).then(response => {
// this.warehouseList = response;
// });
let factoryCode = localStorage.getItem('USER_POOL_NAME_CURRENT').substring(3)
let params = { factoryCode: factoryCode }; //
//let paramsJSON = JSON.stringify(params); // JSON
console.log(factoryCode)
getCKList(params).then(response => {
this.warehouseList = response.data
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -941,7 +1051,7 @@ export default {
},
/** 报工详情按钮操作 */
handleReportHz(row) {
this.reset();
let sr = row;
@ -950,7 +1060,7 @@ export default {
}else{
this.optType = ''
}
this.queryParams.workorderCode = sr.workorderCode;
//
this.queryParams.parentOrder = '0';
@ -981,7 +1091,7 @@ export default {
},
submitReport() {
this.reportRows = this.pReportRows.concat(this.sReportRows)
if ( this.reportRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
@ -992,6 +1102,24 @@ export default {
this.getList();
});
},
submitReportSAP() {
this.reportRows = this.pReportRows.concat(this.sReportRows)
console.log(this.reportRows)
if ( this.reportRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
}
this.reportRows.forEach(row => {
this.$set(row, 'whCode', this.selectedWarehouse);
});
console.log("仓库---"+this.selectedWarehouse)
const reportRowsJson = JSON.stringify(this.reportRows); // this.reportRowsJSON
submitReportPSSAP(reportRowsJson).then(response => {
this.$modal.msgSuccess("操作成功");
this.openReport = false;
this.getList();
});
},
/** 报工损耗按钮操作 */
handleConsumeHz(row) {
this.reset();
@ -1031,7 +1159,7 @@ export default {
},
submitConsume() {
this.consumeRows = this.pConsumeRows.concat(this.sConsumeRows)
if ( this.consumeRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
@ -1053,7 +1181,7 @@ export default {
this.$refs.itemSelectUser.showFlag = true;
},
//
onSelectUser(obj) {
onSelectUser(obj) {
this.form.userName = obj.code;
this.form.nickName = obj.name;
},

@ -264,9 +264,10 @@
<el-table v-loading="loading" :data="putList" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" v-if="false"/>
<el-table-column label="报工单号" align="center" prop="workOrder" width="200px"/>
<!-- <el-table-column label="工厂编码" align="center" prop="factoryCode" />-->
<el-table-column label="生产工单号" align="center" prop="productOrder" width="200px"/>
<el-table-column label="生产工单号" align="center" prop="productOrder" width="200px"/>
<el-table-column label="批次" align="center" prop="batchNumber" width="200px"/>
<el-table-column label="报工单号" align="center" prop="workOrder" width="200px"/>
<el-table-column label="仓库编码" align="center" prop="whCode" />
<el-table-column label="库区编码" align="center" prop="waCode" v-if="false"/>
<el-table-column label="库位编码" align="center" prop="wlCode" v-if="false"/>
@ -461,6 +462,7 @@ export default {
pageNum: 1,
pageSize: 10,
workOrder: null,
batchNumber:null,
factoryCode: null,
productOrder: null,
whCode: null,
@ -522,6 +524,7 @@ export default {
this.form = {
id: null,
workOrder: null,
batchNumber:null,
factoryCode: null,
productOrder: null,
whCode: null,

Loading…
Cancel
Save