This commit is contained in:
zds
2022-08-10 16:09:18 +08:00
parent d885047303
commit d87802ba7e
6 changed files with 244 additions and 7 deletions

View File

@@ -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()