workflowstate&rpj

This commit is contained in:
shijing 2022-07-15 12:44:01 +08:00
parent 3f939338bd
commit af4a575139
11 changed files with 1182 additions and 982 deletions

View File

@ -133,6 +133,14 @@ export default {
);
}
},
item: {
name: "获取",
req: async function (id) {
return await http.get(
`${config.API_URL}/rpm/rpj/${id}/`,
);
}
},
read:{
name: "详情",
req: async function (id) {

View File

@ -233,12 +233,13 @@
param.onProgress({percent: complete})
}
}).then(res => {
var response = config.parseData(res);
if(response.code == config.successCode){
config.parseData(res);
param.onSuccess(res)
}else{
param.onError(response.msg || "未知错误")
}
// if(response.code == config.successCode){
// param.onSuccess(res)
// }else{
// param.onError(response.msg || "")
// }
}).catch(err => {
param.onError(err)
})

View File

@ -11,11 +11,12 @@
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="method" prop="method" min-width="80"></el-table-column>
<el-table-column label="id" prop="id" min-width="200"></el-table-column>
<el-table-column label="日志id" prop="id" min-width="200"></el-table-column>
<el-table-column label="路径" prop="path" min-width="150"></el-table-column>
<el-table-column label="view" prop="view" min-width="150"></el-table-column>
<el-table-column label="method" prop="method" min-width="80">
</el-table-column>
<el-table-column label="view" prop="view" min-width="150"></el-table-column>
<el-table-column label="状态码" prop="status_code" min-width="80">
<template #default="scope">
<el-tag class="ml-2" type="success" v-if="scope.row.status_code>=200&&scope.row.status_code<300">{{scope.row.status_code}}</el-tag>

View File

@ -34,9 +34,11 @@
<el-table-column label="#" type="index" fixed="left" width="50"></el-table-column>
<el-table-column label="名称" prop="name" fixed="left" width="180"></el-table-column>
<el-table-column label="项目类型" prop="type" width="180"
><template #default="scope"
>
<template #default="scope"
>{{ type_[scope.row.type] }}
</template></el-table-column
</template>
</el-table-column
>
<el-table-column
label="合同编号"
@ -53,11 +55,21 @@
prop="leave_time"
width="180"
></el-table-column>
<el-table-column label="状态" prop="state" width="180"
><template #default="scope"
>{{ state_[scope.row.state] }}
</template></el-table-column
>
<el-table-column label="状态" prop="state" width="180">
<template #default="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="审批状态" width="180">
<template #default="scope">
<span v-if="scope.row.ticket_&&scope.row.ticket_.state_" style="margin-right: 5px;">{{scope.row.ticket_.state_.name }}</span>
<el-tag
v-if="scope.row.ticket_&&scope.row.ticket_.act_state"
class="mx-1"
size="small"
:type="scope.row.ticket_.act_state===0?'':scope.row.ticket_.act_state===1?'':scope.row.ticket_.act_state===2?'danger':scope.row.ticket_.act_state===3?'danger':scope.row.ticket_.act_state===5?'danger':scope.row.ticket_.act_state===4?'success':''"
>{{act_states[scope.row.ticket_.act_state]}}
</el-tag>
</template>
</el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
@ -86,20 +98,23 @@
type="primary"
size="small"
@click="next_add(scope.row, scope.$index)"
>继续编辑</el-button>
>继续编辑
</el-button>
<el-button
text
type="primary"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看</el-button>
>查看
</el-button>
<el-button
text
type="warning"
size="small"
@click="table_edit(scope.row, scope.$index)"
>编辑</el-button>
>编辑
</el-button>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
@ -121,18 +136,28 @@
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<show-dialog
v-if="dialog.show"
ref="showDialog"
:rpjId="rpjId"
@closed="dialog.show = false"
></show-dialog>
</template>
<script>
import saveDialog from "./rpj_form.vue";
export default {
<script>
import saveDialog from "./rpj_form.vue";
import showDialog from "./rpj_show.vue";
export default {
name: "remployee",
components: {
saveDialog,
showDialog,
},
data() {
return {
dialog: {
save: false,
show: false,
permission: false,
},
adminform: {
@ -155,8 +180,9 @@ export default {
20: "审批中",
30: "待入厂",
40: "进行中",
40: "已完成",
50: "已完成",
},
rpjId:''
};
},
methods: {
@ -176,10 +202,8 @@ export default {
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
this.rpjId = row.id;
this.dialog.show = true;
},
//
@ -202,8 +226,7 @@ export default {
return err;
});
},
next_add(row)
{
next_add(row) {
this.$router.push({
name: "rpjadd",
query: {
@ -224,5 +247,5 @@ export default {
this.query = {};
},
},
};
};
</script>

View File

@ -49,21 +49,19 @@
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="进场时间">
<el-date-picker
v-model="form.come_time"
type="datetime"
placeholder="选择结束时间"
placeholder="选择进场时间"
/>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="离场时间">
<el-date-picker
v-model="form.leave_time"
type="datetime"
placeholder="选择结束时间"
placeholder="选择离场时间"
/>
</el-form-item>
</el-col>
@ -97,14 +95,13 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>保存
</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
@ -113,8 +110,9 @@
</template>
<script>
import { genTree } from "@/utils/verificate";
export default {
import {genTree} from "@/utils/verificate";
export default {
emits: ["success", "closed"],
data() {
return {
@ -132,12 +130,12 @@ export default {
selectionFilters: [],
setFiltersVisible: false,
rpartyOptions: [],
deptoptions:[],
deptoptions: [],
typeOptions: [
{ id: 10, name: "建筑施工" },
{ id: 20, name: "设备设施检维修" },
{ id: 30, name: "保安保洁服务" },
{ id: 40, name: "其他" },
{id: 10, name: "建筑施工"},
{id: 20, name: "设备设施检维修"},
{id: 30, name: "保安保洁服务"},
{id: 40, name: "其他"},
],
};
},
@ -154,14 +152,14 @@ export default {
},
//
getDept() {
this.$API.system.dept.list.req({ page: 0 }).then((res) => {
this.$API.system.dept.list.req({page: 0}).then((res) => {
this.deptoptions = genTree(res);
});
},
//
getRpartyOptions() {
this.$API.rpm.rparty.list.req({ page: 0 }).then((res) => {
this.$API.rpm.rparty.list.req({page: 0}).then((res) => {
this.rpartyOptions = res;
});
},
@ -209,7 +207,7 @@ export default {
this.setFiltersVisible = true;
},
},
};
};
</script>
<style>

114
src/views/rpm/rpj_show.vue Normal file
View File

@ -0,0 +1,114 @@
<template>
<el-drawer
:title="form.name"
v-model="visible"
:size="1000"
destroy-on-close
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-descriptions direction="vertical" :column="3" border>
<!--<el-descriptions-item label="入厂项目:">{{form.name }}</el-descriptions-item>-->
<el-descriptions-item label="项目类型:">{{types_[form.type]}}</el-descriptions-item>
<el-descriptions-item label="合同编号:">{{form.contract_number}}</el-descriptions-item>
<el-descriptions-item label="状态:">{{state_[form.state]}}</el-descriptions-item>
<el-descriptions-item label="进厂时间:">{{form.come_time}}</el-descriptions-item>
<el-descriptions-item label="离厂时间:">{{form.leave_time}}</el-descriptions-item>
<el-descriptions-item label="所属部门:">{{form.belong_dept_name}}</el-descriptions-item>
<!--<el-descriptions-item label="相关方:">{{form.rparty_name}}</el-descriptions-item>-->
</el-descriptions>
<!--<el-card style="margin-top:20px">
<scTable
ref="table"
:data="peoplelist"
row-key="id"
height='auto'
stripe
hideDo
hidePagination
>
<el-table-column
label="#"
fixed="left"
type="index"
width="50"
></el-table-column>
<el-table-column
label="访客姓名"
prop="visitor_.name"
></el-table-column>
<el-table-column
label="访客手机号"
prop="visitor_.phone"
></el-table-column>
<el-table-column
label="访客身份证号"
prop="visitor_.id_number"
></el-table-column>
<el-table-column label="是否重要访客" prop="is_main">
<template #default="scope"
>
<el-space v-if="scope.row.is_main == true"></el-space>
<el-space v-else></el-space>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
</scTable>
</el-card>-->
</el-main>
</el-container>
</el-drawer>
</template>
<script>
import {genTree} from "@/utils/verificate";
import selectUser from "@/layout/components/userselect";
export default {
emits: ["success", "closed"],
components: {
selectUser,
},
props:{rpjId: { type: String, default: "" }},
data() {
return {
loading: false,
visible: false,
isSaveing: false,
state_: {
10: "创建中",
20: "审批中",
30: "待入厂",
40: "进行中",
50: "已完成",
},
types_: {
10: "建筑施工",
20: "设备设施检维修",
30: "保安保洁服务",
40: "其他",
},
receptionistoptions: [],
peoplelist: [],
};
},
mounted() {
this.getFormData();
},
methods: {
getFormData(){
this.$API.rpm.rpj.item.req(this.rpjId).then((res) => {
this.form = res;
this.visible = true;
});
},
},
};
</script>
<style scoped>
.el-transfer {
--el-transfer-panel-width: 345px !important;
}
</style>

View File

@ -106,7 +106,8 @@
<el-col :md="24" :sm="12" :xs="24">
<el-form-item>
<el-button style="margin-top: 12px" @click="handleNextStep"
>下一步</el-button
>下一步
</el-button
>
</el-form-item>
</el-col>
@ -151,7 +152,8 @@
type="primary"
size="small"
@click="upload(scope.row, scope.$index)"
>上传</el-button
>上传
</el-button
>
<el-popconfirm
title="确定删除吗?"
@ -165,10 +167,12 @@
</el-table-column>
</scTable>
<el-button style="margin-top: 12px" @click="handleLastStep"
>上一步</el-button
>上一步
</el-button
>
<el-button style="margin-top: 12px" @click="handleNextStep"
>下一步</el-button
>下一步
</el-button
>
<sc-dialog v-model="dialogupload" draggable title="上传文件">
<el-form ref="dialogfileForm" :model="fileform" label-width="120px">
@ -183,7 +187,8 @@
tip="最多上传10个文件,单个文件不要超过10M,请上传xlsx/docx格式文件"
>
<el-button type="primary" icon="el-icon-upload"
>上传附件</el-button
>上传附件
</el-button
>
</sc-upload-file>
</el-form-item>
@ -232,7 +237,8 @@
:key="item.number"
:label="item.name"
:value="item.number"
>{{ item.name }}</el-tag
>{{ item.name }}
</el-tag
>
</template>
</el-table-column>
@ -322,41 +328,48 @@
<el-button type="primary" @click="submitWorker"> </el-button>
</template>
</sc-dialog>
<el-button style="margin-top: 12px" @click="handleLastStep"
>上一步</el-button
>
<el-button style="margin-top: 12px" @click="submitOut">退出</el-button>
<el-button @click="handleLastStep">上一步</el-button>
<el-button
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@click="submitTicketCreate(item.id)"
>{{item.name}}</el-button>
<el-button @click="submitOut">退出</el-button>
</el-main>
</el-container>
</template>
<style scoped>
.clearfix {
.clearfix {
font-size: 20px;
}
}
.box-card p {
.box-card p {
line-height: 20px;
}
.content {
margin-top: 10px;
}
.stepSuc:hover {
cursor: pointer;
}
.stepErr:hover {
cursor: not-allowed;
}
</style>
<script>
import { genTree } from "@/utils/verificate";
}
const defaultformworker = {
.content {
margin-top: 10px;
}
.stepSuc:hover {
cursor: pointer;
}
.stepErr:hover {
cursor: not-allowed;
}
</style>
<script>
import {genTree} from "@/utils/verificate";
const defaultformworker = {
duty: "",
rcertificates: [],
rpj: "",
};
export default {
};
export default {
name: "rpjadd",
components: {},
data() {
@ -370,16 +383,15 @@ export default {
search: {
keyword: null,
},
rpjId: "",
rpjform: {},
rpartyOptions: [],
deptoptions: [],
typeOptions: [
{ id: 10, name: "建筑施工" },
{ id: 20, name: "设备设施检维修" },
{ id: 30, name: "保安保洁服务" },
{ id: 40, name: "其他" },
{id: 10, name: "建筑施工"},
{id: 20, name: "设备设施检维修"},
{id: 30, name: "保安保洁服务"},
{id: 40, name: "其他"},
],
rpjfileList: [],
dialogupload: false,
@ -388,12 +400,12 @@ export default {
files: [],
},
filelist: [],
remployeeoptions: [],
certificatesOptions: [],
formworker: defaultformworker,
apiworkerObj: [],
workerdialog: false,
initForm: {},
};
},
mounted() {
@ -401,6 +413,7 @@ export default {
this.getRpj();
this.getRpartyOptions();
this.getDept();
this.getInit();
},
methods: {
//
@ -412,19 +425,19 @@ export default {
},
//
getDept() {
this.$API.system.dept.list.req({ page: 0 }).then((res) => {
this.$API.system.dept.list.req({page: 0}).then((res) => {
this.deptoptions = genTree(res);
});
},
//
getRpjfileList(id) {
this.$API.rpm.rpjfile.list.req({ page: 0, rpj: id }).then((res) => {
this.$API.rpm.rpjfile.list.req({page: 0, rpj: id}).then((res) => {
this.rpjfileList = res;
});
},
//
getRpartyOptions() {
this.$API.rpm.rparty.list.req({ page: 0 }).then((res) => {
this.$API.rpm.rparty.list.req({page: 0}).then((res) => {
this.rpartyOptions = res;
});
},
@ -466,10 +479,7 @@ export default {
},
//退
submitOut() {
this.$router.push({
name: "rpj",
query: {},
});
this.$router.push("rpj");
},
//
del_rpjfile(row) {
@ -511,7 +521,7 @@ export default {
},
//
getremployee() {
this.$API.rpm.remployee.list.req({ page: 0 }).then((res) => {
this.$API.rpm.remployee.list.req({page: 0}).then((res) => {
this.remployeeoptions = res;
});
},
@ -519,7 +529,7 @@ export default {
//
selectWorker() {
this.$API.rpm.rcertificate.list
.req({ remployee: this.formworker.remployee, page: 0 })
.req({remployee: this.formworker.remployee, page: 0})
.then((res) => {
this.certificatesOptions = res;
});
@ -527,7 +537,7 @@ export default {
//
getmemberList(id) {
this.$API.rpm.member.list.req({ rpj: id, page: 0 }).then((res) => {
this.$API.rpm.member.list.req({rpj: id, page: 0}).then((res) => {
this.apiworkerObj = res;
console.log(res);
});
@ -565,6 +575,28 @@ export default {
});
});
},
//
getInit(){
this.$API.wf.workflow.initkey.req('rparty').then((res) => {
this.initForm = res;
});
},
};
//,
submitTicketCreate(id){
let ticket={};
ticket.workflow=this.initForm.workflow;
ticket.ticket_data={rpj:this.rpjId};
ticket.transition=id;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.$message.success("提交成功");
this.$router.push({
name: "rpj",
query: {},
});
});
}
},
};
</script>

View File

@ -136,6 +136,15 @@
},
});
break;
case 'rparty':
this.$router.push({
name: "visitdetail",
query: {
id: row.id,
visitID:row.ticket_data.visit
},
});
break;
}
},
handleLogs(row) {

View File

@ -33,7 +33,7 @@
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<el-table-column label="操作" fixed="right" align="center" width="160">
<template #default="scope">
<el-button type="text" size="small" @click="handleShow(scope.row)">查看详情</el-button>
<!--创建人在初始状态-->

View File

@ -180,6 +180,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="参与者"
prop="participant"
v-if="addForm.participant_type == 6"
>
<el-input v-model="addForm.participant" placeholder="方法名" />
</el-form-item>
<el-form-item
label="分配方式"
prop="participant"
@ -229,7 +236,7 @@
placeholder="请选择岗位"
>
<el-option
v-for="item in roles"
v-for="item in posts"
:key="item.id"
:label="item.name"
:value="item.id"
@ -241,7 +248,7 @@
label="过滤策略"
prop="participant"
v-if="
addForm.participant_type == 4 || addForm.participant_type == 0
addForm.participant_type == 4 || addForm.participant_type == 0|| addForm.participant_type == 10
"
>
<el-select
@ -370,6 +377,7 @@ export default {
participant: "",
participants: [],
roles: [],
posts: [],
staffs: [],
stateChange: [],
fieldList: [],
@ -382,7 +390,7 @@ export default {
participant_cc: [],
enable_retreat: false,
participant_type: 0,
filter_policy: 0,
filter_policy: '0',
distribute_type: 2, //
state_fields: {}, //
},
@ -499,6 +507,7 @@ export default {
this.getList();
this.getUsers();
this.getRole();
this.getPost();
this.getField();
},
methods: {
@ -519,6 +528,11 @@ export default {
async getRole() {
let roles = await this.$API.system.role.list.req({ page: 0 });
this.roles = roles;
},
//
async getPost() {
let posts = await this.$API.system.post.list.req({ page: 0 });
this.posts = posts;
},
//
async getField() {

View File

@ -205,7 +205,7 @@
}
if(res.err_msg){}else{
this.limitedAdd = false;
this.$router.push("/dutywork");
this.$router.push("dutywork");
}
},
@ -223,7 +223,7 @@
this.$API.wf.ticket.ticketDeliver.req(this.ticketId,this.deliverForm).then(res=>{
if(res.err_msg){}else{
this.limitedDeliver = false;
this.$router.push("/dutywork");
this.$router.push("dutywork");
}
})
},
@ -234,7 +234,7 @@
params.suggestion = this.form.suggestion;
this.$API.wf.ticket.ticketHandle.req(this.ticketId,params).then(res=>{
if(res.err_msg){}else{
this.$router.push("/dutywork");
this.$router.push("dutywork");
}
})
},