案件流程节点接口调试
This commit is contained in:
@@ -2,77 +2,73 @@
|
||||
<div>
|
||||
<el-dialog title="新增流程节点" :visible="addvisiable" v-if="addvisiable" @close="cancel" width="600px" center>
|
||||
<el-form :model="ruleForm" label-position="left" :rules="rules" ref="ruleForm" label-width="90px"
|
||||
class="demo-ruleForm">
|
||||
<el-form-item label="节点名称" prop="nodename">
|
||||
<el-select v-model="ruleForm.nodename" placeholder="请选择">
|
||||
<el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
|
||||
class="demo-ruleForm">
|
||||
<el-form-item label="节点名称" prop="nodeName">
|
||||
<el-select v-model="ruleForm.nodeName" placeholder="请选择" @change="changenodeName">
|
||||
<el-option v-for="dict in dict.type.case_flow_node" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="案件状态" prop="casestatus">
|
||||
<el-input v-model="ruleForm.casestatus"></el-input>
|
||||
<el-form-item label="案件状态" prop="caseStatusName">
|
||||
<el-input v-model="ruleForm.caseStatusName" placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="驳回节点" prop="rejectnode">
|
||||
<el-select v-model="ruleForm.rejectnode" placeholder="请选择">
|
||||
<el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id">
|
||||
<el-form-item label="驳回节点" prop="backFlowName">
|
||||
<el-select v-model="ruleForm.backFlowId" placeholder="请选择">
|
||||
<el-option v-for="item in backflowArr" :key="item.backFlowId" :value="item.backFlowId"
|
||||
:label="item.backFlowName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联角色" prop="associatedroles">
|
||||
<el-select v-model="ruleForm.associatedroles" placeholder="请选择">
|
||||
<el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id">
|
||||
<el-form-item label="关联角色" prop="roleIds">
|
||||
<el-select v-model="ruleForm.roleIds" multiple placeholder="请选择">
|
||||
<el-option v-for="item in roleArr" :key="item.roleId" :label="item.roleName" :value="item.roleId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
|
||||
<el-button type="primary" @click="submitUpload" class="endbutton"><span>确认</span></el-button>
|
||||
<el-button type="primary" @click="submitForm" class="endbutton"><span>确认</span></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import {
|
||||
// deptIdentifyList,
|
||||
// } from "@/api/officialSeal/officialSeal.js";
|
||||
import { queryCaseFlowInfo, saveCaseFlow } from "@/api/caseprocessManagement/caseprocessManagement.js";
|
||||
import { listRole } from "@/api/system/role";
|
||||
export default {
|
||||
props: ["addvisiable", "editData", "queryParams"],
|
||||
dicts: ["template_type"],
|
||||
dicts: ["case_flow_node"],
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
data: [],
|
||||
tempList: [],
|
||||
isImg:false,
|
||||
backflowArr: [],//驳回节点
|
||||
roleArr: [],//关联角色
|
||||
isImg: false,
|
||||
filedata: {},
|
||||
flagBtn: false,
|
||||
ruleForm: {},
|
||||
rules: {
|
||||
temName: [
|
||||
{ required: true, message: '请输入模板名称', trigger: 'blur' },
|
||||
nodeName: [
|
||||
{ required: true, message: '请选择模版名称', trigger: 'blur' },
|
||||
],
|
||||
temType: [
|
||||
{ required: true, message: '请输入模板名称', trigger: 'blur' },
|
||||
caseStatusName: [
|
||||
{ required: true, message: '请输入案件状态', trigger: 'blur' },
|
||||
],
|
||||
identifyId: [
|
||||
{ required: true, message: '请输入模板名称', trigger: 'blur' },
|
||||
roleIds: [
|
||||
{ required: true, message: '请选择关联角色', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
},
|
||||
dealvalue: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
editData(val) {
|
||||
addvisiable(val) {
|
||||
if (val) {
|
||||
this.ruleForm = val
|
||||
// let queryParams = {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10000000000000000000000,
|
||||
// };
|
||||
// deptIdentifyList(queryParams).then(res => {
|
||||
// this.tempList = res.rows;
|
||||
// })
|
||||
// this.ruleForm = {}
|
||||
this.ruleForm = this.editData;
|
||||
this.getRoles();
|
||||
this.getbackflowArr()
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -80,46 +76,101 @@ export default {
|
||||
|
||||
},
|
||||
methods: {
|
||||
changenodeName(val) {
|
||||
console.log(val, 'changeval');
|
||||
},
|
||||
// 获取驳回节点数据
|
||||
getbackflowArr() {
|
||||
let queryParams2 = {
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
};
|
||||
queryCaseFlowInfo(queryParams2).then((res) => {
|
||||
this.backflowArr = [];
|
||||
res.rows.forEach(item => {
|
||||
this.backflowArr.push({
|
||||
backFlowName: item.nodeName,
|
||||
backFlowId: item.id
|
||||
})
|
||||
});
|
||||
if (this.editData.id) {
|
||||
let arr = this.backflowArr;
|
||||
let result = arr.filter(obj => obj.backFlowId !== this.editData.id);
|
||||
this.backflowArr = result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取关联角色
|
||||
getRoles() {
|
||||
let queryParams1 = {
|
||||
pageNum: 1,
|
||||
pageSize: 100000000000000000,
|
||||
};
|
||||
listRole(queryParams1).then((res) => {
|
||||
this.roleArr = res.rows
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$emit("cancelAdd");
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
this.isImg = file.type === '.doc' || '.docx'
|
||||
},
|
||||
UploadUrl() {
|
||||
return window.location.origin + "/API/deptIdentify/insertTemplate";
|
||||
},
|
||||
submitUpload() {
|
||||
// 提交
|
||||
submitForm() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.filedata.identifyId = this.ruleForm.identifyId;
|
||||
this.filedata.temName = this.ruleForm.temName;
|
||||
if (this.isImg) {
|
||||
this.$refs.upload.submit();
|
||||
}else{
|
||||
this.$message.error('只能上传doc,docx格式的文件')
|
||||
let params = {};
|
||||
if (this.ruleForm.id) {
|
||||
let nodevalue = this.dict.type.case_flow_node;
|
||||
this.dealvalue = nodevalue.filter((item) => {
|
||||
if(item.value == this.ruleForm.nodeId) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
);
|
||||
// 编辑
|
||||
params = {
|
||||
id: this.ruleForm.id,
|
||||
nodeId: this.dealvalue[0].value,
|
||||
nodeName: this.dealvalue[0].label,
|
||||
caseStatusName: this.ruleForm.caseStatusName,
|
||||
backFlowId: this.ruleForm.backFlowId,
|
||||
roleIds: this.ruleForm.roleIds,
|
||||
sort: this.ruleForm.sort
|
||||
}
|
||||
} else {
|
||||
let nodevalue = this.dict.type.case_flow_node;
|
||||
this.dealvalue = nodevalue.filter((item) => {
|
||||
if (item.value == this.ruleForm.nodeName) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
);
|
||||
// 新增
|
||||
params = {
|
||||
nodeId: this.dealvalue[0].value,
|
||||
nodeName: this.dealvalue[0].label,
|
||||
caseStatusName: this.ruleForm.caseStatusName,
|
||||
backFlowId: this.ruleForm.backFlowId,
|
||||
roleIds: this.ruleForm.roleIds
|
||||
}
|
||||
}
|
||||
if (params.backFlowId == undefined) {
|
||||
delete params.backFlowId
|
||||
}
|
||||
saveCaseFlow(params).then((res) => {
|
||||
this.$modal.msgSuccess("成功!");
|
||||
this.$emit("getList", this.queryParams)
|
||||
this.$emit("cancelAdd");
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
beforeUpload(file) {
|
||||
// debugger
|
||||
// this.isImg = file.type === '.doc' || '.docx'
|
||||
},
|
||||
handleSuccess() {
|
||||
this.$message.success('上传成功');
|
||||
this.$emit("cancelAdd");
|
||||
this.$emit('getList', this.queryParams);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-select {
|
||||
::v-deep .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user