|
@@ -23,7 +23,7 @@
|
|
|
</picker>
|
|
|
</view>
|
|
|
<!-- 职业名称(picker 实现下拉选择) -->
|
|
|
- <view class="form-label-select">
|
|
|
+ <!-- <view class="form-label-select">
|
|
|
<view class="phone-form-label"><text class="form-label-require">*</text>职业名称</view>
|
|
|
<picker mode="selector" :disabled="isJgFlag" :style="isJgFlag?'color:#999':''" :range="zhiyeNames"
|
|
|
range-key="name" @change="zhiyeChange" class="select-picker-box">
|
|
@@ -32,9 +32,9 @@
|
|
|
<icon></icon>
|
|
|
</view>
|
|
|
</picker>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- 职业等级(picker 实现下拉选择) -->
|
|
|
- <view class="form-label-select">
|
|
|
+ <!-- <view class="form-label-select">
|
|
|
<view class="phone-form-label"><text class="form-label-require">*</text>职业等级</view>
|
|
|
<picker mode="selector" :disabled="isZyFlag" :style="isZyFlag?'color:#999':''" :range="zhiyeLevels"
|
|
|
@change="levelChange" class="select-picker-box">
|
|
@@ -43,7 +43,7 @@
|
|
|
<icon></icon>
|
|
|
</view>
|
|
|
</picker>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
|
|
|
<view v-if="formData.banzhengInfoFlag" class="form-label-select">
|
|
|
<view class="phone-form-label"><text class="form-label-require">*</text>参训时间</view>
|
|
@@ -79,33 +79,23 @@
|
|
|
</label>
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
- <view v-if="isZijiazheng !='true'" class="page-btn-box">
|
|
|
- <button type="default" v-if="piliang !=1&&isZijiazheng !='true'" @click="goBack"
|
|
|
- class="phone-white-btn">返回</button>
|
|
|
- <button type="default" v-if="piliang ==1&&isZijiazheng !='true'" @click="piliangBaocun"
|
|
|
- class="phone-green-btn">确认</button>
|
|
|
- <button type="default" v-if="piliang !=1&&isZijiazheng !='true'" @click="addSaveForm"
|
|
|
- class="phone-green-btn">添加</button>
|
|
|
+ <view>
|
|
|
+ <button type="default" @click="selectZy" class="phone-green-btn">选择职业名称等级</button>
|
|
|
</view>
|
|
|
<view v-if="piliangArray.length>0" v-for="(item,index) in piliangArray" :key="index"
|
|
|
class="bzsm-tip-box form-top-margin">
|
|
|
- <view class="title-btn-box">
|
|
|
- <view class="phone-line-title">{{item.jgName}}</view>
|
|
|
- <view class="reset-btn" @click="piliangDelete(item,index)">删除</view>
|
|
|
- </view>
|
|
|
- <view class="tip-content-box">{{item.zyName}} {{item.zyLevelName}}</view>
|
|
|
- <!-- <view class="tip-content-box">职业名称:{{item.zyName}}</view>
|
|
|
- <view class="tip-content-box">职业等级:{{item.zyLevelName}}</view> -->
|
|
|
- </view>
|
|
|
+ <view class="tip-content-box">{{item.name}} {{item.zyLevelName}}</view>
|
|
|
|
|
|
+ </view>
|
|
|
+ <view v-if="isZijiazheng !='true'" class="page-btn-box">
|
|
|
+ <button type="default" v-if="isZijiazheng !='true'" @click="goBack"
|
|
|
+ class="phone-white-btn">返回</button>
|
|
|
+ <button type="default" v-if="isZijiazheng !='true'" @click="addSaveFormPiliang"
|
|
|
+ class="phone-green-btn">添加</button>
|
|
|
+ </view>
|
|
|
|
|
|
</view>
|
|
|
- <view v-if="isZijiazheng !='true' &&piliang ==1" class="page-btn-box content-footer-box">
|
|
|
- <button type="default" v-if="piliang ==1&&isZijiazheng !='true'" @click="goBack"
|
|
|
- class="phone-white-btn">返回</button>
|
|
|
- <button type="default" v-if="piliang ==1&&isZijiazheng !='true'" @click="addSaveFormPiliang"
|
|
|
- class="phone-green-btn">添加</button>
|
|
|
- </view>
|
|
|
+ <selectZyLevel ref="selectRef" @confirm-btn="selectZyLevelConfirm" :id="13"></selectZyLevel>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -118,6 +108,7 @@
|
|
|
getJiazhengBanzhengCheckKc
|
|
|
} from "@/api/jiazheng.js"
|
|
|
import dayjs from "dayjs";
|
|
|
+ import selectZyLevel from "@/components/selectZyLevel/index.vue"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -164,6 +155,9 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ components: {
|
|
|
+ selectZyLevel
|
|
|
+ },
|
|
|
computed: {
|
|
|
jigouNames() {
|
|
|
return this.baozhengJigouOpt.map(item => item.name);
|
|
@@ -181,13 +175,89 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- piliangDelete(item, index) {
|
|
|
- this.piliangArray.splice(index, 1);
|
|
|
+ selectZy() {
|
|
|
+ if (this.formData.baozhengJigouId == '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择报证机构',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.$refs.selectRef.handleShow()
|
|
|
+ },
|
|
|
+ selectZyLevelConfirm(data) {
|
|
|
+ console.log('data', data);
|
|
|
+ this.piliangArray = [...data]
|
|
|
+ console.log('this.piliangArray', this.piliangArray);
|
|
|
+ // const dataWithIds = updatedData.map((item, index) => ({
|
|
|
+ // ...item,
|
|
|
+ // statusBanzheng: '未办证',
|
|
|
+ // id: res.data[index]
|
|
|
+ // }));
|
|
|
+ // this.allData.kaozhengList = [...this.allData.kaozhengList, ...dataWithIds];
|
|
|
},
|
|
|
- isPiliang(data) {
|
|
|
- this.piliang = data
|
|
|
- if (data == 0) {
|
|
|
- this.piliangArray = []
|
|
|
+ // 提交表单
|
|
|
+ addSaveFormPiliang() {
|
|
|
+ let req = {
|
|
|
+ canxunshijian: this.formData.canxunshijian,
|
|
|
+ jgId: this.formData.baozhengJigouId,
|
|
|
+ needKaoshi: this.formData.needKaoshi,
|
|
|
+ needKecheng: this.formData.needKecheng,
|
|
|
+ shicaochengji: this.formData.shicaochengji,
|
|
|
+ zongkeshi: this.formData.zongkeshi,
|
|
|
+ jgType: this.formData.baozhengJigouType,
|
|
|
+ jgName: this.formData.baozhengJigouName,
|
|
|
+ id: this.formData.id,
|
|
|
+ createTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
+ }
|
|
|
+ let mergedArray = this.piliangArray.map(item => {
|
|
|
+ return {
|
|
|
+ ...req, // 展开req的所有属性
|
|
|
+ zyId: item.id,
|
|
|
+ zyName: item.name,
|
|
|
+ zyLevel: item.zyLevel,
|
|
|
+ zyLevelName: item.zyLevelName
|
|
|
+ };
|
|
|
+ });
|
|
|
+ console.log('this.mergedArray', mergedArray);
|
|
|
+
|
|
|
+ if (req.jgId == '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择报证机构',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.piliangArray.length == 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择职业名称和职业等级',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 验证机构类型为1时的必填字段
|
|
|
+ if (this.formData.baozhengJigouType == 1 &&
|
|
|
+ (this.formData.shicaochengji == '' ||
|
|
|
+ this.formData.zongkeshi == '' ||
|
|
|
+ this.formData.canxunshijian == '')) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请填写参训时间,实操成绩,总课时',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('this.status', this.status);
|
|
|
+ console.log('this.localStatus', this.localStatus);
|
|
|
+ console.log('this.mergedArray', mergedArray);
|
|
|
+ if (this.localStatus == 'addEdit') {
|
|
|
+ this.$emit('addEdit', mergedArray, 'addEdit', this.currentIndex);
|
|
|
+ } else if (this.status == 'add') {
|
|
|
+ this.$emit('addSave', mergedArray);
|
|
|
+ } else if (this.localStatus == 'editAdd') {
|
|
|
+ this.$emit('editSave', mergedArray, 'editAdd');
|
|
|
+ } else {
|
|
|
+ this.$emit('editSave', mergedArray, 'edit', this.currentIndex);
|
|
|
}
|
|
|
},
|
|
|
goBack() {
|
|
@@ -198,12 +268,10 @@
|
|
|
},
|
|
|
editinfo(data, index) {
|
|
|
this.piliangArray = []
|
|
|
- console.log('123123', data);
|
|
|
this.$nextTick(() => {
|
|
|
if (!data) {
|
|
|
return false
|
|
|
}
|
|
|
- console.log('datssssa', data);
|
|
|
this.currentIndex = index
|
|
|
this.formData.baozhengJigouName = data.jgName;
|
|
|
this.formData.baozhengJigouId = data.jgId;
|
|
@@ -310,7 +378,7 @@
|
|
|
this.formData.banzhengInfoFlag = false
|
|
|
this.isJgFlag = true
|
|
|
this.isZyFlag = true
|
|
|
- this.piliangArray = []
|
|
|
+ this.piliangArray = []
|
|
|
|
|
|
},
|
|
|
// 报证机构选择
|
|
@@ -408,199 +476,6 @@
|
|
|
// currentMove 编辑状态下的新增
|
|
|
this.localStatus = data
|
|
|
console.log('localStatus', this.localStatus);
|
|
|
- },
|
|
|
- piliangBaocun() {
|
|
|
- let req = {
|
|
|
- canxunshijian: this.formData.canxunshijian,
|
|
|
- jgId: this.formData.baozhengJigouId,
|
|
|
- needKaoshi: this.formData.needKaoshi,
|
|
|
- needKecheng: this.formData.needKecheng,
|
|
|
- shicaochengji: this.formData.shicaochengji,
|
|
|
- zongkeshi: this.formData.zongkeshi,
|
|
|
- zyId: this.formData.zhiyeId,
|
|
|
- zyLevel: this.formData.zhiyeLevelId,
|
|
|
- jgType: this.formData.baozhengJigouType,
|
|
|
- jgName: this.formData.baozhengJigouName,
|
|
|
- zyName: this.formData.zhiyeName,
|
|
|
- zyLevelName: this.formData.zhiyeLevelName,
|
|
|
- id: this.formData.id,
|
|
|
- createTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- if (this.status == 'add' || this.localStatus == 'editadd' || this.localStatus == 'addEdit') {
|
|
|
- req.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- if (req.jgId == '' || req.zyId == '' || req.zyLevel == '') {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择保证机构,职业名称,职业等级',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.formData.baozhengJigouType == 1 && (this.formData.shicaochengji == '' || this.formData
|
|
|
- .zongkeshi ==
|
|
|
- '' || this.formData.canxunshijian == '')) {
|
|
|
- uni.showToast({
|
|
|
- title: '请填写参训时间,实操成绩,总课时',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
- // 检查重复数据 - 新增的重复检查逻辑
|
|
|
- const isDuplicate = this.piliangArray.some(item =>
|
|
|
- item.jgId === req.jgId &&
|
|
|
- item.zyId === req.zyId &&
|
|
|
- item.zyLevel === req.zyLevel
|
|
|
- );
|
|
|
-
|
|
|
- if (isDuplicate) {
|
|
|
- uni.showToast({
|
|
|
- title: '该机构、职业和等级已存在,无法重复添加',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //console.log('req', req);
|
|
|
- this.piliangArray.push(req)
|
|
|
- console.log('this.piliangArray', this.piliangArray);
|
|
|
- },
|
|
|
- // 提交表单
|
|
|
- addSaveFormPiliang() {
|
|
|
- let req = {
|
|
|
- canxunshijian: this.formData.canxunshijian,
|
|
|
- jgId: this.formData.baozhengJigouId,
|
|
|
- needKaoshi: this.formData.needKaoshi,
|
|
|
- needKecheng: this.formData.needKecheng,
|
|
|
- shicaochengji: this.formData.shicaochengji,
|
|
|
- zongkeshi: this.formData.zongkeshi,
|
|
|
- zyId: this.formData.zhiyeId,
|
|
|
- zyLevel: this.formData.zhiyeLevelId,
|
|
|
- jgType: this.formData.baozhengJigouType,
|
|
|
- jgName: this.formData.baozhengJigouName,
|
|
|
- zyName: this.formData.zhiyeName,
|
|
|
- zyLevelName: this.formData.zhiyeLevelName,
|
|
|
- id: this.formData.id,
|
|
|
- createTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- if (this.status == 'add' || this.localStatus == 'editadd' || this.localStatus == 'addEdit') {
|
|
|
- req.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- if (req.jgId == '' || req.zyId == '' || req.zyLevel == '') {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择保证机构,职业名称,职业等级',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.formData.baozhengJigouType == 1 && (this.formData.shicaochengji == '' || this.formData
|
|
|
- .zongkeshi ==
|
|
|
- '' || this.formData.canxunshijian == '')) {
|
|
|
- uni.showToast({
|
|
|
- title: '请填写参训时间,实操成绩,总课时',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- console.log('this.status', this.status);
|
|
|
- console.log('this.localStatus', this.localStatus);
|
|
|
-
|
|
|
- if (this.localStatus == 'editAdd') {
|
|
|
- if (this.piliangArray.length == 0) {
|
|
|
- this.$emit('editSavePiliang', req);
|
|
|
- } else {
|
|
|
- console.log('this.piliangArray', this.piliangArray);
|
|
|
- this.$emit('editSavePiliang', this.piliangArray)
|
|
|
- }
|
|
|
-
|
|
|
- } else if (this.status == 'add') {
|
|
|
- if (this.piliangArray.length == 0) {
|
|
|
- this.$emit('addSavePiliang', req);
|
|
|
- } else {
|
|
|
- console.log('this.piliangArray', this.piliangArray);
|
|
|
- this.$emit('addSavePiliang', this.piliangArray)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- // 提交表单
|
|
|
- addSaveForm() {
|
|
|
- //debugger
|
|
|
-
|
|
|
- console.log('statusstatusstatus', this.status);
|
|
|
-
|
|
|
- let req = {
|
|
|
- canxunshijian: this.formData.canxunshijian,
|
|
|
- jgId: this.formData.baozhengJigouId,
|
|
|
- needKaoshi: this.formData.needKaoshi,
|
|
|
- needKecheng: this.formData.needKecheng,
|
|
|
- shicaochengji: this.formData.shicaochengji,
|
|
|
- zongkeshi: this.formData.zongkeshi,
|
|
|
- zyId: this.formData.zhiyeId,
|
|
|
- zyLevel: this.formData.zhiyeLevelId,
|
|
|
- jgType: this.formData.baozhengJigouType,
|
|
|
- jgName: this.formData.baozhengJigouName,
|
|
|
- zyName: this.formData.zhiyeName,
|
|
|
- zyLevelName: this.formData.zhiyeLevelName,
|
|
|
- id: this.formData.id,
|
|
|
- createTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- console.log('req', req);
|
|
|
- if (this.status == 'add' || this.localStatus == 'editadd' || this.localStatus == 'addEdit') {
|
|
|
- req.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
- }
|
|
|
- if (req.jgId == '' || req.zyId == '' || req.zyLevel == '') {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择保证机构,职业名称,职业等级',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.formData.baozhengJigouType == 1 && (this.formData.shicaochengji == '' || this.formData
|
|
|
- .zongkeshi ==
|
|
|
- '' || this.formData.canxunshijian == '')) {
|
|
|
- uni.showToast({
|
|
|
- title: '请填写参训时间,实操成绩,总课时',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false
|
|
|
- }
|
|
|
- console.log('req123123123', req);
|
|
|
- if (req.jgId && req.zyId && req.zyLevel) {
|
|
|
- if (this.localStatus == 'addEdit') {
|
|
|
- this.$emit('addEdit', req, 'addEdit', this.currentIndex);
|
|
|
- } else if (this.status == 'add') {
|
|
|
- this.$emit('addSave', req);
|
|
|
- } else if (this.localStatus == 'editAdd') {
|
|
|
- this.$emit('editSave', req, 'editAdd');
|
|
|
- } else {
|
|
|
- this.$emit('editSave', req, 'edit', this.currentIndex);
|
|
|
- }
|
|
|
-
|
|
|
- } else if (req.jgId == '' && req.zyId == '' && req.zyLevel == '') {
|
|
|
- if (this.status == 'add') {
|
|
|
- this.$emit('addSave', '');
|
|
|
- } else if (this.localStatus == 'editAdd') {
|
|
|
- //this.$emit('editSave', '');
|
|
|
- // uni.showToast({
|
|
|
- // title: '请选择保证机构,职业名称,职业等级',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
-
|
|
|
- // return false
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择保证机构,职业名称,职业等级',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
-
|
|
|
- return false
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
};
|