yemianqunaxiananniutinajia

This commit is contained in:
shijing 2022-03-02 14:40:42 +08:00
parent 544478dc0b
commit 750e751513
7 changed files with 1695 additions and 1656 deletions

View File

@ -2,12 +2,22 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handlecgCreate" <el-button
>新增采购入库</el-button v-if="checkPermission(['fifo_in_pur'])"
type="primary"
icon="el-icon-plus"
@click="handlecgCreate"
> >
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" 新增采购入库
>新增其他入库</el-button </el-button>
<el-button
v-if="checkPermission(['fifo_in_other'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增其他入库
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="仓库名称/仓库编号" placeholder="仓库名称/仓库编号"
@ -20,15 +30,17 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
@ -43,17 +55,14 @@
v-el-height-adaptive-table="{ bottomOffset: 42 }" v-el-height-adaptive-table="{ bottomOffset: 42 }"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="记录编号" prop="number">
<el-table-column label="记录编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作人员"> <el-table-column label="操作人员">
<template slot-scope="scope" v-if="scope.row.create_by">{{ <template slot-scope="scope" v-if="scope.row.create_by">
scope.row.create_by_.name {{scope.row.create_by_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出/入库时间"> <el-table-column label="出/入库时间" prop="inout_date">
<template slot-scope="scope">{{ scope.row.inout_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="出/入库类型"> <el-table-column label="出/入库类型">
<template slot-scope="scope">{{ types_[scope.row.type] }}</template> <template slot-scope="scope">{{ types_[scope.row.type] }}</template>
@ -64,35 +73,38 @@
<el-tag v-else>已审核</el-tag> <el-tag v-else>已审核</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间"> <el-table-column label="创建时间" prop="create_time">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="scope.row.type==2" v-if="checkPermission(['fifo_pack'])&&scope.row.type==2"
type="primary" type="primary"
@click="handlePack(scope)" @click="handlePack(scope)"
>装箱</el-link
> >
装箱
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['fifo_pack'])"
type="primary" type="primary"
@click="handleDetail(scope)" @click="handleDetail(scope)"
>查看</el-link
> >
查看
</el-link>
<el-link <el-link
v-if="scope.row.is_audited == false" v-if="checkPermission(['fifo_hear'])&&scope.row.is_audited == false"
type="primary" type="primary"
@click="handleAudit(scope)" @click="handleAudit(scope)"
>审核</el-link
> >
审核
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['fifo_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,12 +141,18 @@
</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="dialogVisibles = false" <el-button
>取消</el-button type="danger"
@click="dialogVisibles = false"
> >
<el-button type="primary" @click="confirminpur('Form1')" 取消
>确认</el-button </el-button>
<el-button
type="primary"
@click="confirminpur('Form1')"
> >
确认
</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
@ -180,7 +198,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5" style="margin-right: 10px"> <el-col :span="5" style="margin-right: 10px">
<el-form-item <el-form-item
class="material" class="material"
@ -198,7 +215,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5" style="margin-right: 10px"> <el-col :span="5" style="margin-right: 10px">
<el-form-item <el-form-item
class="count" class="count"
@ -234,10 +250,8 @@
style="width:100%" style="width:100%"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 删除按钮 --> <!-- 删除按钮 -->
<el-col :span="1"> <el-col :span="1">
<el-tooltip <el-tooltip
@ -519,8 +533,7 @@ export default {
}); });
}, },
//装箱 //装箱
handlePack(scope) handlePack(scope) {
{
this.$router.push({name: "salesdetail", params: {id: scope.row.sale},}) this.$router.push({name: "salesdetail", params: {id: scope.row.sale},})
} }
}, },

View File

@ -1,13 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-button type="primary" icon="el-icon-plus" @click="handleorder" <el-button
>选择订单 v-if="checkPermission(['wp_to_order'])"
type="primary"
icon="el-icon-plus"
@click="handleorder"
>
选择订单
</el-button> </el-button>
<el-table <el-table
ref="multipleTable"
v-loading="listLoading" v-loading="listLoading"
:data="iproductData.results" :data="iproductData.results"
ref="multipleTable"
border border
fit fit
stripe stripe
@ -17,12 +22,9 @@
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="成品编号"> <el-table-column label="成品编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品批次" prop="batch">
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品名称" min-width="100" show-overflow-tooltip> <el-table-column label="成品名称" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
@ -30,13 +32,10 @@
<el-table-column label="所在仓库"> <el-table-column label="所在仓库">
<template slot-scope="scope">{{scope.row.warehouse_.name}}</template> <template slot-scope="scope">{{scope.row.warehouse_.name}}</template>
</el-table-column> </el-table-column>
<el-table-column label="订单"> <el-table-column label="订单">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span> <span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
<el-tag <el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
需要确定订单 需要确定订单
</el-tag> </el-tag>
<span v-else></span> <span v-else></span>
@ -45,9 +44,7 @@
<el-table-column label="合同"> <el-table-column label="合同">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span> <span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
<span <span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
</span> </span>
<span v-else></span> <span v-else></span>
</template> </template>
@ -55,9 +52,7 @@
<el-table-column label="客户"> <el-table-column label="客户">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span> <span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
<span <span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
</span> </span>
<span v-else></span> <span v-else></span>
</template> </template>
@ -69,13 +64,9 @@
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="销售状态"> <el-table-column label="销售状态">
<template slot-scope="scope">{{state_[scope.row.state]}}</template> <template slot-scope="scope">{{state_[scope.row.state]}}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作" width="220px"> <!-- <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
@ -150,7 +141,8 @@
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="toorders(scope)" @click="toorders(scope)"
>确认 >
确认
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -167,7 +159,7 @@
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import {getOrderList} from "@/api/sam"; import {getOrderList} from "@/api/sam";
import {mtest, toorder} from "@/api/wpm"; import {mtest, toorder} from "@/api/wpm";
import {genTree} from "@/utils"; // import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default { export default {
@ -225,10 +217,12 @@
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleMtest(scope) { handleMtest(scope) {
this.saleproduct = scope.row.id; this.saleproduct = scope.row.id;
this.dialogVisible = true; this.dialogVisible = true;
}, },
submtest() { submtest() {
mtest(this.saleproduct, this.mtestform).then((res) => { mtest(this.saleproduct, this.mtestform).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
@ -237,6 +231,7 @@
} }
}); });
}, },
//批量选择成品发给谋订单 //批量选择成品发给谋订单
handleorder() { handleorder() {
this.dialogFormVisibleorder = true; this.dialogFormVisibleorder = true;
@ -261,6 +256,7 @@
} }
); );
}, },
//提交批量产品选择的订单 //提交批量产品选择的订单
toorders(scope) { toorders(scope) {
toorder({ toorder({

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增仓库</el-button v-if="checkPermission(['warehouse_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增仓库
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="仓库名称/仓库编号" placeholder="仓库名称/仓库编号"
@ -17,17 +22,18 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
@ -37,24 +43,17 @@
fit fit
stripe stripe
highlight-current-row highlight-current-row
height="100" height="100"
v-el-height-adaptive-table="{bottomOffset: 42}" v-el-height-adaptive-table="{bottomOffset: 42}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="仓库名称"> <el-table-column label="仓库名称" prop="name">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="仓库编号" prop="number">
<el-table-column label="仓库编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="具体地点"> <el-table-column label="具体地点" prop="place">
<template slot-scope="scope">{{ scope.row.place }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time">
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
@ -62,20 +61,23 @@
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
type="primary" type="primary"
@click="handleMaterial(scope)" @click="handleMaterial(scope)"
>查看物料</el-link
> >
查看物料
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
type="primary" type="primary"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['warehouse_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -125,7 +127,7 @@ import {
} from "@/api/inm"; } from "@/api/inm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { genTree } from "@/utils"; // import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultewarehouse = {}; const defaultewarehouse = {};
export default { export default {
@ -183,14 +185,17 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
//跳转到该仓库的物料表 //跳转到该仓库的物料表
handleMaterial(scope) { handleMaterial(scope) {
this.$router.push({name: "inventory", params: {id: scope.row.id}}); this.$router.push({name: "inventory", params: {id: scope.row.id}});
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
@ -198,6 +203,7 @@ export default {
}; };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.warehouse = Object.assign({}, defaultewarehouse); this.warehouse = Object.assign({}, defaultewarehouse);
this.dialogType = "new"; this.dialogType = "new";
@ -215,6 +221,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -227,7 +234,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },

View File

@ -2,10 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增采购订单</el-button v-if="checkPermission(['puorder_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增采购订单
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="采购订单编号、供应商名称" placeholder="采购订单编号、供应商名称"
@ -18,15 +22,17 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
@ -42,13 +48,12 @@
v-el-height-adaptive-table="{ bottomOffset: 43 }" v-el-height-adaptive-table="{ bottomOffset: 43 }"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="采购订单编号"> <el-table-column label="采购订单编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="供应商"> <el-table-column label="供应商">
<template slot-scope="scope" v-if="scope.row.vendor_">{{ <template slot-scope="scope" v-if="scope.row.vendor_">
scope.row.vendor_.name {{scope.row.vendor_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="审核情况" width="150"> <el-table-column label="审核情况" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
@ -56,38 +61,38 @@
<el-tag v-else-if="scope.row.is_audited == true">已审核</el-tag> <el-tag v-else-if="scope.row.is_audited == true">已审核</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间"> <el-table-column label="创建时间" prop="create_time">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['vendor_update'])" v-if="checkPermission(['puorder_update'])"
type="primary" type="primary"
@click="handlePuOrderItem(scope)" @click="handlePuOrderItem(scope)"
>订单项</el-link
> >
订单项
</el-link>
<el-link <el-link
v-if=" v-if="checkPermission(['puorder_hear']) &&scope.row.is_audited == false"
checkPermission(['vendor_update']) &&
scope.row.is_audited == false
"
type="primary" type="primary"
@click="handleAudit(scope)" @click="handleAudit(scope)"
>审核</el-link
> >
审核
</el-link>
<el-link <el-link
v-if="checkPermission(['vendor_update'])" v-if="checkPermission(['puorder_update'])"
type="primary" type="primary"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['vendor_delete'])" v-if="checkPermission(['puorder_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -116,8 +121,8 @@
<el-form-item label="供应商" prop="vendor"> <el-form-item label="供应商" prop="vendor">
<el-select <el-select
style="width: 100%"
v-model="puorder.vendor" v-model="puorder.vendor"
style="width: 100%"
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option

View File

@ -2,7 +2,12 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"> <el-button
v-if="checkPermission(['vendor_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增供应商 新增供应商
</el-button> </el-button>
<el-input <el-input
@ -43,27 +48,19 @@
v-el-height-adaptive-table="{bottomOffset: 50}" v-el-height-adaptive-table="{bottomOffset: 50}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="供应商名"> <el-table-column label="供应商名" prop="name">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="联系人" prop="contact">
<el-table-column label="联系人">
<template slot-scope="scope">{{ scope.row.contact }}</template>
</el-table-column> </el-table-column>
<el-table-column label="联系电话"> <el-table-column label="联系电话" prop="contact_phone">
<template slot-scope="scope">{{ scope.row.contact_phone }}</template>
</el-table-column> </el-table-column>
<el-table-column label="地址" min-width="120" show-overflow-tooltip> <el-table-column label="地址" prop="address" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.address }}</template>
</el-table-column> </el-table-column>
<el-table-column label="供应物料"> <el-table-column label="供应物料" prop="material">
<template slot-scope="scope">{{ scope.row.material }}</template>
</el-table-column> </el-table-column>
<el-table-column label="备注"> <el-table-column label="备注" prop="description">
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="160"> <el-table-column label="创建时间" prop="create_time" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -124,9 +121,9 @@
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="description"> <el-form-item label="备注" prop="description">
<el-input <el-input
v-model="vendor.description"
type="textarea" type="textarea"
:rows="4" :rows="4"
v-model="vendor.description"
placeholder="备注" placeholder="备注"
/> />
</el-form-item> </el-form-item>
@ -140,10 +137,9 @@
</template> </template>
<script> <script>
import {getpVendorList, createVendor, updateVendor, deleteVendor} from "@/api/vendor"; import {getpVendorList, createVendor, updateVendor, deleteVendor} from "@/api/vendor";
import {getUserList} from "@/api/user"; // import {getUserList} from "@/api/user";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
// import {genTree} from "@/utils";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultvendor = { const defaultvendor = {
name: "", name: "",
@ -205,13 +201,15 @@
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.vendor = Object.assign({}, defaultvendor); this.vendor = Object.assign({}, defaultvendor);
this.dialogType = "new"; this.dialogType = "new";
@ -229,6 +227,7 @@
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -241,7 +240,7 @@
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },

View File

@ -2,6 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button
v-if="checkPermission(['workflow_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="名称" placeholder="名称"
@ -14,18 +22,17 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
</div> 重置
<div style="margin-top: 2px"> </el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
@ -39,19 +46,16 @@
v-el-height-adaptive-table="{bottomOffset: 50}" v-el-height-adaptive-table="{bottomOffset: 50}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="名称"> <el-table-column label="名称" prop="name">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="描述"> <el-table-column label="描述" prop="description">
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="工单查看权限校验"> <el-table-column label="工单查看权限校验">
<template slot-scope="scope"> <template slot-scope="scope">
{{ !!(scope.row.view_permission_check)?'':'' }} {{ !!(scope.row.view_permission_check)?'':'' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="180" label="创建时间"> <el-table-column width="180" prop="create_time" label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -62,24 +66,36 @@
<el-link <el-link
v-if="checkPermission(['workflow_update'])" v-if="checkPermission(['workflow_update'])"
@click="handlecfgt(scope)" @click="handlecfgt(scope)"
>配置</el-link> >
配置
</el-link>
<el-link <el-link
v-if="checkPermission(['workflow_update'])" v-if="checkPermission(['workflow_update'])"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['workflow_delete'])" v-if="checkPermission(['workflow_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link> >
删除
</el-link>
<el-link <el-link
v-if="checkPermission(['workflow_update'])"
type="primary" type="primary"
@click="handleTicket(scope)" @click="handleTicket(scope)"
>查看工单</el-link> >
查看工单
</el-link>
<el-link <el-link
v-if="checkPermission(['workflow_update'])"
type="primary" type="primary"
@click="handleWatch(scope)" @click="handleWatch(scope)"
>查看流程图</el-link> >
查看流程图
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -116,7 +132,8 @@
:model="workflow" :model="workflow"
label-width="100px" label-width="100px"
label-position="right" label-position="right"
:rules="rule1"> :rules="rule1"
>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="workflow.name" placeholder="名称"/> <el-input v-model="workflow.name" placeholder="名称"/>
</el-form-item> </el-form-item>
@ -125,9 +142,9 @@
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input <el-input
v-model="workflow.description"
type="textarea" type="textarea"
:rows="4" :rows="4"
v-model="workflow.description"
placeholder="描述" placeholder="描述"
/> />
</el-form-item> </el-form-item>
@ -162,12 +179,21 @@
</template> </template>
<script src="https://d3js.org/d3.v4.min.js"></script> <script src="https://d3js.org/d3.v4.min.js"></script>
<script> <script>
import { getWfTransitionList,getWorkflowList, createWorkflow,updateWorkflow,deleteWorkflow,getWfCustomfieldList,getWfStateList } from "@/api/workflow"; import {
getWfTransitionList,
getWorkflowList,
createWorkflow,
updateWorkflow,
deleteWorkflow,
getWfCustomfieldList,
getWfStateList
} from "@/api/workflow";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
// import vueJsonEditor from 'vue-json-editor' // import vueJsonEditor from 'vue-json-editor'
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import dagreD3 from 'dagre-d3' import dagreD3 from 'dagre-d3'
import * as d3 from 'd3' import * as d3 from 'd3'
const defaultworkflow = { const defaultworkflow = {
name: "", name: "",
number: "", number: "",
@ -227,10 +253,12 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
@ -238,6 +266,7 @@ export default {
} }
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.workflow = Object.assign({}, defaultworkflow); this.workflow = Object.assign({}, defaultworkflow);
this.dialogType = "new"; this.dialogType = "new";
@ -246,6 +275,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleEdit(scope) { handleEdit(scope) {
this.workflow = Object.assign({}, scope.row); // copy obj this.workflow = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit"; this.dialogType = "edit";
@ -257,13 +287,13 @@ export default {
if (response.data) { if (response.data) {
this.choiceOption = response.data; this.choiceOption = response.data;
} }
}); });
}, },
handlecfgt(scope)
{ handlecfgt(scope) {
this.$router.push({name: "configuration", params: {workflow: scope.row.id}}) this.$router.push({name: "configuration", params: {workflow: scope.row.id}})
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -279,13 +309,13 @@ export default {
console.error(err); console.error(err);
}); });
}, },
handleTicket(scope) { handleTicket(scope) {
this.$router.push({name: "workFlowTickets", params: {workflow: scope.row.id}}) this.$router.push({name: "workFlowTickets", params: {workflow: scope.row.id}})
}, },
async confirm(form) {
debugger;
console.log(this.workflow.display_form_str)
async confirm(form) {
// console.log(this.workflow.display_form_str)
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
const isEdit = this.dialogType === "edit"; const isEdit = this.dialogType === "edit";
@ -315,6 +345,7 @@ export default {
} }
}); });
}, },
handleWatch(scope) { handleWatch(scope) {
let that = this; let that = this;
let workFlow = scope.row.id; let workFlow = scope.row.id;
@ -359,7 +390,11 @@ export default {
transitionList.forEach((transition0) => { transitionList.forEach((transition0) => {
if (transition0.condition_expression.length > 0) { if (transition0.condition_expression.length > 0) {
debugger; debugger;
g.setNode(transition0.source_state_.id+100000, {label: "条件表达式",style: "stroke: #000;fill: #afa", shape: "diamond"}); g.setNode(transition0.source_state_.id + 100000, {
label: "条件表达式",
style: "stroke: #000;fill: #afa",
shape: "diamond"
});
g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, { g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, {
// 边标签 // 边标签
label: transition0.name, label: transition0.name,
@ -392,7 +427,8 @@ export default {
let svgGroup = svg.append('g'); let svgGroup = svg.append('g');
// 在绘图容器上运行渲染器生成流程图. // 在绘图容器上运行渲染器生成流程图.
render(d3.select("svg g"), g); render(d3.select("svg g"), g);
}else{} } else {
}
}); });
} }
@ -400,9 +436,11 @@ export default {
}) })
}, },
closeMark() { closeMark() {
this.limitedWatch = false; this.limitedWatch = false;
}, },
onJsonChange(value) { onJsonChange(value) {
// console.log('更改value:', value); // console.log('更改value:', value);
// 实时保存 // 实时保存
@ -427,6 +465,7 @@ export default {
onError1(value) { onError1(value) {
this.hasJsonFlag1 = false this.hasJsonFlag1 = false
}, },
// 检查json // 检查json
checkJson() { checkJson() {
if (this.hasJsonFlag == false) { if (this.hasJsonFlag == false) {
@ -437,6 +476,7 @@ export default {
return true return true
} }
}, },
// 检查json // 检查json
checkJson2() { checkJson2() {
if (this.hasJsonFlag1 == false) { if (this.hasJsonFlag1 == false) {
@ -454,16 +494,19 @@ export default {
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 15px; width: 15px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: #fefefe; background-color: #fefefe;
border-radius: 7px; border-radius: 7px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 7px; border-radius: 7px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.svgMark { .svgMark {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -477,6 +520,7 @@ export default {
z-index: 2000; z-index: 2000;
background: rgba(0, 0, 0, .3); background: rgba(0, 0, 0, .3);
} }
.svgWrapper { .svgWrapper {
background: #fff; background: #fff;
width: 800px; width: 800px;
@ -486,6 +530,7 @@ export default {
max-height: 80vh; max-height: 80vh;
overflow-y: scroll; overflow-y: scroll;
} }
.svgItem { .svgItem {
padding: 20px 40px 0; padding: 20px 40px 0;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
@ -493,22 +538,27 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
svg { svg {
font-size: 14px; font-size: 14px;
} }
.node rect { .node rect {
stroke: #606266; stroke: #606266;
fill: #fff; fill: #fff;
} }
.edgePath path { .edgePath path {
stroke: #606266; stroke: #606266;
fill: #333; fill: #333;
stroke-width: 1.5px; stroke-width: 1.5px;
} }
g.conditions > rect { g.conditions > rect {
fill: #00ffd0; fill: #00ffd0;
stroke: #000; stroke: #000;
} }
.el-icon-close { .el-icon-close {
cursor: pointer; cursor: pointer;
} }

View File

@ -2,7 +2,22 @@
<div class="app-container"> <div class="app-container">
<el-card style="margin-bottom: 10px"> <el-card style="margin-bottom: 10px">
<div> <div>
<el-select v-model="pageForm.workflow" placeholder="工作流" clearable style="width: 200px" class="filter-item" @change="handleFilter"> <el-button
v-if="checkPermission(['ticket_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增
</el-button>
<el-select
v-model="pageForm.workflow"
placeholder="工作流"
clearable
style="width: 200px"
class="filter-item"
@change="handleFilter"
>
<el-option <el-option
v-for="item in workflows" v-for="item in workflows"
:key="item.id" :key="item.id"
@ -15,39 +30,42 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button> >
重置
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button> >
</div> 搜索
<div style="margin-top: 2px"> </el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
</div> </div>
</el-card> </el-card>
<el-tabs v-model="pageForm.category" type="border-card" @tab-click="handleClick"> <el-card>
<el-tab-pane label="待处理" name="duty"> <el-tabs v-model="pageForm.category" type="card" @tab-click="handleClick">
<el-tab-pane label="待处理" name="duty"></el-tab-pane>
<el-tab-pane label="我处理" name="worked"></el-tab-pane>
<el-tab-pane label="我发起" name="owner"></el-tab-pane>
<el-tab-pane label="抄送我" name="cc"></el-tab-pane>
</el-tabs>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="tickets" :data="tickets"
border fit stripe border
fit
stripe
style="width: 100%" style="width: 100%"
height="100" height="100"
highlight-current-row highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 100}" v-el-height-adaptive-table="{bottomOffset: 80}"
> >
<el-table-column label="工单标题" min-width="100" prop="title"> <el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column> </el-table-column>
<el-table-column label="当前状态" min-width="100"> <el-table-column label="当前状态" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.act_state==0" label="草稿中" value="scope.row.act_state">草稿中</el-tag> <el-tag>{{states[scope.row.act_state]}}</el-tag>
<el-tag v-else-if="scope.row.act_state==1" label="进行中" value="scope.row.act_state">进行中</el-tag>
<el-tag v-else-if="scope.row.act_state==2" label="被退回" value="scope.row.act_state">被退回</el-tag>
<el-tag v-else-if="scope.row.act_state==3" label="被撤回" value="scope.row.act_state">被撤回</el-tag>
<el-tag v-else-if="scope.row.act_state==4" label="已完成" value="scope.row.act_state">已完成</el-tag>
<el-tag v-else-if="scope.row.act_state==5" label="已关闭" value="scope.row.act_state">已关闭</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="进行状态" min-width="100"> <el-table-column label="进行状态" min-width="100">
@ -57,21 +75,71 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template> <template slot-scope="scope">
{{scope.row.workflow_.name}}
</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time"> <el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.state_.distribute_type==1&&scope.row.participant_type==2" type="danger" @click="handleGetTicket(scope)">接单</el-link> <el-link
<el-link v-else-if="(scope.row.act_state==1||scope.row.act_state==3)&&scope.row.participant_type!==2&&scope.row.state_.type===0" type="primary" @click="handleDetail(scope)">处理</el-link> v-if="checkPermission(['ticket_handle'])&&scope.row.state_.distribute_type===1&&scope.row.participant_type===2"
<el-link v-if="scope.row.state_.type==1&&userId==1" type="danger" @click="handleClose(scope,'2')">关闭</el-link> type="danger"
@click="handleGetTicket(scope)"
>
接单
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])&&(scope.row.act_state===1||scope.row.act_state===3)&&scope.row.participant_type!==2&&scope.row.state_.type===0"
type="primary"
@click="handleDetail(scope)"
>
处理
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])&&scope.row.state_.type===1&&userId===1"
type="danger"
@click="handleClose(scope,'2')"
>
关闭
</el-link>
<!--如果state_.retreat为可退回则显示撤回按钮 state_.type==1处于草稿状态 --> <!--如果state_.retreat为可退回则显示撤回按钮 state_.type==1处于草稿状态 -->
<el-link v-if="scope.row.state_.enable_retreat&&userId==scope.row.create_by&&scope.row.state_.type!==1" type="danger" @click="handleClose(scope,'1')">撤回</el-link> <el-link
<el-link type="primary" @click="handleDetails(scope)">详情</el-link> v-if="checkPermission(['ticket_handle'])&&scope.row.state_.enable_retreat&&userId===scope.row.create_by&&scope.row.state_.type!==1"
<el-link type="success" @click="handleDelete(scope)">删除</el-link> type="danger"
<el-link type="success" @click="handlePicture(scope)">查看流程图</el-link> @click="handleClose(scope,'1')"
<el-link type="success" @click="handleLogs(scope)">工单日志</el-link> >
撤回
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])"
type="primary"
@click="handleDetails(scope)"
>
详情
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])"
type="success"
@click="handleDelete(scope)"
>
删除
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])"
type="success"
@click="handlePicture(scope)"
>
查看流程图
</el-link>
<el-link
v-if="checkPermission(['ticket_handle'])"
type="success"
@click="handleLogs(scope)"
>
工单日志
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -81,150 +149,7 @@
:limit.sync="pageForm.page_size" :limit.sync="pageForm.page_size"
@pagination="getList" @pagination="getList"
/> />
</el-tab-pane> </el-card>
<el-tab-pane label="我处理" name="worked">
<el-table :data="tickets"
border fit stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 60}">
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.act_state==0" label="草稿中" value="scope.row.act_state">草稿中</el-tag>
<el-tag v-else-if="scope.row.act_state==1" label="进行中" value="scope.row.act_state">进行中</el-tag>
<el-tag v-else-if="scope.row.act_state==2" label="被退回" value="scope.row.act_state">被退回</el-tag>
<el-tag v-else-if="scope.row.act_state==3" label="被撤回" value="scope.row.act_state">被撤回</el-tag>
<el-tag v-else-if="scope.row.act_state==4" label="已完成" value="scope.row.act_state">已完成</el-tag>
<el-tag v-else-if="scope.row.act_state==5" label="已关闭" value="scope.row.act_state">已关闭</el-tag>
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}</span>
<span v-else>{{scope.row.state_.name}}</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<!-- <el-link v-if="scope.row.state_.distribute_type==1&&scope.row.participant_type==2" type="danger" @click="handleGetTicket(scope)">接单</el-link>
<el-link v-else-if="(scope.row.act_state==1||scope.row.act_state==3)&&scope.row.participant_type!==2&&scope.row.state_.type===0" type="primary" @click="handleDetail(scope)">处理</el-link>
-->
<el-link v-if="scope.row.state_.type==1&&userId==1" type="danger" @click="handleClose(scope,'2')">关闭</el-link>
<el-link type="primary" @click="handleDetails(scope)">详情</el-link>
<el-link type="success" @click="handlePicture(scope)">查看流程图</el-link>
<el-link type="success" @click="handleLogs(scope)">工单日志</el-link>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="我发起" name="owner">
<el-table :data="tickets"
border fit stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 60}">
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.act_state==0" label="草稿中" value="scope.row.act_state">草稿中</el-tag>
<el-tag v-else-if="scope.row.act_state==1" label="进行中" value="scope.row.act_state">进行中</el-tag>
<el-tag v-else-if="scope.row.act_state==2" label="被退回" value="scope.row.act_state">被退回</el-tag>
<el-tag v-else-if="scope.row.act_state==3" label="被撤回" value="scope.row.act_state">被撤回</el-tag>
<el-tag v-else-if="scope.row.act_state==4" label="已完成" value="scope.row.act_state">已完成</el-tag>
<el-tag v-else-if="scope.row.act_state==5" label="已关闭" value="scope.row.act_state">已关闭</el-tag>
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}</span>
<span v-else>{{scope.row.state_.name}}</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope" v-if="scope.row.state_">
<el-link v-if="scope.row.state_.enable_retreat&&scope.row.state_.type!==1" type="danger" @click="handleClose(scope,'1')">撤回</el-link>
<el-link v-if="scope.row.state_.type==1" type="danger" @click="handleClose(scope,'2')">关闭</el-link>
<el-link type="primary" @click="handleDetails(scope)">详情</el-link>
<el-link type="success" @click="handleDelete(scope)">删除</el-link>
<el-link type="success" @click="handlePicture(scope)">查看流程图</el-link>
<el-link type="success" @click="handleLogs(scope)">工单日志</el-link>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="抄送我" name="cc">
<el-table :data="tickets"
border fit stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 60}">
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.act_state==0" label="草稿中" value="scope.row.act_state">草稿中</el-tag>
<el-tag v-else-if="scope.row.act_state==1" label="进行中" value="scope.row.act_state">进行中</el-tag>
<el-tag v-else-if="scope.row.act_state==2" label="被退回" value="scope.row.act_state">被退回</el-tag>
<el-tag v-else-if="scope.row.act_state==3" label="被撤回" value="scope.row.act_state">被撤回</el-tag>
<el-tag v-else-if="scope.row.act_state==4" label="已完成" value="scope.row.act_state">已完成</el-tag>
<el-tag v-else-if="scope.row.act_state==5" label="已关闭" value="scope.row.act_state">已关闭</el-tag>
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}</span>
<span v-else>{{scope.row.state_.name}}</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link type="primary" @click="handleDetails(scope)">详情</el-link>
<el-link type="danger" @click="handlePicture(scope)">查看流程图</el-link>
<el-link type="success" @click="handleLogs(scope)">工单日志</el-link>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
<div class="svgMark" v-if="dialogVisible" @click="closeMark"> <div class="svgMark" v-if="dialogVisible" @click="closeMark">
<div class="svgWrapper"> <div class="svgWrapper">
<div class="svgItem">工单流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div> <div class="svgItem">工单流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div>
@ -237,14 +162,17 @@
</el-col> </el-col>
</el-row> </el-row>
<el-steps :active="actives" spac="400px" align-center="" style="padding-top: 20px;"> <el-steps :active="actives" spac="400px" align-center="" style="padding-top: 20px;">
<el-step :title="item.name" v-for="item in flowSteps " :key="item.id"> <el-step
v-for="item in flowSteps "
:key="item.id"
:title="item.name"
>
</el-step> </el-step>
</el-steps> </el-steps>
<div style="width: 90%;margin: auto;"> <div style="width: 90%;margin: auto;">
<svg height=1000 id="mySvg" style="width:100%!important;"> <svg height=1000 id="mySvg" style="width:100%!important;">
</svg> </svg>
</div> </div>
</div> </div>
</div> </div>
<el-dialog :visible.sync="limitedRetreat" :title="handleTitle"> <el-dialog :visible.sync="limitedRetreat" :title="handleTitle">
@ -283,7 +211,8 @@
<el-input v-model="item.default_value" :placeholder="item.description"/> <el-input v-model="item.default_value" :placeholder="item.description"/>
</template> </template>
<template v-if="item.field_type==='int'"> <template v-if="item.field_type==='int'">
<el-input v-model="item.default_value" type="number" :placeholder="item.description" oninput="value=value.replace(/[^\d]/g,'')" /> <el-input v-model="item.default_value" type="number" :placeholder="item.description"
oninput="value=value.replace(/[^\d]/g,'')"/>
</template> </template>
<template v-if="item.field_type==='float'"> <template v-if="item.field_type==='float'">
<el-input v-model="item.default_value" type="number" :placeholder="item.description"/> <el-input v-model="item.default_value" type="number" :placeholder="item.description"/>
@ -356,26 +285,20 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="limitedFlowLogs" title="工单日志"> <el-dialog :visible.sync="limitedFlowLogs" title="工单日志">
<el-table :data="floeLogs" fit stripe <el-table
:data="floeLogs"
fit
stripe
style="width: 100%;border-top:1px solid #EBEEF5;" style="width: 100%;border-top:1px solid #EBEEF5;"
height="100" height="100"
highlight-current-row highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 60}"> v-el-height-adaptive-table="{bottomOffset: 60}"
>
<el-table-column label="工单标题" min-width="100"> <el-table-column label="工单标题" min-width="100">
<template slot-scope="scope" v-if="scope.row.ticket_data"> <template slot-scope="scope" v-if="scope.row.ticket_data">
<span>{{scope.row.ticket_data.title}}</span> <span>{{scope.row.ticket_data.title}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.act_state==0" label="草稿中" value="scope.row.act_state">草稿中</el-tag>
<el-tag v-else-if="scope.row.act_state==1" label="进行中" value="scope.row.act_state">进行中</el-tag>
<el-tag v-else-if="scope.row.act_state==2" label="被退回" value="scope.row.act_state">被退回</el-tag>
<el-tag v-else-if="scope.row.act_state==3" label="被撤回" value="scope.row.act_state">被撤回</el-tag>
<el-tag v-else-if="scope.row.act_state==4" label="已完成" value="scope.row.act_state">已完成</el-tag>
<el-tag v-else-if="scope.row.act_state==5" label="已关闭" value="scope.row.act_state">已关闭</el-tag>
</template>
</el-table-column>-->
<el-table-column label="进行状态" min-width="100"> <el-table-column label="进行状态" min-width="100">
<template slot-scope="scope" v-if="scope.row.state_"> <template slot-scope="scope" v-if="scope.row.state_">
<span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}</span> <span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}</span>
@ -396,11 +319,28 @@
<script src="https://d3js.org/d3.v4.min.js"></script> <script src="https://d3js.org/d3.v4.min.js"></script>
<script> <script>
import {upUrl, upHeaders} from "@/api/file"; import {upUrl, upHeaders} from "@/api/file";
import {getWorkflowList,getWfCustomfieldList,createTicket,getWfStateList,getTickets,ticketAccpet,getWfTransitionList, import checkPermission from "@/utils/permission";
ticketHandle,getWfFlowSteps,getTicketDetail,getTicketTransitions,getTicketFlowlog,ticketRetreat,ticketClose,ticketDestory} from "@/api/workflow"; import {
getWorkflowList,
getWfCustomfieldList,
createTicket,
getWfStateList,
getTickets,
ticketAccpet,
getWfTransitionList,
ticketHandle,
getWfFlowSteps,
getTicketDetail,
getTicketTransitions,
getTicketFlowlog,
ticketRetreat,
ticketClose,
ticketDestory
} from "@/api/workflow";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
import dagreD3 from 'dagre-d3' import dagreD3 from 'dagre-d3'
import * as d3 from 'd3' import * as d3 from 'd3'
export default { export default {
name: "ticket", name: "ticket",
components: {Pagination}, components: {Pagination},
@ -458,8 +398,15 @@
rule1: { rule1: {
title: [{required: true, message: "请输入", trigger: "blur"}], title: [{required: true, message: "请输入", trigger: "blur"}],
workflow: [{required: true, message: "选择", trigger: "blur"}] workflow: [{required: true, message: "选择", trigger: "blur"}]
} },
, states: {
0: "草稿中",
1: "进行中",
2: "被退回",
3: "被撤回",
4: "已完成",
5: "已关闭",
},
} }
}, },
mounted() { mounted() {
@ -474,6 +421,8 @@
this.getWorkFlow(); this.getWorkFlow();
}, },
methods: { methods: {
checkPermission,
getList() { getList() {
this.listLoading = true; this.listLoading = true;
getTickets(this.pageForm).then((res) => { getTickets(this.pageForm).then((res) => {
@ -660,7 +609,8 @@
this.limitedRetreat = true; this.limitedRetreat = true;
this.retreatId = scope.row.id; this.retreatId = scope.row.id;
}, },
handleLogs(){}, handleLogs() {
},
handlePicture(scope) { handlePicture(scope) {
let that = this; let that = this;
that.dialogVisible = true; that.dialogVisible = true;
@ -684,7 +634,8 @@
}) })
that.sort = dat[0].sort; that.sort = dat[0].sort;
that.actives = that.flowSteps.indexOf(dat[0]); that.actives = that.flowSteps.indexOf(dat[0]);
if( that.flowSteps.length-that.actives >1){}else{ if (that.flowSteps.length - that.actives > 1) {
} else {
that.actives = that.flowSteps.length; that.actives = that.flowSteps.length;
} }
var g = new dagreD3.graphlib.Graph().setGraph({ var g = new dagreD3.graphlib.Graph().setGraph({
@ -741,7 +692,11 @@
debugger; debugger;
console.log(transition0.condition_expression.length) console.log(transition0.condition_expression.length)
if (transition0.condition_expression.length > 0) { if (transition0.condition_expression.length > 0) {
g.setNode(transition0.source_state_.id+100000, {label: "条件表达式", style: "fill: #a4d088", shape: "diamond"}); g.setNode(transition0.source_state_.id + 100000, {
label: "条件表达式",
style: "fill: #a4d088",
shape: "diamond"
});
g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, { g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, {
// 边标签 // 边标签
label: transition0.name, label: transition0.name,
@ -821,7 +776,8 @@
} }
}) })
}else{} } else {
}
}); });
} }
}); });
@ -908,7 +864,8 @@
}) })
}) })
}, },
stepclick(){}, stepclick() {
},
closeMark() { closeMark() {
this.dialogVisible = false; this.dialogVisible = false;
} }
@ -920,16 +877,19 @@
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 15px; width: 15px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: #fefefe; background-color: #fefefe;
border-radius: 7px; border-radius: 7px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 7px; border-radius: 7px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.svgMark { .svgMark {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -943,6 +903,7 @@
z-index: 2000; z-index: 2000;
background: rgba(0, 0, 0, .3); background: rgba(0, 0, 0, .3);
} }
.svgWrapper { .svgWrapper {
background: #fff; background: #fff;
width: 800px; width: 800px;
@ -952,6 +913,7 @@
max-height: 80vh; max-height: 80vh;
overflow-y: scroll; overflow-y: scroll;
} }
.svgItem { .svgItem {
padding: 20px 40px 0; padding: 20px 40px 0;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
@ -959,25 +921,31 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
svg { svg {
font-size: 14px; font-size: 14px;
} }
.node rect { .node rect {
stroke: #606266; stroke: #606266;
fill: #fff; fill: #fff;
} }
.edgePath path { .edgePath path {
stroke: #606266; stroke: #606266;
fill: #333; fill: #333;
stroke-width: 1.5px; stroke-width: 1.5px;
} }
.el-icon-close { .el-icon-close {
cursor: pointer; cursor: pointer;
} }
.listItem { .listItem {
margin-top: 15px; margin-top: 15px;
font-size: 16px; font-size: 16px;
} }
.listItem > span { .listItem > span {
width: 100px; width: 100px;
text-align: right; text-align: right;
@ -986,7 +954,6 @@
} }
.tooltip { .tooltip {
position: absolute; position: absolute;
font-size: 12px; font-size: 12px;
@ -1004,10 +971,12 @@
.tooltip > div { .tooltip > div {
padding: 10px; padding: 10px;
} }
.node rect { .node rect {
stroke: #333; stroke: #333;
fill: #999; fill: #999;
} }
.node { .node {
cursor: pointer; cursor: pointer;
} }