|
@@ -1,103 +1,112 @@
|
|
|
<template>
|
|
|
<view class="jz-content-box">
|
|
|
- <view v-if="status =='add'" class="bzsm-tip-box form-top-margin">
|
|
|
- <view class="title-btn-box">
|
|
|
- <view class="phone-line-title">说明</view>
|
|
|
- <view @click="resetFun" class="reset-btn">重置</view>
|
|
|
- </view>
|
|
|
- <view class="tip-content-box">1.如果不需要办理证书,可直接点击保存按钮。</view>
|
|
|
- <view class="tip-content-box">2.点击重置按钮,只重置办证信息,其他信息不改变。</view>
|
|
|
- </view>
|
|
|
- <!-- 报证机构(picker 实现下拉选择) -->
|
|
|
- <view class="form-label-select form-top-margin">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>报证机构</view>
|
|
|
- <picker :disabled="(status =='edit'&&localStatus=='')" mode="selector" :range="jigouNames"
|
|
|
- @change="jigouChange" class="select-picker-box">
|
|
|
- <view class="form-radio-select" :class="{'form-radio-disabled': (status =='edit'&&localStatus=='')}">
|
|
|
- <view>{{ formData.baozhengJigouName || '请选择报证机构' }}</view>
|
|
|
- <icon></icon>
|
|
|
+ <view :class="isZijiazheng=='true'?'mask-view':''">
|
|
|
+ <view class="content-body-box">
|
|
|
+ <view v-if="status =='add'" class="bzsm-tip-box form-top-margin">
|
|
|
+ <view class="title-btn-box">
|
|
|
+ <view class="phone-line-title">说明</view>
|
|
|
+ <view @click="resetFun" class="reset-btn">重置</view>
|
|
|
+ </view>
|
|
|
+ <view class="tip-content-box">1.如果不需要办理证书,可直接点击保存按钮。</view>
|
|
|
+ <view class="tip-content-box">2.点击重置按钮,只重置办证信息,其他信息不改变。</view>
|
|
|
</view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
- <!-- 职业名称(picker 实现下拉选择) -->
|
|
|
- <view class="form-label-select">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>职业名称</view>
|
|
|
- <picker mode="selector" :range="zhiyeNames" range-key="name" @change="zhiyeChange"
|
|
|
- class="select-picker-box">
|
|
|
- <view class="form-radio-select">
|
|
|
- <view>{{ formData.zhiyeName || '请选择职业名称' }}</view>
|
|
|
- <icon></icon>
|
|
|
+ <!-- 报证机构(picker 实现下拉选择) -->
|
|
|
+ <view class="form-label-select form-top-margin">
|
|
|
+ <view class="phone-form-label"><text class="form-label-require">*</text>报证机构</view>
|
|
|
+ <picker :disabled="(status =='edit'&&localStatus=='')" mode="selector" :range="jigouNames"
|
|
|
+ @change="jigouChange" class="select-picker-box">
|
|
|
+ <view class="form-radio-select"
|
|
|
+ :class="{'form-radio-disabled': (status =='edit'&&localStatus=='')}">
|
|
|
+ <view>{{ formData.baozhengJigouName || '请选择报证机构' }}</view>
|
|
|
+ <icon></icon>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
- <!-- 职业等级(picker 实现下拉选择) -->
|
|
|
- <view class="form-label-select">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>职业等级</view>
|
|
|
- <picker mode="selector" :range="zhiyeLevels" @change="levelChange" class="select-picker-box">
|
|
|
- <view class="form-radio-select">
|
|
|
- <view>{{ formData.zhiyeLevelName || '请选择等级' }}</view>
|
|
|
- <icon></icon>
|
|
|
+ <!-- 职业名称(picker 实现下拉选择) -->
|
|
|
+ <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">
|
|
|
+ <view class="form-radio-select">
|
|
|
+ <view>{{ formData.zhiyeName || '请选择职业名称' }}</view>
|
|
|
+ <icon></icon>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <!-- 职业等级(picker 实现下拉选择) -->
|
|
|
+ <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">
|
|
|
+ <view class="form-radio-select">
|
|
|
+ <view>{{ formData.zhiyeLevelName || '请选择等级' }}</view>
|
|
|
+ <icon></icon>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
|
|
|
- <view v-if="formData.banzhengInfoFlag" class="form-label-select">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>参训时间</view>
|
|
|
- <uni-datetime-picker class="form-radio-picker" v-model="formData.canxunShijian" type="date"
|
|
|
- @change="canxunShijianChange">
|
|
|
- <view class="form-radio-select">
|
|
|
- <view>{{formData.canxunShijian}}</view>
|
|
|
- <icon></icon>
|
|
|
+ <view v-if="formData.banzhengInfoFlag" class="form-label-select">
|
|
|
+ <view class="phone-form-label"><text class="form-label-require">*</text>参训时间</view>
|
|
|
+ <uni-datetime-picker class="form-radio-picker" v-model="formData.canxunshijian" type="date"
|
|
|
+ @change="canxunShijianChange">
|
|
|
+ <view class="form-radio-select">
|
|
|
+ <view>{{formData.canxunshijian}}</view>
|
|
|
+ <icon></icon>
|
|
|
+ </view>
|
|
|
+ </uni-datetime-picker>
|
|
|
</view>
|
|
|
- </uni-datetime-picker>
|
|
|
- </view>
|
|
|
|
|
|
- <view v-if="formData.banzhengInfoFlag" class="form-label-input">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>实操成绩</view>
|
|
|
- <input v-model="formData.shicaochengji" placeholder="请填写实操成绩" />
|
|
|
- </view>
|
|
|
- <view v-if="formData.banzhengInfoFlag" class="form-label-input">
|
|
|
- <view class="phone-form-label"><text class="form-label-require">*</text>总课时</view>
|
|
|
- <input v-model="formData.zongkeshi" placeholder="请填写总课时" />
|
|
|
- </view>
|
|
|
+ <view v-if="formData.banzhengInfoFlag" class="form-label-input">
|
|
|
+ <view class="phone-form-label"><text class="form-label-require">*</text>实操成绩</view>
|
|
|
+ <input v-model="formData.shicaochengji" placeholder="请填写实操成绩" />
|
|
|
+ </view>
|
|
|
+ <view v-if="formData.banzhengInfoFlag" class="form-label-input">
|
|
|
+ <view class="phone-form-label"><text class="form-label-require">*</text>总课时</view>
|
|
|
+ <input v-model="formData.zongkeshi" placeholder="请填写总课时" />
|
|
|
+ </view>
|
|
|
+ <view v-if="formData.needFlag" class="form-label-select">
|
|
|
+ <view class="phone-form-label"><text class="form-label-require"></text>需要考试</view>
|
|
|
+ <radio-group @change="kaoshiChange">
|
|
|
+ <label class="radio-label">
|
|
|
+ <radio :value="'true'" :checked="formData.needKaoshi == 'true'" color="#3fd2a1"
|
|
|
+ style="transform:scale(0.65)" />
|
|
|
+ <text>是</text>
|
|
|
+ </label>
|
|
|
+ <label class="radio-label">
|
|
|
+ <radio :value="'false'" :checked="formData.needKaoshi == 'false'" color="#3fd2a1"
|
|
|
+ style="transform:scale(0.65)" />
|
|
|
+ <text>否</text>
|
|
|
+ </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>
|
|
|
+ <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 v-if="formData.needFlag" class="form-label-select">
|
|
|
- <view class="phone-form-label"><text class="form-label-require"></text>需要课程</view>
|
|
|
- <radio-group @change="kechengChange">
|
|
|
- <label class="radio-label">
|
|
|
- <radio :value="'true'" :disabled=" formData.kcDisabled" :checked="formData.needKecheng == 'true'"
|
|
|
- color="#3fd2a1" style="transform:scale(0.65)" />
|
|
|
- <text>是</text>
|
|
|
- </label>
|
|
|
- <label class="radio-label">
|
|
|
- <radio :value="'false'" :checked="formData.needKecheng == 'false'" color="#3fd2a1"
|
|
|
- style="transform:scale(0.65)" />
|
|
|
- <text>否</text>
|
|
|
- </label>
|
|
|
- </radio-group>
|
|
|
- </view>
|
|
|
- <view v-if="formData.needFlag" class="form-label-select">
|
|
|
- <view class="phone-form-label"><text class="form-label-require"></text>需要考试</view>
|
|
|
- <radio-group @change="kaoshiChange">
|
|
|
- <label class="radio-label">
|
|
|
- <radio :value="'true'" :checked="formData.needKaoshi == 'true'" color="#3fd2a1"
|
|
|
- style="transform:scale(0.65)" />
|
|
|
- <text>是</text>
|
|
|
- </label>
|
|
|
- <label class="radio-label">
|
|
|
- <radio :value="'false'" :checked="formData.needKaoshi == 'false'" color="#3fd2a1"
|
|
|
- style="transform:scale(0.65)" />
|
|
|
- <text>否</text>
|
|
|
- </label>
|
|
|
- </radio-group>
|
|
|
- </view>
|
|
|
- <view class="page-btn-box">
|
|
|
- <button type="default" v-if="status!='add'" @click="goBack" class="phone-white-btn">返回</button>
|
|
|
- <button type="default" @click="addSaveForm" class="phone-green-btn">保存</button>
|
|
|
+ </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>
|
|
|
</view>
|
|
|
- <!-- 提交按钮 -->
|
|
|
- <!-- <button class="submit-btn" @click="submitForm">提交</button> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -121,15 +130,15 @@
|
|
|
zhiyeId: '',
|
|
|
zhiyeLevelName: '',
|
|
|
zhiyeLevelId: '',
|
|
|
- canxunShijian: '',
|
|
|
+ canxunshijian: '',
|
|
|
shicaochengji: '',
|
|
|
zongkeshi: '',
|
|
|
needKecheng: 'false', // 默认选中"是"
|
|
|
needKaoshi: 'false', // 默认选中"是"
|
|
|
kcDisabled: false,
|
|
|
needFlag: false,
|
|
|
- id:'',
|
|
|
- createTime:''
|
|
|
+ id: '',
|
|
|
+ createTime: ''
|
|
|
},
|
|
|
baozhengJigouOpt: [
|
|
|
|
|
@@ -139,13 +148,21 @@
|
|
|
|
|
|
],
|
|
|
localStatus: '',
|
|
|
- currentIndex :''
|
|
|
+ currentIndex: '',
|
|
|
+ isJgFlag: true,
|
|
|
+ isZyFlag: true,
|
|
|
+ piliang: '',
|
|
|
+ piliangArray: []
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
status: {
|
|
|
type: String,
|
|
|
+ },
|
|
|
+ isZijiazheng: {
|
|
|
+ type: String,
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
jigouNames() {
|
|
@@ -164,10 +181,24 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- goBack(){
|
|
|
- this.$emit('goBack');
|
|
|
+ piliangDelete(item, index) {
|
|
|
+ this.piliangArray.splice(index, 1);
|
|
|
+ },
|
|
|
+ isPiliang(data) {
|
|
|
+ this.piliang = data
|
|
|
+ if (data == 0) {
|
|
|
+ this.piliangArray = []
|
|
|
+ }
|
|
|
},
|
|
|
- editinfo(data,index) {
|
|
|
+ goBack() {
|
|
|
+ this.isJgFlag = true
|
|
|
+ this.isZyFlag = true
|
|
|
+ this.piliangArray = []
|
|
|
+ this.$emit('goBack');
|
|
|
+ },
|
|
|
+ editinfo(data, index) {
|
|
|
+ this.piliangArray = []
|
|
|
+ console.log('123123', data);
|
|
|
this.$nextTick(() => {
|
|
|
if (!data) {
|
|
|
return false
|
|
@@ -184,6 +215,7 @@
|
|
|
this.formData.zhiyeLevelName = data.zyLevelName;
|
|
|
this.formData.zhiyeLevelId = data.zyLevel;
|
|
|
if (this.formData.baozhengJigouId) {
|
|
|
+ this.isJgFlag = false
|
|
|
getJiazhengZhiye({
|
|
|
id: this.formData.baozhengJigouId
|
|
|
}).then(res => {
|
|
@@ -192,6 +224,7 @@
|
|
|
})
|
|
|
}
|
|
|
if (this.formData.baozhengJigouId && this.formData.zhiyeId) {
|
|
|
+ this.isZyFlag = false
|
|
|
let req = {
|
|
|
jgId: this.formData.baozhengJigouId,
|
|
|
zyId: this.formData.zhiyeId,
|
|
@@ -202,7 +235,8 @@
|
|
|
this.zhiyelevelsOpt = res.data
|
|
|
})
|
|
|
}
|
|
|
- this.formData.canxunShijian = data.canxunShijian;
|
|
|
+ this.formData.canxunshijian = data.canxunshijian;
|
|
|
+ this.formData.zongkeshi = data.zongkeshi;
|
|
|
this.formData.shicaochengji = data.shicaochengji;
|
|
|
this.formData.needKecheng = data.needKecheng ? data.needKecheng.toString() : 'false';
|
|
|
this.formData.needKaoshi = data.needKaoshi ? data.needKaoshi.toString() : 'false';
|
|
@@ -252,16 +286,18 @@
|
|
|
this.formData.zhiyeId = ''
|
|
|
this.formData.zhiyeLevelName = ''
|
|
|
this.formData.zhiyeLevelId = ''
|
|
|
- this.formData.canxunShijian = ''
|
|
|
+ this.formData.canxunshijian = ''
|
|
|
this.formData.shicaochengji = ''
|
|
|
this.formData.zongkeshi = ''
|
|
|
+ this.isJgFlag = true
|
|
|
+ this.isZyFlag = true
|
|
|
},
|
|
|
resetFun() {
|
|
|
this.formData.zhiyeName = ''
|
|
|
this.formData.zhiyeId = ''
|
|
|
this.formData.zhiyeLevelName = ''
|
|
|
this.formData.zhiyeLevelId = ''
|
|
|
- this.formData.canxunShijian = ''
|
|
|
+ this.formData.canxunshijian = ''
|
|
|
this.formData.shicaochengji = ''
|
|
|
this.formData.zongkeshi = ''
|
|
|
this.formData.baozhengJigouName = ''
|
|
@@ -272,7 +308,9 @@
|
|
|
this.formData.needFlag = false
|
|
|
this.formData.kcDisabled = false
|
|
|
this.formData.banzhengInfoFlag = false
|
|
|
-
|
|
|
+ this.isJgFlag = true
|
|
|
+ this.isZyFlag = true
|
|
|
+ this.piliangArray = []
|
|
|
|
|
|
},
|
|
|
// 报证机构选择
|
|
@@ -283,6 +321,7 @@
|
|
|
this.formData.banzhengInfoFlag = this.baozhengJigouOpt[e.detail.value].jgType == 1;
|
|
|
// 每一次都重置
|
|
|
this.resetData()
|
|
|
+
|
|
|
console.log('this.formData.banzhengInfoFlag', this.formData.banzhengInfoFlag);
|
|
|
if (this.formData.banzhengInfoFlag) {
|
|
|
this.formData.needFlag = false
|
|
@@ -293,7 +332,10 @@
|
|
|
this.formData.needKaoshi = 'true'
|
|
|
this.formData.needKecheng = 'false'
|
|
|
}
|
|
|
- this.getZhiye()
|
|
|
+ if (this.formData.baozhengJigouId) {
|
|
|
+ this.isJgFlag = false //开启
|
|
|
+ this.getZhiye()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 职业等级选择
|
|
@@ -326,11 +368,14 @@
|
|
|
zhiyeChange(e) {
|
|
|
this.formData.zhiyeName = this.zhiyeNameOpt[e.detail.value].name;
|
|
|
this.formData.zhiyeId = this.zhiyeNameOpt[e.detail.value].id;
|
|
|
- this.getZhiyeLevel()
|
|
|
+ if (this.formData.baozhengJigouId && this.formData.zhiyeId) {
|
|
|
+ this.isZyFlag = false
|
|
|
+ this.getZhiyeLevel()
|
|
|
+ }
|
|
|
},
|
|
|
canxunShijianChange(e) {
|
|
|
console.log('e', e);
|
|
|
- this.formData.canxunShijian = e
|
|
|
+ this.formData.canxunshijian = e
|
|
|
},
|
|
|
|
|
|
// 需要课程选择
|
|
@@ -359,11 +404,127 @@
|
|
|
this.formData.needKaoshi = e.detail.value.toString();
|
|
|
},
|
|
|
currentMove(data) {
|
|
|
- console.log('');
|
|
|
+ console.log('data', data);
|
|
|
// 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
|
|
@@ -384,12 +545,19 @@
|
|
|
zyName: this.formData.zhiyeName,
|
|
|
zyLevelName: this.formData.zhiyeLevelName,
|
|
|
id: this.formData.id,
|
|
|
- createTime:dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
+ createTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
}
|
|
|
console.log('req', req);
|
|
|
- if(this.status =='add'||this.localStatus =='editadd'){
|
|
|
+ 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 == '')) {
|
|
@@ -399,19 +567,22 @@
|
|
|
});
|
|
|
return false
|
|
|
}
|
|
|
+ console.log('req123123123', req);
|
|
|
if (req.jgId && req.zyId && req.zyLevel) {
|
|
|
- if (this.status == 'add') {
|
|
|
+ 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);
|
|
|
+ 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') {
|
|
|
+ } else if (this.localStatus == 'editAdd') {
|
|
|
//this.$emit('editSave', '');
|
|
|
// uni.showToast({
|
|
|
// title: '请选择保证机构,职业名称,职业等级',
|
|
@@ -419,8 +590,8 @@
|
|
|
// });
|
|
|
|
|
|
// return false
|
|
|
- }else{
|
|
|
-
|
|
|
+ } else {
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
uni.showToast({
|
|
@@ -430,34 +601,6 @@
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
- // // 表单验证
|
|
|
- // if (!this.formData.institution) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '请选择报证机构',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (!this.formData.selectedLevel) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '请选择职业等级',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (!this.formData.selectedOccupation) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '请选择职业名称',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 提交数据(示例)
|
|
|
- // console.log('提交数据:', this.formData);
|
|
|
- // uni.showToast({
|
|
|
- // title: '提交成功'
|
|
|
- // });
|
|
|
}
|
|
|
}
|
|
|
};
|