|
@@ -5,15 +5,15 @@
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-form :class="isDetail ? '' : 'v-form-text'" ref="formItem" :model="sizeForm" :rules="rules" label-width="160px">
|
|
|
|
|
|
+ <el-form :class="isDetail ? '' : 'v-form-text'" ref="ruleForm" :model="sizeForm" :rules="rules" label-width="160px">
|
|
<dg-row>
|
|
<dg-row>
|
|
<dg-col :span="12">
|
|
<dg-col :span="12">
|
|
- <el-form-item label="审批类型:" prop="approveType">
|
|
|
|
- <div v-if="isDetail">{{ sizeForm.approveType }}</div>
|
|
|
|
|
|
+ <el-form-item label="审批类型:" prop="applyType">
|
|
|
|
+ <div v-if="isDetail">{{ sizeForm.applyType }}</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
<dg-select
|
|
<dg-select
|
|
- :data="approveType"
|
|
|
|
- v-model="sizeForm.approveType"
|
|
|
|
|
|
+ :data="applyType"
|
|
|
|
+ v-model="sizeForm.applyType"
|
|
@change="handleChangeApproveType"
|
|
@change="handleChangeApproveType"
|
|
:disabled="type == 'edit'"
|
|
:disabled="type == 'edit'"
|
|
></dg-select>
|
|
></dg-select>
|
|
@@ -24,31 +24,30 @@
|
|
<el-form-item label="流程名称:" prop="processName">
|
|
<el-form-item label="流程名称:" prop="processName">
|
|
<div v-if="isDetail">{{ sizeForm.processName }}</div>
|
|
<div v-if="isDetail">{{ sizeForm.processName }}</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- <dg-select :data="[]" v-model="sizeForm.processName"></dg-select>
|
|
|
|
|
|
+ <dg-select
|
|
|
|
+ :data="processNameType"
|
|
|
|
+ v-model="sizeForm.processName"
|
|
|
|
+ @change="handleChangeProcessName"
|
|
|
|
+ ></dg-select>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
- <dg-col :span="12">
|
|
|
|
- <el-form-item label="流程编号:" prop="processTitle">
|
|
|
|
- <div v-if="isDetail">{{ sizeForm.processTitle }}</div>
|
|
|
|
- <div v-else>
|
|
|
|
- <el-input v-model="sizeForm.processTitle" :disabled="true"></el-input>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <dg-col :span="12" v-if="isDetail">
|
|
|
|
+ <el-form-item label="流程编号:" prop="businessCode">
|
|
|
|
+ <div>{{ sizeForm.businessCode }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
- <dg-col :span="12">
|
|
|
|
- <el-form-item label="审批单标题:" prop="processTitle">
|
|
|
|
- <div v-if="isDetail">{{ sizeForm.processTitle }}</div>
|
|
|
|
- <div v-else>
|
|
|
|
- <el-input v-model="sizeForm.processTitle" :disabled="true"></el-input>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <dg-col :span="12" v-if="isDetail">
|
|
|
|
+ <el-form-item label="审批单编号:" prop="applicantId">
|
|
|
|
+ <div>{{ sizeForm.applicantId }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
<dg-col :span="12">
|
|
<dg-col :span="12">
|
|
- <el-form-item label="审批单编号:" prop="processTitle">
|
|
|
|
- <div v-if="isDetail">{{ sizeForm.processTitle }}</div>
|
|
|
|
|
|
+ <!-- 流程名称+申请人姓名+日期 -->
|
|
|
|
+ <el-form-item label="审批单标题:" prop="applyTitle">
|
|
|
|
+ <div v-if="isDetail">{{ sizeForm.applyTitle }}</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- <el-input v-model="sizeForm.processTitle" :disabled="true"></el-input>
|
|
|
|
|
|
+ <el-input v-model="sizeForm.applyTitle" :disabled="true"></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
@@ -92,7 +91,7 @@
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
- <dg-col :span="12" v-if="sizeForm.approveType == '1'">
|
|
|
|
|
|
+ <dg-col :span="12" v-if="sizeForm.applyType == '1'">
|
|
<el-form-item label="应用方:" prop="applyId">
|
|
<el-form-item label="应用方:" prop="applyId">
|
|
<div v-if="isDetail">{{ sizeForm.applyId }}</div>
|
|
<div v-if="isDetail">{{ sizeForm.applyId }}</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
@@ -112,18 +111,18 @@
|
|
<dg-row>
|
|
<dg-row>
|
|
<dg-col :span="24">
|
|
<dg-col :span="24">
|
|
<!-- <component :is="approveComponent"></component> -->
|
|
<!-- <component :is="approveComponent"></component> -->
|
|
- <el-form-item label="审批内容:" class="self-form-item" prop="applyContent">
|
|
|
|
|
|
+ <el-form-item label="审批内容:" class="self-form-item" prop="flowContent">
|
|
<div style="display: flex" v-if="!isDetail">
|
|
<div style="display: flex" v-if="!isDetail">
|
|
<el-input
|
|
<el-input
|
|
type="textarea"
|
|
type="textarea"
|
|
:autosize="{ minRows: 5 }"
|
|
:autosize="{ minRows: 5 }"
|
|
- v-model="sizeForm.applyContent"
|
|
|
|
|
|
+ v-model="sizeForm.flowContent"
|
|
:disabled="true"
|
|
:disabled="true"
|
|
></el-input>
|
|
></el-input>
|
|
<dg-button style="margin-left: 10px" @click="handleChoice">选择</dg-button>
|
|
<dg-button style="margin-left: 10px" @click="handleChoice">选择</dg-button>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- {{ sizeForm.applyContent }}
|
|
|
|
|
|
+ {{ sizeForm.flowContent }}
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
@@ -146,7 +145,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</dg-col>
|
|
</dg-col>
|
|
<!-- 数据资源访问权限 -->
|
|
<!-- 数据资源访问权限 -->
|
|
- <div v-if="sizeForm.approveType == '2'">
|
|
|
|
|
|
+ <div v-if="sizeForm.applyType == '2'">
|
|
<dg-col :span="13">
|
|
<dg-col :span="13">
|
|
<el-form-item label="案件/事件/线索/被查询人员类别:" prop="userType" label-width="250px">
|
|
<el-form-item label="案件/事件/线索/被查询人员类别:" prop="userType" label-width="250px">
|
|
<div v-if="isDetail">{{ sizeForm.userType }}</div>
|
|
<div v-if="isDetail">{{ sizeForm.userType }}</div>
|
|
@@ -196,14 +195,18 @@
|
|
</dg-col>
|
|
</dg-col>
|
|
<dg-col :span="10">
|
|
<dg-col :span="10">
|
|
<dg-date-picker
|
|
<dg-date-picker
|
|
- v-model="sizeForm.yxq"
|
|
|
|
|
|
+ :start-value.sync="sizeForm.startTime"
|
|
|
|
+ :end-value.sync="sizeForm.endTime"
|
|
type="daterange"
|
|
type="daterange"
|
|
range-separator="至"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ :default-time="['00:00:00', '23:59:59']"
|
|
v-show="sizeForm.permissionValidType !== '02'"
|
|
v-show="sizeForm.permissionValidType !== '02'"
|
|
:picker-options="pickerOptions"
|
|
:picker-options="pickerOptions"
|
|
|
|
+ clearable
|
|
|
|
+ :unlink-panels="true"
|
|
>
|
|
>
|
|
</dg-date-picker>
|
|
</dg-date-picker>
|
|
</dg-col>
|
|
</dg-col>
|
|
@@ -245,17 +248,20 @@
|
|
</el-form>
|
|
</el-form>
|
|
<div v-footer>
|
|
<div v-footer>
|
|
<dg-button @click="handleCancel">取消</dg-button>
|
|
<dg-button @click="handleCancel">取消</dg-button>
|
|
- <!-- <dg-button type="primary" @click="handleSave">保存</dg-button> -->
|
|
|
|
|
|
+ <dg-button type="primary" @click="handleSave">保存</dg-button>
|
|
<dg-button type="primary" @click="handleSubmit">提交</dg-button>
|
|
<dg-button type="primary" @click="handleSubmit">提交</dg-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import * as regular from '@/utils/regular';
|
|
|
|
|
|
+import { checkPhone } from '@/utils/regular';
|
|
import appFuncForm from './app-func-form.vue';
|
|
import appFuncForm from './app-func-form.vue';
|
|
import serviceSourceForm from './service-source-form.vue';
|
|
import serviceSourceForm from './service-source-form.vue';
|
|
import dataSourceForm from './data-source-form.vue';
|
|
import dataSourceForm from './data-source-form.vue';
|
|
|
|
+import moment from 'moment';
|
|
|
|
+import { savePermissionApply } from '@/api/permission-selfhelp-manage';
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'FormItem',
|
|
name: 'FormItem',
|
|
// 接收父页面传过来的属性
|
|
// 接收父页面传过来的属性
|
|
@@ -267,11 +273,11 @@ export default {
|
|
},
|
|
},
|
|
// 页面数据绑定
|
|
// 页面数据绑定
|
|
data() {
|
|
data() {
|
|
- const checkPhone = (rule, val, callback) => {
|
|
|
|
|
|
+ const checkPhoneValid = (rule, val, callback) => {
|
|
if (!val) {
|
|
if (!val) {
|
|
return callback(new Error('请输入手机号码'));
|
|
return callback(new Error('请输入手机号码'));
|
|
}
|
|
}
|
|
- if (val && !regular.checkPhone(val)) {
|
|
|
|
|
|
+ if (val && !checkPhone(val)) {
|
|
return callback(new Error('请输入正确格式的手机号码'));
|
|
return callback(new Error('请输入正确格式的手机号码'));
|
|
}
|
|
}
|
|
callback();
|
|
callback();
|
|
@@ -279,7 +285,7 @@ export default {
|
|
return {
|
|
return {
|
|
sizeForm: {},
|
|
sizeForm: {},
|
|
approveComponent: 'appFuncForm',
|
|
approveComponent: 'appFuncForm',
|
|
- approveType: [
|
|
|
|
|
|
+ applyType: [
|
|
{
|
|
{
|
|
label: '应用功能访问权限',
|
|
label: '应用功能访问权限',
|
|
value: '0'
|
|
value: '0'
|
|
@@ -293,15 +299,24 @@ export default {
|
|
value: '2'
|
|
value: '2'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
|
|
+ processNameType: [
|
|
|
|
+ {
|
|
|
|
+ label: '应用功能访问权限申请',
|
|
|
|
+ value: '0'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '服务资源访问权限申请',
|
|
|
|
+ value: '1'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
rules: {
|
|
rules: {
|
|
- processTitle: { required: true, message: '请输入流程标题', trigger: 'blur' },
|
|
|
|
- applyContent: { required: true, message: '请选择审批内容', trigger: 'blur' },
|
|
|
|
- approveType: { required: true, message: '请输入流程类型', trigger: 'blur' },
|
|
|
|
|
|
+ flowContent: { required: true, message: '请选择审批内容', trigger: 'blur' },
|
|
|
|
+ applyType: { required: true, message: '请选择审批类型', trigger: 'blur' },
|
|
processName: { required: true, message: '请输入流程名称', trigger: 'blur' },
|
|
processName: { required: true, message: '请输入流程名称', trigger: 'blur' },
|
|
applyReason: [{ required: true, message: '请输入申请理由', trigger: 'blur' }],
|
|
applyReason: [{ required: true, message: '请输入申请理由', trigger: 'blur' }],
|
|
applicantPhoneNo: [
|
|
applicantPhoneNo: [
|
|
{ required: true, message: '请输入申请人电话号码', trigger: 'blur' },
|
|
{ required: true, message: '请输入申请人电话号码', trigger: 'blur' },
|
|
- { validator: checkPhone, trigger: 'blur' }
|
|
|
|
|
|
+ { validator: checkPhoneValid, trigger: 'blur' }
|
|
],
|
|
],
|
|
permissionValidType: { required: true, message: '请选择有效期类型', trigger: 'change' },
|
|
permissionValidType: { required: true, message: '请选择有效期类型', trigger: 'change' },
|
|
applyId: [{ required: true, message: '请选择应用方', trigger: 'blur' }], // 应用方
|
|
applyId: [{ required: true, message: '请选择应用方', trigger: 'blur' }], // 应用方
|
|
@@ -325,35 +340,85 @@ export default {
|
|
disabledDate(currentDate) {
|
|
disabledDate(currentDate) {
|
|
return currentDate.getTime() < Date.now() - 8.64e7;
|
|
return currentDate.getTime() < Date.now() - 8.64e7;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ applySelectKeys: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- components: {
|
|
|
|
- appFuncForm
|
|
|
|
- },
|
|
|
|
|
|
+ components: {},
|
|
computed: {
|
|
computed: {
|
|
isDetail() {
|
|
isDetail() {
|
|
return this.type == 'detail';
|
|
return this.type == 'detail';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ 'sizeForm.processName': {
|
|
|
|
+ handler(val) {
|
|
|
|
+ if (val) {
|
|
|
|
+ this.sizeForm.applyTitle =
|
|
|
|
+ this.processNameType.find((item) => item.value == val).label +
|
|
|
|
+ '-' +
|
|
|
|
+ this.sizeForm.applicantName +
|
|
|
|
+ '-' +
|
|
|
|
+ moment().format('YYYY-MM-DD');
|
|
|
|
+ this.sizeForm.businessCode = val;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 'sizeForm.applyType': {
|
|
|
|
+ handler(val) {
|
|
|
|
+ this.sizeForm.applicantId = val;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 改变流程名称
|
|
|
|
+ handleChangeProcessName() {},
|
|
// 取消
|
|
// 取消
|
|
handleCancel() {
|
|
handleCancel() {
|
|
this.$emit.close();
|
|
this.$emit.close();
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
- handleSave() {},
|
|
|
|
|
|
+ handleSave() {
|
|
|
|
+ this.sizeForm.operateType = '1';
|
|
|
|
+ this.save();
|
|
|
|
+ },
|
|
// 提交
|
|
// 提交
|
|
- handleSubmit() {},
|
|
|
|
|
|
+ handleSubmit() {
|
|
|
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if ( !this.sizeForm.startTime && !this.sizeForm.endTime) {
|
|
|
|
+ this.$message.warning("请选择开始时间和结束时间!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.sizeForm.operateType = '2';
|
|
|
|
+ this.save();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ save() {
|
|
|
|
+ const { resourceInfos, applyId, userType, userName, userCode, ...otherInfo } = this.sizeForm;
|
|
|
|
+ const params = {
|
|
|
|
+ resourceInfos,
|
|
|
|
+ workFlow: otherInfo
|
|
|
|
+ };
|
|
|
|
+ savePermissionApply(params).then((res) => {
|
|
|
|
+ if (this.sizeForm.operateType == '2') {
|
|
|
|
+ this.$message.success('提交成功!');
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.success('保存成功!');
|
|
|
|
+ }
|
|
|
|
+ this.$emit('success');
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 选择
|
|
// 选择
|
|
handleChoice() {
|
|
handleChoice() {
|
|
const vm = this;
|
|
const vm = this;
|
|
- const approveType = vm.sizeForm.approveType;
|
|
|
|
|
|
+ const applyType = vm.sizeForm.applyType;
|
|
// 审批内容选择
|
|
// 审批内容选择
|
|
let component;
|
|
let component;
|
|
- if (approveType == '0') {
|
|
|
|
|
|
+ if (applyType == '0') {
|
|
component = appFuncForm;
|
|
component = appFuncForm;
|
|
- } else if (approveType == '1') {
|
|
|
|
|
|
+ } else if (applyType == '1') {
|
|
component = serviceSourceForm;
|
|
component = serviceSourceForm;
|
|
} else {
|
|
} else {
|
|
component = dataSourceForm;
|
|
component = dataSourceForm;
|
|
@@ -363,14 +428,15 @@ export default {
|
|
title: '选择资源',
|
|
title: '选择资源',
|
|
shadow: [0.4, '#fff'],
|
|
shadow: [0.4, '#fff'],
|
|
props: {
|
|
props: {
|
|
- selectKeys: vm.sizeForm.resourceInfoDTO
|
|
|
|
|
|
+ selectKeys: this.applySelectKeys
|
|
},
|
|
},
|
|
content: component,
|
|
content: component,
|
|
area: ['1200px', '700px'],
|
|
area: ['1200px', '700px'],
|
|
on: {
|
|
on: {
|
|
- success(approveContent, selectKeys) {
|
|
|
|
- vm.sizeForm.resourceInfoDTO = selectKeys;
|
|
|
|
- vm.sizeForm.applyContent = vm.sizeForm.applicantName + '申请资源:' + approveContent;
|
|
|
|
|
|
+ success(approveContent, selectKeys, resourceInfos = []) {
|
|
|
|
+ vm.sizeForm.resourceInfos = resourceInfos;
|
|
|
|
+ vm.applySelectKeys = selectKeys;
|
|
|
|
+ vm.sizeForm.flowContent = vm.sizeForm.applicantName + '申请访问资源:' + approveContent;
|
|
layer.close(layer.dialogIndex);
|
|
layer.close(layer.dialogIndex);
|
|
},
|
|
},
|
|
close() {
|
|
close() {
|
|
@@ -381,7 +447,7 @@ export default {
|
|
},
|
|
},
|
|
// 切换审批类型
|
|
// 切换审批类型
|
|
handleChangeApproveType(val) {
|
|
handleChangeApproveType(val) {
|
|
- this.sizeForm.applyContent = '';
|
|
|
|
|
|
+ this.sizeForm.flowContent = '';
|
|
this.sizeForm.resourceInfoDTO = [];
|
|
this.sizeForm.resourceInfoDTO = [];
|
|
if (val == '0') {
|
|
if (val == '0') {
|
|
this.approveComponent = 'appFuncForm';
|
|
this.approveComponent = 'appFuncForm';
|
|
@@ -430,28 +496,23 @@ export default {
|
|
if (!this.id) {
|
|
if (!this.id) {
|
|
this.sizeForm = {
|
|
this.sizeForm = {
|
|
// 流程标题
|
|
// 流程标题
|
|
- processTitle: '',
|
|
|
|
- applicantId: id, // 申请人id
|
|
|
|
|
|
+ applyTitle: '',
|
|
|
|
+ applicantId: '0', // id
|
|
applicantIdcard: idcard, // 申请人身份证号
|
|
applicantIdcard: idcard, // 申请人身份证号
|
|
applicantName: name, // 申请人姓名
|
|
applicantName: name, // 申请人姓名
|
|
applicantOrgCode: securityOrg, // 申请人机构代码
|
|
applicantOrgCode: securityOrg, // 申请人机构代码
|
|
applicantOrgName: securityOrgName, //申请人机构名称
|
|
applicantOrgName: securityOrgName, //申请人机构名称
|
|
applicantPhoneNo: mobile, // 申请人号码
|
|
applicantPhoneNo: mobile, // 申请人号码
|
|
- applyContent: '', // 审核内容
|
|
|
|
|
|
+ flowContent: '', // 审核内容
|
|
applyReason: '', // 申请原因
|
|
applyReason: '', // 申请原因
|
|
- approveTaskIdentifier: '', // 前端无用
|
|
|
|
- yxq: '', // 有效日期
|
|
|
|
- createTime: '',
|
|
|
|
businessCode: '', // 前端无用
|
|
businessCode: '', // 前端无用
|
|
operateType: '', // 1--保存 2--提交
|
|
operateType: '', // 1--保存 2--提交
|
|
- processInstanceId: '', //前端无用
|
|
|
|
- processType: '',
|
|
|
|
- approveType: '0',
|
|
|
|
|
|
+ applyType: '0',
|
|
processName: '',
|
|
processName: '',
|
|
- permissionValidType: '',
|
|
|
|
|
|
+ permissionValidType: '02',
|
|
startTime: '',
|
|
startTime: '',
|
|
endTime: '',
|
|
endTime: '',
|
|
- resourceInfoDTO: [],
|
|
|
|
|
|
+ resourceInfos: [],
|
|
applyId: '', // 应用方
|
|
applyId: '', // 应用方
|
|
userType: '',
|
|
userType: '',
|
|
userName: '',
|
|
userName: '',
|