Compare commits

...

2 Commits

8 changed files with 99 additions and 80 deletions

View File

@ -22,9 +22,9 @@
</div> </div>
</div> </div>
<el-dialog title="请使用手机扫码预览" :visible.sync="viewCode" width="300px" :close-on-click-modal="false" center> <!-- <el-dialog title="请使用手机扫码预览" :visible.sync="viewCode" width="300px" :close-on-click-modal="false" center>-->
<img src="../../assets/image/code.png" width="250" height="250"> <!-- <img src="../../assets/image/code.png" width="250" height="250">-->
</el-dialog> <!-- </el-dialog>-->
</div> </div>
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<node :title="config.name" :show-error="showError" :content="content" :node-id="config.id" <node :title="config.name" :show-error="showError" :content="content"
:show-avatar="config.props.assignedType === 'ASSIGN_USER'" :user-info="assignedUser" :show-avatar="config.props.assignedType === 'ASSIGN_USER'" :user-info="assignedUser"
:error-info="errorInfo" :error-info="errorInfo"
:select-user="selectUser" :select-user="selectUser"
@ -109,9 +109,6 @@ export default {
this.errorInfo = '审批人为空时, 转交给指定人员:【请指定一个具体的人】' this.errorInfo = '审批人为空时, 转交给指定人员:【请指定一个具体的人】'
err.push('审批人为空时, 转交给指定人员:【请指定一个具体的人】') err.push('审批人为空时, 转交给指定人员:【请指定一个具体的人】')
this.showError = true this.showError = true
} else if (this.viewer) {
this.showError = !this.validate_ASSIGN_USER(err)
console.log(this.showError)
} }
return this.showError return this.showError
} catch (e) { } catch (e) {
@ -129,7 +126,16 @@ export default {
} }
}, },
validate_SELF_SELECT(err) { validate_SELF_SELECT(err) {
return true; if (!this.viewer){
return true
}
let userInfo = this.$store.state.selectUserMap.get(this.config.id);
if (undefined !== userInfo && Array.isArray(userInfo) && userInfo.length > 0) {
return true;
}
this.errorInfo = '请指定审批人员'
err.push(`${this.config.name} 未指定审批人员`)
return false;
}, },
validate_LEADER_TOP(err) { validate_LEADER_TOP(err) {
return true; return true;

View File

@ -141,7 +141,6 @@ export default {
}, },
created() { created() {
let userInfo = this.$store.state.selectUserMap.get(this.nodeId); let userInfo = this.$store.state.selectUserMap.get(this.nodeId);
console.log(this.nodeId,"sadasdasd",userInfo,this._userInfo)
if (userInfo){ if (userInfo){
let userInfoList = [] let userInfoList = []
for (let val of userInfo) { for (let val of userInfo) {

View File

@ -98,7 +98,7 @@
</el-dialog> </el-dialog>
<re-process :code="selectInstanceId" v-if="openItemDl" @submit="resubmit"/> <re-process :code="selectInstanceId" v-if="openItemDl" @success="getList"/>
</div> </div>
</template> </template>
@ -162,10 +162,8 @@ export default {
that.$store.state.refuseList = data.refuseList; that.$store.state.refuseList = data.refuseList;
that.$store.state.passList = data.passList; that.$store.state.passList = data.passList;
this.loading = false; this.loading = false;
console.log(data, "获取到的结果数据")
}) })
}, },
init() { init() {
this.processInstanceData = { this.processInstanceData = {
userInfo: {}, userInfo: {},
@ -173,7 +171,6 @@ export default {
formItems: [], formItems: [],
processList: [], processList: [],
}; };
this.loading = true; this.loading = true;
this.$store.state.design = this.taskData; this.$store.state.design = this.taskData;
this.$store.state.runningList = []; this.$store.state.runningList = [];
@ -184,11 +181,6 @@ export default {
this.$store.state.diagramMode = "viewer"; this.$store.state.diagramMode = "viewer";
this.$store.state.preview = false; this.$store.state.preview = false;
}, },
resubmit(flag) {
if (flag) {
this.getList();
}
},
getList() { getList() {
getAboutInstanceList().then(res => { getAboutInstanceList().then(res => {
let data = res.data let data = res.data

View File

@ -68,9 +68,16 @@ export default {
this.$message.error(err); this.$message.error(err);
}); });
}, },
validate(call) { validate() {
this.$refs.initiateForm.validate(call); let formValidate
this.$refs.processDiagramViewer.validate(call); this.$refs.initiateForm.validate(formCall => {
formValidate = formCall;
})
let proValidate = this.$refs.processDiagramViewer.validate()
if (!formValidate) {
return false;
}
return (Array.isArray(proValidate) && proValidate.length === 0);
} }
} }
}; };

View File

@ -96,7 +96,7 @@
<process-diagram-viewer v-if="processDiagramViewer"/> <process-diagram-viewer v-if="processDiagramViewer"/>
<div style="height: 70px;"></div> <div style="height: 70px;"></div>
</el-dialog> </el-dialog>
<re-process :code="selectInstanceId" v-if="openItemDl" @submit="resubmit"/> <re-process :code="selectInstanceId" v-if="openItemDl" @success="getList()"/>
</div> </div>
</template> </template>
@ -155,11 +155,6 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
resubmit(flag) {
if (flag) {
this.getList();
}
},
init() { init() {
this.processInstanceData = { this.processInstanceData = {
userInfo: {}, userInfo: {},

View File

@ -97,21 +97,27 @@ export default {
formData: JSON.stringify(this.formData), formData: JSON.stringify(this.formData),
optionalUser: selectUserMap optionalUser: selectUserMap
} }
this.validate(valid => { let valid = this.validate(() => {})
if (valid) { if (valid) {
restartProcessInstance(paramsData).then(res => { restartProcessInstance(paramsData).then(res => {
this.$emit("submit", true) this.openItemDl = false
this.openItemDl = false this.$message.success(res.msg)
this.$message.success(res.msg) this.$emit("success")
}) })
} else { } else {
this.$message.warning("请完善表单😥") this.$message.warning("请完善表单😥")
} }
})
}, },
validate(call) { validate(call) {
this.$refs.initiateForm.validate(call); let formValidate
this.$refs.processDiagramViewer.validate(call); this.$refs.initiateForm.validate(formCall => {
formValidate = formCall;
})
let proValidate = this.$refs.processDiagramViewer.validate(call)
if (!formValidate) {
return false;
}
return (Array.isArray(proValidate) && proValidate.length === 0);
} }
} }
} }

View File

@ -7,7 +7,8 @@
<el-tab-pane label="审批列表" name="approveList"> <el-tab-pane label="审批列表" name="approveList">
<el-row style="margin-bottom: 20px"> <el-row style="margin-bottom: 20px">
<el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4"> <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
<el-input size="medium" v-model="formList.inputs" placeholder="搜索表单" @keyup.enter.native="getGroups" clearable> <el-input size="medium" v-model="formList.inputs" placeholder="搜索表单" @keyup.enter.native="getGroups"
clearable>
<i slot="prefix" class="el-input__icon el-icon-search"></i> <i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input> </el-input>
</el-col> </el-col>
@ -44,15 +45,16 @@
<disposal-task v-if="active === 'disposalTask'" ref="disposalTask"/> <disposal-task v-if="active === 'disposalTask'" ref="disposalTask"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="我发起的" name="initiated"> <el-tab-pane label="我发起的" name="initiated">
<initiated-instance v-if="active === 'initiated'" ref="InitiatedInstance"/> <initiated-instance v-if="active === 'initiated'" ref="InitiatedInstance"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关于我的" name="aboutMe"> <el-tab-pane label="关于我的" name="aboutMe">
<about-instance v-if="active === 'aboutMe'" ref="AboutInstance"/> <about-instance v-if="active === 'aboutMe'" ref="AboutInstance"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog title="发起审批" :visible.sync="openItemDl" :close-on-click-modal="true"> <el-dialog title="发起审批" :visible.sync="openItemDl" :close-on-click-modal="true">
<initiate-process ref="processInstance" :code="selectForm.processDefinitionKey" v-if="openItemDl"></initiate-process> <initiate-process ref="processInstance" :code="selectForm.processDefinitionKey"
v-if="openItemDl"></initiate-process>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="mini" @click="openItemDl = false"> </el-button> <el-button size="mini" @click="openItemDl = false"> </el-button>
<el-button size="mini" type="primary" @click="submitForm"> </el-button> <el-button size="mini" type="primary" @click="submitForm"> </el-button>
@ -71,7 +73,7 @@ import AboutInstance from "./AboutInstance";
export default { export default {
name: "workSpace", name: "workSpace",
components: {AboutInstance, InitiateProcess,DisposalTask,InitiatedInstance}, components: {AboutInstance, InitiateProcess, DisposalTask, InitiatedInstance},
data() { data() {
return { return {
active: 'disposalTask', active: 'disposalTask',
@ -95,16 +97,16 @@ export default {
methods: { methods: {
getGroups() { getGroups() {
let groupItem = { let groupItem = {
id:100, id: 100,
name:"clay测试", name: "clay测试",
items:[] items: []
} }
let query = { let query = {
state: 1 state: 1
} }
getProcessDefinitionList(query).then(res=>{ getProcessDefinitionList(query).then(res => {
groupItem.items = res.data.rows groupItem.items = res.data.rows
groupItem.items.forEach(item=>{ groupItem.items.forEach(item => {
item.logo = JSON.parse(item.logo) item.logo = JSON.parse(item.logo)
}) })
this.actives.push(groupItem.name) this.actives.push(groupItem.name)
@ -118,26 +120,29 @@ export default {
this.openItemDl = true this.openItemDl = true
}, },
// todo // todo
submitForm(){ submitForm() {
let processInstance = this.$refs.processInstance; let processInstance = this.$refs.processInstance;
let selectUserMap = {} let selectUserMap = {}
this.$store.state.selectUserMap.forEach(((value, key) => {selectUserMap[key]=value})) this.$store.state.selectUserMap.forEach(((value, key) => {
selectUserMap[key] = value
}))
let paramsData = { let paramsData = {
processDefinitionId: this.selectForm.processDefinitionId, processDefinitionId: this.selectForm.processDefinitionId,
formData: JSON.stringify(processInstance.formData), formData: JSON.stringify(processInstance.formData),
optionalUser: selectUserMap optionalUser: selectUserMap
} }
processInstance.validate(valid => { let valid = processInstance.validate(() => {
if (valid) {
startProcessInstance(paramsData).then(res=>{
this.openItemDl = false
this.$message.success(res.msg)
this.$refs.disposalTask.getList()
})
} else {
this.$message.warning("请完善表单😥")
}
}) })
console.log(valid)
if (valid) {
startProcessInstance(paramsData).then(res => {
this.openItemDl = false
this.$message.success(res.msg)
this.$refs.disposalTask.getList()
})
} else {
this.$message.warning("请完善表单😥")
}
} }
} }
} }
@ -145,54 +150,63 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
@media screen and (max-width: 1852px) { @media screen and (max-width: 1852px) {
/deep/.el-dialog { /deep/ .el-dialog {
width: 70%; width: 70%;
} }
} }
@media screen and (max-width: 1766px) { @media screen and (max-width: 1766px) {
/deep/.el-dialog { /deep/ .el-dialog {
width: 85%!important; width: 85% !important;
} }
} }
@media screen and (max-width: 1660px) { @media screen and (max-width: 1660px) {
/deep/.el-dialog { /deep/ .el-dialog {
width: 90%!important; width: 90% !important;
} }
} }
@media screen and (max-width: 1560px) { @media screen and (max-width: 1560px) {
/deep/.el-dialog { /deep/ .el-dialog {
width: 65%; width: 65%;
//height: 1270px!important; //height: 1270px!important;
} }
/deep/.el-main {
width: 100%!important; /deep/ .el-main {
width: 100% !important;
} }
} }
@media screen and (max-width: 1360px) { @media screen and (max-width: 1360px) {
/deep/.el-dialog { /deep/ .el-dialog {
min-width: 1072px; min-width: 1072px;
} }
} }
/deep/.el-dialog {
/deep/ .el-dialog {
width: 80%; width: 80%;
//height: 830px; //height: 830px;
margin-top: 4vh!important; margin-top: 4vh !important;
} }
/deep/.el-main {
height: 600px!important; /deep/ .el-main {
height: 600px !important;
overflow: auto; overflow: auto;
} }
/deep/.el-main::-webkit-scrollbar{
/deep/ .el-main::-webkit-scrollbar {
width: 6px; width: 6px;
height: 6px; height: 6px;
background-color: #f8f8f8; background-color: #f8f8f8;
} }
/deep/.el-main::-webkit-scrollbar-thumb{
/deep/ .el-main::-webkit-scrollbar-thumb {
width: 6px; width: 6px;
background-color: #adacac; background-color: #adacac;
border-radius: 4px; border-radius: 4px;
} }
.workspace { .workspace {
padding: 50px 20px; padding: 50px 20px;
position: relative; position: relative;
@ -260,7 +274,7 @@ export default {
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
div{ div {
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 10px;
width: 100px; width: 100px;