|
@@ -1,98 +1,105 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <div class="item">
|
|
|
- <div class="left_tag">
|
|
|
- <div class="role border_role" :class="{ activeClass: over == 1 }" @click="getNature">性质</div>
|
|
|
- <div class="role functional" :class="{ activeClass: over == 2 }" @click="getPostList">岗位</div>
|
|
|
- </div>
|
|
|
- <div class="right_add">
|
|
|
- <el-button type="primary" icon="el-icon-plus" class="add_btn" @click="handleAddNature" v-show="natureShow">添加</el-button>
|
|
|
- <el-button type="primary" icon="el-icon-plus" class="add_btn" @click="handleAddPost" v-show="postShow">添加</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 性质列表 -->
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="natureList"
|
|
|
- :row-class-name="tableRowClassName"
|
|
|
- :row-style="selectedstyle"
|
|
|
- border
|
|
|
- class="roleTable"
|
|
|
- @row-click="natureLineClick"
|
|
|
- @row-dblclick="natureLineDbclick"
|
|
|
- v-show="natureShow"
|
|
|
- >
|
|
|
- <el-table-column label="性质" prop="natureName" width="198" />
|
|
|
- <el-table-column label="描述" prop="remarks" width="416" />
|
|
|
- <el-table-column label="操作" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['system:role:edit']" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete-solid" v-hasPermi="['system:role:remove']" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-top" @click="natureRise(scope.row)">上升</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-bottom" @click="natureDecline(scope.row)">下降</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- 岗位列表 -->
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="postList"
|
|
|
- border
|
|
|
- :row-class-name="tableRowClassName"
|
|
|
- :row-style="selectedstyle1"
|
|
|
- class="roleTable"
|
|
|
- @row-click="postLineClick"
|
|
|
- v-show="postShow"
|
|
|
- >
|
|
|
- <el-table-column label="岗位" prop="postName" width="198" />
|
|
|
- <el-table-column label="性质" width="102">
|
|
|
- {{natureName}}
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="描述" prop="remark" width="231" />
|
|
|
- <el-table-column label="操作" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="updataPost(scope.row)">编辑</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete-solid" @click="deletePost(scope.row)">删除</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-top" @click="postRise(scope.row)">上升</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-bottom" @click="postDecline(scope.row)">下降</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> -->
|
|
|
+ <div class="page-container">
|
|
|
+ <div class="content-container">
|
|
|
+ <div class="main">
|
|
|
+ <div class="table-nav">
|
|
|
+ <div class="tags">
|
|
|
+ <div class="tag" :class="{ activeClass: over == 1 }" @click="getNature">性质</div>
|
|
|
+ <div class="tag" :class="{ activeClass: over == 2 }" @click="getPostList">岗位</div>
|
|
|
+ </div>
|
|
|
+ <div class="actions">
|
|
|
+ <el-button type="primary" plain size="small " @click="handleAddNature" v-show="natureShow">添加</el-button>
|
|
|
+ <el-button type="primary" plain size="small " @click="handleAddPost" v-show="postShow">添加</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 性质列表 -->
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="natureList"
|
|
|
+ :header-cell-style="{ 'text-align': 'center' }"
|
|
|
+ :cell-style="{ textAlign: 'center', cursor: 'pointer' }"
|
|
|
+ border
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="natureLineClick"
|
|
|
+ v-show="natureShow"
|
|
|
+ >
|
|
|
+ <el-table-column label="性质" prop="natureName" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a href="javascript:void(0);" class="linked" @click="natureLineDbclick(scope.row)">{{ scope.row.natureName }}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="描述" prop="remarks" width="1200" />
|
|
|
+ <el-table-column label="操作" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['system:role:edit']" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete-solid" v-hasPermi="['system:role:remove']" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-top" @click="natureRise(scope.row, scope.$index)">上升</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-bottom" @click="natureDecline(scope.row, scope.$index)">下降</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- 岗位列表 -->
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="postList"
|
|
|
+ border
|
|
|
+ :header-cell-style="{ 'text-align': 'center' }"
|
|
|
+ highlight-current-row
|
|
|
+ :cell-style="{ textAlign: 'center', cursor: 'pointer' }"
|
|
|
+ @row-click="postLineClick"
|
|
|
+ v-show="postShow"
|
|
|
+ >
|
|
|
+ <el-table-column label="岗位" prop="postName" width="200" />
|
|
|
+ <el-table-column label="性质" width="200">
|
|
|
+ {{ natureName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="描述" prop="remark" width="800" />
|
|
|
+ <el-table-column label="操作" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="updataPost(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete-solid" @click="deletePost(scope.row)">删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-top" @click="postRise(scope.row, scope.$index)">上升</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-bottom" @click="postDecline(scope.row, scope.$index)">下降</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> -->
|
|
|
|
|
|
- <!-- 添加或修改性质对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="natureOpen" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="性质" prop="natureName">
|
|
|
- <el-input v-model="form.natureName" placeholder="请输入性质" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="remarks">
|
|
|
- <el-input v-model="form.remarks" placeholder="请输入描述" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancelNature">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitFormNature">保 存</el-button>
|
|
|
+ <!-- 添加或修改性质对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="natureOpen" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="性质" prop="natureName">
|
|
|
+ <el-input v-model="form.natureName" placeholder="请输入性质" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述" prop="remarks">
|
|
|
+ <el-input v-model="form.remarks" placeholder="请输入描述" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelNature">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitFormNature">保 存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 岗位添加或修改对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="postOpen" width="500px" append-to-body>
|
|
|
+ <el-form ref="formPost" :model="formPost" :rules="rulesPost" label-width="80px">
|
|
|
+ <el-form-item label="岗位" prop="postName">
|
|
|
+ <el-input v-model="formPost.postName" placeholder="请输入岗位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="性质">
|
|
|
+ <el-input v-model="natureName" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述" prop="remark">
|
|
|
+ <el-input v-model="formPost.remark" placeholder="请输入描述" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelPost">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitFormPost">保 存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
- <!-- 岗位添加或修改对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="postOpen" width="500px" append-to-body>
|
|
|
- <el-form ref="formPost" :model="formPost" :rules="rulesPost" label-width="80px">
|
|
|
- <el-form-item label="岗位" prop="postName">
|
|
|
- <el-input v-model="formPost.postName" placeholder="请输入岗位" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="性质">
|
|
|
- <el-input v-model="natureName" disabled />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="remark">
|
|
|
- <el-input v-model="formPost.remark" placeholder="请输入描述" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancelPost">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitFormPost">保 存</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -106,16 +113,6 @@ export default {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- // total: 0,
|
|
|
// 岗位表格数据
|
|
|
postList: [],
|
|
|
// 弹出层标题
|
|
@@ -125,7 +122,7 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
natureId: 0,
|
|
|
- postName: '',
|
|
|
+ postName: ''
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
@@ -150,7 +147,7 @@ export default {
|
|
|
nature: {},
|
|
|
perPostId: 0,
|
|
|
decPostId: 0,
|
|
|
- natureObj: {},
|
|
|
+ natureObj: {}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -184,17 +181,6 @@ export default {
|
|
|
tableRowClassName({ row, rowIndex }) {
|
|
|
row.index = rowIndex
|
|
|
},
|
|
|
- //设置行对象(row)的样式(style)
|
|
|
- selectedstyle({ row, rowIndex }) {
|
|
|
- if (this.getIndex === rowIndex) {
|
|
|
- return { 'background-color': '#EBEEF5' }
|
|
|
- }
|
|
|
- },
|
|
|
- selectedstyle1({ row, rowIndex }) {
|
|
|
- if (this.getIndex1 === rowIndex) {
|
|
|
- return { 'background-color': '#EBEEF5' }
|
|
|
- }
|
|
|
- },
|
|
|
// 单击性质表格某一行
|
|
|
natureLineClick(row, event, column) {
|
|
|
this.getIndex = row.index
|
|
@@ -202,10 +188,11 @@ export default {
|
|
|
},
|
|
|
// 双击性质表格某一行
|
|
|
natureLineDbclick(row) {
|
|
|
+ console.log(row)
|
|
|
this.queryParams.natureId = row.natureId
|
|
|
this.natureName = row.natureName
|
|
|
this.nature = row
|
|
|
- listPost(this.queryParams).then(res => {
|
|
|
+ listPost(this.queryParams).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.postList = res.data
|
|
|
this.natureShow = false
|
|
@@ -234,7 +221,7 @@ export default {
|
|
|
if (valid) {
|
|
|
if (this.formPost.postId != undefined) {
|
|
|
updatePost(this.formPost).then((response) => {
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
+ this.$msg({ message: '修改成功' })
|
|
|
this.postOpen = false
|
|
|
this.getList()
|
|
|
this.natureLineDbclick(this.nature)
|
|
@@ -244,17 +231,17 @@ export default {
|
|
|
this.formPost.natureId = this.queryParams.natureId
|
|
|
this.formPost.postSort = parseInt(this.postList[0].postSort) + 1
|
|
|
addPost(this.formPost).then((response) => {
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
+ this.$msg({ message: '添加成功' })
|
|
|
this.formPost = {}
|
|
|
this.postOpen = false
|
|
|
this.getList()
|
|
|
this.natureLineDbclick(this.nature)
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.formPost.postSort = 1
|
|
|
this.formPost.natureId = this.queryParams.natureId
|
|
|
addPost(this.formPost).then((response) => {
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
+ this.$msg({ message: '添加成功' })
|
|
|
this.formPost = {}
|
|
|
this.formPost.postSort = null
|
|
|
this.postOpen = false
|
|
@@ -286,7 +273,7 @@ export default {
|
|
|
},
|
|
|
// 修改岗位按钮
|
|
|
updataPost(row) {
|
|
|
- getPost(row.postId).then(res => {
|
|
|
+ getPost(row.postId).then((res) => {
|
|
|
this.formPost = res.data
|
|
|
this.postOpen = true
|
|
|
this.title = '修改岗位'
|
|
@@ -295,22 +282,22 @@ export default {
|
|
|
// 删除岗位
|
|
|
deletePost(row) {
|
|
|
this.$modal
|
|
|
- .confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
- return delPost(row.postId)
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- console.log(res)
|
|
|
- if (res.code === 200) {
|
|
|
- this.getList()
|
|
|
- this.natureLineDbclick(this.nature)
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
- }else if (res.code === 500) {
|
|
|
- this.getList()
|
|
|
- this.$notify({title: '警告', message: res.msg, type: 'warning'});
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
+ .confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delPost(row.postId)
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.getList()
|
|
|
+ this.natureLineDbclick(this.nature)
|
|
|
+ this.$msg({ message: '删除成功' })
|
|
|
+ } else if (res.code === 500) {
|
|
|
+ this.getList()
|
|
|
+ this.$notify({ title: '警告', message: res.msg, type: 'warning' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
},
|
|
|
/** 性质提交按钮 */
|
|
|
submitFormNature: function () {
|
|
@@ -331,7 +318,7 @@ export default {
|
|
|
this.natureOpen = false
|
|
|
this.getList()
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.form.natureSort = 1
|
|
|
addNature(this.form).then((response) => {
|
|
|
console.log(response)
|
|
@@ -347,56 +334,57 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 性质上升
|
|
|
- natureRise(row) {
|
|
|
+ natureRise(row, rowIndex) {
|
|
|
+ console.log(rowIndex)
|
|
|
this.perId = row.natureSort
|
|
|
let sysNatureEditBOs = []
|
|
|
let item = {}
|
|
|
let previous = {}
|
|
|
- if (row.index === 0) {
|
|
|
- this.$notify({title: '警告', message: '已经是最高级,无法上升!', type: 'warning'});
|
|
|
- }else{
|
|
|
- row.natureSort = this.natureList[row.index - 1].natureSort
|
|
|
- this.natureList[row.index - 1].natureSort = this.perId
|
|
|
+ if (rowIndex === 0) {
|
|
|
+ this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
|
|
|
+ } else {
|
|
|
+ row.natureSort = this.natureList[rowIndex - 1].natureSort
|
|
|
+ this.natureList[rowIndex - 1].natureSort = this.perId
|
|
|
item = {
|
|
|
natureId: row.natureId,
|
|
|
natureSort: row.natureSort
|
|
|
}
|
|
|
previous = {
|
|
|
- natureId: this.natureList[row.index - 1].natureId,
|
|
|
- natureSort: this.natureList[row.index - 1].natureSort
|
|
|
+ natureId: this.natureList[rowIndex - 1].natureId,
|
|
|
+ natureSort: this.natureList[rowIndex - 1].natureSort
|
|
|
}
|
|
|
sysNatureEditBOs = [item, previous]
|
|
|
- updateSortNature(sysNatureEditBOs).then(res => {
|
|
|
+ updateSortNature(sysNatureEditBOs).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess('上升成功')
|
|
|
+ this.$msg({ message: '设置成功' })
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// 岗位上升
|
|
|
- postRise(row) {
|
|
|
+ postRise(row, rowIndex) {
|
|
|
this.perPostId = row.postSort
|
|
|
let sysNatureEditBOs = []
|
|
|
let item = {}
|
|
|
let previous = {}
|
|
|
- if (row.index === 0) {
|
|
|
- this.$notify({title: '警告', message: '已经是最高级,无法上升!', type: 'warning'});
|
|
|
- }else{
|
|
|
- row.postSort = this.postList[row.index - 1].postSort
|
|
|
- this.postList[row.index - 1].postSort = this.perPostId
|
|
|
+ if (rowIndex === 0) {
|
|
|
+ this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
|
|
|
+ } else {
|
|
|
+ row.postSort = this.postList[rowIndex - 1].postSort
|
|
|
+ this.postList[rowIndex - 1].postSort = this.perPostId
|
|
|
item = {
|
|
|
postId: row.postId,
|
|
|
postSort: row.postSort
|
|
|
}
|
|
|
previous = {
|
|
|
- postId: this.postList[row.index - 1].postId,
|
|
|
- postSort: this.postList[row.index - 1].postSort
|
|
|
+ postId: this.postList[rowIndex - 1].postId,
|
|
|
+ postSort: this.postList[rowIndex - 1].postSort
|
|
|
}
|
|
|
sysNatureEditBOs = [item, previous]
|
|
|
- updateSortPost(sysNatureEditBOs).then(res => {
|
|
|
+ updateSortPost(sysNatureEditBOs).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess('上升成功')
|
|
|
+ this.$msg({ message: '设置成功' })
|
|
|
this.getList()
|
|
|
this.natureLineDbclick(this.nature)
|
|
|
}
|
|
@@ -404,56 +392,56 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 性质下降
|
|
|
- natureDecline(row) {
|
|
|
+ natureDecline(row, rowIndex) {
|
|
|
this.decId = row.natureSort
|
|
|
let sysNatureEditBOs = []
|
|
|
let item = {}
|
|
|
let previous = {}
|
|
|
- if (row.index === this.natureList.length - 1) {
|
|
|
- this.$notify({title: '警告', message: '已经是最低级,无法下降!', type: 'warning'});
|
|
|
- }else{
|
|
|
- row.natureSort = this.natureList[row.index + 1].natureSort
|
|
|
- this.natureList[row.index + 1].natureSort = this.decId
|
|
|
+ if (rowIndex === this.natureList.length - 1) {
|
|
|
+ this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
|
|
|
+ } else {
|
|
|
+ row.natureSort = this.natureList[rowIndex + 1].natureSort
|
|
|
+ this.natureList[rowIndex + 1].natureSort = this.decId
|
|
|
item = {
|
|
|
natureId: row.natureId,
|
|
|
natureSort: row.natureSort
|
|
|
}
|
|
|
previous = {
|
|
|
- natureId: this.natureList[row.index + 1].natureId,
|
|
|
- natureSort: this.natureList[row.index + 1].natureSort
|
|
|
+ natureId: this.natureList[rowIndex + 1].natureId,
|
|
|
+ natureSort: this.natureList[rowIndex + 1].natureSort
|
|
|
}
|
|
|
sysNatureEditBOs = [item, previous]
|
|
|
- updateSortNature(sysNatureEditBOs).then(res => {
|
|
|
+ updateSortNature(sysNatureEditBOs).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess('下降成功')
|
|
|
+ this.$msg({ message: '设置成功' })
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// 岗位下降
|
|
|
- postDecline(row) {
|
|
|
+ postDecline(row, rowIndex) {
|
|
|
this.decPostId = row.postSort
|
|
|
let sysNatureEditBOs = []
|
|
|
let item = {}
|
|
|
let previous = {}
|
|
|
- if (row.index === this.postList.length - 1) {
|
|
|
- this.$notify({title: '警告', message: '已经是最低级,无法下降!', type: 'warning'});
|
|
|
- }else{
|
|
|
- row.postSort = this.postList[row.index + 1].postSort
|
|
|
- this.postList[row.index + 1].postSort = this.decPostId
|
|
|
+ if (rowIndex === this.postList.length - 1) {
|
|
|
+ this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
|
|
|
+ } else {
|
|
|
+ row.postSort = this.postList[rowIndex + 1].postSort
|
|
|
+ this.postList[rowIndex + 1].postSort = this.decPostId
|
|
|
item = {
|
|
|
postId: row.postId,
|
|
|
postSort: row.postSort
|
|
|
}
|
|
|
previous = {
|
|
|
- postId: this.postList[row.index + 1].postId,
|
|
|
- postSort: this.postList[row.index + 1].postSort
|
|
|
+ postId: this.postList[rowIndex + 1].postId,
|
|
|
+ postSort: this.postList[rowIndex + 1].postSort
|
|
|
}
|
|
|
sysNatureEditBOs = [item, previous]
|
|
|
- updateSortPost(sysNatureEditBOs).then(res => {
|
|
|
+ updateSortPost(sysNatureEditBOs).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess('下降成功')
|
|
|
+ this.$msg({ message: '设置成功' })
|
|
|
this.getList()
|
|
|
this.natureLineDbclick(this.nature)
|
|
|
}
|
|
@@ -463,58 +451,21 @@ export default {
|
|
|
/** 删除性质按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
this.$modal
|
|
|
- .confirm('是否确认删除性质为"' + row.natureName + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
- return delNature(row.natureId)
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getList()
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
+ .confirm('是否确认删除性质为"' + row.natureName + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delNature(row.natureId)
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.$msg({ message: '删除成功' })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-.role {
|
|
|
- width: 90px;
|
|
|
- height: 40px;
|
|
|
- text-align: center;
|
|
|
- line-height: 40px;
|
|
|
- font-size: 14px;
|
|
|
- border: 1px solid #dfe6ec;
|
|
|
- border-bottom: none;
|
|
|
-}
|
|
|
-.roleTable {
|
|
|
- width: 1154px;
|
|
|
-}
|
|
|
-.add_btn {
|
|
|
- width: 80px;
|
|
|
- height: 35px;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
-.item {
|
|
|
- width: 1154px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
-}
|
|
|
-.dataTable {
|
|
|
- width: 656px;
|
|
|
-}
|
|
|
-.left_tag {
|
|
|
- display: flex;
|
|
|
-}
|
|
|
-.border_role {
|
|
|
- border-right: none;
|
|
|
-}
|
|
|
.activeClass {
|
|
|
color: #409eff;
|
|
|
}
|
|
|
-.tableRowClassName {
|
|
|
- background: olive;
|
|
|
-}
|
|
|
-.pagination-container[data-v-72233bcd] {
|
|
|
- width: 1154px;
|
|
|
-}
|
|
|
</style>
|