This commit is contained in:
2309368887@qq.com 2022-07-07 14:26:50 +08:00
commit 65cadaeb54
15 changed files with 2055 additions and 645 deletions

BIN
public/img/left_arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

BIN
public/img/v_track.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

BIN
public/img/v_view.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

@ -12,6 +12,14 @@ export default {
); );
} }
}, },
item: {
name: "获取企业员工",
req: async function(id){
return await http.get(
`${config.API_URL}/hrm/employee/${id}/`,
);
}
},
create: { create: {
name: "新增员工", name: "新增员工",
req: async function(data){ req: async function(data){

View File

@ -341,8 +341,8 @@ export default {
list: { list: {
url: `${config.API_URL}/system/user_post/`, url: `${config.API_URL}/system/user_post/`,
name: "用户/岗位关系", name: "用户/岗位关系",
req: async function(params){ req: async function(data){
return await http.get(this.url, params); return await http.get(this.url, data);
} }
}, },
create: { create: {

View File

@ -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
);
}
}
},
} }

View File

@ -168,7 +168,7 @@ const routes = [
"name": "configuration", "name": "configuration",
"path": "/wf/configuration", "path": "/wf/configuration",
"meta": { "meta": {
"title": "工", "title": "工作流配置",
"icon": "el-icon-menu", "icon": "el-icon-menu",
"hidden": true "hidden": true
}, },

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -41,9 +41,9 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="所属部门"> <el-form-item label="所属部门">
<el-cascader <el-cascader
v-model="form.dept" v-model="form.belong_dept"
:options="group" :options="group"
:props="deptsProps" :props="groupsProps"
clearable clearable
style="width: 100%;"> style="width: 100%;">
</el-cascader> </el-cascader>
@ -190,18 +190,12 @@
}*/ }*/
], ],
}, },
addForm: {
name: "",
sort: "",
user: "",
post: "",
dept: [],
},
groupsProps: { groupsProps: {
// value: "id", // value: "id",
multiple: false, multiple: false,
emitPath: false, emitPath: false,
checkStrictly: true, checkStrictly: true,
expandTrigger: 'hover',
}, },
group: [], group: [],
postOptions: [], postOptions: [],
@ -248,7 +242,6 @@
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
// this.addForm.dept = this.addForm.dept[1];
if (this.mode === 'add') { if (this.mode === 'add') {
this.$API.hrm.employee.create.req(this.form) this.$API.hrm.employee.create.req(this.form)
.then(res => { .then(res => {

View File

@ -135,7 +135,7 @@
mounted() { mounted() {
this.getPosts(); this.getPosts();
this.getGroup(); this.getGroup();
this.getUserPostList();
}, },
methods: { methods: {
getPosts(){ getPosts(){
@ -162,6 +162,7 @@
setData(data) { setData(data) {
debugger; debugger;
Object.assign(this.form, data); Object.assign(this.form, data);
this.getUserPostList();
}, },
closeDrawer() { closeDrawer() {
this.visible = false; this.visible = false;
@ -181,7 +182,10 @@
///// /////
// //
getUserPostList(){ 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){ if(res.err_msg){
this.$message.error(res.err_msg) this.$message.error(res.err_msg)
}else{ }else{

View File

@ -1,6 +1,6 @@
<template> <template>
<el-container> <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"> <el-tab-pane label="自定义字段" name="customField">
<field v-if="activeName==='customField'"></field> <field v-if="activeName==='customField'"></field>
</el-tab-pane> </el-tab-pane>

View File

@ -6,7 +6,7 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <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 type="index" width="50"/>
<el-table-column label="字段标识" prop="field_key"></el-table-column> <el-table-column label="字段标识" prop="field_key"></el-table-column>
<el-table-column label="字段名称" prop="field_name"></el-table-column> <el-table-column label="字段名称" prop="field_name"></el-table-column>
@ -121,9 +121,8 @@
name: "field", name: "field",
data() { data() {
return { return {
apiObj: this.$API.wf.field.list,
id: sessionStorage.getItem('jinYuWorkflowId'), id: sessionStorage.getItem('jinYuWorkflowId'),
list: null, list: [],
type: "add", type: "add",
titleMap: { titleMap: {
add: '新增', add: '新增',
@ -193,28 +192,6 @@
} }
}, },
mounted() { 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(); this.getList();
}, },
methods: { methods: {
@ -271,8 +248,7 @@
this.addForm = Object.assign({}, row); this.addForm = Object.assign({}, row);
}, },
async getList() { async getList() {
let res = await this.$API.wf.getCustomfields.get(this.id); let res = await this.$API.wf.workflow.customfields.req(this.id);
console.log(res);
this.list = res; this.list = res;
}, },
}, },

View File

@ -2,12 +2,23 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <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> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<el-table ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow> <scTable
<el-table-column type="index" width="50"/> 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="名称" prop="name"></el-table-column>
<el-table-column label="是否隐藏"> <el-table-column label="是否隐藏">
<template #default="scope"> <template #default="scope">
@ -18,24 +29,33 @@
<el-table-column label="顺序ID" prop="sort"></el-table-column> <el-table-column label="顺序ID" prop="sort"></el-table-column>
<el-table-column label="类型"> <el-table-column label="类型">
<template #default="scope"> <template #default="scope">
<el-tag effect="plain" v-if="scope.row.type==0"> <el-tag effect="plain" v-if="scope.row.type == 0">
普通类型 普通类型
</el-tag> </el-tag>
<el-tag effect="plain" v-if="scope.row.type==1"> <el-tag effect="plain" v-if="scope.row.type == 1">
初始状态 初始状态
</el-tag> </el-tag>
<el-tag effect="plain" v-if="scope.row.type==2"> <el-tag effect="plain" v-if="scope.row.type == 2">
结束状态 结束状态
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="参与人类型"> <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>
<el-table-column label="创建时间" prop="create_time"></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="right" width="120">
<template #default="scope"> <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="确定删除吗?"> <el-popconfirm title="确定删除吗?">
<template #reference> <template #reference>
<el-button type="text" size="small">删除</el-button> <el-button type="text" size="small">删除</el-button>
@ -43,39 +63,40 @@
</el-popconfirm> </el-popconfirm>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </scTable>
<el-dialog <el-dialog v-model="dialogVisible" :title="titleMap[type]">
v-model="dialogVisible"
:title="titleMap[type]"
>
<el-form <el-form
ref="Form" ref="Form"
:model="addForm" :model="addForm"
label-width="100px" label-width="100px"
label-position="right" label-position="right"
:rules="rule"
> >
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="addForm.name" placeholder="名称"/> <el-input v-model="addForm.name" placeholder="名称" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="是否隐藏" prop="is_hidden" label-width="120px">
label="是否隐藏"
prop="is_hidden"
label-width="120px"
>
<el-switch v-model="addForm.is_hidden"></el-switch> <el-switch v-model="addForm.is_hidden"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="状态顺序" prop="sort"> <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>
<el-form-item label="状态类型" prop="type"> <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 <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -87,82 +108,218 @@
<el-switch v-model="addForm.enable_retreat"></el-switch> <el-switch v-model="addForm.enable_retreat"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="参与者类型" prop="participant_type"> <el-form-item label="参与者类型" prop="participant_type">
<el-select style="width: 100%" v-model="addForm.participant_type" placeholder="请选择" <el-select
@change="typeChange"> style="width: 100%"
v-model="addForm.participant_type"
placeholder="请选择"
>
<el-option <el-option
v-for="item in typeoptions" v-for="item in typeoptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==1"> <el-form-item
<el-select style="width: 100%" v-model="participant" placeholder="请选择参与者"> label="参与者"
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==2"> <el-form-item
<el-select style="width: 100%" v-model="participants" multiple placeholder="请选择参与者"> label="参与者"
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与者" prop="participant" v-if="addForm.participant_type==7"> <el-form-item
<el-select style="width: 100%" v-model="participant" placeholder="请选择字段"> label="参与者"
<el-option v-for="item in fieldList" :key="item.id" :label="item.field_name" prop="participant"
:value="item.field_key"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分配方式" prop="participant" v-if="addForm.participant_type==2"> <el-form-item
<el-select style="width: 100%" v-model="addForm.distribute_type" placeholder="请选择分配方式"> label="分配方式"
<el-option label="主动接单" value="1"></el-option> prop="participant"
<el-option label="直接处理" value="2"></el-option> >
<el-option label="随机分配" value="3"></el-option> <el-select
<el-option label="全部处理" value="4"></el-option> 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-select>
</el-form-item> </el-form-item>
<el-form-item label="角色" prop="participant" v-if="addForm.participant_type==4"> <el-form-item
<el-select style="width: 100%" v-model="participants" multiple placeholder="请选择角色"> label="角色"
<el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="过滤策略" prop="participant" v-if="addForm.participant_type==4"> <el-form-item
<el-select style="width: 100%" v-model="addForm.filter_policy" placeholder="请选择过滤策略"> 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="0"></el-option>
<el-option label="和工单同属以及上级部门" value="1"></el-option> <el-option label="和工单同属以及上级部门" value="1"></el-option>
<el-option label="和创建人同属以及上级部门" value="2"></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-select>
</el-form-item> </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-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 v-for="item in codes" :key="item.func" :label="item.name" :value="item.func">
</el-option> </el-option>
</el-select> </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>
<el-form-item label="抄送给" prop="participant"> <el-form-item label="抄送给" prop="participant">
<el-select style="width: 100%" v-model="addForm.participant_cc" multiple placeholder="请选择抄送给谁"> <el-select
<el-option v-for="item in staffs" :key="item.id" :label="item.name" :value="item.id"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="字段状态"> <el-form-item label="字段状态">
<el-button @click="addWordStateChange">添加修改</el-button> <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-col :span="11">
<el-select style="width: 100%" v-model="item.name" placeholder="请选择字段"> <el-select
<el-option v-for="item in fieldList" :key="item.id" :label="item.field_name" style="width: 100%"
:value="item.field_key"> 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-option>
</el-select> </el-select>
</el-col> </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-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 <el-option
v-for="item in state_fields" v-for="item in state_fields"
:label="item.label" :label="item.label"
@ -171,10 +328,10 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="2" style="text-align: center" v-if="$index!==0"> <el-col :span="2" style="text-align: center" v-if="$index !== 0">
<i <i
class="el-icon-remove-outline" class="el-icon-remove-outline"
style="color: red;font-size: 16px;" style="color: red; font-size: 16px"
@click.prevent="removeStateChange($index)" @click.prevent="removeStateChange($index)"
></i> ></i>
</el-col> </el-col>
@ -182,30 +339,32 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false"
<el-button type="primary" @click="submitHandle('Form')">确认</el-button> >取消</el-button
>
<el-button type="primary" @click="submitHandle('Form')"
>确认</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</el-main> </el-main>
</el-container> </el-container>
</template> </template>
<script> <script>
export default { export default {
name: "state", name: "state",
data() { data() {
return { return {
apiObj: this.$API.wf.state.list, id: sessionStorage.getItem("jinYuWorkflowId"),
id: sessionStorage.getItem('jinYuWorkflowId'),
list: null, list: null,
type: "add", type: "add",
titleMap: { titleMap: {
add: '新增', add: "新增",
edit: '编辑', edit: "编辑",
show: '查看' show: "查看",
}, },
participant: '', participant: "",
participants: [], participants: [],
roles: [], roles: [],
staffs: [], staffs: [],
@ -213,90 +372,127 @@
fieldList: [], fieldList: [],
// //
addForm: { addForm: {
name: '', name: "",
is_hidden: false, is_hidden: false,
sort: '', sort: "",
type: '', type: "",
participant_cc: [], participant_cc: [],
enable_retreat: false, enable_retreat: false,
participant_type: 0, participant_type: 0,
filter_policy: 0, filter_policy: 0,
distribute_type: '2',// distribute_type: 2, //
state_fields: {}// state_fields: {}, //
}, },
// //
rules: { rules: {
name: [ name: [{ required: true, message: "请输入工作流名称" }],
{required: true, message: '请输入工作流名称'}
]
}, },
options_: { options_: {
"0": '无处理', 0: "无处理",
"1": '个人', 1: "个人",
"2": '多人', 2: "多人",
"4": '角色', 4: "角色",
"6": '脚本', 6: "脚本",
"7": '工单的字段', 7: "工单的字段",
"9": '代码获取', 9: "代码获取",
10: "岗位",
}, },
options: [{ options2_: {
1: "主动接单",
2: "直接处理",
3: "随机分配",
4: "全部处理",
},
options: [
{
value: 0, value: 0,
label: '普通类型' label: "普通类型",
}, { },
{
value: 1, value: 1,
label: '初始状态' label: "初始状态",
}, { },
{
value: 2, value: 2,
label: '结束状态' label: "结束状态",
}], },
typeoptions: [{ ],
typeoptions: [
{
value: 0, value: 0,
label: '无处理' label: "无处理",
}, { },
{
value: 1, value: 1,
label: '个人' label: "个人",
}, { },
{
value: 2, value: 2,
label: '多人' label: "多人",
} },
, { {
value: 4, value: 4,
label: '角色' label: "角色",
} },
, { {
value: 6, value: 6,
label: '脚本' label: "脚本",
} },
, { {
value: 7, value: 7,
label: '工单的字段' label: "工单的字段",
} },
, { {
value: 9, value: 9,
label: '代码获取' label: "代码获取",
}], },
{
value: 10,
label: "岗位",
},
],
state_fields: [ state_fields: [
{ {
value: 1, value: 1,
label: '只读' label: "只读",
}, { },
{
value: 2, value: 2,
label: '必填' label: "必填",
}, { },
{
value: 3, value: 3,
label: '可选' label: "可选",
}, { },
{
value: 4,
label: "隐藏",
},
],
dis_type_options: [
{
label: "主动接单",
value: 1,
},
{
label: "直接处理",
value: 2,
},
{
label: "随机分配",
value: 3,
},
{
label: "全部处理",
value: 4, value: 4,
label: '隐藏'
}, },
], ],
editId: null, editId: null,
dialogVisible: false, dialogVisible: false,
} };
}, },
mounted() { mounted() {
debugger; this.id = sessionStorage.getItem("jinYuWorkflowId");
this.id = sessionStorage.getItem('jinYuWorkflowId');
this.getList(); this.getList();
this.getUsers(); this.getUsers();
this.getRole(); this.getRole();
@ -305,51 +501,40 @@
methods: { methods: {
// //
addWordStateChange() { addWordStateChange() {
this.stateChange.push({name: '', value: ''}) this.stateChange.push({ name: "", value: "" });
}, },
// //
removeStateChange(index) { removeStateChange(index) {
this.stateChange.splice(index, 1) this.stateChange.splice(index, 1);
}, },
// //
async getUsers() { 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; this.staffs = staffs;
}, },
// //
async getRole() { 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; this.roles = roles;
}, },
// //
async getField() { 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; this.fieldList = fieldList;
}, },
handleAdd() { handleAdd() {
this.type = 'add'; this.type = "add";
this.dialogVisible = true; this.dialogVisible = true;
}, },
submitHandle() { async submitHandle() {
let that = this; 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; that.isSaveing = true;
let res = null; let res = null;
if (that.type === 'add') { if (that.type === "add") {
that.addForm.workflow = this.id; that.addForm.workflow = this.id;
res = that.$API.wf.stateAdd.post(that.addForm) res = await that.$API.wf.state.create.req(that.addForm);
} else { } 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) { if (res.err_msg) {
that.isSaveing = false; that.isSaveing = false;
@ -358,24 +543,48 @@
that.dialogVisible = false; that.dialogVisible = false;
that.getList(); 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) { handleEdit(row) {
this.type = 'edit'; this.type = "edit";
this.editId = row.id; this.editId = row.id;
this.dialogVisible = true; this.dialogVisible = true;
this.addForm = Object.assign({}, row); this.addForm = Object.assign({}, row);
}, },
async getList() { 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); console.log(res);
this.list = res; this.list = res;
}, },
}, },
} };
</script> </script>
<style scoped> <style scoped>
</style> </style>

View File

@ -1,11 +1,17 @@
<template> <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-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-table </div>
:data="list" </el-header>
style="width: 100%" <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="name"></el-table-column>
<el-table-column label="定时器(单位秒)" prop="timer"></el-table-column> <el-table-column label="定时器(单位秒)" prop="timer"></el-table-column>
<el-table-column label="源状态"> <el-table-column label="源状态">
@ -38,7 +44,7 @@
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </scTable>
<el-dialog <el-dialog
v-model="dialogVisible" v-model="dialogVisible"
:title="titleMap[type]" :title="titleMap[type]"
@ -48,7 +54,6 @@
:model="addForm" :model="addForm"
label-width="130px" label-width="130px"
label-position="right" label-position="right"
:rules="rule"
> >
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="addForm.name" placeholder="名称"/> <el-input v-model="addForm.name" placeholder="名称"/>
@ -78,6 +83,7 @@
</el-form-item> </el-form-item>
<el-form-item label="条件表达式" prop="condition_expression"> <el-form-item label="条件表达式" prop="condition_expression">
<vue-json-editor <vue-json-editor
style="width:100%"
v-model="addForm.condition_expression" v-model="addForm.condition_expression"
:showBtns="false" :showBtns="false"
:mode="'code'" :mode="'code'"
@ -105,6 +111,8 @@
</div> </div>
</el-dialog> </el-dialog>
</el-main> </el-main>
</el-container>
</template> </template>
<script> <script>
@ -176,37 +184,35 @@
this.addForm = Object.assign({}, row); this.addForm = Object.assign({}, row);
}, },
async getList() { 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; this.list = res;
}, },
async getStateList() { 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); console.log(res);
this.stateList = res; this.stateList = res;
}, },
submitHandle(){ async submitHandle(){
let that = this; let that = this;
this.$refs.Form.validate((valid) => {
if (valid) {
let res = null; let res = null;
if (that.type === 'add') { if (that.type === 'add') {
debugger; debugger;
that.addForm.workflow = this.id; that.addForm.workflow = this.id;
res = that.$API.wf.transitionAdd.post(that.addForm); res = await that.$API.wf.transition.create.req(that.addForm);
} else { } 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){ if(res.err_msg){
this.$message.error(res.err_msg) that.isSaveing = false;
}else{ }else{
that.isSaveing = false; that.isSaveing = false;
that.limitedVisible = false; that.dialogVisible = false;
that.$refs.table.refresh();
}
that.isSaveing = false;
that.limitedVisible = false;
that.getList(); that.getList();
} }
this.$refs.Form.validate((valid) => {
if (valid) {
}
}) })
}, },
}, },