|
|
@@ -37,14 +37,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { defineComponent, reactive, ref, toRefs, computed, onMounted, watch } from 'vue';
|
|
|
+import { defineComponent, reactive, ref, toRefs, computed, onMounted, watch, createVNode } from 'vue';
|
|
|
import PositionDrawer from './PositionDrawer.vue';
|
|
|
import { structureList, getPostsList, getPositionList, delPosition } from '/@/api/sys/position';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
+import { message,Modal } from 'ant-design-vue';
|
|
|
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'position',
|
|
|
- components: { PositionDrawer },
|
|
|
+ components: { PositionDrawer, ExclamationCircleOutlined },
|
|
|
setup(props, { emit }) {
|
|
|
const drawerRef = ref(null)
|
|
|
const data = reactive({
|
|
|
@@ -113,6 +114,8 @@ export default defineComponent({
|
|
|
getPositionList(params).then(res => {
|
|
|
if (res.datas && res.datas.length) {
|
|
|
data.position.data = res.datas
|
|
|
+ }else{
|
|
|
+ message.info('该职位下无岗位数据')
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
@@ -177,18 +180,29 @@ export default defineComponent({
|
|
|
} else if (data.position.currentId === "") {
|
|
|
message.error('请先选择岗位!')
|
|
|
} else {
|
|
|
- let params = {
|
|
|
- oabaseid: data.posts.currentId,
|
|
|
- id: data.position.currentId
|
|
|
- }
|
|
|
- delPosition(params).then(res => {
|
|
|
- if (res.datas === 1) {
|
|
|
- message.success('操作成功')
|
|
|
- onSubmit(true)
|
|
|
- } else {
|
|
|
- message.error('操作失败')
|
|
|
- }
|
|
|
- })
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除提示',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '确定删除岗位?',
|
|
|
+ centered: true,
|
|
|
+ okText: '确定',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: (() => {
|
|
|
+ let params = {
|
|
|
+ oabaseid: data.posts.currentId,
|
|
|
+ id: data.position.currentId
|
|
|
+ }
|
|
|
+ delPosition(params).then(res => {
|
|
|
+ if (res.datas === 1) {
|
|
|
+ message.success('操作成功')
|
|
|
+ onSubmit(true)
|
|
|
+ } else {
|
|
|
+ message.error('操作失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
const onSubmit = (e) => {
|