Merge branch 'ehs' of https://e.coding.net/ctcdevteam/ehs/ehs_web into ehs
This commit is contained in:
commit
65cadaeb54
Binary file not shown.
|
After Width: | Height: | Size: 250 B |
Binary file not shown.
|
After Width: | Height: | Size: 283 B |
Binary file not shown.
|
After Width: | Height: | Size: 276 B |
|
|
@ -12,6 +12,14 @@ export default {
|
|||
);
|
||||
}
|
||||
},
|
||||
item: {
|
||||
name: "获取企业员工",
|
||||
req: async function(id){
|
||||
return await http.get(
|
||||
`${config.API_URL}/hrm/employee/${id}/`,
|
||||
);
|
||||
}
|
||||
},
|
||||
create: {
|
||||
name: "新增员工",
|
||||
req: async function(data){
|
||||
|
|
|
|||
|
|
@ -341,8 +341,8 @@ export default {
|
|||
list: {
|
||||
url: `${config.API_URL}/system/user_post/`,
|
||||
name: "用户/岗位关系",
|
||||
req: async function(params){
|
||||
return await http.get(this.url, params);
|
||||
req: async function(data){
|
||||
return await http.get(this.url, data);
|
||||
}
|
||||
},
|
||||
create: {
|
||||
|
|
|
|||
|
|
@ -14,4 +14,35 @@ export default {
|
|||
},
|
||||
|
||||
},
|
||||
blt:{
|
||||
all:{
|
||||
name: "全部在线标签列表信息",
|
||||
req: async function(data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/third/tdevice/blt/all/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
countBind:{
|
||||
name: "统计绑定定位卡人/设备数",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/third/tdevice/blt/count_bind/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
countNow:{
|
||||
name: "统计在厂终端数",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/third/tdevice/blt/count_now/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ const routes = [
|
|||
"name": "configuration",
|
||||
"path": "/wf/configuration",
|
||||
"meta": {
|
||||
"title": "工单",
|
||||
"title": "工作流配置",
|
||||
"icon": "el-icon-menu",
|
||||
"hidden": true
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,102 @@
|
|||
<template>
|
||||
<el-drawer
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "新增",
|
||||
edit: "编辑",
|
||||
show: "查看/处理",
|
||||
},
|
||||
form: {},
|
||||
rules: {},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.rpm.rparty.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.rpm.rparty.update.req(
|
||||
this.form.id,
|
||||
this.form
|
||||
);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
// this.loading = true
|
||||
// const params = {
|
||||
// id: data.id
|
||||
// }
|
||||
// setTimeout(async ()=>{
|
||||
// var res = await this.$API.system.table.info.get(params)
|
||||
// this.loading = false
|
||||
// this.form = res.data
|
||||
// },400)
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -41,9 +41,9 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="所属部门">
|
||||
<el-cascader
|
||||
v-model="form.dept"
|
||||
v-model="form.belong_dept"
|
||||
:options="group"
|
||||
:props="deptsProps"
|
||||
:props="groupsProps"
|
||||
clearable
|
||||
style="width: 100%;">
|
||||
</el-cascader>
|
||||
|
|
@ -190,18 +190,12 @@
|
|||
}*/
|
||||
],
|
||||
},
|
||||
addForm: {
|
||||
name: "",
|
||||
sort: "",
|
||||
user: "",
|
||||
post: "",
|
||||
dept: [],
|
||||
},
|
||||
groupsProps: {
|
||||
// value: "id",
|
||||
multiple: false,
|
||||
emitPath: false,
|
||||
checkStrictly: true,
|
||||
expandTrigger: 'hover',
|
||||
},
|
||||
group: [],
|
||||
postOptions: [],
|
||||
|
|
@ -248,7 +242,6 @@
|
|||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
// this.addForm.dept = this.addForm.dept[1];
|
||||
if (this.mode === 'add') {
|
||||
this.$API.hrm.employee.create.req(this.form)
|
||||
.then(res => {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
mounted() {
|
||||
this.getPosts();
|
||||
this.getGroup();
|
||||
this.getUserPostList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
getPosts(){
|
||||
|
|
@ -162,6 +162,7 @@
|
|||
setData(data) {
|
||||
debugger;
|
||||
Object.assign(this.form, data);
|
||||
this.getUserPostList();
|
||||
},
|
||||
closeDrawer() {
|
||||
this.visible = false;
|
||||
|
|
@ -181,7 +182,10 @@
|
|||
/////
|
||||
//用户岗位关系列表
|
||||
getUserPostList(){
|
||||
this.$API.system.userPost.list.req().then(res=>{
|
||||
debugger;
|
||||
console.log(this.form.id);
|
||||
let obj = {user:this.form.id};
|
||||
this.$API.system.userPost.list.req(obj).then(res=>{
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-tabs style="width: 100%" type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tabs style="width: 100%; height:100%" type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="自定义字段" name="customField">
|
||||
<field v-if="activeName==='customField'"></field>
|
||||
</el-tab-pane>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow>
|
||||
<scTable ref="table" :data="list" row-key="id" stripe highlightCurrentRow hidePagination>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="字段标识" prop="field_key"></el-table-column>
|
||||
<el-table-column label="字段名称" prop="field_name"></el-table-column>
|
||||
|
|
@ -121,9 +121,8 @@
|
|||
name: "field",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wf.field.list,
|
||||
id: sessionStorage.getItem('jinYuWorkflowId'),
|
||||
list: null,
|
||||
list: [],
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
|
|
@ -193,28 +192,6 @@
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.list = [
|
||||
{
|
||||
id: "5001",
|
||||
name: "scEcharts",
|
||||
subtitle: "重新封装的Echarts,暴露源对象",
|
||||
state: "1",
|
||||
type: "数据",
|
||||
progress: 70,
|
||||
user: "sss",
|
||||
time: "2010-10-10"
|
||||
},
|
||||
{
|
||||
id: "5002",
|
||||
name: "scEditor",
|
||||
subtitle: "Tinymce封装的富文本编辑器",
|
||||
state: "2",
|
||||
type: "表单",
|
||||
progress: 40,
|
||||
user: "sss",
|
||||
time: "2010-10-10"
|
||||
}
|
||||
];
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -271,8 +248,7 @@
|
|||
this.addForm = Object.assign({}, row);
|
||||
},
|
||||
async getList() {
|
||||
let res = await this.$API.wf.getCustomfields.get(this.id);
|
||||
console.log(res);
|
||||
let res = await this.$API.wf.workflow.customfields.req(this.id);
|
||||
this.list = res;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,12 +2,23 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<el-table ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<scTable
|
||||
ref="table"
|
||||
:data="list"
|
||||
row-key="id"
|
||||
stripe
|
||||
highlightCurrentRow
|
||||
hidePagination
|
||||
>
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="是否隐藏">
|
||||
<template #default="scope">
|
||||
|
|
@ -30,12 +41,21 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参与人类型">
|
||||
<template #default="scope">{{ options_[scope.row.participant_type] }}</template>
|
||||
<template #default="scope">{{
|
||||
options_[scope.row.participant_type]
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分配方式">
|
||||
<template #default="scope">{{
|
||||
options2_[scope.row.distribute_type]
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="right" width="120">
|
||||
<template #default="scope">
|
||||
<el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="handleEdit(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm title="确定删除吗?">
|
||||
<template #reference>
|
||||
<el-button type="text" size="small">删除</el-button>
|
||||
|
|
@ -43,39 +63,40 @@
|
|||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="titleMap[type]"
|
||||
>
|
||||
</scTable>
|
||||
<el-dialog v-model="dialogVisible" :title="titleMap[type]">
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="addForm"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
:rules="rule"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="addForm.name" placeholder="名称" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="是否隐藏"
|
||||
prop="is_hidden"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="是否隐藏" prop="is_hidden" label-width="120px">
|
||||
<el-switch v-model="addForm.is_hidden"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态顺序" prop="sort">
|
||||
<el-input v-model="addForm.sort" type="number" placeholder="状态顺序"/>
|
||||
<el-input
|
||||
v-model="addForm.sort"
|
||||
type="number"
|
||||
placeholder="状态顺序"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态类型" prop="type">
|
||||
<el-select style="width: 100%" v-model="addForm.type" placeholder="请选择">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.type"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -87,82 +108,218 @@
|
|||
<el-switch v-model="addForm.enable_retreat"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与者类型" prop="participant_type">
|
||||
<el-select style="width: 100%" v-model="addForm.participant_type" placeholder="请选择"
|
||||
@change="typeChange">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant_type"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeoptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==1">
|
||||
<el-select style="width: 100%" v-model="participant" placeholder="请选择参与者">
|
||||
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-form-item
|
||||
label="参与者"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 1"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant"
|
||||
placeholder="请选择参与者"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in staffs"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==2">
|
||||
<el-select style="width: 100%" v-model="participants" multiple placeholder="请选择参与者">
|
||||
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-form-item
|
||||
label="参与者"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 2"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant"
|
||||
multiple
|
||||
placeholder="请选择参与者"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in staffs"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==7">
|
||||
<el-select style="width: 100%" v-model="participant" placeholder="请选择字段">
|
||||
<el-option v-for="item in fieldList" :key="item.id" :label="item.field_name"
|
||||
:value="item.field_key">
|
||||
<el-form-item
|
||||
label="参与者"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 7"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant"
|
||||
placeholder="请选择字段"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fieldList"
|
||||
:key="item.id"
|
||||
:label="item.field_name"
|
||||
:value="item.field_key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分配方式" prop="participant" v-if="addForm.participant_type==2">
|
||||
<el-select style="width: 100%" v-model="addForm.distribute_type" placeholder="请选择分配方式">
|
||||
<el-option label="主动接单" value="1"></el-option>
|
||||
<el-option label="直接处理" value="2"></el-option>
|
||||
<el-option label="随机分配" value="3"></el-option>
|
||||
<el-option label="全部处理" value="4"></el-option>
|
||||
<el-form-item
|
||||
label="分配方式"
|
||||
prop="participant"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.distribute_type"
|
||||
placeholder="请选择分配方式"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dis_type_options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="participant" v-if="addForm.participant_type==4">
|
||||
<el-select style="width: 100%" v-model="participants" multiple placeholder="请选择角色">
|
||||
<el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-form-item
|
||||
label="角色"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 4"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant"
|
||||
multiple
|
||||
placeholder="请选择角色"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roles"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="过滤策略" prop="participant" v-if="addForm.participant_type==4">
|
||||
<el-select style="width: 100%" v-model="addForm.filter_policy" placeholder="请选择过滤策略">
|
||||
<el-form-item
|
||||
label="岗位"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 10"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant"
|
||||
multiple
|
||||
placeholder="请选择岗位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roles"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="过滤策略"
|
||||
prop="participant"
|
||||
v-if="
|
||||
addForm.participant_type == 4 || addForm.participant_type == 0
|
||||
"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.filter_policy"
|
||||
placeholder="请选择过滤策略"
|
||||
>
|
||||
<el-option label="无" value="0"></el-option>
|
||||
<el-option label="和工单同属以及上级部门" value="1"></el-option>
|
||||
<el-option label="和创建人同属以及上级部门" value="2"></el-option>
|
||||
<el-option label="和上步处理人同属以及上级部门" value="3"></el-option>
|
||||
<el-option
|
||||
label="和上步处理人同属以及上级部门"
|
||||
value="3"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="代码选择" prop="participant" v-if="addForm.participant_type==9">
|
||||
<!-- <el-form-item label="代码选择" prop="participant" v-if="addForm.participant_type==9">
|
||||
<el-select style="width: 100%" v-model="participants" placeholder="请选择代码">
|
||||
<el-option v-for="item in codes" :key="item.func" :label="item.name" :value="item.func">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item
|
||||
label="代码名"
|
||||
prop="participant"
|
||||
v-if="addForm.participant_type == 9"
|
||||
>
|
||||
<!-- <el-select style="width: 100%" v-model="participants" placeholder="请选择代码">
|
||||
<el-option v-for="item in codes" :key="item.func" :label="item.name" :value="item.func">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
<el-input v-model="addForm.participant" placeholder="方法名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抄送给" prop="participant">
|
||||
<el-select style="width: 100%" v-model="addForm.participant_cc" multiple placeholder="请选择抄送给谁">
|
||||
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="addForm.participant_cc"
|
||||
multiple
|
||||
placeholder="请选择抄送给谁"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in staffs"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字段状态">
|
||||
<el-button @click="addWordStateChange">添加修改</el-button>
|
||||
<el-row v-for="(item,$index) in stateChange" :key="item+$index" style="margin-top: 2px">
|
||||
<el-row
|
||||
v-for="(item, $index) in stateChange"
|
||||
:key="item + $index"
|
||||
style="margin-top: 2px"
|
||||
>
|
||||
<el-col :span="11">
|
||||
<el-select style="width: 100%" v-model="item.name" placeholder="请选择字段">
|
||||
<el-option v-for="item in fieldList" :key="item.id" :label="item.field_name"
|
||||
:value="item.field_key">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="item.name"
|
||||
placeholder="请选择字段"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fieldList"
|
||||
:key="item.id"
|
||||
:label="item.field_name"
|
||||
:value="item.field_key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="1" style="height: 1px;"></el-col>
|
||||
<el-col :span="1" style="height: 1px"></el-col>
|
||||
<el-col :span="8">
|
||||
<el-select style="width: 100%" v-model="item.value" placeholder="请选择状态">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="item.value"
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in state_fields"
|
||||
:label="item.label"
|
||||
|
|
@ -174,7 +331,7 @@
|
|||
<el-col :span="2" style="text-align: center" v-if="$index !== 0">
|
||||
<i
|
||||
class="el-icon-remove-outline"
|
||||
style="color: red;font-size: 16px;"
|
||||
style="color: red; font-size: 16px"
|
||||
@click.prevent="removeStateChange($index)"
|
||||
></i>
|
||||
</el-col>
|
||||
|
|
@ -182,13 +339,16 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitHandle('Form')">确认</el-button>
|
||||
<el-button type="danger" @click="dialogVisible = false"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitHandle('Form')"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -196,16 +356,15 @@
|
|||
name: "state",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wf.state.list,
|
||||
id: sessionStorage.getItem('jinYuWorkflowId'),
|
||||
id: sessionStorage.getItem("jinYuWorkflowId"),
|
||||
list: null,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
edit: '编辑',
|
||||
show: '查看'
|
||||
add: "新增",
|
||||
edit: "编辑",
|
||||
show: "查看",
|
||||
},
|
||||
participant: '',
|
||||
participant: "",
|
||||
participants: [],
|
||||
roles: [],
|
||||
staffs: [],
|
||||
|
|
@ -213,90 +372,127 @@
|
|||
fieldList: [],
|
||||
//表单数据
|
||||
addForm: {
|
||||
name: '',
|
||||
name: "",
|
||||
is_hidden: false,
|
||||
sort: '',
|
||||
type: '',
|
||||
sort: "",
|
||||
type: "",
|
||||
participant_cc: [],
|
||||
enable_retreat: false,
|
||||
participant_type: 0,
|
||||
filter_policy: 0,
|
||||
distribute_type: '2',//分发类型
|
||||
state_fields: {}//字段状态是否可写
|
||||
distribute_type: 2, //分发类型
|
||||
state_fields: {}, //字段状态是否可写
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入工作流名称'}
|
||||
]
|
||||
name: [{ required: true, message: "请输入工作流名称" }],
|
||||
},
|
||||
options_: {
|
||||
"0": '无处理',
|
||||
"1": '个人',
|
||||
"2": '多人',
|
||||
"4": '角色',
|
||||
"6": '脚本',
|
||||
"7": '工单的字段',
|
||||
"9": '代码获取',
|
||||
0: "无处理",
|
||||
1: "个人",
|
||||
2: "多人",
|
||||
4: "角色",
|
||||
6: "脚本",
|
||||
7: "工单的字段",
|
||||
9: "代码获取",
|
||||
10: "岗位",
|
||||
},
|
||||
options: [{
|
||||
options2_: {
|
||||
1: "主动接单",
|
||||
2: "直接处理",
|
||||
3: "随机分配",
|
||||
4: "全部处理",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: '普通类型'
|
||||
}, {
|
||||
label: "普通类型",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '初始状态'
|
||||
}, {
|
||||
label: "初始状态",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '结束状态'
|
||||
}],
|
||||
typeoptions: [{
|
||||
label: "结束状态",
|
||||
},
|
||||
],
|
||||
typeoptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '无处理'
|
||||
}, {
|
||||
label: "无处理",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '个人'
|
||||
}, {
|
||||
label: "个人",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '多人'
|
||||
}
|
||||
, {
|
||||
label: "多人",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '角色'
|
||||
}
|
||||
, {
|
||||
label: "角色",
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
label: '脚本'
|
||||
}
|
||||
, {
|
||||
label: "脚本",
|
||||
},
|
||||
{
|
||||
value: 7,
|
||||
label: '工单的字段'
|
||||
}
|
||||
, {
|
||||
label: "工单的字段",
|
||||
},
|
||||
{
|
||||
value: 9,
|
||||
label: '代码获取'
|
||||
}],
|
||||
label: "代码获取",
|
||||
},
|
||||
{
|
||||
value: 10,
|
||||
label: "岗位",
|
||||
},
|
||||
],
|
||||
state_fields: [
|
||||
{
|
||||
value: 1,
|
||||
label: '只读'
|
||||
}, {
|
||||
label: "只读",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '必填'
|
||||
}, {
|
||||
label: "必填",
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '可选'
|
||||
}, {
|
||||
label: "可选",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: "隐藏",
|
||||
},
|
||||
],
|
||||
dis_type_options: [
|
||||
{
|
||||
label: "主动接单",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: "直接处理",
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: "随机分配",
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: "全部处理",
|
||||
value: 4,
|
||||
label: '隐藏'
|
||||
},
|
||||
],
|
||||
editId: null,
|
||||
dialogVisible: false,
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
debugger;
|
||||
this.id = sessionStorage.getItem('jinYuWorkflowId');
|
||||
this.id = sessionStorage.getItem("jinYuWorkflowId");
|
||||
this.getList();
|
||||
this.getUsers();
|
||||
this.getRole();
|
||||
|
|
@ -305,51 +501,40 @@
|
|||
methods: {
|
||||
//添加字段选项
|
||||
addWordStateChange() {
|
||||
this.stateChange.push({name: '', value: ''})
|
||||
this.stateChange.push({ name: "", value: "" });
|
||||
},
|
||||
//删除字段选项
|
||||
removeStateChange(index) {
|
||||
this.stateChange.splice(index, 1)
|
||||
this.stateChange.splice(index, 1);
|
||||
},
|
||||
//获取员工
|
||||
async getUsers() {
|
||||
let staffs = await this.$API.system.user.get({page: 0});
|
||||
let staffs = await this.$API.system.user.list.req({ page: 0 });
|
||||
this.staffs = staffs;
|
||||
},
|
||||
//获取角色
|
||||
async getRole() {
|
||||
let roles = await this.$API.system.role.get({page: 0});
|
||||
let roles = await this.$API.system.role.list.req({ page: 0 });
|
||||
this.roles = roles;
|
||||
},
|
||||
//获取字段
|
||||
async getField() {
|
||||
let fieldList = await this.$API.wf.getCustomfields.get(this.id);
|
||||
let fieldList = await this.$API.wf.workflow.customfields.req(this.id);
|
||||
this.fieldList = fieldList;
|
||||
},
|
||||
handleAdd() {
|
||||
this.type = 'add';
|
||||
this.type = "add";
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
submitHandle() {
|
||||
async submitHandle() {
|
||||
let that = this;
|
||||
debugger;
|
||||
this.$refs.Form.validate((valid) => {
|
||||
if (valid) {
|
||||
let state_fields = {};
|
||||
if (this.stateChange.length > 0) {
|
||||
for (let i = 0; i < this.stateChange.length; i++) {
|
||||
state_fields[this.stateChange[i].name] = this.stateChange[i].value;
|
||||
}
|
||||
}
|
||||
this.addForm.state_fields = state_fields;
|
||||
this.addForm.participant = this.addForm.participant_type === 1 ? this.participant : this.participants;
|
||||
that.isSaveing = true;
|
||||
let res = null;
|
||||
if (that.type === 'add') {
|
||||
if (that.type === "add") {
|
||||
that.addForm.workflow = this.id;
|
||||
res = that.$API.wf.stateAdd.post(that.addForm)
|
||||
res = await that.$API.wf.state.create.req(that.addForm);
|
||||
} else {
|
||||
res = that.$API.wf.stateEdit.put(that.editId, that.addForm);
|
||||
res = await that.$API.wf.state.update.req(that.editId, that.addForm);
|
||||
}
|
||||
if (res.err_msg) {
|
||||
that.isSaveing = false;
|
||||
|
|
@ -358,24 +543,48 @@
|
|||
that.dialogVisible = false;
|
||||
that.getList();
|
||||
}
|
||||
}
|
||||
})
|
||||
// this.$refs.Form.validate((valid) => {
|
||||
// if (valid) {
|
||||
// let state_fields = {};
|
||||
// if (this.stateChange.length > 0) {
|
||||
// for (let i = 0; i < this.stateChange.length; i++) {
|
||||
// state_fields[this.stateChange[i].name] = this.stateChange[i].value;
|
||||
// }
|
||||
// }
|
||||
// this.addForm.state_fields = state_fields;
|
||||
// this.addForm.participant = this.addForm.participant_type === 1 ? this.participant : this.participants;
|
||||
// that.isSaveing = true;
|
||||
// let res = null;
|
||||
// if (that.type === 'add') {
|
||||
// that.addForm.workflow = this.id;
|
||||
// res = that.$API.wf.stateAdd.post(that.addForm)
|
||||
// } else {
|
||||
// res = that.$API.wf.stateEdit.put(that.editId, that.addForm);
|
||||
// }
|
||||
// if (res.err_msg) {
|
||||
// that.isSaveing = false;
|
||||
// } else {
|
||||
// that.isSaveing = false;
|
||||
// that.dialogVisible = false;
|
||||
// that.getList();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.type = 'edit';
|
||||
this.type = "edit";
|
||||
this.editId = row.id;
|
||||
this.dialogVisible = true;
|
||||
this.addForm = Object.assign({}, row);
|
||||
},
|
||||
async getList() {
|
||||
let res = await this.$API.wf.getWorkflowState.get(this.id);
|
||||
let res = await this.$API.wf.workflow.states.req(this.id);
|
||||
console.log(res);
|
||||
this.list = res;
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
<template>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
|
||||
<el-table
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
||||
<scTable
|
||||
:data="list" ref="table"
|
||||
row-key="id" stripe highlightCurrentRow hidePagination
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="定时器(单位秒)" prop="timer"></el-table-column>
|
||||
<el-table-column label="源状态">
|
||||
|
|
@ -38,7 +44,7 @@
|
|||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</scTable>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="titleMap[type]"
|
||||
|
|
@ -48,7 +54,6 @@
|
|||
:model="addForm"
|
||||
label-width="130px"
|
||||
label-position="right"
|
||||
:rules="rule"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="addForm.name" placeholder="名称"/>
|
||||
|
|
@ -78,6 +83,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="条件表达式" prop="condition_expression">
|
||||
<vue-json-editor
|
||||
style="width:100%"
|
||||
v-model="addForm.condition_expression"
|
||||
:showBtns="false"
|
||||
:mode="'code'"
|
||||
|
|
@ -105,6 +111,8 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -176,37 +184,35 @@
|
|||
this.addForm = Object.assign({}, row);
|
||||
},
|
||||
async getList() {
|
||||
let res = await this.$API.wf.getWorkflowTransition.get(this.id);
|
||||
let res = await this.$API.wf.workflow.transitions.req(this.id);
|
||||
this.list = res;
|
||||
},
|
||||
async getStateList() {
|
||||
let res = await this.$API.wf.getWorkflowState.get(this.id);
|
||||
let res = await this.$API.wf.workflow.states.req(this.id);
|
||||
console.log(res);
|
||||
this.stateList = res;
|
||||
},
|
||||
submitHandle(){
|
||||
async submitHandle(){
|
||||
let that = this;
|
||||
this.$refs.Form.validate((valid) => {
|
||||
if (valid) {
|
||||
let res = null;
|
||||
if (that.type === 'add') {
|
||||
debugger;
|
||||
that.addForm.workflow = this.id;
|
||||
res = that.$API.wf.transitionAdd.post(that.addForm);
|
||||
res = await that.$API.wf.transition.create.req(that.addForm);
|
||||
} else {
|
||||
res = that.$API.wf.transitionEdit.put(that.editId, that.addForm);
|
||||
res = await that.$API.wf.transition.update.req(that.editId, that.addForm);
|
||||
}
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
that.isSaveing = false;
|
||||
}else{
|
||||
that.isSaveing = false;
|
||||
that.limitedVisible = false;
|
||||
that.$refs.table.refresh();
|
||||
}
|
||||
that.isSaveing = false;
|
||||
that.limitedVisible = false;
|
||||
that.dialogVisible = false;
|
||||
that.getList();
|
||||
}
|
||||
this.$refs.Form.validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue