Commit b6825556 authored by 仇晓婷's avatar 仇晓婷

文档审核

parent 0e993ca7
......@@ -30,4 +30,8 @@ export default {
listTable(params){
return Api.post(`${material}/custompropertydefinition/list`,params); //物料扩展属性
},
//文档自定义属性
listbyid(params){
return Api.get(`${material}/documentpropertydefinition/listbyid`,params);
},
}
\ No newline at end of file
<template>
<div class="body-document">
<h4>详细信息</h4>
<Row>
<Col span="21">
<div class="new-detail detail-d">
<Row>
<Filed :span="6" :name="l('creationTime') + ':'">{{
entity.creationTime
}}</Filed>
<Filed :span="6" :name="l('creatorUserId') + ':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="6" :name="l('status') + ':'">
<state code="word.document.status" :value="entity.status" />
</Filed>
<Filed
v-for="li in fileds"
:key="li.field"
:span="li.span"
:name="li.title + ':'"
>
<State
v-if="li.dataType == 3"
:code="li.note"
:value="entity[li.field]"
/>
<div v-else-if="li.dataType == 8">{{ entity[li.field] }}</div>
<div v-else-if="li.dataType == 5" v-html="entity[li.field]"></div>
<DTSpan v-else-if="li.dataType == 4" :value="entity[li.field]" />
<span v-else>{{ entity[li.field] }}</span>
<State
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:code="li.note"
:value="entity[li.field]"
/>
</Filed>
<Filed :span="24" :name="l('filePath') + ':'" class="filed-d">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
</Row>
</div>
</Col>
<Col span="3" class="dcm-right">
<div class="img-touxiang">
<img :src="downUrl + avatorPath" v-if="avatorPath" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
</div>
</template>
<script>
import Api from "../api";
export default {
name: "detail",
components: {},
props: {
idVal: {
type: String,
default: "",
},
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
data() {
return {
entity: {
state: "",
},
fileds: [],
};
},
created() {
this.dataImmut = [];
this.dataMut = [];
Api.get({ Id: this.idVal }).then((r) => {
console.log(r);
if (r.success) {
let farmData = {};
farmData = JSON.parse(r.result.formData);
console.log(farmData);
this.entity = farmData;
Api.listbyid({
categoryId: farmData.categoryId,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result);
this.fileds = result.filter(function (item) {
item.span = 6;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
});
} else {
this.$Message.error("加载失败");
}
});
},
methods: {
load(v) {},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {},
};
</script>
<style lang="less">
// .top-title {
// // margin: 10px;
// background: #fff;
// box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
// position: relative;
// border-radius: 5px;
// .row-left {
// width: 1000px;
// }
// ul {
// display: -webkit-inline-box;
// display: inline-box;
// position: absolute;
// bottom: 5px;
// right: 0px;
// li {
// width: 70px;
// span {
// color: #e0e0e0;
// }
// }
// }
// }
.body-document {
margin: 0 20px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
min-height: 300px;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
margin-top: 20px;
margin-right: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
// .detail-document {
// background-color: #f5f7f9 !important;
// }
</style>
\ No newline at end of file
<template>
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="文档审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此文档审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from "../api";
import Detail from "./detail";
import Process from "../process";
export default {
layout: "empty",
name: "Index",
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: "通过",
comment: "",
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: "", //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: "",
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: "请选择驳回节点",
type: "number",
trigger: "change"
}
],
comment: [
{
required: true,
message: "请输入原因",
trigger: "blur"
}
]
}
};
},
props: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.currentUserId = this.$store.state.userInfo.userId;
this.detailId = this.$http.common.getquerystring("id");
this.footerStatu = this.$http.common.getquerystring("statu");
this.getDetailInfos(this.detailId);
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {
}
});
} else {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {
}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error("加载失败");
}
});
},
//获取流程节点
getNodes(nodes) {
this.nodeList = [];
nodes.forEach(data => {
let nodeObj = {};
nodeObj.value = data.id;
nodeObj.label = data.name;
nodeObj.statu = 1;
this.nodeList.push(nodeObj);
});
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value;
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
item => item.value == this.currentNodeID
);
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value;
} else {
this.preNodeID = this.nodeList[0].value;
}
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
};
// alert(JSON.stringify(param))
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success("审批通过成功");
this.modalCheckNo = false;
} else {
this.$Message.error("审批通过失败");
this.modalCheckNo = true;
}
});
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
};
// alert(JSON.stringify(param))
Api.reject(param).then(r => {
if (r.success) {
this.$Message.success("驳回审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error("加载失败");
this.modalCheckNo = true;
}
});
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
};
//alert(JSON.stringify(param))
Api.terminate(param).then(r => {
if (r.success) {
this.$Message.success("终止审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error("加载失败");
this.modalCheckNo = true;
}
});
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == "驳回") {
this.checkNo();
} else if (this.formMyCheck.radioSp == "终止") {
this.checkCancel();
} else if (this.formMyCheck.radioSp == "通过") {
this.checkOk();
}
this.footerStatu = 3;
},
l(key) {
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
};
</script>
......@@ -6,7 +6,7 @@
<TabPane label="待我审批的" name="1"></TabPane>
<TabPane label="我已审批的" name="2"></TabPane>
<TabPane label="待办任务" name="3">
<Task v-if="tabIndex==4"></Task>
<Task v-if="tabIndex == 4"></Task>
</TabPane>
</Tabs>
<DataGrid
......@@ -19,11 +19,11 @@
:height="gridHeight"
>
<template slot="easySearch">
<Row style="line-height:32px;width:1000px;">
<Row style="line-height: 32px; width: 1000px">
<Col span="5">
<Select
v-model="easySearch.schemaId.value"
style="width:200px"
style="width: 200px"
clearable
placeholder="请选择审批类别"
transfer
......@@ -38,7 +38,11 @@
</Select>
</Col>
<Col span="10">
<DTSearch v-model="easySearch.range.value" @on-change="setTime" type="date"></DTSearch>
<DTSearch
v-model="easySearch.range.value"
@on-change="setTime"
type="date"
></DTSearch>
</Col>
<Col span="9">
<Input
......@@ -60,7 +64,13 @@
fullscreen
@on-cancel="cancelModal"
>
<iframe width="100%" id="mainFrame" :height="iframeHeight" frameborder="0" :src="srcUrl"></iframe>
<iframe
width="100%"
id="mainFrame"
:height="iframeHeight"
frameborder="0"
:src="srcUrl"
></iframe>
</Modal>
</div>
</template>
......@@ -70,7 +80,7 @@ import Task from "./task";
export default {
name: "handle",
components: {
Task
Task,
},
data() {
return {
......@@ -80,7 +90,7 @@ export default {
type: { op: "Equal", value: 1 }, // 1我发起的 2待我审批的 3 我已审批的
keys: { op: "code", value: "" },
schemaId: { op: "Equal", value: null }, //审批类别
range: { op: "Range", value: null }
range: { op: "Range", value: null },
},
schemaList: [],
results: [],
......@@ -92,17 +102,17 @@ export default {
key: "id",
width: 80,
title: this.l("id"),
hide: true
hide: true,
},
{
key: "code",
width: 240,
title: this.l("code")
title: this.l("code"),
},
{
title: this.l("schemaId"),
key: "schemaId",
hide: true
hide: true,
},
{
title: this.l("status"),
......@@ -110,26 +120,26 @@ export default {
align: "center",
width: 120,
high: true,
code: "Handle.todoList.status"
code: "Handle.todoList.status",
},
{
title: this.l("creatorUserId"),
key: "creatorUserId",
hide: true
hide: true,
},
{
title: this.l("creator"),
key: "creator",
align: "center"
align: "center",
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center"
align: "center",
},
{
title: this.l("schemaName"),
key: "schemaName"
key: "schemaName",
},
// {
// title: this.l('status'),
......@@ -139,25 +149,25 @@ export default {
{
title: this.l("startRecordId"),
key: "startRecordId",
hide: true
hide: true,
},
{
title: this.l("currentNodeId"),
key: "currentNodeId",
hide: true
hide: true,
},
{
title: this.l("currentNodeName"),
key: "currentNodeName"
key: "currentNodeName",
},
{
title: this.l("nextNodeId"),
key: "nextNodeId",
hide: true
hide: true,
},
{
title: this.l("nextNodeName"),
key: "nextNodeName"
key: "nextNodeName",
},
{
......@@ -170,7 +180,7 @@ export default {
{
attrs: {
oprate: "detail",
title: this.tabIndex == 2 ? "审核" : "查看"
title: this.tabIndex == 2 ? "审核" : "查看",
},
on: {
click: () => {
......@@ -180,14 +190,14 @@ export default {
params.row.code,
params.row.id
);
}
}
},
},
},
this.tabIndex == 2 ? "审核" : "查看"
)
),
]);
}
}
},
},
],
codeTypeName: "", //审核类型
gridHeight: "",
......@@ -196,7 +206,7 @@ export default {
srcUrl: "",
iframeHeight: "",
titleOrderExamine: "",
OrderExamine: ""
OrderExamine: "",
//订单审核结束
};
},
......@@ -237,7 +247,7 @@ export default {
},
//获取所以审核类型
getSchema() {
Api.getAll().then(r => {
Api.getAll().then((r) => {
if (r.success) {
this.schemaList = r.result;
} else {
......@@ -300,6 +310,9 @@ export default {
case "b6303ddc-8b5e-40a3-a51b-294657d1d913": //物料审批
types = 13;
break;
case "04d67b82-91aa-47a7-b9e3-28cdeec4537e": //文档审批
types = 14;
break;
default:
types = 1;
break;
......@@ -312,8 +325,8 @@ export default {
l(key) {
let vkey = "handleList" + "." + key;
return this.$t(vkey) || key;
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -200,7 +200,7 @@ export default {
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.entity[u.field] = "";
// this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment