diff --git a/src/views/modules/base/organization/organization.vue b/src/views/modules/base/organization/organization.vue index a5aaabc72..ec36dd23c 100644 --- a/src/views/modules/base/organization/organization.vue +++ b/src/views/modules/base/organization/organization.vue @@ -273,6 +273,22 @@ + + + + + + + + + + + + @@ -285,12 +301,15 @@ - + + + +
取 消 @@ -383,23 +402,51 @@ - - - - + + + - + + + + + + + + + + + + + + + + + + + + + +
@@ -410,6 +457,42 @@ + @@ -505,7 +588,42 @@ import daiMap from '@/utils/dai-map'; export default { data() { + // 验证手机号 + const checkPhone = (rule, value, callback) => { + if (value === '') { + callback(new Error('请输入手机号')); + } else if (!/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(1[|6|7|8][0-9]))\d{8}$/.test(value)) { + callback(new Error('请输入正确的手机号格式')); + } else { + callback(); + } + }; + // 验证身份证号 + + const checkCardId = (rule, value, callback) => { + if (value === '') { + callback(new Error('请输入身份证号')); + } else if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value)) { + callback(new Error('请输入正确的身份证号')); + } else { + callback(); + } + }; + // 验证统一社会信用代码 + const checkCreditCode = (rule, value, callback) => { + if (value === '') { + callback(new Error('请输入统一社会信用代码')); + // /[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}/ + } else if (!/^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g.test(value)) { + callback(new Error('请输入正确的统一社会信用代码')); + } else { + callback(); + } + }; + return { + uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', + customerId: '', // 新增组织弹窗 createAgencyDialogFlag: false, // 修改市区级组织弹窗 @@ -627,8 +745,15 @@ export default { contacts: '', mobile: '', remark: '', - code: '' + code: '', + secretaryName: '', + secretaryMobile: '', + dutyMobile: '', + unifiedSocialCreditCode: '', + unifiedSocialCreditCodeCertificate: '', + fullAddress: '', }, + // 树 tree: [], // 新增人员表单项 @@ -670,7 +795,13 @@ export default { areaCode: '', agencyId: '', areaName: '', - remark: '' + remark: '', + secretaryName: '', + secretaryMobile: '', + dutyMobile: '', + unifiedSocialCreditCode: '', + unifiedSocialCreditCodeCertificate: '', + fullAddress: '', }, // 下级机关单位 OrgUnitDetailsForm: { @@ -724,35 +855,53 @@ export default { departmentName: [ { required: true, - message: '社区名称必填', + message: '社区名称不能为空', trigger: 'blur' } ], gridName: [ { required: true, - message: '网格名称必填', + message: '网格名称不能为空', trigger: 'blur' } ], addDepartmentName: [ { required: true, - message: '部门名称必填', + message: '部门名称不能为空', trigger: 'blur' } ] }, rulesPeo: { - name: [{ required: true, message: '姓名必填', trigger: 'blur' }], - mobile: [{ required: true, message: '手机号必填', trigger: 'blur' }], - gender: [{ required: true, message: '性别必填', trigger: 'blur' }], - post: [{ required: true, message: '专兼职必填', trigger: 'blur' }], - duty: [{ required: true, message: '职责必填', trigger: 'blur' }], - newRoles: [{ required: true, message: '角色必填', trigger: 'blur' }] + name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }], + mobile: [{ required: true, validator: checkPhone, message: '手机号不能为空', trigger: 'blur' }], + gender: [{ required: true, message: '性别不能为空', trigger: 'blur' }], + idCard: [{ required: true, validator: checkCardId, trigger: 'blur' }], + viliagePosition: [{ required: true, message: '村居委员职务不能为空', trigger: 'blur' }], + partyPosition: [{ required: true, message: '党组织职务不能为空', trigger: 'blur' }], + address: [{ required: true, message: '居住地址不能为空', trigger: 'blur' }], + culture: [{ required: true, message: '文化程度不能为空', trigger: 'blur' }], + + post: [{ required: true, message: '专兼职不能为空', trigger: 'blur' }], + duty: [{ required: true, message: '职责不能为空', trigger: 'blur' }], + newRoles: [{ required: true, message: '角色不能为空', trigger: 'blur' }] + }, + dataRuleOrg: { + // checkPhone + // checkCardId + // checkCreditCode + agencyName: [{ required: true, message: '组织名称不能为空', trigger: 'blur' }], + areaCode: [{ required: true, message: '组织区划不能为空', trigger: 'blur' }], + secretaryName: [{ required: true, message: '村居/社区书记姓名不能为空', trigger: 'blur' }], + secretaryMobile: [{ required: true, validator: checkPhone, trigger: 'blur' }], + dutyMobile: [{ required: true, message: '值班电话不能为空', trigger: 'blur' }], + unifiedSocialCreditCode: [{ required: true, validator: checkCreditCode, trigger: 'blur' }], + unifiedSocialCreditCodeCertificate: [{ required: true, message: '统一社会信用代码证书不能为空', trigger: 'blur' }], + fullAddress: [{ required: true, message: '详细地址不能为空', trigger: 'blur' }] }, - selDeptType: '', searchStaffKeyword: '', @@ -821,6 +970,23 @@ export default { // this.initMap() }, methods: { + handleImgSuccess(index, res, file) { + if (res.code === 0 && res.msg === 'success') { + console.log('res.data.url', res.data.url); + this.agencyForm.unifiedSocialCreditCodeCertificate = res.data.url; + } else { + this.$message.error(res.msg); + } + }, + + beforeImgUpload(file) { + const isLt1M = file.size / 1024 / 1024 < 1; + + if (!isLt1M) { + this.$message.error('上传图片大小不能超过 1MB!'); + } + return isLt1M; + }, // async handleExport () { // let title = "部门导出"; @@ -872,7 +1038,7 @@ export default { let fileFormData = new FormData(); fileFormData.append('file', this.files); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - fileFormData.append('agencyId',this.currentAgencyId); + fileFormData.append('agencyId', this.currentAgencyId); url = '/gov/org/department/yantai/import'; window.app.ajax.post2( @@ -892,7 +1058,6 @@ export default { // this.$message.error(rspMsg) } // this.loadTable(); - }, (rspMsg, data) => {}, { headers: { 'Content-Type': 'multipart/form-data' } } @@ -1389,6 +1554,14 @@ export default { (this.agencyForm.mobile = ''), (this.agencyForm.code = ''), (this.agencyForm.remark = ''), + + (this.agencyForm.secretaryName = ''), + (this.agencyForm.secretaryMobile = ''), + (this.agencyForm.dutyMobile = ''), + (this.agencyForm.unifiedSocialCreditCode = ''), + (this.agencyForm.unifiedSocialCreditCodeCertificate = ''), + (this.agencyForm.fullAddress = ''), + (this.latitude = ''), (this.longitude = ''); }, @@ -1401,6 +1574,12 @@ export default { (this.OrgDetailsForm.mobile = ''), (this.OrgDetailsForm.centerAddress = ''), (this.OrgDetailsForm.areaCode = ''); + (this.OrgDetailsForm.secretaryName = ''), + (this.OrgDetailsForm.secretaryMobile = ''), + (this.OrgDetailsForm.dutyMobile = ''), + (this.OrgDetailsForm.unifiedSocialCreditCode = ''), + (this.OrgDetailsForm.unifiedSocialCreditCodeCertificate = ''), + (this.OrgDetailsForm.fullAddress = ''), this.OrgDetailsForm.agencyId = ''; (this.latitude = ''), (this.longitude = ''); }, @@ -2118,7 +2297,13 @@ export default { code: this.agencyForm.code, remark: this.agencyForm.remark, latitude: this.latitude, - longitude: this.longitude + longitude: this.longitude, + secretaryName: this.secretaryName, + secretaryMobile: this.secretaryMobile, + dutyMobile: this.dutyMobile, + unifiedSocialCreditCode: this.unifiedSocialCreditCode, + unifiedSocialCreditCodeCertificate: this.unifiedSocialCreditCodeCertificate, + fullAddress: this.fullAddress, }; const { data, code, msg } = await requestPost(url, params); @@ -2192,6 +2377,12 @@ export default { this.latitude = data.latitude; this.longitude = data.longitude; this.OrgDetailsForm.agencyId = data.agencyId; + this.OrgDetailsForm.secretaryName=data.secretaryName; + this.OrgDetailsForm.secretaryMobile=data.secretaryMobile; + this.OrgDetailsForm.dutyMobile=data.dutyMobile; + this.OrgDetailsForm.unifiedSocialCreditCode=data.unifiedSocialCreditCode; + this.OrgDetailsForm.unifiedSocialCreditCodeCertificate=data.unifiedSocialCreditCodeCertificate; + this.OrgDetailsForm.fullAddress=data.fullAddress; } else { this.$message.error(msg); } @@ -2395,4 +2586,27 @@ export default { .el-tag + .el-tag { margin-left: 10px; } +.avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + } + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 178px; + height: 178px; + line-height: 178px; + text-align: center; + } + .avatar { + width: 178px; + height: 178px; + display: block; + }