You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

640 lines
22 KiB

<template>
<div class="customer-css">
<el-dialog title="生产订单-工艺路线维护" v-drag v-bind="$attrs" v-on="$listeners" width="800px" class="customer-dialog" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'订单号:'">
<el-input v-model="searchData.orderNo" class="customer-input-color-red" readonly style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'物料编码:'">
<el-input v-model="searchData.partNo" class="customer-input-color-red" readonly style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称/规格:'">
<el-input v-model="searchData.partDesc" class="customer-input-color-red" readonly style="width: 260px"></el-input>
</el-form-item>
<el-form-item :label="'工厂编号:'">
<el-input v-model="searchData.site" class="customer-input-color-red" readonly style="width: 130px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-button class="customer-bun-min" type="primary" @click="addModel" style="margin-left: 0px; margin-bottom: 0px;">新增</el-button>
<el-button class="customer-bun-min" type="primary" @click="updateModel" style="margin-left: 0px; margin-bottom: 0px;">编辑</el-button>
<el-button class="customer-bun-min" type="primary" @click="deleteSORoutingData" style="margin-left: 0px; margin-bottom: 0px;">删除</el-button>
</el-form>
<el-table
:height="height"
:data="dataList"
border
@row-click="clickData"
highlight-current-row
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="维护工艺路线明细" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="660px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-form-item :label="'工序号:'">
<el-input v-model="detailData.itemNo" class="customer-input-color-red" readonly style="width: 130px;text-align: right" type="number"></el-input>
</el-form-item>
<el-form-item :label="'工序名称:'">
<el-input v-model="detailData.operationDesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码:</a></span>
<el-input v-model="detailData.workCenterNo" style="width: 150px"></el-input>
</el-form-item>
<el-form-item :label="'准备时间:'">
<el-input v-model="detailData.machSetupTime" style="width: 150px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-form-item :label="'单位产出量:'">
<el-input v-model="detailData.machRunFactor" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'产出单位:'">
<el-select filterable v-model="detailData.factorUnit" style="width: 130px">
<el-option label="单位/小时" value="单位/小时"></el-option>
<el-option label="小时" value="小时"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'计划开工时间:'">
<el-date-picker
v-model="detailData.planStartTime"
type="datetime"
style="width: 150px"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item :label="'计划完工时间:'">
<el-date-picker
v-model="detailData.planFinishTime"
type="datetime"
style="width: 150px"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-form-item :label="'效率:'">
<el-input v-model="detailData.efficiency" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'操作工人数:'">
<el-input v-model="detailData.crewsize" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'备注:'">
<el-input v-model="detailData.remark" style="width: 150px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveSORoutingData()">保存</el-button>
<el-button type="primary" @click="addModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist'
import {
getSORoutingData,
}from "@/api/base/site.js"
export default {
name: "updateProductRouting",
components: {
Chooselist
},
data () {
return {
searchData:{
orderNo:'',
partNo:'',
partDesc:'',
site:'',
user:this.$store.state.user.name,
},
tagNo:'',
addModelFlag:false,
height:350,
dataList:[],
dataListLoading:false,
currentRow:null,
columnList:[
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableItemNo',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "itemNo",
headerAlign: "center",
align: "right",
columnLabel: "工序号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableOperationDesc',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "operationDesc",
headerAlign: "center",
align: "left",
columnLabel: "工序名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 300
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableWorkCenterNo',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "workCenterNo",
headerAlign: "center",
align: "left",
columnLabel: "加工中心编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableWorkCenterDesc',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "workCenterDesc",
headerAlign: "center",
align: "left",
columnLabel: "加工中心名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableMachSetupTime',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "machSetupTime",
headerAlign: "center",
align: "right",
columnLabel: "准备时间(小时)",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableMachRunFactor',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "machRunFactor",
headerAlign: "center",
align: "right",
columnLabel: "单位产出量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableFactorUnit',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "factorUnit",
headerAlign: "center",
align: "left",
columnLabel: "产出单位",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableTimeRequired',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "timeRequired",
headerAlign: "center",
align: "right",
columnLabel: "需求时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableTimeReported',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "timeReported",
headerAlign: "center",
align: "right",
columnLabel: "报告时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableEfficiency',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "efficiency",
headerAlign: "center",
align: "right",
columnLabel: "效率(%)",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableRemark',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "remark",
headerAlign: "center",
align: "left",
columnLabel: "备注",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableQtyRequired',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "qtyRequired",
headerAlign: "center",
align: "right",
columnLabel: "需求数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableQtyReported',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "qtyReported",
headerAlign: "center",
align: "right",
columnLabel: "计价单位",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableQtyApprove',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "qtyApprove",
headerAlign: "center",
align: "right",
columnLabel: "合格数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TablePlanStartTime',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "planStartTime",
headerAlign: "center",
align: "left",
columnLabel: "计划开工时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TablePlanFinishTime',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "planFinishTime",
headerAlign: "center",
align: "left",
columnLabel: "计划完工时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableBarcodeID',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "barcodeID",
headerAlign: "center",
align: "left",
columnLabel: "条形码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableCrewsize',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "crewsize",
headerAlign: "center",
align: "left",
columnLabel: "操作工人数",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableWXPartNo',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "wxPartNo",
headerAlign: "center",
align: "left",
columnLabel: "费用结算料号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6099,
serialNumber: '6099TableWXSpec',
tableId: "6099Table",
tableName: "维护工艺路线工序表",
columnProp: "wxSpec",
headerAlign: "center",
align: "left",
columnLabel: "费用结算物料名称/规格",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 250
},
],
detailData:{
itemNo:'',
operationDesc:'',
workCenterNo:'',
machSetupTime:'',
machRunFactor:'',
factorUnit:'单位/小时',
planStartTime:'',
planFinishTime:'',
efficiency:'',
crewsize:'',
remark:'',
site:'',
partNo:'',
revNo:'',
add:'',
user:'',
},
detailmodelInputFlag:false,
}
},
mounted() {
},
watch: {
'$route' (to, from) {
// if(localStorage.getItem('calendar')!=undefined){
// this.jump();
// }
}
},
methods: {
getBaseData(val){
if (this.tagNo === 24){
this.detailData.workCenterNo = val.WorkCenterNo
}
},
// 获取基础数据列表
getBaseList(val){
this.tagNo = val
this.$nextTick(() => {
let strVal = "";
if (val === 24){
strVal = this.detailData.workCenterNo
}
this.$refs.baseList.init(val,strVal)
})
},
init(searchData){
//设置参数
this.searchData = searchData;
//调用方法
this.getData();
},
getData(){
getSORoutingData(this.searchData).then(({data}) => {
this.dataList = data.rows;
if(data.total==0){
this.dataList =[];
}
})
},
clickData(row){
this.currentRow = JSON.parse(JSON.stringify(row));
},
addModel(){
this.detailData={
itemNo:'',
operationDesc:'',
workCenterNo:'',
machSetupTime:'',
machRunFactor:'',
factorUnit:'单位/小时',
planStartTime:'',
planFinishTime:'',
efficiency:'',
crewsize:'',
remark:'',
site:'',
partNo:'',
revNo:'',
add:0,
user:this.$store.state.user.name,
};
if(this.dataList===[]){
this.detailData.itemNo=10;
}else {
this.detailData.itemNo=this.dataList[0].itemNo;
for (let i = 0; i < this.dataList.length; i++) {
if(this.detailData.itemNo<this.dataList[i].itemNo){
this.detailData.itemNo=this.dataList[i].itemNo
}
}
this.detailData.itemNo+=10;
}
this.addModelFlag=true;
},
updateModel(){
if(this.currentRow==null){
this.$alert('请选择工序', '错误', {
confirmButtonText: '确定'
})
return false;
}
this.detailData={
itemNo:this.currentRow.itemNo,
operationDesc:this.currentRow.operationDesc,
workCenterNo:this.currentRow.workCenterNo,
machSetupTime:this.currentRow.machSetupTime,
machRunFactor:this.currentRow.machRunFactor,
factorUnit:this.currentRow.factorUnit,
planStartTime:this.currentRow.planStartTime,
planFinishTime:this.currentRow.planFinishTime,
efficiency:this.currentRow.efficiency,
crewsize:this.currentRow.crewsize,
remark:this.currentRow.remark,
site:this.currentRow.site,
partNo:this.currentRow.partNo,
revNo:this.currentRow.revNo,
add:1,
user:this.$store.state.user.name,
}
this.addModelFlag=true;
},
},
created() {
}
}
</script>
<style scoped>
/*统一的input内容颜色样式*/
.customer-input-color-red /deep/ .el-input__inner {
color: red;
}
</style>