|
|
@@ -52,7 +52,7 @@
|
|
|
<el-col :span="10">
|
|
|
<el-form-item prop="organization" label="所属机构">
|
|
|
<el-input v-if="operationForm.typeAttr!='6'" disabled v-model="operationForm.organization"></el-input>
|
|
|
- <el-cascader v-else style="width: 100%" v-model="operationForm.organization" placeholder="请选择所属机构" :options="deptOption" :props="optionProps"></el-cascader>
|
|
|
+ <el-cascader v-else style="width: 100%" v-model="operationForm.organization" placeholder="请选择所属机构" :options="deptOption" :props="optionProps" @change="deptIdChange"></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
@@ -129,7 +129,10 @@
|
|
|
<el-descriptions title="资料附件">
|
|
|
<el-descriptions-item>
|
|
|
<template #default>
|
|
|
- <el-form-item prop="IDCardFront" label="身份证(人像面)" label-width="150">
|
|
|
+ <el-form-item prop="IDCardFront" label-width="150">
|
|
|
+ <template #label>
|
|
|
+ <span style="color: #f56c6c">*</span>身份证(人像面)
|
|
|
+ </template>
|
|
|
<el-upload action="" v-if="!IDCardFront" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 1)">
|
|
|
<el-button link type="primary">上传</el-button>
|
|
|
</el-upload>
|
|
|
@@ -145,7 +148,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="IDCardBack" label="身份证(国徽面)" label-width="150">
|
|
|
+ <el-form-item prop="IDCardBack" label-width="150">
|
|
|
+ <template #label>
|
|
|
+ <span style="color: #f56c6c">*</span>身份证(国徽面)
|
|
|
+ </template>
|
|
|
<el-upload v-if="!IDCardBack" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 2)">
|
|
|
<el-button link type="primary">上传</el-button>
|
|
|
</el-upload>
|
|
|
@@ -451,6 +457,7 @@
|
|
|
import { ref, reactive, defineEmits, onMounted } from 'vue'
|
|
|
import type { AddOperation } from '@/api/modules/operation.ts'
|
|
|
import type { FormRules, FormInstance } from "element-plus";
|
|
|
+import { Plus } from '@element-plus/icons-vue'
|
|
|
import api from "@/api";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
|
|
|
@@ -566,12 +573,12 @@ const operationRules = ref<FormRules>({
|
|
|
referrerNumber: [
|
|
|
{ required: true, trigger: "blur", message: "请填写推荐人工号" }
|
|
|
],
|
|
|
- IDCardFront: [
|
|
|
- { required: true, trigger: "change", message: "请上传身份(人像面)" }
|
|
|
- ],
|
|
|
- IDCardBack: [
|
|
|
- { required: true, trigger: "change", message: "请上传身份(国徽面)" }
|
|
|
- ],
|
|
|
+ // IDCardFront: [
|
|
|
+ // { required: true, trigger: "change", message: "请上传身份(人像面)" }
|
|
|
+ // ],
|
|
|
+ // IDCardBack: [
|
|
|
+ // { required: true, trigger: "change", message: "请上传身份(国徽面)" }
|
|
|
+ // ],
|
|
|
bankCardId: [
|
|
|
{
|
|
|
pattern: /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/,
|
|
|
@@ -636,6 +643,7 @@ const initEditData = (id) => {
|
|
|
api.operationApi.operationDetail(id).then(res => {
|
|
|
if(res?.code == 200) {
|
|
|
let formData = res.data
|
|
|
+ initTeamData(formData?.typeAttr==='5'?'1':formData?.typeAttr==='8'?'2':formData?.typeAttr==='7'?'3':'')
|
|
|
operationForm.value = formData
|
|
|
operationForm.value.organization = formData.deptName
|
|
|
operationForm.value.deptId = formData.deptId
|
|
|
@@ -913,75 +921,82 @@ const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
|
|
|
if(type) {
|
|
|
await OperationFormRef.validate((valid, error) => {
|
|
|
if(valid) {
|
|
|
- let formData = {...operationForm.value}
|
|
|
- // formData.organization = operationForm.value.organization[operationForm.value.organization.length - 1]
|
|
|
- formData.systemCode = localStorage.getItem('login_system')?localStorage.getItem('login_system'):''
|
|
|
- formData.province = operationForm.value.address?operationForm.value.address[0]:''
|
|
|
- formData.city = operationForm.value.address?operationForm.value.address[1]?operationForm.value.address[1]:'':''
|
|
|
- formData.district = operationForm.value.address?operationForm.value.address[2]?operationForm.value.address[2]:'':''
|
|
|
- if(editId.value) {
|
|
|
- api.operationApi.updateOperation(formData).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- ElMessage({
|
|
|
- message: res.msg,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- emits('closeDialog', '确定')
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: res.msg,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
- IDCardFrontName.value = ''
|
|
|
- IDCardFront.value = ''
|
|
|
- IDCardBackName.value = ''
|
|
|
- IDCardBack.value = ''
|
|
|
- certificationName.value = ''
|
|
|
- certification.value = ''
|
|
|
- contractName.value = ''
|
|
|
- contract.value = ''
|
|
|
- applicantName.value = ''
|
|
|
- applicant.value = ''
|
|
|
- decidePayName.value = ''
|
|
|
- decidePay.value = ''
|
|
|
- dimissionName.value = ''
|
|
|
- dimission.value = ''
|
|
|
- recordShow.value = false
|
|
|
- OperationFormRef.resetFields()
|
|
|
- emits('closeDialog', '取消')
|
|
|
- })
|
|
|
+ if(IDCardFront.value&&IDCardBack.value) {
|
|
|
+ let formData = {...operationForm.value}
|
|
|
+ // formData.organization = operationForm.value.organization[operationForm.value.organization.length - 1]
|
|
|
+ formData.systemCode = localStorage.getItem('login_system')?localStorage.getItem('login_system'):''
|
|
|
+ formData.province = operationForm.value.address?operationForm.value.address[0]:''
|
|
|
+ formData.city = operationForm.value.address?operationForm.value.address[1]?operationForm.value.address[1]:'':''
|
|
|
+ formData.district = operationForm.value.address?operationForm.value.address[2]?operationForm.value.address[2]:'':''
|
|
|
+ if(editId.value) {
|
|
|
+ api.operationApi.updateOperation(formData).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ emits('closeDialog', '确定')
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ IDCardFrontName.value = ''
|
|
|
+ IDCardFront.value = ''
|
|
|
+ IDCardBackName.value = ''
|
|
|
+ IDCardBack.value = ''
|
|
|
+ certificationName.value = ''
|
|
|
+ certification.value = ''
|
|
|
+ contractName.value = ''
|
|
|
+ contract.value = ''
|
|
|
+ applicantName.value = ''
|
|
|
+ applicant.value = ''
|
|
|
+ decidePayName.value = ''
|
|
|
+ decidePay.value = ''
|
|
|
+ dimissionName.value = ''
|
|
|
+ dimission.value = ''
|
|
|
+ recordShow.value = false
|
|
|
+ OperationFormRef.resetFields()
|
|
|
+ emits('closeDialog', '取消')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ api.operationApi.addOperation(formData).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ emits('closeDialog', '确定')
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ IDCardFrontName.value = ''
|
|
|
+ IDCardFront.value = ''
|
|
|
+ IDCardBackName.value = ''
|
|
|
+ IDCardBack.value = ''
|
|
|
+ certificationName.value = ''
|
|
|
+ certification.value = ''
|
|
|
+ contractName.value = ''
|
|
|
+ contract.value = ''
|
|
|
+ applicantName.value = ''
|
|
|
+ applicant.value = ''
|
|
|
+ decidePayName.value = ''
|
|
|
+ decidePay.value = ''
|
|
|
+ dimissionName.value = ''
|
|
|
+ dimission.value = ''
|
|
|
+ recordShow.value = false
|
|
|
+ OperationFormRef.resetFields()
|
|
|
+ emits('closeDialog', '取消')
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
- api.operationApi.addOperation(formData).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- ElMessage({
|
|
|
- message: res.msg,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- emits('closeDialog', '确定')
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: res.msg,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
- IDCardFrontName.value = ''
|
|
|
- IDCardFront.value = ''
|
|
|
- IDCardBackName.value = ''
|
|
|
- IDCardBack.value = ''
|
|
|
- certificationName.value = ''
|
|
|
- certification.value = ''
|
|
|
- contractName.value = ''
|
|
|
- contract.value = ''
|
|
|
- applicantName.value = ''
|
|
|
- applicant.value = ''
|
|
|
- decidePayName.value = ''
|
|
|
- decidePay.value = ''
|
|
|
- dimissionName.value = ''
|
|
|
- dimission.value = ''
|
|
|
- recordShow.value = false
|
|
|
- OperationFormRef.resetFields()
|
|
|
- emits('closeDialog', '取消')
|
|
|
+ ElMessage({
|
|
|
+ message: '请上传必传附件!',
|
|
|
+ type: 'warning'
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1029,7 +1044,7 @@ const initInfo = () => {
|
|
|
健康状况 health_status
|
|
|
学历 educational
|
|
|
* */
|
|
|
- let infoList = ['gender', 'nation', 'marriage', 'political_status', 'health_status', 'educational']
|
|
|
+ let infoList = ['gender', 'nation', 'marriage', 'political_status', 'health_status', 'educational', 'team']
|
|
|
infoList.forEach((item: string, index: number) => {
|
|
|
api.commonApi.personInfo(item).then((res) => {
|
|
|
if(res?.code == 200) {
|
|
|
@@ -1057,6 +1072,21 @@ const getArea = () => {
|
|
|
}
|
|
|
|
|
|
// 团队数据
|
|
|
+const initTeamData = async (e) => {
|
|
|
+ const { code, data, msg } = await api.teamApi.teamList({
|
|
|
+ attribute: e,
|
|
|
+ param: ''
|
|
|
+ })
|
|
|
+ if(code == 200) {
|
|
|
+ teamList.value = data
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
let teamList = ref([])
|
|
|
const typeAttrChange = async (e) => {
|
|
|
operationForm.value.organization = ''
|
|
|
@@ -1065,22 +1095,13 @@ const typeAttrChange = async (e) => {
|
|
|
operationForm.value.referrerId = ''
|
|
|
operationForm.value.referrerNumber = ''
|
|
|
if(e != '6') {
|
|
|
- const { code, data, msg } = await api.teamApi.teamList({
|
|
|
- attribute: e,
|
|
|
- param: ''
|
|
|
- })
|
|
|
- if(code == 200) {
|
|
|
- teamList.value = data
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: msg,
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- }
|
|
|
+ initTeamData(e==='5'?'1':e==='8'?'2':e==='7'?'3':'')
|
|
|
} else {
|
|
|
institutionList();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 团队切换
|
|
|
const deptChange = (e) => {
|
|
|
const obj = teamList.value.find(item => item.id == e)
|
|
|
operationForm.value.organization = obj.deptName
|
|
|
@@ -1088,6 +1109,13 @@ const deptChange = (e) => {
|
|
|
getUser(obj.deptId)
|
|
|
getRecommend(obj.deptId)
|
|
|
}
|
|
|
+// 机构切换
|
|
|
+const deptIdChange = (e) => {
|
|
|
+ if(e) {
|
|
|
+ getUser(e[e.length - 1])
|
|
|
+ getRecommend(e[e.length - 1])
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
// 初始化银行数据
|
|
|
let bankOption = ref([])
|