刘璐珈

This commit is contained in:
Vergil
2020-03-11 17:16:38 +08:00
parent e31e2390c3
commit 3f02d00eb8
7 changed files with 448 additions and 175 deletions

View File

@@ -13,7 +13,7 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button size="small" icon="el-icon-circle-plus-outline" type="distribution" style="margin-left: 25%" @click="addTable()">增加装配计划</el-button>
<el-button size="small" icon="el-icon-circle-plus-outline" type="distribution" style="margin-left: 300px" @click="addTable()">增加装配计划</el-button>
<el-button type="danger" plain size="small" icon="el-icon-delete" style="float: right;margin-right: 20px" @click="deleteData()">删除</el-button>
</el-row>
</el-card>
@@ -33,33 +33,33 @@
</div>
</div>
</el-card>
<el-card style="width: 40%; float: left">
<el-table :data="tableData1" border stripe size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center">
<el-card style="width: 39%; float: left">
<el-table :data="tableData1" border stripe size="mini" highlight-current-row style="width: 515px;margin-top: 15px" height="720px" @row-click="searchTable2">
<el-table-column label="项目名称" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床编号" align="center">
<el-table-column label="机床编号" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" show-overflow-tooltip>
<el-table-column label="机床名称" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="机床数量" align="center">
<el-table-column label="机床数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.机床数量 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card style="width: 59.5%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center">
<el-card style="width: 61%; float: left">
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 525px;margin-top: 15px" height="720px" @row-dblclick="changeState" @row-click="deleteData1">
<el-table-column label="组号" align="center" width="120px">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-select v-model="scope.row.组件流水号" filterable clearable size="small" style="width: 100px" @change="groupChange(scope.row, scope.$index)">
@@ -75,7 +75,7 @@
</template>
</template>
</el-table-column>
<el-table-column label="任务名称" align="center">
<el-table-column label="任务名称" align="center" width="160px">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.任务名称" size="mini" style="width: 100%"/>
@@ -85,23 +85,30 @@
</template>
</template>
</el-table-column>
<el-table-column label="计划工时" align="center">
<el-table-column label="计划工时" align="center" width="100px">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.计划工时" size="mini" style="width: 100%"/>
<el-input v-model="scope.row.计划工时" size="mini" style="width: 100%" props="" @input="filterNuber(scope.row.计划工时, scope.$index, '计划工时')"/>
</template>
<template v-else>
{{ scope.row.计划工时 }}
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250px" fixed="right">
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<!--<el-tooltip :open-delay="1000" effect="dark" content="编辑" placement="top">-->
<!--<div style="display: inline-block">-->
<!--<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>-->
<!--<el-button v-else type="text" size="small" icon="el-icon-edit-outline" @click="scope.row.edit=!scope.row.edit"/>-->
<!--<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>-->
<!--</div>-->
<!--</el-tooltip>-->
<el-tooltip :open-delay="1000" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button v-if="scope.row.edit" type="success" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="text" size="small" icon="el-icon-edit-outline" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="scope.row.edit" type="warning" plain size="small" @click="cancel(scope.row)">取消</el-button>
<el-button v-if="scope.row.edit" type="text" plain size="small" @click="cancel(scope.row)">取消</el-button>
</div>
</el-tooltip>
</template>
@@ -134,6 +141,23 @@ export default {
this.initProject()
},
methods: {
// 保留两位小数的正实数
filterNuber(val, index, date) {
console.log(index, 6666)
let value = '' + val
value = value
.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的
.replace('.', '$#$')
.replace(/\./g, '')
.replace('$#$', '.')
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数
if (value.indexOf('.') < 0 && value !== '') {
value = parseFloat(value)
}
console.log(value)
this.tableData2[index][date] = value
},
getFileData(machineValue) {
this.hadFile = []
getFileData(machineValue).then(res => {
@@ -185,7 +209,7 @@ export default {
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
计划工时: Number(response.data[i].计划工时).toFixed(2),
edit: false
})
}
@@ -212,7 +236,7 @@ export default {
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
计划工时: Number(response.data[i].计划工时).toFixed(2),
edit: false
})
}
@@ -232,7 +256,7 @@ export default {
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
计划工时: Number(response.data[i].计划工时).toFixed(2),
edit: false
})
}
@@ -264,7 +288,7 @@ export default {
组件流水号: response.data[i].组件流水号,
组号: response.data[i].组号,
任务名称: response.data[i].任务名称,
计划工时: response.data[i].计划工时,
计划工时: Number(response.data[i].计划工时).toFixed(2),
edit: false
})
}