|
@@ -8,30 +8,16 @@
|
|
|
<!-- 技能块展示 -->
|
|
|
<view class="phone-select-group">
|
|
|
<view v-for="item in data.list" :key="item.id" class="phone-select-item"
|
|
|
- :class="{ selectActive: !!item.zyLevelName }" @click="toggleSelect(item)">
|
|
|
+ :class="{ selectActive: item.active }" @click="toggleSelect(item)">
|
|
|
{{ item.name }}
|
|
|
- <view class="select-item-tag" v-if="!!item.zyLevelName">{{item.zyLevelName[0]}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="zydj-popup-btn-box">
|
|
|
- <button type="default" class="phone-green-btn" @click="confirmBtn">保存</button>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </contentDialogVue>
|
|
|
- <!-- 弹窗 -->
|
|
|
- <contentDialogVue ref="commonPopup2" type="center" :showBtn="false" title="请选择职业等级">
|
|
|
- <view class="phone-common-dialog">
|
|
|
- <view class="common-body-box">
|
|
|
- <view class="common-title">选择等级</view>
|
|
|
- <!-- 等级选择 -->
|
|
|
- <view class="common-content">
|
|
|
- <view class="dj-select-item" v-for="item in data.zyLevelList" :key="item.id" @click="handleSelectLevelId(item)">
|
|
|
- {{item.name}}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <button type="default" class="phone-green-btn" @click="confirmBtn">保存</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</contentDialogVue>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -41,7 +27,6 @@
|
|
|
} from 'vue';
|
|
|
import {
|
|
|
getJiazhengZhiye,
|
|
|
- getJiazhengLevel
|
|
|
} from "@/api/jiazheng.js"
|
|
|
import contentDialogVue from '@/components/dialog/contentDialog.vue';
|
|
|
|
|
@@ -74,14 +59,13 @@
|
|
|
id: {
|
|
|
type: Number,
|
|
|
},
|
|
|
- mode: {
|
|
|
- type: String,
|
|
|
- default: 'duoxuan' // danxuan / duoxuan
|
|
|
- }
|
|
|
+ mode: {
|
|
|
+ type: String,
|
|
|
+ default: 'duoxuan' // danxuan / duoxuan
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
const commonPopup = ref(null);
|
|
|
- const commonPopup2 = ref(null);
|
|
|
const $emit = defineEmits(['confirm-btn'])
|
|
|
|
|
|
const data = reactive({
|
|
@@ -89,11 +73,8 @@
|
|
|
// item: {
|
|
|
// zyId: null,
|
|
|
// zyName: null,
|
|
|
- // zyLevel: null,
|
|
|
- // zyLevelName: null
|
|
|
+ // active: true
|
|
|
// }
|
|
|
- activeId: null, // 激活的zyId
|
|
|
- zyLevelList: [],
|
|
|
})
|
|
|
|
|
|
|
|
@@ -109,8 +90,8 @@
|
|
|
}
|
|
|
// 确认
|
|
|
function confirmBtn() {
|
|
|
- $emit('confirm-btn', data.list.filter(item => item.zyLevelName));
|
|
|
- handleClose();
|
|
|
+ $emit('confirm-btn', data.list.filter(item => item.active));
|
|
|
+ handleClose();
|
|
|
}
|
|
|
|
|
|
function getZyList(alreadySelect) {
|
|
@@ -124,16 +105,14 @@
|
|
|
return {
|
|
|
id: item.id,
|
|
|
name: item.name,
|
|
|
- zyLevel: da1.zyLevel,
|
|
|
- zyLevelName: da1.zyLevelName
|
|
|
+ active: true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
id: item.id,
|
|
|
name: item.name,
|
|
|
- zyLevel: null,
|
|
|
- zyLevelName: null
|
|
|
+ active: false
|
|
|
}
|
|
|
})
|
|
|
commonPopup.value.handleShow();
|
|
@@ -141,40 +120,16 @@
|
|
|
}
|
|
|
|
|
|
function toggleSelect(item) {
|
|
|
- if (item.zyLevelName) {
|
|
|
- item.zyLevel = null;
|
|
|
- item.zyLevelName = null
|
|
|
- } else {
|
|
|
- data.activeId = item.id;
|
|
|
- getLevelList(item);
|
|
|
+ item.active = !item.active;
|
|
|
+ if (props.mode == 'danxuan') {
|
|
|
+ data.list = res.data.map(cite => {
|
|
|
+ if (cite.id != item.id) {
|
|
|
+ cite.active = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function getLevelList() {
|
|
|
- getJiazhengLevel({jgId: props.id,zyId: data.activeId}).then(res => {
|
|
|
- data.zyLevelList = res.data;
|
|
|
- commonPopup2.value.handleShow();
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- function handleSelectLevelId(item) {
|
|
|
- data.list.map(ite => {
|
|
|
- if (ite.id === data.activeId) {
|
|
|
- ite.zyLevel = item.id;
|
|
|
- ite.zyLevelName = item.name
|
|
|
- } else {
|
|
|
- if (props.mode == 'danxuan') {
|
|
|
- ite.zyLevel = null;
|
|
|
- ite.zyLevelName = null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- return ite;
|
|
|
- })
|
|
|
- commonPopup2.value.handleClose()
|
|
|
- }
|
|
|
-
|
|
|
defineExpose({
|
|
|
handleShow,
|
|
|
handleClose
|