|
@@ -14,8 +14,8 @@
|
|
|
<dg-select
|
|
|
:data="applyType"
|
|
|
v-model="sizeForm.applyType"
|
|
|
- @change="handleChangeApproveType"
|
|
|
:disabled="type == 'edit'"
|
|
|
+ @change="handleChangeApplyType"
|
|
|
></dg-select>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -28,6 +28,7 @@
|
|
|
:data="processNameType"
|
|
|
v-model="sizeForm.processName"
|
|
|
@change="handleChangeProcessName"
|
|
|
+ :disabled="type == 'edit'"
|
|
|
></dg-select>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -44,10 +45,10 @@
|
|
|
</dg-col>
|
|
|
<dg-col :span="12">
|
|
|
<!-- 流程名称+申请人姓名+日期 -->
|
|
|
- <el-form-item label="审批单标题:" prop="applyTitle">
|
|
|
- <div v-if="isDetail">{{ sizeForm.applyTitle }}</div>
|
|
|
+ <el-form-item label="审批单标题:" prop="flowTitle">
|
|
|
+ <div v-if="isDetail">{{ sizeForm.flowTitle }}</div>
|
|
|
<div v-else>
|
|
|
- <el-input v-model="sizeForm.applyTitle" :disabled="true"></el-input>
|
|
|
+ <el-input v-model="sizeForm.flowTitle" :disabled="true"></el-input>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</dg-col>
|
|
@@ -247,9 +248,11 @@
|
|
|
</dg-row> -->
|
|
|
</el-form>
|
|
|
<div v-footer>
|
|
|
- <dg-button @click="handleCancel">取消</dg-button>
|
|
|
- <dg-button type="primary" @click="handleSave">保存</dg-button>
|
|
|
- <dg-button type="primary" @click="handleSubmit">提交</dg-button>
|
|
|
+ <div v-if="type !== 'detail'">
|
|
|
+ <dg-button @click="handleCancel">取消</dg-button>
|
|
|
+ <dg-button type="primary" @click="handleSave">保存</dg-button>
|
|
|
+ <dg-button type="primary" @click="handleSubmit">提交</dg-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -260,7 +263,8 @@ import appFuncForm from './app-func-form.vue';
|
|
|
import serviceSourceForm from './service-source-form.vue';
|
|
|
import dataSourceForm from './data-source-form.vue';
|
|
|
import moment from 'moment';
|
|
|
-import { savePermissionApply } from '@/api/permission-selfhelp-manage';
|
|
|
+// import { savePermissionApply, applyDetail, updateApply } from '@/api/permission-selfhelp-manage';
|
|
|
+import * as Api from '@/api/permission-selfhelp-manage';
|
|
|
|
|
|
export default {
|
|
|
name: 'FormItem',
|
|
@@ -361,7 +365,8 @@ export default {
|
|
|
value: '测试应用',
|
|
|
label: '测试应用'
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ applyContentCom: appFuncForm
|
|
|
};
|
|
|
},
|
|
|
components: {},
|
|
@@ -374,7 +379,7 @@ export default {
|
|
|
'sizeForm.processName': {
|
|
|
handler(val) {
|
|
|
if (val) {
|
|
|
- this.sizeForm.applyTitle =
|
|
|
+ this.sizeForm.flowTitle =
|
|
|
this.processNameType.find((item) => item.value == val).label +
|
|
|
'-' +
|
|
|
this.sizeForm.applicantName +
|
|
@@ -387,13 +392,26 @@ export default {
|
|
|
'sizeForm.applyType': {
|
|
|
handler(val) {
|
|
|
this.sizeForm.applicantId = val;
|
|
|
+ let component;
|
|
|
+ if (val == '2') {
|
|
|
+ component = dataSourceForm;
|
|
|
+ } else if (val == '1') {
|
|
|
+ component = serviceSourceForm;
|
|
|
+ } else {
|
|
|
+ component = appFuncForm;
|
|
|
+ }
|
|
|
+ this.applyContentCom = component;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
// 改变流程名称
|
|
|
handleChangeProcessName() {},
|
|
|
- // 取消
|
|
|
+ handleChangeApplyType() {
|
|
|
+ this.sizeForm.flowContent = '';
|
|
|
+ this.sizeForm.resourceInfoDTO = [];
|
|
|
+ },
|
|
|
+ // 取消/关闭
|
|
|
handleCancel() {
|
|
|
this.$emit('close');
|
|
|
},
|
|
@@ -413,11 +431,33 @@ export default {
|
|
|
},
|
|
|
save() {
|
|
|
const { resourceInfos, applyId, userType, userName, userCode, ...otherInfo } = this.sizeForm;
|
|
|
- const params = {
|
|
|
- resourceInfos,
|
|
|
- workFlow: otherInfo
|
|
|
+ let params = {
|
|
|
+ resourceInfos
|
|
|
};
|
|
|
- savePermissionApply(params).then((res) => {
|
|
|
+ let api = '';
|
|
|
+
|
|
|
+ if (this.type == 'add') {
|
|
|
+ params['workFlow'] = otherInfo;
|
|
|
+ api = 'savePermissionApply';
|
|
|
+ } else {
|
|
|
+ const { permissionValidType, operateType, applicantPhoneNo, applyReason, startTime, endTime, flowContent } = this.sizeForm;
|
|
|
+ // 只选可编辑的字段
|
|
|
+ params = {
|
|
|
+ resourceInfos,
|
|
|
+ permissionValidType,
|
|
|
+ operateType,
|
|
|
+ applicantPhoneNo,
|
|
|
+ applyReason,
|
|
|
+ startTime,
|
|
|
+ endTime,
|
|
|
+ flowContent,
|
|
|
+ id: this.id
|
|
|
+
|
|
|
+ };
|
|
|
+ api = 'updateApply';
|
|
|
+ }
|
|
|
+
|
|
|
+ Api[api](params).then((res) => {
|
|
|
if (this.sizeForm.operateType == '2') {
|
|
|
this.$message.success('提交成功!');
|
|
|
} else {
|
|
@@ -429,24 +469,15 @@ export default {
|
|
|
// 选择
|
|
|
handleChoice() {
|
|
|
const vm = this;
|
|
|
- const applyType = vm.sizeForm.applyType;
|
|
|
- // 审批内容选择
|
|
|
- let component;
|
|
|
- if (applyType == '0') {
|
|
|
- component = appFuncForm;
|
|
|
- } else if (applyType == '1') {
|
|
|
- component = serviceSourceForm;
|
|
|
- } else {
|
|
|
- component = dataSourceForm;
|
|
|
- }
|
|
|
-
|
|
|
+ const keys = [...this.applySelectKeys, ...this.sizeForm.resourceInfos.map((item) => item.funId)];
|
|
|
const layer = this.$dgLayer({
|
|
|
title: '选择资源',
|
|
|
shadow: [0.4, '#fff'],
|
|
|
props: {
|
|
|
- selectKeys: this.applySelectKeys
|
|
|
+ selectKeys: keys,
|
|
|
+ needFilter: true
|
|
|
},
|
|
|
- content: component,
|
|
|
+ content: this.applyContentCom,
|
|
|
area: ['1200px', '700px'],
|
|
|
on: {
|
|
|
success(approveContent, selectKeys, resourceInfos = []) {
|
|
@@ -465,14 +496,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 切换审批类型
|
|
|
- handleChangeApproveType(val) {
|
|
|
- this.sizeForm.flowContent = '';
|
|
|
- this.sizeForm.resourceInfoDTO = [];
|
|
|
- if (val == '0') {
|
|
|
- this.approveComponent = 'appFuncForm';
|
|
|
- }
|
|
|
- },
|
|
|
/**
|
|
|
* 下载附件
|
|
|
*/
|
|
@@ -509,6 +532,20 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
+ },
|
|
|
+ getDetail() {
|
|
|
+ const params = {
|
|
|
+ id: this.id,
|
|
|
+ needFlowInfo: true
|
|
|
+ };
|
|
|
+ Api.applyDetail(params).then((res) => {
|
|
|
+ const { workFlow, resourceInfos, ...otherInfo } = res.data.content;
|
|
|
+ this.sizeForm = {
|
|
|
+ ...workFlow,
|
|
|
+ resourceInfos,
|
|
|
+ ...otherInfo
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -516,7 +553,7 @@ export default {
|
|
|
if (!this.id) {
|
|
|
this.sizeForm = {
|
|
|
// 流程标题
|
|
|
- applyTitle: '',
|
|
|
+ flowTitle: '',
|
|
|
applicantId: '0', // id
|
|
|
applicantIdcard: idcard, // 申请人身份证号
|
|
|
applicantName: name, // 申请人姓名
|
|
@@ -538,6 +575,8 @@ export default {
|
|
|
userName: '',
|
|
|
userCode: ''
|
|
|
};
|
|
|
+ } else {
|
|
|
+ this.getDetail();
|
|
|
}
|
|
|
},
|
|
|
mounted() {}
|