报工界面调整

yangwl
zhaoxiaolin 8 months ago
parent 9e541ffffe
commit ec61055794

@ -286,3 +286,19 @@ export function getNewPrepareData(workorderCode) {
});
}
// 删除报工报表
export function deleteBomRowNow(id) {
return request({
url: '/mes/reportWork/deleteBomRowNow/' + id,
method: 'delete'
});
}
//
export function getWarehouseList(query) {
return request({
url: '/mes/reportWork/getWarehouseList',
method: 'get',
params: query
});
}

@ -144,4 +144,12 @@ export function syncSAP() {
url: '/plan/order/syncSAP',
method: 'post'
});
}
//下发生产工单
export function deleteOrder(orderIds) {
return request({
url: '/plan/order/deleteOrder/' + orderIds,
method: 'post'
});
}

@ -196,7 +196,7 @@
<el-table-column label="排产数量" align="center" prop="quantity" width="100"/>
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="累计报工数量" align="center" prop="quantityFeedback" width="100"/>
<el-table-column label="用人数" align="center" prop="useMan" width="100"/>
<!--<el-table-column label="用人数" align="center" prop="useMan" width="100"/>-->
<el-table-column label="累计工时" align="center" prop="workTime" />
<el-table-column label="生产时间" align="center" prop="productDate" width="100"/>
<el-table-column label="SAP报工状态" align="center" prop="uploadStatus" width="150">
@ -514,16 +514,18 @@
:label="item.title"
:name="item.libId"
>
<!--<el-button size="mini" type="primary" @click="addConsumeTableRow(item.libList)"></el-button>-->
<el-table v-loading="loading" :data="item.libList" ref="mypConsumeTable" @selection-change="pConsumeSelection">
<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="150" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true"
<el-table-column label="订单编码" width="130" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true"
:formatter="orderCodeFormate"/>
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="物料编码" width="130" align="left" prop="materialCode" :show-overflow-tooltip="true"
:formatter="productCodeFormate"
/>
<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="150" 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>
@ -531,18 +533,38 @@
<el-table-column label="单位" width="50" align="center" prop="unit"/>
<el-table-column label="反冲标识" align="center" prop="recoil"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
<!--
<el-table-column label="仓库" width="150" align="center" prop="warehouseCode">
<template slot-scope="scope">
<el-select v-model="scope.row.warehouseCode" placeholder="请选择仓库" width="50%"
@change="handleEdit(scope.$index,scope.row)"
v-if="scope.row.workorderCodeSap == null||scope.row.attr1"
>
<el-option
v-for="work in cwarehouseList"
:key="work.warehouseCode"
:label="work.warehouseName"
:value="work.warehouseCode"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="90">
<template slot-scope="scope">
<el-button @click.native.prevent="deleteBomRow(scope.$index, item.libList)"
size="small" type="danger" plain>
size="small" type="danger" plain
v-if="scope.row.workorderCodeSap == null||scope.row.attr1"
>
移除</el-button>
</template>
</el-table-column>-->
</el-table-column>
</el-table>
<div class="button-container">
<el-button size="mini" type="primary" @click="addConsumeTableRow(item.libList)"></el-button>
</div>
</el-tab-pane>
<!--工单产品bom参考-->
<!--工单产品bom参考
<el-tab-pane label="BOM组成参照" name="pBom">
<el-table v-loading="loading" :data="pBomTableList" ref="pBomTable"
row-key="materialCode"
@ -562,7 +584,7 @@
<el-table-column label="成本核算标识相关" align="center" prop="sanka" width="100"/>
</el-table>
</el-tab-pane>
-->
</el-tabs>
<div slot="footer" class="dialog-footer">
@ -649,10 +671,10 @@
@onSelected="onSelectEquip"
></ItemSelectEquip>
<!--最新领料单选择弹窗-->
<ItemSelectNewPrepare
<ItemSelectMaterial
ref="itemSelectNewPrepare"
@onSelected="onSelectNewPrepare"
></ItemSelectNewPrepare>
></ItemSelectMaterial>
<!--母工单---->
<!-- 打印预览弹出层 -->
<el-dialog
@ -685,29 +707,26 @@
<el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table"
:data="printData.workTable" border style="width: 100%">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column prop="workorderCodeSap" label="订单号" width="100" :formatter="orderCodeFormate"/>
<el-table-column prop="workorderCode" label="生产工单号" width="130"></el-table-column>
<el-table-column prop="productCode" label="物料编码" width="120" :formatter="productCodeFormate"/>
<el-table-column prop="productName" label="物料名称" width="180"></el-table-column>
<el-table-column prop="unit" label="单位" width="50"></el-table-column>
<el-table-column prop="workorderCodeSap" label="订单号" width="130" :formatter="orderCodeFormate"/>
<!--<el-table-column prop="workorderCode" label="生产工单号" width="150"></el-table-column>-->
<el-table-column prop="productCode" label="物料编码" width="150" :formatter="productCodeFormate"/>
<el-table-column prop="productName" label="物料名称" width="300"></el-table-column>
<el-table-column prop="unit" label="单位" width="70"></el-table-column>
<el-table-column prop="version" label="版本"></el-table-column>
<el-table-column prop="quantity" label="报工数量"></el-table-column>
<el-table-column prop="batch" label="批次" width="240"></el-table-column>
<el-table-column prop="quantityFeedback" label="批次数量" width="100"></el-table-column>
<el-table-column prop="voucher" label="凭证"></el-table-column>
<!--<el-table-column prop="quantity" label="报工数量"></el-table-column>-->
<el-table-column prop="batch" label="批次" width="300"></el-table-column>
<el-table-column prop="quantityFeedback" label="批次数量" width="90"></el-table-column>
<!--<el-table-column prop="voucher" label="凭证"></el-table-column>-->
</el-table>
<br/>
<!-- 底部
<el-row class="my-print-foot">
<el-col :offset="1" :span="3">SAP-No:{{ printData.SAPNo }}</el-col>
<el-col :offset="1" :span="3">Z-PM-F-030-A.1</el-col>
</el-row>
<el-row class="my-print-foot">
<el-col :offset="1" :span="3">制单人:{{ printData.manufacture }}</el-col>
<el-col :offset="1" :span="3">审核人{{ printData.auditor }}</el-col>
<el-col :offset="1" :span="6">车间负责人:</el-col>
<el-col :offset="1" :span="6">车间交货人:</el-col>
<el-col :offset="1" :span="6">仓库验收人:</el-col>
</el-row>
-->
</el-form>
@ -720,9 +739,9 @@
</template>
<script>
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,getWarehouseList,
updateReportWork,reportSap,getBatchList,reportSapCancel,
getAllLevelReportList,
getAllLevelReportList,deleteBomRowNow,
getReportSAPList,submitReportPS,submitReportPSSAP,getCKList,
getPutInOrderList
} from "@/api/mes/reportWork";
@ -730,14 +749,14 @@ import { getConsumeList,submitConsumePS,submitReportInfo,getBomList,getAllLevelC
import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue";
import ItemSelectWorkOrder from "./selectWorkOrder.vue";
import ItemSelectNewPrepare from "./selectNewPrepare.vue";
import ItemSelectMaterial from "./selectMaterial.vue";
import ItemSelectEquip from "./selectEquip.vue";
import moment from 'moment';
import { getlistCK } from '@/api/wms/outorder'
export default {
name: "ReportWork",
dicts: ['report_type','report_sap_status'],
components: {ReportWorkConsume,ItemSelectUser,ItemSelectWorkOrder,ItemSelectEquip,ItemSelectNewPrepare},
components: {ReportWorkConsume,ItemSelectUser,ItemSelectWorkOrder,ItemSelectEquip,ItemSelectMaterial},
data() {
return {
optType: undefined,
@ -897,23 +916,33 @@ export default {
],workCenter: [
{ required: true, message: "工作中心不能为空", trigger: "blur" }
],
}
},
consumeList : [],
cwarehouseList:[]
};
},
created() {
this.getDate();
this.getWorkcenterList();
this.getWarehouseList();
},
methods: {
getWorkcenterList(){
getWorkcenterList().then(data => {
this.options1 = data;
});
},
//
getWarehouseList(){
getWarehouseList({}).then(data => {
this.cwarehouseList = data;
});
},
//
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //
if(cellValue !=null){
return cellValue.slice(7,18); //
}
},
//
orderCodeFormate(row, column, cellValue){
@ -1057,6 +1086,7 @@ export default {
this.pConsumeRows = [];
this.sConsumeRows = [];
this.consumeRows = [];
this.consumeList = [];
},
/** 搜索按钮操作 */
handleQuery() {
@ -1304,18 +1334,25 @@ export default {
this.queryParams.workorderCode = sr.workorderCode;
//BOM
this.queryParams.parentOrder = '0';
getBomList(this.queryParams).then(response => {
this.pBomTableList = this.handleTree(response, 'materialCode', 'pMaterialCode')
});
//this.queryParams.parentOrder = '0';
//getBomList(this.queryParams).then(response => {
// this.pBomTableList = this.handleTree(response, 'materialCode', 'pMaterialCode')
//});
},
//
pConsumeSelection(selection) {
this.pConsumeRows = this.pConsumeRows.concat(selection)
const allRows = this.pConsumeRows.concat(selection)
this.pConsumeRows = allRows.reduce((acc, cur) => {
const hasDuplicate = acc.some(item => item.materialCode === cur.materialCode);
if (!hasDuplicate) {
acc.push(cur);
}
return acc;
}, []);
},
sConsumeSelection(selection) {
this.sConsumeRows = selection
this.sConsumeRows = selection;
},
submitConsume() {
this.consumeRows = this.pConsumeRows;
@ -1327,6 +1364,7 @@ export default {
submitConsumePS(this.consumeRows).then(response => {
this.$modal.msgSuccess("报工信息修改成功");
this.openConsume = false;
this.reset();
this.getList();
});
},
@ -1391,7 +1429,7 @@ export default {
this.getList();
});
},
// -
// -
handlePrint(params) {
printJS({
printable: params.printable, // 'printFrom', // id
@ -1429,22 +1467,40 @@ export default {
},
//--
deleteBomRow(index, rows) {
rows.splice(index, 1);
this.$modal.confirm('是否确认删除?确认后,不需要点击下方确定,立马删除!').then(function() {
return deleteBomRowNow(rows[index].recordId);
}).then(() => {
rows.splice(index, 1);
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//--
addConsumeTableRow(consumeList){
if(consumeList.length==0){
addConsumeTableRow(rows){
debugger
this.consumeList = rows;
if(rows.length==0){
this.$modal.msgError(`上位机尚未填写损耗,不允许提前新增`);
return
}
this.$refs.itemSelectNewPrepare.showFlag = true;
this.$refs.itemSelectNewPrepare.init(consumeList[0].workorderCode);
this.$refs.itemSelectNewPrepare.init(rows[0].workorderCode);
},
//--
onSelectNewPrepare(obj) {
console.log(obj)
debugger
for(let i=0;i<obj.length;i++){
const row = {
workorderCode: obj[i].workorderCode,
materialCode: obj[i].component,
materialName: obj[i].componentName,
quantity: obj[i].quantity,
unit: obj[i].unit,
recoil:"X"
};
this.consumeList.push(row);
}
}
}
};
@ -1462,4 +1518,18 @@ export default {
margin-left: 15px;
height: 38px;
}
.button-container {
text-align: right;
margin-top: 10px;
margin-right: 10px;
}
.my-print-table {
font-size: 20px;
}
.my-print-nav {
font-size: 19px;
}
.my-print-foot {
font-size: 19px;
}
</style>

@ -45,27 +45,18 @@
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="物料编码" width="100" align="left" prop="component" :show-overflow-tooltip="true" />
<el-table-column label="物料编码" width="130" align="left" prop="component" :show-overflow-tooltip="true"
:formatter="productCodeFormate"
/>
<el-table-column label="物料名称" width="200" align="left" prop="componentName" :show-overflow-tooltip="true" />
<el-table-column label="物料组" width="80" align="left" prop="productGroup" :show-overflow-tooltip="true" />
<el-table-column label="物料组名称" width="100" align="left" prop="productGroupName" :show-overflow-tooltip="true" />
<el-table-column label="损耗数量" align="center" prop="quantity">
<el-table-column label="物料组" width="100" align="left" prop="productGroup" :show-overflow-tooltip="true" />
<el-table-column label="物料组名称" width="120" align="left" prop="productGroupName" :show-overflow-tooltip="true" />
<el-table-column label="实际用量" align="center" prop="quantity">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantity" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope">
<el-select v-model="scope.row.unit" placeholder="请选择单位" width="50%" @change="handleEdit(scope.$index,scope.row)">
<el-option
v-for="dict in dict.type.unit"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="单位" width="100" align="center" prop="unit"></el-table-column>
</el-table>
<pagination
@ -111,12 +102,12 @@ export default {
id: "id",
label: "label"
},
workorderCode:'',
//
queryParams: {
pageNum: 1,
pageSize: 10,
productCode: '',
workorderCode:'',
component : '',
componentName : '',
productGroupName:''
@ -129,9 +120,14 @@ export default {
},
methods: {
init(productCode,workorderCode){
this.queryParams.productCode = productCode;
this.queryParams.workorderCode = workorderCode;
//
productCodeFormate(row, column, cellValue){
if(cellValue !=null){
return cellValue.slice(7,18); //
}
},
init(workorderCode){
this.workorderCode = workorderCode;
this.getList();
},
/** 查询表格列表*/
@ -166,12 +162,17 @@ export default {
console.log('row:',index, row);
},
submitBomForm() {
if ( this.selectionRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
}
if ( this.selectionRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
}
//
this.selectionRows.forEach(obj => {
obj.workorderCode = this.workorderCode;
});
this.$emit('onSelected', this.$refs.myTable.selection);
this.$emit('onSelected', this.selectionRows);
this.showFlag = false;
},
}

@ -54,6 +54,16 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="订单状态" prop="delFlag">
<el-select v-model="queryParams.delFlag" placeholder="请选择订单是否有效" clearable>
<el-option
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -72,6 +82,17 @@
>SAP同步
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-s-release"
size="mini"
@click="handleDeleteOrder"
:disabled="single"
v-hasPermi="['mes:pro:order:edit']"
>关闭订单</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
@ -153,12 +174,11 @@
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!--
<el-table-column width="120" label="更新时间" align="center" prop="updateTime">
<el-table-column label="订单状态" align="center" prop="delFlag">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planComplete, '{y}-{m}-{d}') }}</span>
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.delFlag"/>
</template>
</el-table-column>-->
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width " fixed="right">
<template slot-scope="scope">
<el-button
@ -167,7 +187,7 @@
icon="el-icon-plus"
@click="splitBtn(scope.row)"
v-hasPermi="['mes:pro:order:edit']"
v-if="scope.row.parentOrder == 0"
v-if="scope.row.parentOrder == 0 && scope.row.delFlag == 0"
>拆分
</el-button>
</template>
@ -549,7 +569,8 @@ import {
listOrder,
addOrder,
updateOrder,
syncSAP, selectMaterielList,getAutoSplitList
syncSAP, selectMaterielList,getAutoSplitList,
deleteOrder
} from '@/api/plan/order'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -558,7 +579,7 @@ import {getToken} from "@/utils/auth"
export default {
name: 'Order',
dicts: ['product_type', 'order_status','order_type'],
dicts: ['product_type', 'order_status','order_type','sys_notice_status'],
components: {
Treeselect
},
@ -854,7 +875,6 @@ export default {
},
// -
handleFileSuccess(response, file, fileList) {
debugger
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
@ -1243,7 +1263,7 @@ export default {
routeCode: this.splitForm.routeCode,
sortNo: this.splitForm.sortNo
}
this.loading = true;
subSplitOrder(data).then(response => {
if (response.code == 500) {
this.$modal.msgError(response.msg)
@ -1251,6 +1271,7 @@ export default {
}
this.$modal.msgSuccess('提交成功')
this.queryParams.status = "o1"
this.loading = false;
this.getList()
})
@ -1400,6 +1421,28 @@ export default {
} else {
return false;
}
},
//
handleDeleteOrder(){
this.loading = true;
let _this = this;
const orderIds = this.orderCodes.map(item => item.id);
const orderCodes = this.orderCodes.map(item => item.orderCode);
this.$modal.confirm('是否确认关闭订单"' + orderCodes + '"').then(function () {
return deleteOrder(orderIds);
}).then(() => {
this.$modal.msgSuccess("关闭成功");
this.loading = false;
this.getList();
}).catch(
function (e) {
if (e == 'cancel') {
_this.loading = false;
} else if(e == 'close') {
_this.loading = false;
}
});
}
}

@ -873,6 +873,7 @@ export default {
},
// -
handleUpdateDown(row) {
var statusesArray = this.statuses;
for (var i = 0; i < statusesArray.length; i++) {
if (statusesArray[i] != 'w0') {//
@ -880,6 +881,7 @@ export default {
return
}
}
this.loading = true;
let _this = this;
const workorderIds = row.workorderCode || this.codes;

Loading…
Cancel
Save