优化
This commit is contained in:
@@ -261,11 +261,25 @@
|
||||
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<el-table-column align="center" label="操作" width="270" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="!button2" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
|
||||
<el-button v-show="!scope.row.edit" :disabled="!button2" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" :disabled="!button2" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
<el-button
|
||||
type="primary" class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-top"
|
||||
@click="moveUp(scope.$index, scope.row)"
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary" class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-bottom"
|
||||
@click="moveDown(scope.$index, scope.row)"
|
||||
>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -474,6 +488,25 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
moveUp(index, item) {
|
||||
if (index > 0) {
|
||||
const upDate = this.tableDtl[index - 1]
|
||||
this.tableDtl.splice(index - 1, 1)
|
||||
this.tableDtl.splice(index, 0, upDate)
|
||||
} else {
|
||||
this.$message.error('已经是第一条,不可上移')
|
||||
}
|
||||
},
|
||||
moveDown(index, item) {
|
||||
if ((index + 1) === this.tableDtl.length) {
|
||||
this.$message.error('已经是最后一条,不可下移')
|
||||
} else {
|
||||
console.log(index)
|
||||
const downDate = this.tableDtl[index + 1]
|
||||
this.tableDtl.splice(index + 1, 1)
|
||||
this.tableDtl.splice(index, 0, downDate)
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$refs['form2'].resetFields()
|
||||
this.$refs['form'].resetFields()
|
||||
|
||||
Reference in New Issue
Block a user