|
@@ -100,7 +100,7 @@
|
|
|
</dg-col>
|
|
|
<dg-col :span="12" v-if="isDetail">
|
|
|
<el-form-item label="创建时间:">
|
|
|
- {{ sizeForm.createTime }}
|
|
|
+ {{ sizeForm.createTime }}
|
|
|
</el-form-item>
|
|
|
</dg-col>
|
|
|
<dg-col :span="12" v-if="sizeForm.applyType == 'SERVICE_AUTH'">
|
|
@@ -119,7 +119,9 @@
|
|
|
<el-form-item label="审批内容:" class="self-form-item" prop="flowContent">
|
|
|
<div style="display: flex" v-if="!isDetail">
|
|
|
<el-input type="textarea" :autosize="{ minRows: 5 }" :value="flowContentStr" :disabled="true"></el-input>
|
|
|
- <dg-button style="margin-left: 10px" @click="handleChoice" v-if="sizeForm.applyType">选择</dg-button>
|
|
|
+ <dg-button style="margin-left: 10px" @click="handleChoice" v-if="sizeForm.applyType && !this.repeatApply"
|
|
|
+ >选择</dg-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
{{ flowContentStr }}
|
|
@@ -172,7 +174,7 @@
|
|
|
</dg-col>
|
|
|
</div>
|
|
|
</dg-row>
|
|
|
- <dg-row>
|
|
|
+ <!-- <dg-row>
|
|
|
<dg-col :span="24">
|
|
|
<el-form-item label="权限有效期:" prop="permissionValidType">
|
|
|
<div v-if="isDetail">
|
|
@@ -195,14 +197,12 @@
|
|
|
</dg-col>
|
|
|
<dg-col :span="10">
|
|
|
<dg-date-picker
|
|
|
- :start-value.sync="sizeForm.startTime"
|
|
|
- :end-value.sync="sizeForm.endTime"
|
|
|
+ v-model="dateRange"
|
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- :default-time="['00:00:00', '23:59:59']"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
v-show="sizeForm.permissionValidType !== '02'"
|
|
|
:picker-options="pickerOptions"
|
|
|
clearable
|
|
@@ -214,7 +214,7 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</dg-col>
|
|
|
- </dg-row>
|
|
|
+ </dg-row> -->
|
|
|
<!-- v1.0.0不实现 -->
|
|
|
<!-- <dg-row>
|
|
|
<dg-col :span="12">
|
|
@@ -253,6 +253,19 @@
|
|
|
<dg-button type="primary" @click="handleSubmit">提交</dg-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 重复申请提示框 -->
|
|
|
+ <dg-dialog title="提示" :visible.sync="visible" width="450px" :modal="false">
|
|
|
+ <p class="repeatContent">
|
|
|
+ 您存在待审批的审批单,审批单号:
|
|
|
+ <span @click="handleOpenDetail">
|
|
|
+ {{ repeatApply }}
|
|
|
+ </span>
|
|
|
+ ,无法申请,请等待审批后再进行资源申请。
|
|
|
+ </p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <dg-button @click="visible = false">关闭</dg-button>
|
|
|
+ </span>
|
|
|
+ </dg-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -289,7 +302,7 @@ export default {
|
|
|
// 验证有效期间
|
|
|
const checkPermissionValid = (rule, val, callback) => {
|
|
|
if (val == '01') {
|
|
|
- if (!this.sizeForm.startTime && !this.sizeForm.endTime) {
|
|
|
+ if (!this.dateRange) {
|
|
|
return callback(new Error('请选择开始时间和结束时间'));
|
|
|
} else {
|
|
|
callback();
|
|
@@ -333,6 +346,7 @@ export default {
|
|
|
code: '02'
|
|
|
}
|
|
|
],
|
|
|
+ dateRange: "",
|
|
|
pickerOptions: {
|
|
|
disabledDate(currentDate) {
|
|
|
return currentDate.getTime() < Date.now() - 8.64e7;
|
|
@@ -357,7 +371,9 @@ export default {
|
|
|
cancelText: '申请撤销服务:'
|
|
|
}
|
|
|
},
|
|
|
- needFilter: true
|
|
|
+ needFilter: true,
|
|
|
+ visible: false,
|
|
|
+ repeatApply: ''
|
|
|
};
|
|
|
},
|
|
|
components: {},
|
|
@@ -380,37 +396,63 @@ export default {
|
|
|
watch: {
|
|
|
'sizeForm.applyType': {
|
|
|
handler(val) {
|
|
|
- let component;
|
|
|
- if (val == 'DATA_AUTH') {
|
|
|
- component = dataSourceForm;
|
|
|
- } else if (val == 'SERVICE_AUTH') {
|
|
|
- component = serviceSourceForm;
|
|
|
- } else {
|
|
|
- component = appFuncForm;
|
|
|
+ if (val) {
|
|
|
+ let component;
|
|
|
+ if (val == 'DATA_AUTH') {
|
|
|
+ component = dataSourceForm;
|
|
|
+ } else if (val == 'SERVICE_AUTH') {
|
|
|
+ component = serviceSourceForm;
|
|
|
+ } else {
|
|
|
+ component = appFuncForm;
|
|
|
+ }
|
|
|
+ this.applyContentCom = component;
|
|
|
}
|
|
|
- this.applyContentCom = component;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 获取流程名称
|
|
|
- getProcessName(val) {
|
|
|
- Api.getFlowDefine(val).then((res) => {
|
|
|
- const { content, result, msg } = res.data;
|
|
|
- if (result == '200') {
|
|
|
- this.sizeForm.processName = content.processName;
|
|
|
- this.sizeForm.businessCode = content.businessCode;
|
|
|
- this.sizeForm.processType = content.processTypeCode;
|
|
|
- // 审批单标题 = 流程名称 + 申请人姓名 + 日期
|
|
|
- this.sizeForm.flowTitle = `${content.processName}-${this.sizeForm.applicantName}-${moment().format(
|
|
|
- 'YYYY-MM-DD'
|
|
|
- )}`;
|
|
|
- } else {
|
|
|
- this.$message.warning(msg);
|
|
|
+ handleOpenDetail() {
|
|
|
+ const layer = this.$dgLayer({
|
|
|
+ title: '详情',
|
|
|
+ props: {
|
|
|
+ applyOrdNo: this.repeatApply,
|
|
|
+ type: 'detail'
|
|
|
+ },
|
|
|
+ content: require('./detail.vue'),
|
|
|
+ area: ['1280px', '900px'],
|
|
|
+ on: {
|
|
|
+ success(params) {
|
|
|
+ layer.close(layer.dialogIndex);
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ layer.close(layer.dialogIndex);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 切换审批类型,清空审批内容
|
|
|
+ // 获取流程名称
|
|
|
+ getProcessName(val) {
|
|
|
+ // 暂时处理: 服务和数据资源暂不开放,直接提示‘功能设计中,敬请期待!’
|
|
|
+ if (val == 'APP_FUN_AUTH') {
|
|
|
+ Api.getFlowDefine(val).then((res) => {
|
|
|
+ const { content, result, msg } = res.data;
|
|
|
+ if (result == '200') {
|
|
|
+ this.sizeForm.processName = content.processName;
|
|
|
+ this.sizeForm.businessCode = content.businessCode;
|
|
|
+ this.sizeForm.processType = content.processTypeCode;
|
|
|
+ // 审批单标题 = 流程名称 + 申请人姓名 + 日期
|
|
|
+ this.sizeForm.flowTitle = `${content.processName}-${this.sizeForm.applicantName}-${moment().format(
|
|
|
+ 'YYYY-MM-DD'
|
|
|
+ )}`;
|
|
|
+ } else {
|
|
|
+ this.$message.warning(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.warning('功能设计中,敬请期待!');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 切换审批类型,判断是否存在未审批的单,清空审批内容
|
|
|
handleChangeApplyType(val) {
|
|
|
this.sizeForm.flowContent = '';
|
|
|
this.sizeForm.resourceInfos = [];
|
|
@@ -439,21 +481,34 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
save() {
|
|
|
- const { resourceInfos, applyId, userType, userName, userCode, ...otherInfo } = this.sizeForm;
|
|
|
+ const { resourceInfos, delResourceInfos, applyId, userType, userName, userCode, ...otherInfo } = this.sizeForm;
|
|
|
let params = {
|
|
|
- resourceInfos
|
|
|
+ resourceInfos,
|
|
|
+ delResourceInfos
|
|
|
};
|
|
|
let api = '';
|
|
|
-
|
|
|
+ if (this.sizeForm.permissionValidType == '01') {
|
|
|
+ this.sizeForm.startTime = this.dateRange[0];
|
|
|
+ this.sizeForm.endTime = this.dateRange[1];
|
|
|
+ }
|
|
|
if (this.type == 'add') {
|
|
|
params['workFlow'] = otherInfo;
|
|
|
api = 'savePermissionApply';
|
|
|
} else {
|
|
|
- const { permissionValidType, operateType, applicantPhoneNo, applyReason, startTime, endTime, flowContent } =
|
|
|
- this.sizeForm;
|
|
|
+ const {
|
|
|
+ permissionValidType,
|
|
|
+ operateType,
|
|
|
+ applicantPhoneNo,
|
|
|
+ applyReason,
|
|
|
+ startTime,
|
|
|
+ endTime,
|
|
|
+ flowContent,
|
|
|
+ delResourceInfos
|
|
|
+ } = this.sizeForm;
|
|
|
// 只选可编辑的字段
|
|
|
params = {
|
|
|
resourceInfos,
|
|
|
+ delResourceInfos,
|
|
|
permissionValidType,
|
|
|
operateType,
|
|
|
applicantPhoneNo,
|
|
@@ -467,12 +522,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
Api[api](params).then((res) => {
|
|
|
- if (this.sizeForm.operateType == '2') {
|
|
|
- this.$message.success('提交成功!');
|
|
|
+ const { result, msg } = res.data;
|
|
|
+ if (result == '200') {
|
|
|
+ if (this.sizeForm.operateType == '2') {
|
|
|
+ this.$message.success('提交成功!');
|
|
|
+ } else {
|
|
|
+ this.$message.success('保存成功!');
|
|
|
+ }
|
|
|
+ this.$emit('success');
|
|
|
} else {
|
|
|
- this.$message.success('保存成功!');
|
|
|
+ this.$message.error(msg);
|
|
|
}
|
|
|
- this.$emit('success');
|
|
|
});
|
|
|
},
|
|
|
// 选择
|
|
@@ -485,13 +545,15 @@ export default {
|
|
|
props: {
|
|
|
selectKeys: this.applySelectKeys,
|
|
|
needFilter: this.needFilter,
|
|
|
- type: this.type
|
|
|
+ type: this.type,
|
|
|
+ applicantOrdNo: this.applyOrdNo
|
|
|
},
|
|
|
content: this.applyContentCom,
|
|
|
area: ['1200px', '700px'],
|
|
|
on: {
|
|
|
- success(visitResourceName, cancelResourceName, selectKeys, resourceInfos = []) {
|
|
|
+ success(visitResourceName, cancelResourceName, selectKeys, resourceInfos = [], delResourceInfos = []) {
|
|
|
vm.sizeForm.resourceInfos = resourceInfos;
|
|
|
+ vm.sizeForm.delResourceInfos = delResourceInfos;
|
|
|
vm.applySelectKeys = selectKeys;
|
|
|
const visitorName =
|
|
|
vm.sizeForm.applyType !== 'SERVICE_AUTH' ? vm.sizeForm.applicantName : vm.sizeForm.applyId;
|
|
@@ -549,13 +611,22 @@ export default {
|
|
|
needFlowInfo: true
|
|
|
};
|
|
|
Api.applyDetail(params).then((res) => {
|
|
|
- const { workFlow, resourceInfos, ...otherInfo } = res.data.content;
|
|
|
+ const { workFlow, resourceInfos, existResourceInfos, delResourceInfos, ...otherInfo } = res.data.content;
|
|
|
this.sizeForm = {
|
|
|
...workFlow,
|
|
|
resourceInfos,
|
|
|
+ delResourceInfos,
|
|
|
...otherInfo
|
|
|
};
|
|
|
- this.applySelectKeys = this.sizeForm.resourceInfos.map((item) => item.funId);
|
|
|
+ if (this.sizeForm.permissionValidType == '01') {
|
|
|
+ this.dateRange = [this.sizeForm.startTime, this.sizeForm.endTime];
|
|
|
+ }
|
|
|
+ const delResourceInfoIds = delResourceInfos.map((item) => item.funId);
|
|
|
+ // 默认选中节点 = 新增节点 + ( 已有节点 - 欲撤销节点 )
|
|
|
+ this.applySelectKeys = [
|
|
|
+ ...resourceInfos,
|
|
|
+ ...existResourceInfos.filter((item) => !delResourceInfoIds.includes(item.funId))
|
|
|
+ ].map((item) => item.funId);
|
|
|
this.show = true;
|
|
|
});
|
|
|
}
|
|
@@ -581,6 +652,7 @@ export default {
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
resourceInfos: [],
|
|
|
+ delResourceInfos: [],
|
|
|
applyId: '', // 应用方
|
|
|
userType: '',
|
|
|
userName: '',
|
|
@@ -598,5 +670,11 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
-// @import './index.scss';
|
|
|
+.repeatContent {
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ span {
|
|
|
+ color: #1890ff;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|