Commit 4c9c39af authored by 周远喜's avatar 周远喜

Merge branch 'master' of http://git.mes123.com/zhouyx/mes-ui

parents 44632f2d b61860d7
...@@ -403,10 +403,31 @@ div::-webkit-scrollbar-corner { ...@@ -403,10 +403,31 @@ div::-webkit-scrollbar-corner {
.pt15 { .pt15 {
padding-top: 15px padding-top: 15px
} }
.pr10 {
padding-right: 10px;
}
.pr20 {
padding-right: 20px;
}
.pr30 { .pr30 {
padding-right: 30px; padding-right: 30px;
} }
.pr50 {
padding-right: 50px;
}
.pr80 {
padding-right: 80px;
}
.pr100 {
padding-right: 100px;
}
.pr200 {
padding-right: 200px;
}
.pr240 {
padding-right: 240px;
}
.bnone { .bnone {
border: none; border: none;
...@@ -996,10 +1017,9 @@ textarea::-webkit-input-placeholder { ...@@ -996,10 +1017,9 @@ textarea::-webkit-input-placeholder {
display:block; display:block;
line-height:30px; line-height:30px;
padding:5px 10px; padding:5px 10px;
background:#f5f6fa; border-bottom: #ccc solid 1px;
border-bottom:solid 1px #ccc; border-right: #ccc solid 1px;
border-left:solid 1px #ccc; border-left: #ccc solid 1px;
border-right:solid 1px #ccc
} }
.cellInfoTitle { .cellInfoTitle {
padding: 0 10px; padding: 0 10px;
......
<template> <template>
<div class="flex fd tree-menu"> <div class="flex fd tree-menu">
<h3> <h3>
产品结构 产品结构
<div class="fr mr10 mt10"> <div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small"> <ButtonGroup class="fr" size="small">
<Button <Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" <Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
@click="toggle" <Button icon="md-rewind" title="收起" @click="hide"></Button>
title="展开/合并" </ButtonGroup>
></Button> </div>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3> </h3>
<div class="search"> <div class="search">
<Input search placeholder="请输入关键字" v-model="keys" clearable /> <Input search placeholder="请输入关键字" v-model="keys" clearable />
</div> </div>
<div class="fg"> <div class="fg">
<div class="tree"> <div class="tree">
<Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree> <Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "", name: "",
data() { data() {
return { return {
keys: "", keys: "",
expand: false, expand: false,
list: [] list: []
}; };
},
created() {
this.loadTree();
},
methods: {
loadTree() {
this.$api
.get(`${technologyUrl}productlevel/getproducttreenew`)
.then(r => {
setTree(r.result);
function setTree(data) {
data.map(u => {
u.title = u.name;
u.value = u.id;
// u.expand = true;
// u.selected = false;
// u.checked = false;
if (u.children) {
setTree(u.children);
}
});
}
var data = r.result;
this.list = this.$u.clone(data);
});
}, },
toggle() { created() {
this.expand = !this.expand; this.loadTree();
}, },
renderContent(h, { root, node, data }) { methods: {
let type = "md-folder"; loadTree() {
if (data.isProduct != 0) { this.$api
type = "ios-image"; .get(`${technologyUrl}productlevel/getproducttreenew`)
} .then(r => {
return h("span", [ setTree(r.result);
h("Icon", {
props: { function setTree(data) {
type: type data.map(u => {
}, u.title = u.name;
style: { u.value = u.id;
marginRight: "8px" u.expand = true;
} // u.selected = false;
}), // u.checked = false;
h( if (u.children) {
"span", setTree(u.children);
{ }
style: { });
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)" }
var data = r.result;
this.list = this.$u.clone(data);
});
},
toggle() {
this.expand = !this.expand;
},
renderContent(h, {
root,
node,
data
}) {
let type = "md-folder";
if (data.isProduct != 0) {
type = "ios-image";
} }
}, return h("span", [
data.title h("Icon", {
) props: {
]); type: type
}, },
change(v, b) { style: {
// console.log(b); marginRight: "8px"
let ids = []; }
let productIds = []; }),
if (b.bomId !== 0) { h(
ids.push(b.bomId); "span", {
} style: {
productIds.push(b.value); color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
if (b.children) { }
addId(b.children); },
function addId(data) { data.title
data.map(u => { )
if (u.bomId !== 0) { ]);
ids.push(u.bomId); },
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
if (b.bomId !== 0) {
ids.push(b.bomId);
} }
productIds.push(u.value); productIds.push(b.value);
if (u.children) { if (b.children) {
addId(u.children); addId(b.children);
function addId(data) {
data.map(u => {
if (u.bomId !== 0) {
ids.push(u.bomId);
}
productIds.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
} }
}); this.$emit("on-select", b.bomId, b, productIds, ids);
},
hide() {
this.$emit("on-hide");
} }
}
this.$emit("on-select", b.bomId, b, productIds, ids);
}, },
hide() { computed: {
this.$emit("on-hide"); data() {
} let items = this.$u.clone(this.list);
}, let expand = this.expand;
computed: { let result = [];
data() { search(this.keys, items);
let items = this.$u.clone(this.list);
let expand = this.expand; function search(keys, data) {
let result = []; data.map(u => {
search(this.keys, items); if (keys.length < 2) {
function search(keys, data) { u.expand = expand;
data.map(u => { result.push(u);
if (keys.length < 2) { } else {
u.expand = expand; u.expand = expand;
result.push(u); if (u.title.indexOf(keys) > -1) {
} else { result.push(u);
u.expand = expand; } else if (u.children) {
if (u.title.indexOf(keys) > -1) { search(keys, u.children);
result.push(u); }
} else if (u.children) { }
search(keys, u.children); });
} }
} return result;
}); }
}
return result;
} }
}
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less"; @import "../../assets/css/custom.less";
.tree-menu { .tree-menu {
h3 { h3 {
height: 50px; height: 50px;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: bold; font-weight: bold;
line-height: 50px; line-height: 50px;
color: @left-tree-header-color; color: @left-tree-header-color;
background: @left-tree-header-bg-color; background: @left-tree-header-bg-color;
opacity: 1; opacity: 1;
padding-left: 10px; padding-left: 10px;
} }
.search {
height: 50px; .search {
padding: 5px 10px; height: 50px;
} padding: 5px 10px;
.fg { }
flex: none;
// height:0; .fg {
overflow: auto; flex: none;
padding-left: 10px; // height:0;
} overflow: auto;
.tree { padding-left: 10px;
height: calc(100vh - 215px); }
overflow: auto;
} .tree {
height: calc(100vh - 215px);
overflow: auto;
}
} }
</style> </style>
\ No newline at end of file
...@@ -266,6 +266,7 @@ export default { ...@@ -266,6 +266,7 @@ export default {
if (r.success) { if (r.success) {
this.$Message.success('审批通过成功') this.$Message.success('审批通过成功')
this.footerStatu = 3 this.footerStatu = 3
this.$refs.userProcess.load(this.detailId)
} else { } else {
this.$Message.error('审批通过失败') this.$Message.error('审批通过失败')
} }
...@@ -282,6 +283,7 @@ export default { ...@@ -282,6 +283,7 @@ export default {
Api.reject(param).then((r) => { Api.reject(param).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('驳回审批成功') this.$Message.success('驳回审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3 this.footerStatu = 3
} else { } else {
this.$Message.error('加载失败') this.$Message.error('加载失败')
...@@ -298,6 +300,7 @@ export default { ...@@ -298,6 +300,7 @@ export default {
Api.terminate(param).then((r) => { Api.terminate(param).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('终止审批成功') this.$Message.success('终止审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3 this.footerStatu = 3
} else { } else {
this.$Message.error('加载失败') this.$Message.error('加载失败')
......
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="修复文件审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="修复文件审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此修复文件审批? <span class="new-red">{{ statuTitle }}</span> 此修复文件审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process 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.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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') 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'
}]
}
} }
})
},
//获取流程节点
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
}
}, },
//审批通过 props: {},
checkOk() { async fetch({
// alert(this.passId) store,
let param = { params
id: this.passId, }) {
comment: '', await store.dispatch('loadDictionary') // 加载数据字典
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
}
})
}, },
//审批驳回 created() {
checkNo() { this.currentUserId = this.$store.state.userInfo.userId
// alert(this.passId) this.detailId = this.$http.common.getquerystring('id')
let param = { this.footerStatu = this.$http.common.getquerystring('statu')
id: this.passId, this.getDetailInfos(this.detailId)
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
}
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == '通过') {
let param = { this.modalCheckNo = true
id: this.passId, } else if (this.formMyCheck.radioSp == '驳回') {
comment: this.formMyCheck.comment this.$refs['formValidate'].validate((valid) => {
} if (valid) {
//alert(JSON.stringify(param)) this.modalCheckNo = true
Api.terminate(param).then((r) => { this.statuTitle = '驳回'
if (r.success) { } else {}
this.$Message.success('终止审批成功') })
this.modalCheckNo = false } else {
} else { this.$refs['formValidate'].validate((valid) => {
this.$Message.error('加载失败') if (valid) {
this.modalCheckNo = true 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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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)
} }
})
},
//终止或驳回
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) { watch: {}
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="支撑文件审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="支撑文件审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此支撑文件审批? <span class="new-red">{{ statuTitle }}</span> 此支撑文件审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process 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.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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') 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'
}]
}
} }
})
},
//获取流程节点
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
}
}, },
//审批通过 props: {},
checkOk() { async fetch({
// alert(this.passId) store,
let param = { params
id: this.passId, }) {
comment: '', await store.dispatch('loadDictionary') // 加载数据字典
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
}
})
}, },
//审批驳回 created() {
checkNo() { this.currentUserId = this.$store.state.userInfo.userId
// alert(this.passId) this.detailId = this.$http.common.getquerystring('id')
let param = { this.footerStatu = this.$http.common.getquerystring('statu')
id: this.passId, this.getDetailInfos(this.detailId)
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
}
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == '通过') {
let param = { this.modalCheckNo = true
id: this.passId, } else if (this.formMyCheck.radioSp == '驳回') {
comment: this.formMyCheck.comment this.$refs['formValidate'].validate((valid) => {
} if (valid) {
//alert(JSON.stringify(param)) this.modalCheckNo = true
Api.terminate(param).then((r) => { this.statuTitle = '驳回'
if (r.success) { } else {}
this.$Message.success('终止审批成功') })
this.modalCheckNo = false } else {
} else { this.$refs['formValidate'].validate((valid) => {
this.$Message.error('加载失败') if (valid) {
this.modalCheckNo = true 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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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)
} }
})
},
//终止或驳回
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) { watch: {}
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="切片文件审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="切片文件审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此切片文件审批? <span class="new-red">{{ statuTitle }}</span> 此切片文件审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process 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.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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') 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'
}]
}
} }
})
},
//获取流程节点
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
}
}, },
//审批通过 props: {},
checkOk() { async fetch({
// alert(this.passId) store,
let param = { params
id: this.passId, }) {
comment: '', await store.dispatch('loadDictionary') // 加载数据字典
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
}
})
}, },
//审批驳回 created() {
checkNo() { this.currentUserId = this.$store.state.userInfo.userId
// alert(this.passId) this.detailId = this.$http.common.getquerystring('id')
let param = { this.footerStatu = this.$http.common.getquerystring('statu')
id: this.passId, this.getDetailInfos(this.detailId)
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
}
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == '通过') {
let param = { this.modalCheckNo = true
id: this.passId, } else if (this.formMyCheck.radioSp == '驳回') {
comment: this.formMyCheck.comment this.$refs['formValidate'].validate((valid) => {
} if (valid) {
//alert(JSON.stringify(param)) this.modalCheckNo = true
Api.terminate(param).then((r) => { this.statuTitle = '驳回'
if (r.success) { } else {}
this.$Message.success('终止审批成功') })
this.modalCheckNo = false } else {
} else { this.$refs['formValidate'].validate((valid) => {
this.$Message.error('加载失败') if (valid) {
this.modalCheckNo = true 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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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.$refs.userProcess.load(this.detailId)
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)
} }
})
},
//终止或驳回
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) { watch: {}
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="物料审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="物料审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此物料审批? <span class="new-red">{{ statuTitle }}</span> 此物料审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "../api"; import Api from "../api";
import Detail from "./detail"; import Detail from "./detail";
import Process from "../process"; import Process from "../process";
export default { export default {
layout: "empty", layout: "empty",
name: "Index", name: "Index",
components: { components: {
Detail, Detail,
Process 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("加载失败");
}
});
}, },
//获取流程节点 data() {
getNodes(nodes) { return {
this.nodeList = []; currentUserId: 0,
nodes.forEach(data => { formMyCheck: {
let nodeObj = {}; radioSp: "通过",
nodeObj.value = data.id; comment: "",
nodeObj.label = data.name; workHours: 0, //工时
nodeObj.statu = 1; printPeriod: 0, //打印周期
this.nodeList.push(nodeObj); equipment: "", //设备
}); materialWeight: 0, //材料重量
//第一节点node的ID rejectToNodeId: null
this.firstNodeID = this.nodeList[0].value; },
//根据当前nodeid找到上一节点的nodeId modalCheckOk: false,
var index = this.nodeList.findIndex( modalCheckNo: false,
item => item.value == this.currentNodeID detailId: null,
); statuTitle: "",
if (index > 0) { footerStatu: null, //是否显示footer
this.preNodeID = this.nodeList[index - 1].value; getDetailResults: [], //getdetail返回数据
} else { getDetailResultOrder: [], //getdetail返回订单detail数据
this.preNodeID = this.nodeList[0].value; 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"
}]
}
};
}, },
changeToNode(val) { props: {},
if (val == "1") { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID; store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID; }) {
} await store.dispatch("loadDictionary"); // 加载数据字典
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId;
// alert(this.passId) this.detailId = this.$http.common.getquerystring("id");
let param = { this.footerStatu = this.$http.common.getquerystring("statu");
id: this.passId, this.getDetailInfos(this.detailId);
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;
}
});
}, },
//审批驳回 methods: {
checkNo() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == "通过") {
let param = { this.statuTitle = "通过";
id: this.passId, this.modalCheckNo = true;
comment: this.formMyCheck.comment, } else if (this.formMyCheck.radioSp == "驳回") {
rejectToNodeId: this.formMyCheck.rejectToNodeId this.$refs["formValidate"].validate(valid => {
}; if (valid) {
// alert(JSON.stringify(param)) this.modalCheckNo = true;
Api.reject(param).then(r => { this.statuTitle = "驳回";
if (r.success) { } else {}
this.$Message.success("驳回审批成功"); });
this.modalCheckNo = false; } else {
} else { this.$refs["formValidate"].validate(valid => {
this.$Message.error("加载失败"); if (valid) {
this.modalCheckNo = true; 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.$refs.userProcess.load(this.detailId);
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.$refs.userProcess.load(this.detailId);
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.$refs.userProcess.load(this.detailId);
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);
} }
});
},
//审批终止
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) { watch: {}
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
}; };
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="文档审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="文档审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此文档审批? <span class="new-red">{{ statuTitle }}</span> 此文档审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "../api"; import Api from "../api";
import Detail from "./detail"; import Detail from "./detail";
import Process from "../process"; import Process from "../process";
export default { export default {
layout: "empty", layout: "empty",
name: "Index", name: "Index",
components: { components: {
Detail, Detail,
Process 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("加载失败");
}
});
}, },
//获取流程节点 data() {
getNodes(nodes) { return {
this.nodeList = []; currentUserId: 0,
nodes.forEach(data => { formMyCheck: {
let nodeObj = {}; radioSp: "通过",
nodeObj.value = data.id; comment: "",
nodeObj.label = data.name; workHours: 0, //工时
nodeObj.statu = 1; printPeriod: 0, //打印周期
this.nodeList.push(nodeObj); equipment: "", //设备
}); materialWeight: 0, //材料重量
//第一节点node的ID rejectToNodeId: null
this.firstNodeID = this.nodeList[0].value; },
//根据当前nodeid找到上一节点的nodeId modalCheckOk: false,
var index = this.nodeList.findIndex( modalCheckNo: false,
item => item.value == this.currentNodeID detailId: null,
); statuTitle: "",
if (index > 0) { footerStatu: null, //是否显示footer
this.preNodeID = this.nodeList[index - 1].value; getDetailResults: [], //getdetail返回数据
} else { getDetailResultOrder: [], //getdetail返回订单detail数据
this.preNodeID = this.nodeList[0].value; 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"
}]
}
};
}, },
changeToNode(val) { props: {},
if (val == "1") { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID; store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID; }) {
} await store.dispatch("loadDictionary"); // 加载数据字典
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId;
// alert(this.passId) this.detailId = this.$http.common.getquerystring("id");
let param = { this.footerStatu = this.$http.common.getquerystring("statu");
id: this.passId, this.getDetailInfos(this.detailId);
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;
}
});
}, },
//审批驳回 methods: {
checkNo() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == "通过") {
let param = { this.statuTitle = "通过";
id: this.passId, this.modalCheckNo = true;
comment: this.formMyCheck.comment, } else if (this.formMyCheck.radioSp == "驳回") {
rejectToNodeId: this.formMyCheck.rejectToNodeId this.$refs["formValidate"].validate(valid => {
}; if (valid) {
// alert(JSON.stringify(param)) this.modalCheckNo = true;
Api.reject(param).then(r => { this.statuTitle = "驳回";
if (r.success) { } else {}
this.$Message.success("驳回审批成功"); });
this.modalCheckNo = false; } else {
} else { this.$refs["formValidate"].validate(valid => {
this.$Message.error("加载失败"); if (valid) {
this.modalCheckNo = true; 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.$refs.userProcess.load(this.detailId);
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.$refs.userProcess.load(this.detailId);
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.$refs.userProcess.load(this.detailId);
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);
} }
});
},
//审批终止
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) { watch: {}
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
}; };
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" /> <Process ref="userProcess" :idVal="detailId" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
:model="formMyCheck" <Row>
:label-width="100" <Col span="18">
:rules="ruleValidate" <FormItem label="审批意见:">
inline <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
ref="formValidate" <Radio label="通过"></Radio>
> <Radio label="驳回"></Radio>
<Row> <Radio label="终止"></Radio>
<Col span="18"> </RadioGroup>
<FormItem label="审批意见:"> </FormItem>
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Radio label="通过"></Radio> <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Radio label="驳回"></Radio> <Option value class="option-text">请选择驳回节点</Option>
<Radio label="终止"></Radio> <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</RadioGroup> </Select>
</FormItem> <RadioGroup type="button" size="small" @on-change="changeToNode">
<FormItem <Radio label="1">上一节点</Radio>
label="驳回节点:" <Radio label="2">第一节点</Radio>
v-if="formMyCheck.radioSp === '驳回'" </RadioGroup>
prop="rejectToNodeId" </FormItem>
> <FormItem label="原因:" v-if="
<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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal <Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
v-model="modalCheckNo" <br />
title="订单审批" <h4>
width="800" 您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
:scrollable="true" </h4>
> <br />
<br /> <div slot="footer">
<h4> <Button @click="modalCheckNo = false">取消</Button>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批? <Button type="primary" @click="checkFalse">确定</Button>
</h4> </div>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
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
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.modalCheckNo = true
this.statuTitle = '通过'
} 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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
if (r.success) { workHours: 0, //工时
this.currentNodeID = r.result.currentNodeId printPeriod: 0, //打印周期
this.passId=r.result.currentRecordId equipment: '', //设备
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 materialWeight: 0, //材料重量
this.getNodes(r.result.nodes) rejectToNodeId: null
} else { },
this.$Message.error('加载失败') 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
ruleValidate: {
rejectToNodeId: [{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}],
comment: [{
required: true,
message: '请输入原因',
trigger: 'blur'
}]
}
} }
})
},
//获取流程节点
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) { props: {},
if (val == '1') { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID }) {
} await store.dispatch('loadDictionary') // 加载数据字典
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId
let param = { this.detailId = this.$http.common.getquerystring('id')
id: this.passId, this.footerStatu = this.$http.common.getquerystring('statu')
comment: this.formMyCheck.comment, this.getDetailInfos(this.detailId)
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
this.footerStatu=3
}, },
//审批驳回 methods: {
checkNo() { nextCheckOk() {
let param = { if (this.formMyCheck.radioSp == '通过') {
id: this.passId, this.modalCheckNo = true
comment: this.formMyCheck.comment, this.statuTitle = '通过'
rejectToNodeId: this.formMyCheck.rejectToNodeId } else if (this.formMyCheck.radioSp == '驳回') {
} this.$refs['formValidate'].validate((valid) => {
// alert(JSON.stringify(param)) if (valid) {
Api.reject(param).then((r) => { this.modalCheckNo = true
if (r.success) { this.statuTitle = '驳回'
this.$Message.success('驳回审批成功') } else {}
this.footerStatu=3 })
} else { } else {
this.$Message.error('加载失败') this.$refs['formValidate'].validate((valid) => {
} if (valid) {
this.modalCheckNo = true
}) this.statuTitle = '终止'
this.modalCheckNo = false } else {}
}, })
//审批终止 }
checkCancel() { },
let param = { getDetailInfos(idVal) {
id: this.passId, this.getDetailRecords = []
comment: this.formMyCheck.comment let param = {
} Id: idVal
//alert(JSON.stringify(param)) }
Api.terminate(param).then((r) => { Api.getdetail(param).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('终止审批成功') this.currentNodeID = r.result.currentNodeId
this.footerStatu=3 this.passId = r.result.currentRecordId
} else { this.nextNodeUserIdList = this.$refs.userProcess.immutData //获取下一节点的审核人
this.$Message.error('加载失败') 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() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
this.footerStatu = 3
},
//审批驳回
checkNo() {
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
})
this.modalCheckNo = false
},
//审批终止
checkCancel() {
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
})
this.modalCheckNo = false
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
})
this.modalCheckNo = false
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
}, },
l(key) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" /> <Process ref="userProcess" :idVal="detailId" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
:model="formMyCheck" <Row>
:label-width="100" <Col span="18">
:rules="ruleValidate" <FormItem label="审批意见:">
inline <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
ref="formValidate" <Radio label="通过"></Radio>
> <Radio label="驳回"></Radio>
<Row> <Radio label="终止"></Radio>
<Col span="18"> </RadioGroup>
<FormItem label="审批意见:"> </FormItem>
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Radio label="通过"></Radio> <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Radio label="驳回"></Radio> <Option value class="option-text">请选择驳回节点</Option>
<Radio label="终止"></Radio> <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</RadioGroup> </Select>
</FormItem> <RadioGroup type="button" size="small" @on-change="changeToNode">
<FormItem <Radio label="1">上一节点</Radio>
label="驳回节点:" <Radio label="2">第一节点</Radio>
v-if="formMyCheck.radioSp === '驳回'" </RadioGroup>
prop="rejectToNodeId" </FormItem>
> <FormItem label="原因:" v-if="
<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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal <Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
v-model="modalCheckNo" <br />
title="订单审批" <h4>
width="800" 您确定 <span class="new-red">{{ statuTitle }}</span> 此工艺规程审批?
:scrollable="true" </h4>
> <br />
<br /> <div slot="footer">
<h4> <Button @click="modalCheckNo = false">取消</Button>
您确定 <span class="new-red">{{ statuTitle }}</span> 此工艺规程审批? <Button type="primary" @click="checkFalse">确定</Button>
</h4> </div>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
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
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.modalCheckNo = true
this.statuTitle = '通过'
} 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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
if (r.success) { workHours: 0, //工时
this.currentNodeID = r.result.currentNodeId printPeriod: 0, //打印周期
this.passId=r.result.currentRecordId equipment: '', //设备
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 materialWeight: 0, //材料重量
this.getNodes(r.result.nodes) rejectToNodeId: null
} else { },
this.$Message.error('加载失败') 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
ruleValidate: {
rejectToNodeId: [{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}],
comment: [{
required: true,
message: '请输入原因',
trigger: 'blur'
}]
}
} }
})
},
//获取流程节点
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) { props: {},
if (val == '1') { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID }) {
} await store.dispatch('loadDictionary') // 加载数据字典
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId
let param = { this.detailId = this.$http.common.getquerystring('id')
id: this.passId, this.footerStatu = this.$http.common.getquerystring('statu')
comment: this.formMyCheck.comment, this.getDetailInfos(this.detailId)
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
}, },
//审批驳回 methods: {
checkNo() { nextCheckOk() {
let param = { if (this.formMyCheck.radioSp == '通过') {
id: this.passId, this.modalCheckNo = true
comment: this.formMyCheck.comment, this.statuTitle = '通过'
rejectToNodeId: this.formMyCheck.rejectToNodeId } else if (this.formMyCheck.radioSp == '驳回') {
} this.$refs['formValidate'].validate((valid) => {
// alert(JSON.stringify(param)) if (valid) {
Api.reject(param).then((r) => { this.modalCheckNo = true
if (r.success) { this.statuTitle = '驳回'
this.$Message.success('驳回审批成功') } else {}
this.footerStatu = 3 })
} else { } else {
this.$Message.error('加载失败') this.$refs['formValidate'].validate((valid) => {
} if (valid) {
this.modalCheckNo = false this.modalCheckNo = true
}) this.statuTitle = '终止'
}, } else {}
//审批终止 })
checkCancel() { }
let param = { },
id: this.passId, getDetailInfos(idVal) {
comment: this.formMyCheck.comment this.getDetailRecords = []
} let param = {
//alert(JSON.stringify(param)) Id: idVal
Api.terminate(param).then((r) => { }
if (r.success) { Api.getdetail(param).then((r) => {
this.$Message.success('终止审批成功') if (r.success) {
this.footerStatu = 3 this.currentNodeID = r.result.currentNodeId
} else { this.passId = r.result.currentRecordId
this.$Message.error('加载失败') 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() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
checkNo() {
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
}, },
l(key) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj"/> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'"> <div class="footers" v-if="footerStatu === '2'">
<Form :model="formMyCheck" :label-width="100"> <Form :model="formMyCheck" :label-width="100">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;"> <FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> --> <!-- <Radio label="终止"></Radio> -->
</RadioGroup> </RadioGroup>
<Select <Select v-if="formMyCheck.radioSp === '驳回'" style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
v-if="formMyCheck.radioSp === '驳回'" <Option value class="option-text">请选择驳回节点</Option>
style="width:200px" <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
clearable </Select>
transfer <RadioGroup v-if="formMyCheck.radioSp === '驳回'" type="button" size="small" @on-change="changeToNode">
placeholder="请选择驳回节点" <Radio label="1">上一节点</Radio>
v-model="formMyCheck.rejectToNodeId" <Radio label="2">第一节点</Radio>
> </RadioGroup>
<Option value class="option-text">请选择驳回节点</Option> <Input v-if="formMyCheck.radioSp === '驳回'" v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请填写原因" />
<Option </FormItem>
v-for="(item, index) in nodeList" </Col>
:value="item.value" <Col span="6" style="text-align:right;padding-right:40px">
:label="item.label" <Button type="primary" @click="nextCheckOk">确定</Button>
:key="index" </Col>
:disabled="item.statu > 0 ? false : true" </Row>
></Option> </Form>
</Select>
<RadioGroup
v-if="formMyCheck.radioSp === '驳回'"
type="button"
size="small"
@on-change="changeToNode"
>
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
<Input
v-if="formMyCheck.radioSp === '驳回'"
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> </div>
<Modal <Modal v-model="modalCheckNo" title="材料消耗单审批" width="800" :scrollable="true">
v-model="modalCheckNo" <br />
title="材料消耗单审批" <h4>
width="800" 您确定 <span class="new-red">{{ statuTitle }}</span> 此材料消耗单审批?
:scrollable="true" </h4>
> <br />
<br /> <div slot="footer">
<h4> <Button @click="modalCheckNo = false">取消</Button>
您确定 <span class="new-red">{{ statuTitle }}</span> 此材料消耗单审批? <Button type="primary" @click="checkFalse">确定</Button>
</h4> </div>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
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:{}
}
},
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() {
let rejectToNode = this.formMyCheck.rejectToNodeId
let commasge = this.formMyCheck.comment
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
if(rejectToNode == null){
this.$Message.error('请选择驳回节点')
return
}
if(commasge == ''){
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
}
// else {
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
// }
}, },
getDetailInfos(idVal) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj=r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckNo: false,
this.$Message.error('加载失败') 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: {}
} }
})
},
//获取流程节点
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) { props: {},
if (val == '1') { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID }) {
} await store.dispatch('loadDictionary') // 加载数据字典
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId
let param = { this.detailId = this.$http.common.getquerystring('id')
id: this.passId, this.footerStatu = this.$http.common.getquerystring('statu')
comment: '', this.getDetailInfos(this.detailId)
nextOperationIdList: [],
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
let param = { let rejectToNode = this.formMyCheck.rejectToNodeId
id: this.passId, let commasge = this.formMyCheck.comment
comment: this.formMyCheck.comment if (this.formMyCheck.radioSp == '通过') {
} this.checkOk()
Api.terminate(param).then((r) => { } else if (this.formMyCheck.radioSp == '驳回') {
if (r.success) { if (rejectToNode == null) {
this.$Message.success('终止审批成功') this.$Message.error('请选择驳回节点')
this.footerStatu = 3 return
} else { }
this.$Message.error('加载失败') if (commasge == '') {
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
}
// else {
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
// }
},
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() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: [],
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
// if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
// }
// else if (this.formMyCheck.radioSp == '终止') {
// this.checkCancel()
// }
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
// if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
// }
// else if (this.formMyCheck.radioSp == '终止') {
// this.checkCancel()
// }
this.footerStatu=3
}, },
l(key) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
:model="formMyCheck" <Row>
:label-width="100" <Col span="18">
:rules="ruleValidate" <FormItem label="审批意见:">
inline <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
ref="formValidate" <Radio label="通过"></Radio>
> <Radio label="驳回"></Radio>
<Row> <Radio label="终止"></Radio>
<Col span="18"> </RadioGroup>
<FormItem label="审批意见:"> </FormItem>
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Radio label="通过"></Radio> <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Radio label="驳回"></Radio> <Option value class="option-text">请选择驳回节点</Option>
<Radio label="终止"></Radio> <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</RadioGroup> </Select>
</FormItem> <RadioGroup type="button" size="small" @on-change="changeToNode">
<FormItem <Radio label="1">上一节点</Radio>
label="驳回节点:" <Radio label="2">第一节点</Radio>
v-if="formMyCheck.radioSp === '驳回'" </RadioGroup>
prop="rejectToNodeId" </FormItem>
> <FormItem label="原因:" v-if="
<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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<!-- 订单审里通过form --> <!-- 订单审里通过form -->
<!-- <Modal v-model="modalCheckOk" title="订单审里" width="800" :scrollable="true"> <!-- <Modal v-model="modalCheckOk" title="订单审里" width="800" :scrollable="true">
...@@ -104,234 +74,235 @@ ...@@ -104,234 +74,235 @@
</div> </div>
</Modal>--> </Modal>-->
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批? <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process 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')
console.log(this.detailId)
console.log(this.footerStatu)
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
this.statuTitle = '通过'
} 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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') 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'
}]
}
} }
})
},
//获取流程节点
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
}
}, },
//审批通过 props: {},
checkOk() { async fetch({
// alert(this.passId) store,
let param = { params
id: this.passId, }) {
comment: '', await store.dispatch('loadDictionary') // 加载数据字典
nextOperationIdList: this.nextNodeUserIdList,//this.nextNodeUserIdList
data: {}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
}, },
//审批驳回 created() {
checkNo() { this.currentUserId = this.$store.state.userInfo.userId
// alert(this.passId) this.detailId = this.$http.common.getquerystring('id')
let param = { this.footerStatu = this.$http.common.getquerystring('statu')
id: this.passId, console.log(this.detailId)
comment: this.formMyCheck.comment, console.log(this.footerStatu)
rejectToNodeId: this.formMyCheck.rejectToNodeId this.getDetailInfos(this.detailId)
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == '通过') {
let param = { this.modalCheckNo = true
id: this.passId, this.statuTitle = '通过'
comment: this.formMyCheck.comment } else if (this.formMyCheck.radioSp == '驳回') {
} this.$refs['formValidate'].validate((valid) => {
//alert(JSON.stringify(param)) if (valid) {
Api.terminate(param).then((r) => { this.modalCheckNo = true
if (r.success) { this.statuTitle = '驳回'
this.$Message.success('终止审批成功') } else {}
this.footerStatu=3 })
} else { } else {
this.$Message.error('加载失败') 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, //this.nextNodeUserIdList
data: {}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
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 = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
this.modalCheckNo = false
})
},
//终止或驳回
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) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show" />
<div class="footers" v-if="footerStatu === '2'"> <div class="footers" v-if="footerStatu === '2'">
<Form :model="formMyCheck" :label-width="150"> <Form :model="formMyCheck" :label-width="150">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;"> <FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> --> <!-- <Radio label="终止"></Radio> -->
</RadioGroup> </RadioGroup>
<Select <Select v-if="formMyCheck.radioSp === '驳回'" style="width:200px" clearable ransfer placeholder="请选择驳回节点" class="selectBox" v-model="formMyCheck.rejectToNodeId">
v-if="formMyCheck.radioSp === '驳回'" <Option value class="option-text">请选择驳回节点</Option>
style="width:200px" clearable ransfer <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
placeholder="请选择驳回节点" class="selectBox" </Select>
v-model="formMyCheck.rejectToNodeId"> <RadioGroup v-if="formMyCheck.radioSp === '驳回'" type="button" size="small" @on-change="changeToNode">
<Option value class="option-text">请选择驳回节点</Option> <Radio label="1">上一节点</Radio>
<Option <Radio label="2">第一节点</Radio>
v-for="(item, index) in nodeList" </RadioGroup>
:value="item.value" <Input v-if="formMyCheck.radioSp === '驳回' ||
:label="item.label" formMyCheck.radioSp === '终止'" v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请如如驳回原因" />
:key="index" </FormItem>
:disabled="item.statu > 0 ? false : true" </Col>
></Option> <Col span="6" style="text-align:right;padding-right:40px">
</Select> <Button type="primary" @click="nextCheckOk">下一步</Button>
<RadioGroup </Col>
v-if="formMyCheck.radioSp === '驳回'" </Row>
type="button" </Form>
size="small"
@on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
<Input
v-if="formMyCheck.radioSp === '驳回' ||
formMyCheck.radioSp === '终止'"
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> </div>
<!-- 不合格品通过form --> <!-- 不合格品通过form -->
<Modal <Modal v-model="modalCheckOk" title="不合格品审理" width="800" :mask-closable="false" :scrollable="true">
v-model="modalCheckOk" <div v-if="showSize==2">
title="不合格品审理" <Form :model="formMyCheck" ref="formMyCheck" :rules="ruleValidate" :label-width="150">
width="800" :mask-closable="false" <Row>
:scrollable="true"> <Col span="24">
<div v-if="showSize==2"> <FormItem label="问题产生原因分析:" prop="causeAnalysis" style="width:100%">
<Form :model="formMyCheck" ref="formMyCheck" :rules="ruleValidate" :label-width="150"> <Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.causeAnalysis" :disabled="disabledFlag" style="width: 600px" />
<Row> </FormItem>
<Col span="24"> </Col>
<FormItem label="问题产生原因分析:" prop="causeAnalysis" style="width:100%"> <Col span="24">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.causeAnalysis" <FormItem label="审理结论:" prop="conclusion" style="width:100%">
:disabled="disabledFlag" style="width: 600px"/> <CheckboxGroup v-model="formMyCheck.conclusion">
</FormItem> <Checkbox label="返工" value='1' :disabled="disabledFlag"></Checkbox>
</Col> <Checkbox label="返修" value='2' :disabled="disabledFlag"></Checkbox>
<Col span="24"> <Checkbox label="降级使用" value='3' :disabled="disabledFlag"></Checkbox>
<FormItem label="审理结论:" prop="conclusion" style="width:100%"> <Checkbox label="让步" value='4' :disabled="disabledFlag"></Checkbox>
<CheckboxGroup v-model="formMyCheck.conclusion"> <Checkbox label="报废" value='5' :disabled="disabledFlag"></Checkbox>
<Checkbox label="返工" value='1' :disabled="disabledFlag"></Checkbox> <Checkbox label="通知顾客" value='6' :disabled="disabledFlag"></Checkbox>
<Checkbox label="返修" value='2' :disabled="disabledFlag"></Checkbox> </CheckboxGroup>
<Checkbox label="降级使用" value='3' :disabled="disabledFlag"></Checkbox> </FormItem>
<Checkbox label="让步" value='4' :disabled="disabledFlag"></Checkbox> </Col>
<Checkbox label="报废" value='5' :disabled="disabledFlag"></Checkbox> </Row>
<Checkbox label="通知顾客" value='6' :disabled="disabledFlag"></Checkbox> <Row>
</CheckboxGroup> <Col span="24">
</FormItem> <FormItem label="纠正措施:" prop="measures" style="width:100%">
</Col> <Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.measures" :disabled="disabledFlag" style="width: 600px" />
</Row> </FormItem>
<Row> </Col>
<Col span="24"> <Col span="24">
<FormItem label="纠正措施:" prop="measures" style="width:100%"> <FormItem label="审理级别:" prop="triaLevel" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.measures" <CheckboxGroup v-model="formMyCheck.triaLevel">
:disabled="disabledFlag" style="width: 600px"/> <Checkbox label="一级审理" value='1' :disabled="disabledFlag"></Checkbox>
</FormItem> <Checkbox label="二级审理" value='2' :disabled="disabledFlag"></Checkbox>
</Col> <Checkbox label="三级审理" value='3' :disabled="disabledFlag"></Checkbox>
<Col span="24"> </CheckboxGroup>
<FormItem label="审理级别:" prop="triaLevel" style="width:100%"> </FormItem>
<CheckboxGroup v-model="formMyCheck.triaLevel"> </Col>
<Checkbox label="一级审理" value='1' :disabled="disabledFlag"></Checkbox> </Row>
<Checkbox label="二级审理" value='2' :disabled="disabledFlag"></Checkbox> </Form>
<Checkbox label="三级审理" value='3' :disabled="disabledFlag"></Checkbox> </div>
</CheckboxGroup> <div v-if="showSize==4">
</FormItem> <Form :model="formResultText" ref="formResultText" :rules="ruleValidate" :label-width="150">
</Col> <Row>
</Row> <Col span="24">
</Form> <FormItem label="落实情况验证结果:" prop="resultText" style="width:100%">
</div> <Input type="textarea" :autosize="{minRows:3,maxRows: 7}" v-model="formResultText.resultText" :disabled="disabledFlag" style="width: 600px" />
<div v-if="showSize==4"> </FormItem>
<Form :model="formResultText" ref="formResultText" :rules="ruleValidate" :label-width="150"> </Col>
<Row> </Row>
<Col span="24"> </Form>
<FormItem label="落实情况验证结果:" prop="resultText" style="width:100%"> </div>
<Input type="textarea" :autosize="{minRows:3,maxRows: 7}" v-model="formResultText.resultText" <div slot="footer">
:disabled="disabledFlag" style="width: 600px"/> <Button @click="cancelFn">取消</Button>
</FormItem> <Button type="primary" @click="checkOk()" v-show="footerStatue">确定</Button>
</Col> </div>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="cancelFn">取消</Button>
<Button type="primary" @click="checkOk()" v-show="footerStatue">确定</Button>
</div>
</Modal> </Modal>
<Modal <Modal v-model="ResultModal" title="测试步骤" width="800" :scrollable="true">
v-model="ResultModal" <div>
title="测试步骤" {{'第'+this.showSize+'布'}}
width="800" :scrollable="true"> {{'id'+this.typeId}}
<div> </div>
{{'第'+this.showSize+'布'}} <div slot="footer">
{{'id'+this.typeId}} <Button @click="cancelFn02">取消</Button>
</div> <Button type="primary" @click="checkOk6">确定</Button>
<div slot="footer"> </div>
<Button @click="cancelFn02">取消</Button>
<Button type="primary" @click="checkOk6">确定</Button>
</div>
</Modal> </Modal>
<Modal <Modal v-model="modalCheckNo" title="不合格品审批" width="800" :scrollable="true">
v-model="modalCheckNo" <br />
title="不合格品审批" <h4>
width="800" :scrollable="true"> 您确定 <span class="new-red">{{ statuTitle }}</span> 此不合格品审批?
<br/> </h4>
<h4> <br />
您确定 <span class="new-red">{{ statuTitle }}</span> 此不合格品审批? <div slot="footer">
</h4> <Button @click="modalCheckNo = false">取消</Button>
<br /> <Button type="primary" @click="checkFalse">确定</Button>
<div slot="footer"> </div>
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
causeAnalysis: '', //问题产生原因分析
conclusion: [], //审理结论
measures: '', //纠正措施
triaLevel: [], //审理级别
rejectToNodeId: null
},
formResultText:{resultText: ''},//落实情况
ResultModal: false,//落实情况
footerStatue: true,//详情隐藏确定
disabledFlag: false,//是否可用
stepeFlag: null,//审核flag
showSize:1,// 弹框默认展示内容
ruleValidate: {
causeAnalysis: [{ required: true, message: '请填写原因分析', trigger: 'blur' }],
conclusion: [
{ required: true, type: 'array', min: 1, message: '至少选择一个审理结论', trigger: 'change' },
// { type: 'array', max: 2, message: '最多选两个审理结论', trigger: 'change' }
],
measures: [{ required: true, message: '请填写纠正措施', trigger: 'blur' }],
resultText: [{ required: true, message: '请填写落实情况', trigger: 'blur' }],
triaLevel: [{ required: true, type: 'array', min: 1, message: '至少选择一个审理级别', trigger: 'change' }],
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
typeId: null,//审批节点
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj:{}
}
},
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() {
let rejectToNode = this.formMyCheck.rejectToNodeId
let commasge = this.formMyCheck.comment
if (this.formMyCheck.radioSp == '通过') {
if( this.typeId==2){
this.modalCheckNo = true
this.statuTitle = '通过'
}
else{
this.footerStatue = true
this.modalCheckOk = true
}
} else if (this.formMyCheck.radioSp == '驳回') {
if(rejectToNode == null){
this.$Message.error('请选择驳回节点')
return
}
if(commasge == ''){
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
this.$Message.error('请选择审批意见')
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
}
}, },
show(a){ data() {
this.disabledFlag = true return {
let contextDate = JSON.parse(a.contextData) currentUserId: 0,
console.log(a) formMyCheck: {
if(contextDate.measures){ radioSp: '通过',
this.showSize = 2 comment: '',
this.stepeFlag = 2//第二步 causeAnalysis: '', //问题产生原因分析
this.formMyCheck = contextDate conclusion: [], //审理结论
}else if(contextDate.resultText){ measures: '', //纠正措施
this.showSize = 4 triaLevel: [], //审理级别
this.stepeFlag = 4 rejectToNodeId: null
this.formResultText = contextDate },
} formResultText: {
// else{ resultText: ''
// alert('第三步') }, //落实情况
// } ResultModal: false, //落实情况
this.modalCheckOk = true footerStatue: true, //详情隐藏确定
this.footerStatue = false disabledFlag: false, //是否可用
}, stepeFlag: null, //审核flag
getDetailInfos(idVal) { showSize: 1, // 弹框默认展示内容
this.getDetailRecords = [] ruleValidate: {
let param = { causeAnalysis: [{
Id: idVal required: true,
} message: '请填写原因分析',
Api.getdetail(param).then((r) => { trigger: 'blur'
if (r.success) { }],
this.currentNodeID = r.result.currentNodeId conclusion: [{
this.passId = r.result.currentRecordId required: true,
this.typeId = r.result.currentIndexId type: 'array',
this.showSize = this.typeId + 1 min: 1,
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 message: '至少选择一个审理结论',
this.getNodes(r.result.nodes) trigger: 'change'
} else { },
this.$Message.error('加载失败') // { type: 'array', max: 2, message: '最多选两个审理结论', trigger: 'change' }
],
measures: [{
required: true,
message: '请填写纠正措施',
trigger: 'blur'
}],
resultText: [{
required: true,
message: '请填写落实情况',
trigger: 'blur'
}],
triaLevel: [{
required: true,
type: 'array',
min: 1,
message: '至少选择一个审理级别',
trigger: 'change'
}],
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
typeId: null, //审批节点
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {}
} }
})
},
//获取流程节点
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
}
},
cancelFn(){
this.modalCheckOk = false
this.formMyCheck.radioSp = '通过'
this.disabledFlag = false
if(this.stepeFlag = 2){
this.showSize = 4
}
}, },
cancelFn02(){ props: {},
this.ResultModal = false async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
}, },
checkOk6(){ created() {
this.ResultModal = false 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: {
checkOk() { nextCheckOk() {
if(this.typeId==1){ let rejectToNode = this.formMyCheck.rejectToNodeId
this.$refs['formMyCheck'].validate((valid) => { let commasge = this.formMyCheck.comment
// console.log(valid) if (this.formMyCheck.radioSp == '通过') {
if (valid) { if (this.typeId == 2) {
this.modalCheckNo = true
this.statuTitle = '通过'
} else {
this.footerStatue = true
this.modalCheckOk = true
}
} else if (this.formMyCheck.radioSp == '驳回') {
if (rejectToNode == null) {
this.$Message.error('请选择驳回节点')
return
}
if (commasge == '') {
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
this.$Message.error('请选择审批意见')
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
}
},
show(a) {
this.disabledFlag = true
let contextDate = JSON.parse(a.contextData)
console.log(a)
if (contextDate.measures) {
this.showSize = 2
this.stepeFlag = 2 //第二步
this.formMyCheck = contextDate
} else if (contextDate.resultText) {
this.showSize = 4
this.stepeFlag = 4
this.formResultText = contextDate
}
// else{
// alert('第三步')
// }
this.modalCheckOk = true
this.footerStatue = false
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = { let param = {
id: this.passId, Id: idVal
comment: '', }
nextOperationIdList: this.nextNodeUserIdList, Api.getdetail(param).then((r) => {
data: { if (r.success) {
causeAnalysis: this.formMyCheck.causeAnalysis, this.currentNodeID = r.result.currentNodeId
conclusion: this.formMyCheck.conclusion, this.passId = r.result.currentRecordId
measures: this.formMyCheck.measures, this.typeId = r.result.currentIndexId
triaLevel: this.formMyCheck.triaLevel this.showSize = this.typeId + 1
} this.nextNodeUserIdList = this.$refs.userProcess.immutData //获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
} }
Api.pass(param).then((r) => { })
// console.log(param) },
if (r.success) { //获取流程节点
this.$Message.success('审批通过成功') getNodes(nodes) {
this.footerStatu=3 this.nodeList = []
} else { nodes.forEach((data) => {
this.$Message.error('审批通过失败') let nodeObj = {}
} nodeObj.value = data.id
}) nodeObj.label = data.name
this.modalCheckOk = false nodeObj.statu = 1
} else { this.nodeList.push(nodeObj)
console.log("审核不通过") })
} //第一节点node的ID
}) this.firstNodeID = this.nodeList[0].value
}else if(this.typeId==3){ //根据当前nodeid找到上一节点的nodeId
this.$refs['formResultText'].validate((valid) => { var index = this.nodeList.findIndex(
if (valid){ (item) => item.value == this.currentNodeID
let param = { )
id: this.passId, if (index > 0) {
comment: '', this.preNodeID = this.nodeList[index - 1].value
nextOperationIdList: this.nextNodeUserIdList, } else {
data: { this.preNodeID = this.nodeList[0].value
resultText: this.formResultText.resultText }
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
cancelFn() {
this.modalCheckOk = false
this.formMyCheck.radioSp = '通过'
this.disabledFlag = false
if (this.stepeFlag = 2) {
this.showSize = 4
}
},
cancelFn02() {
this.ResultModal = false
},
checkOk6() {
this.ResultModal = false
},
//审批通过
checkOk() {
if (this.typeId == 1) {
this.$refs['formMyCheck'].validate((valid) => {
// console.log(valid)
if (valid) {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
causeAnalysis: this.formMyCheck.causeAnalysis,
conclusion: this.formMyCheck.conclusion,
measures: this.formMyCheck.measures,
triaLevel: this.formMyCheck.triaLevel
}
} }
} Api.pass(param).then((r) => {
Api.pass(param).then((r) => { // console.log(param)
// console.log(param) if (r.success) {
if (r.success) { this.$Message.success('审批通过成功')
this.$Message.success('审批通过成功') this.$refs.userProcess.load(this.detailId)
this.footerStatu=3 this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
} else { } else {
this.$Message.error('审批通过失败') console.log("审核不通过")
}
})
} else if (this.typeId == 3) {
this.$refs['formResultText'].validate((valid) => {
if (valid) {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
resultText: this.formResultText.resultText
}
}
Api.pass(param).then((r) => {
// console.log(param)
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
} }
}) })
this.modalCheckOk = false }
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
} }
this.modalCheckNo = false
}) })
} },
//审批终止
}, checkCancel() {
//审批驳回 let param = {
checkNo() { id: this.passId,
let param = { comment: this.formMyCheck.comment
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
// 通过
passFn(){
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
} }
Api.pass(param).then((r) => { Api.terminate(param).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('审批通过成功') this.$Message.success('终止审批成功')
this.footerStatu=3 this.$refs.userProcess.load(this.detailId)
} else { this.footerStatu = 3
this.$Message.error('审批通过失败') } else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
// 通过
passFn() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
} }
this.modalCheckNo = false Api.pass(param).then((r) => {
}) if (r.success) {
}, this.$Message.success('审批通过成功')
//终止或驳回 this.footerStatu = 3
checkFalse() { } else {
if (this.formMyCheck.radioSp == '驳回') { this.$Message.error('审批通过失败')
this.checkNo() }
}else if(this.formMyCheck.radioSp == '通过'){ this.modalCheckNo = false
this.passFn() })
} },
else if (this.formMyCheck.radioSp == '终止') { //终止或驳回
this.checkCancel() checkFalse() {
} if (this.formMyCheck.radioSp == '驳回') {
this.footerStatu=3 this.checkNo()
} else if (this.formMyCheck.radioSp == '通过') {
this.passFn()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
}, },
l(key) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
:model="formMyCheck" <Row>
:label-width="100" <Col span="18">
:rules="ruleValidate" <FormItem label="审批意见:">
inline <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
ref="formValidate" <Radio label="通过"></Radio>
> <Radio label="驳回"></Radio>
<Row> <Radio label="终止"></Radio>
<Col span="18"> </RadioGroup>
<FormItem label="审批意见:"> </FormItem>
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Radio label="通过"></Radio> <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Radio label="驳回"></Radio> <Option value class="option-text">请选择驳回节点</Option>
<Radio label="终止"></Radio> <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</RadioGroup> </Select>
</FormItem> <RadioGroup type="button" size="small" @on-change="changeToNode">
<FormItem <Radio label="1">上一节点</Radio>
label="驳回节点:" <Radio label="2">第一节点</Radio>
v-if="formMyCheck.radioSp === '驳回'" </RadioGroup>
prop="rejectToNodeId" </FormItem>
> <FormItem label="原因:" v-if="
<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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<!-- 订单审里通过form --> <!-- 订单审里通过form -->
<Modal v-model="modalCheckOk" title="协调单审理" width="800" :scrollable="true"> <Modal v-model="modalCheckOk" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100"> <Form :model="formMyCheck" :label-width="100">
<Row> <Row>
<Col span="12"> <Col span="12">
<FormItem label="闭环情况" style="width:100%"> <FormItem label="闭环情况" style="width:100%">
<Input v-model="formMyCheck.close_situation" style="width:500px" /> <Input v-model="formMyCheck.close_situation" style="width:500px" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Form>
<div slot="footer" v-show="footerStatue === true"> <div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk = false">取消</Button> <Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button> <Button type="primary" @click="checkOk">确定</Button>
</div> </div>
</Modal> </Modal>
<!-- 订单审里通过form --> <!-- 订单审里通过form -->
<Modal v-model="modalCheckOk1" title="协调单审理" width="800" :scrollable="true"> <Modal v-model="modalCheckOk1" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100"> <Form :model="formMyCheck" :label-width="100">
<Row> <Row>
<FormItem label="协调结果"> <FormItem label="协调结果">
<textarea v-model="formMyCheck.coordinate_results" style="width: 600px"></textarea> <textarea v-model="formMyCheck.coordinate_results" style="width: 600px"></textarea>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="在制品处理意见"> <FormItem label="在制品处理意见">
<textarea v-model="formMyCheck.handling_suggestion" style="width: 600px"></textarea> <textarea v-model="formMyCheck.handling_suggestion" style="width: 600px"></textarea>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="是否更改设计文件"> <FormItem label="是否更改设计文件">
<Select v-model="formMyCheck.change_design_file" placeholder="请选择" style="width:225px;"> <Select v-model="formMyCheck.change_design_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option> <Option value="是"></Option>
<Option value="否"></Option> <Option value="否"></Option>
</Select> </Select>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="是否更改工艺文件"> <FormItem label="是否更改工艺文件">
<Select v-model="formMyCheck.change_process_file" placeholder="请选择" style="width:225px;"> <Select v-model="formMyCheck.change_process_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option> <Option value="是"></Option>
<Option value="否"></Option> <Option value="否"></Option>
</Select> </Select>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="是否编写临时工艺"> <FormItem label="是否编写临时工艺">
<Select <Select v-model="formMyCheck.compilation_temporary_process" placeholder="请选择" style="width:225px;">
v-model="formMyCheck.compilation_temporary_process" <Option value="是"></Option>
placeholder="请选择" <Option value="否"></Option>
style="width:225px;" </Select>
> </FormItem>
<Option value="是"></Option> </Row>
<Option value="否"></Option> </Form>
</Select> <div slot="footer" v-show="footerStatue === true">
</FormItem> <Button @click="modalCheckOk1 = false">取消</Button>
</Row> <Button type="primary" @click="checkOk">确定</Button>
</Form> </div>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk1 = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal> </Modal>
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批? <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
coordinate_results:'',
handling_suggestion:'',
change_design_file:'',
change_process_file:'',
close_situation:'',
compilation_temporary_process:'',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: '', //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckOk1:false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
footerStatue:true,
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')
console.log(this.footerStatu)
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
console.log(this.currentNodeID)
if (this.formMyCheck.radioSp == '通过') {
if(this.currentNodeID==165)
{
this.footerStatue=true
this.modalCheckOk = true
}
else if(this.currentNodeID==163)
{
this.footerStatue=true
this.modalCheckOk1 = true
}
else{
this.modalCheckNo = true
this.statuTitle = '通过'
}
} 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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r coordinate_results: '',
if (r.success) { handling_suggestion: '',
this.currentNodeID = r.result.currentNodeId change_design_file: '',
this.passId=r.result.currentRecordId change_process_file: '',
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 close_situation: '',
this.getNodes(r.result.nodes) compilation_temporary_process: '',
} else { workHours: 0, //工时
this.$Message.error('加载失败') printPeriod: 0, //打印周期
} equipment: '', //设备
}) materialWeight: '', //材料重量
}, rejectToNodeId: null
//获取流程节点 },
getNodes(nodes) { modalCheckOk: false,
this.nodeList = [] modalCheckOk1: false,
nodes.forEach((data) => { modalCheckNo: false,
let nodeObj = {} detailId: null,
nodeObj.value = data.id statuTitle: '',
nodeObj.label = data.name footerStatu: null, //是否显示footer
nodeObj.statu = 1 footerStatue: true,
this.nodeList.push(nodeObj) getDetailResults: [], //getdetail返回数据
}) getDetailResultOrder: [], //getdetail返回订单detail数据
//第一节点node的ID getDetailProcess: [], //getdetail返回process信息
this.firstNodeID = this.nodeList[0].value getDetailRecords: [], //getdetail返回当前records信息
//根据当前nodeid找到上一节点的nodeId passId: null, //通过审批/驳回/终止接口 id,
var index = this.nodeList.findIndex( nodeList: [], //返回节点
(item) => item.value == this.currentNodeID currentNodeID: null, //当前节点
) firstNodeID: null, //第一个节点
if (index > 0) { preNodeID: null, //上一个节点
this.preNodeID = this.nodeList[index - 1].value nextNodeUserIdList: [], //通过时提交的下一个节点UserId
} else { testObj: {},
this.preNodeID = this.nodeList[0].value ruleValidate: {
} rejectToNodeId: [{
}, required: true,
changeToNode(val) { message: '请选择驳回节点',
if (val == '1') { type: 'number',
this.formMyCheck.rejectToNodeId = this.preNodeID trigger: 'change'
} else { }],
this.formMyCheck.rejectToNodeId = this.firstNodeID comment: [{
} required: true,
}, message: '请输入原因',
//审批通过 trigger: 'blur'
checkOk() { }]
// alert(this.passId) }
var param = {
// id: this.passId,
// comment: '',
// nextOperationIdList: this.nextNodeUserIdList,
// data: {}
}
if(this.currentNodeID==165)
{
if (!this.formMyCheck.close_situation) {
this.$Message.error('请填写闭环情况')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
close_situation: this.formMyCheck.close_situation
}
}
}
else if(this.currentNodeID==163)
{
if (!this.formMyCheck.coordinate_results) {
this.$Message.error('请填写协调结果')
return
}
if (!this.formMyCheck.handling_suggestion) {
this.$Message.error('请填写在制品处理意见')
return
}
if (!this.formMyCheck.change_design_file) {
this.$Message.error('请选择是否更改设计文件')
return
}
if (!this.formMyCheck.change_process_file) {
this.$Message.error('请选择是否更改工艺文件')
return
}
if (!this.formMyCheck.compilation_temporary_process) {
this.$Message.error('请选择是否编写临时工艺')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
coordinate_results: this.formMyCheck.coordinate_results,
handling_suggestion: this.formMyCheck.handling_suggestion,
change_design_file: this.formMyCheck.change_design_file,
change_process_file: this.formMyCheck.change_process_file,
compilation_temporary_process: this.formMyCheck.compilation_temporary_process
}
}
}
else{
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
this.modalCheckNo = false
this.modalCheckOk = false
this.modalCheckOk1 = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
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.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
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.footerStatu=3
} else {
this.$Message.error('加载失败')
} }
this.modalCheckNo = false
})
}, },
//终止或驳回 props: {},
checkFalse() { async fetch({
if (this.formMyCheck.radioSp == '驳回') { store,
this.checkNo() params
} else if (this.formMyCheck.radioSp == '终止') { }) {
this.checkCancel() await store.dispatch('loadDictionary') // 加载数据字典
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
}, },
l(key) { created() {
key = 'MaterialPlacode' + '.' + key this.currentUserId = this.$store.state.userInfo.userId
return this.$t(key) this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
console.log(this.footerStatu)
this.getDetailInfos(this.detailId)
}, },
show(a){ methods: {
console.log(a) nextCheckOk() {
this.footerStatue = false console.log(this.currentNodeID)
let contextDate = JSON.parse(a.contextData) if (this.formMyCheck.radioSp == '通过') {
this.formMyCheck = contextDate if (this.currentNodeID == 165) {
if(a.nodeId==163) this.footerStatue = true
{ this.modalCheckOk = true
this.modalCheckOk1 = true } else if (this.currentNodeID == 163) {
} this.footerStatue = true
else if(a.nodeId==165) this.modalCheckOk1 = true
{ } else {
this.modalCheckOk = true this.modalCheckNo = true
} this.statuTitle = '通过'
}
} 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)
var param = {
// id: this.passId,
// comment: '',
// nextOperationIdList: this.nextNodeUserIdList,
// data: {}
}
if (this.currentNodeID == 165) {
if (!this.formMyCheck.close_situation) {
this.$Message.error('请填写闭环情况')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
close_situation: this.formMyCheck.close_situation
}
}
} else if (this.currentNodeID == 163) {
if (!this.formMyCheck.coordinate_results) {
this.$Message.error('请填写协调结果')
return
}
if (!this.formMyCheck.handling_suggestion) {
this.$Message.error('请填写在制品处理意见')
return
}
if (!this.formMyCheck.change_design_file) {
this.$Message.error('请选择是否更改设计文件')
return
}
if (!this.formMyCheck.change_process_file) {
this.$Message.error('请选择是否更改工艺文件')
return
}
if (!this.formMyCheck.compilation_temporary_process) {
this.$Message.error('请选择是否编写临时工艺')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
coordinate_results: this.formMyCheck.coordinate_results,
handling_suggestion: this.formMyCheck.handling_suggestion,
change_design_file: this.formMyCheck.change_design_file,
change_process_file: this.formMyCheck.change_process_file,
compilation_temporary_process: this.formMyCheck.compilation_temporary_process
}
}
} else {
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
this.modalCheckNo = false
this.modalCheckOk = false
this.modalCheckOk1 = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
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.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
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 = 'MaterialPlacode' + '.' + key
return this.$t(key)
},
show(a) {
console.log(a)
this.footerStatue = false
let contextDate = JSON.parse(a.contextData)
this.formMyCheck = contextDate
if (a.nodeId == 163) {
this.modalCheckOk1 = true
} else if (a.nodeId == 165) {
this.modalCheckOk = true
}
},
}, },
}, watch: {}
watch: {}
} }
</script> </script>
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" /> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate"> <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row> <Row>
<Col span="18"> <Col span="18">
<FormItem label="审批意见:"> <FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio> <Radio label="通过"></Radio>
<Radio label="驳回"></Radio> <Radio label="驳回"></Radio>
<Radio label="终止"></Radio> <Radio label="终止"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
style="width:200px" <Option value class="option-text">请选择驳回节点</Option>
clearable <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
transfer </Select>
placeholder="请选择驳回节点" <RadioGroup type="button" size="small" @on-change="changeToNode">
v-model="formMyCheck.rejectToNodeId" <Radio label="1">上一节点</Radio>
> <Radio label="2">第一节点</Radio>
<Option value class="option-text">请选择驳回节点</Option> </RadioGroup>
<Option </FormItem>
v-for="(item, index) in nodeList" <FormItem label="原因:" v-if="
: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 === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<Modal v-model="modalCheckNo" title="合格证审批" width="800" :scrollable="true"> <Modal v-model="modalCheckNo" title="合格证审批" width="800" :scrollable="true">
<br /> <br />
<h4> <h4>
您确定 您确定
<span class="new-red">{{ statuTitle }}</span> 此合格证审批? <span class="new-red">{{ statuTitle }}</span> 此合格证审批?
</h4> </h4>
<br /> <br />
<div slot="footer"> <div slot="footer">
<Button @click="modalCheckNo = false">取消</Button> <Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button> <Button type="primary" @click="checkFalse">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process 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.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) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') 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'
}]
}
} }
})
},
//获取流程节点
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
}
}, },
//审批通过 props: {},
checkOk() { async fetch({
// alert(this.passId) store,
let param = { params
id: this.passId, }) {
comment: '', await store.dispatch('loadDictionary') // 加载数据字典
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 = false
}, },
//审批驳回 created() {
checkNo() { this.currentUserId = this.$store.state.userInfo.userId
// alert(this.passId) this.detailId = this.$http.common.getquerystring('id')
let param = { this.footerStatu = this.$http.common.getquerystring('statu')
id: this.passId, this.getDetailInfos(this.detailId)
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
// alert(this.passId) if (this.formMyCheck.radioSp == '通过') {
let param = { this.modalCheckNo = true
id: this.passId, } else if (this.formMyCheck.radioSp == '驳回') {
comment: this.formMyCheck.comment this.$refs['formValidate'].validate((valid) => {
} if (valid) {
//alert(JSON.stringify(param)) this.modalCheckNo = true
Api.terminate(param).then((r) => { this.statuTitle = '驳回'
if (r.success) { } else {}
this.$Message.success('终止审批成功') })
} else { } else {
this.$Message.error('加载失败') 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.$refs.userProcess.load(this.detailId)
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
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.$refs.userProcess.load(this.detailId)
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
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.$refs.userProcess.load(this.detailId)
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
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 = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
this.modalCheckNo = false
})
},
//终止或驳回
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) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
<style lang="less" scope> <style lang="less">
@import "./shen.less"; @import "./shen.less";
</style> </style>
<template> <template>
<div class="Design"> <div class="Design">
<h3>{{ processTitle }}</h3> <h3>{{ processTitle }}</h3>
<Divider /> <Divider />
<Timeline> <Timeline>
<TimelineItem v-for="(item, index) in dataImmut" :key="index"> <TimelineItem v-for="(item, index) in dataImmut" :key="index">
<Badge :count="index + 1" slot="dot" :type="type(index)"></Badge> <Badge :count="index + 1" slot="dot" :type="type(index)"></Badge>
<p class="title"> <p class="title">
<state code="workflow.record.status" :value="item.status" type="tag" /> <state code="workflow.record.status" :value="item.status" type="tag" />
{{ item.name }} &nbsp;( {{ item.name }} &nbsp;(
<state code="workflow.form.audit.type" :value="item.operation" />) <state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" title="固定" type="ios-lock" /> <Icon v-if="item.isFixed" title="固定" type="ios-lock" />
</p> </p>
<div class="content"> <div class="content">
<!-- <div class="records" v-if="index==cur"> <!-- <div class="records" v-if="index==cur">
<span>审批人:</span> <span>审批人:</span>
<User <User
v-for="(item3, index3) in item.records" v-for="(item3, index3) in item.records"
...@@ -24,186 +24,189 @@ ...@@ -24,186 +24,189 @@
class="mr5" class="mr5"
/> />
</div> --> </div> -->
<div v-if="index>cur"> <div v-if="index>cur">
<CheckboxGroup v-model="immutData"> <CheckboxGroup v-model="immutData">
<span>审批人:</span> <span>审批人:</span>
<Checkbox <Checkbox v-for="(item1, index1) in item.defaultUsers.immutable" :key="index1" :label="item1" :disabled="item.isFixed">
v-for="(item1, index1) in item.defaultUsers.immutable" <User :value="item1" style="margin-right:5px;" />
:key="index1" </Checkbox>
:label="item1" </CheckboxGroup>
:disabled="item.isFixed" </div>
> <div class="wait" v-else>
<User :value="item1" style="margin-right:5px;" /> <span>审批人:</span>
</Checkbox> <User v-for="(item2, index2) in item.defaultUsers.immutable" :key="index2" :value="item2" class="mr5" />
</CheckboxGroup> </div>
</div> <div style="width:98%" v-if="com(item.records).length>0">
<div class="wait" v-else> <!-- <Table :columns="columns" border size="small" width="90%" :data="com(item.records)"></Table> -->
<span>审批人:</span> <p class="shen_row" v-for="(item3, index3) in item.records" :key="index3" :value="item3">
<User <User class="user_span" :value="item3.operatorId" />
v-for="(item2, index2) in item.defaultUsers.immutable" <span class="plr row_time">{{item3.operationTime}}</span>
:key="index2" <state code="workflow.record.status" class="row_statu" :value="item3.status" type="text"></state>
:value="item2" <span class="plr remark" v-if="item3.remark">{{item3.remark}}</span>
class="mr5" <a class="plr row_ditill" v-if="item3.contextData" @click="edit(item3)">详情</a>
/> <!-- <span>{{item3.contextData}}</span> -->
</div> </p>
<div style="width:98%" v-if="com(item.records).length>0"> </div>
<!-- <Table :columns="columns" border size="small" width="90%" :data="com(item.records)"></Table> --> </div>
<p class="shen_row" v-for="(item3, index3) in item.records" :key="index3" :value="item3"> </TimelineItem>
<User class="user_span" :value="item3.operatorId"/>
<span class="plr row_time">{{item3.operationTime}}</span>
<state code="workflow.record.status" class="row_statu" :value="item3.status" type="text"></state>
<span class="plr remark" v-if="item3.remark">{{item3.remark}}</span>
<a class="plr row_ditill" v-if="item3.contextData" @click="edit(item3)">详情</a>
<!-- <span>{{item3.contextData}}</span> -->
</p>
</div>
</div>
</TimelineItem>
</Timeline> </Timeline>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
export default { export default {
name: 'process', name: 'process',
components: {}, components: {},
async fetch({ store, params }) { async fetch({
await store.dispatch('loadDictionary') // 加载数据字典 store,
}, params
data() { }) {
return { await store.dispatch('loadDictionary') // 加载数据字典
currentUserId: 0, },
processTitle: '审批流程', data() {
currentNodeId: null, return {
dataImmut: [], currentUserId: 0,
creatRows: [], processTitle: '审批流程',
cur: 0, currentNodeId: null,
columns: [ dataImmut: [],
{ creatRows: [],
key: 'status', cur: 0,
title: '结果', columns: [{
align: 'left', key: 'status',
width: 100, title: '结果',
render: (h, params) => { align: 'left',
return h('state', { width: 100,
attrs: { render: (h, params) => {
value: params.row.status, return h('state', {
code: 'workflow.record.status' attrs: {
} value: params.row.status,
code: 'workflow.record.status'
}
})
}
},
{
key: 'operatorId',
title: '操作人',
align: 'left',
width: 100,
easy: true,
high: true,
render: (h, params) => {
return h('User', {
attrs: {
value: params.row.operatorId
}
})
}
},
{
title: '时间',
key: 'operationTime',
width: 200,
align: 'center'
},
{
title: '备注',
key: 'remark',
align: 'center'
},
{
key: 'contextData',
title: '详细',
width: 100,
align: 'left',
render: (h, params) => {
if (params.row.contextData.length > 2)
return h(
'a', {
on: {
click: () => this.edit(params.row)
}
},
'详情'
)
return h('span', '')
}
}
],
dataMut: [],
immutData: [],
schemaId: ''
}
},
props: {
idVal: {
type: String,
default: ''
}
},
created() {
this.currentUserId = this.$store.state.userInfo.userId
this.dataImmut = []
this.dataMut = []
this.load(this.idVal)
},
methods: {
load(v) {
Api.getdetail({
Id: v
}).then((r) => {
if (r.success) {
this.dataImmut = r.result.nodes
this.currentNodeId = r.result.currentNodeId
let idUser = []
r.result.nodes.map((u, i) => {
//查找当前节点索引
if (u.id == this.currentNodeId) {
this.cur = i
};
// if(u.defaultUsers.mutable&&u.defaultUsers.mutable.length>0){
// u.defaultUsers.immutable=u.defaultUsers.immutable.concat(u.defaultUsers.mutable)
u.defaultUsers.immutable = u.defaultUsers.immutable || (u.defaultUsers.mutable) //审核人员bug
// }
})
if (this.dataImmut.length > this.cur + 1) {
// console.log("this.dataImmut[this.cur + 1]:",this.dataImmut[this.cur + 1],this.cur,this.dataImmut.length )
this.immutData = this.dataImmut[this.cur + 1].defaultUsers.immutable || (this.dataImmut[this.cur + 1].defaultUsers.mutable) //审核人员bug
}
} else {
this.$Message.error('加载失败')
}
}) })
}
}, },
{ type(i) {
key: 'operatorId', if (i < this.cur) {
title: '操作人', return 'primary'
align: 'left', } else if (i == this.cur) {
width: 100, return 'info'
easy: true, } else if (i == this.cur + 1) {
high: true, return 'warning'
render: (h, params) => { } else {
return h('User', { attrs: { value: params.row.operatorId } }) return 'normal'
} }
}, },
{ edit(record) {
title: '时间', // alert(record.id)
key: 'operationTime', this.$emit('node-click', record)
width: 200, console.log(record)
align: 'center'
}, },
{ com(items) {
title: '备注', if (items)
key: 'remark', return items.filter((u) => {
align: 'center' return [2, 3, 5, 6].indexOf(u.status) > -1
})
else
return [];
}, },
{ l(key) {
key: 'contextData', key = 'orderInfo' + '.' + key
title: '详细', return this.$t(key)
width: 100,
align: 'left',
render: (h, params) => {
if (params.row.contextData.length > 2)
return h(
'a',
{ on: { click: () => this.edit(params.row) } },
'详情'
)
return h('span', '')
}
} }
],
dataMut: [],
immutData: [],
schemaId: ''
}
},
props: {
idVal: {
type: String,
default: ''
}
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.dataImmut = []
this.dataMut = []
Api.getdetail({ Id: this.idVal }).then((r) => {
if (r.success) {
this.dataImmut = r.result.nodes
this.currentNodeId = r.result.currentNodeId
let idUser = []
r.result.nodes.map((u, i) => {
//查找当前节点索引
if (u.id == this.currentNodeId) {
this.cur = i
};
// if(u.defaultUsers.mutable&&u.defaultUsers.mutable.length>0){
// u.defaultUsers.immutable=u.defaultUsers.immutable.concat(u.defaultUsers.mutable)
u.defaultUsers.immutable=u.defaultUsers.immutable||(u.defaultUsers.mutable)//审核人员bug
// }
})
if (this.dataImmut.length > this.cur + 1) {
// console.log("this.dataImmut[this.cur + 1]:",this.dataImmut[this.cur + 1],this.cur,this.dataImmut.length )
this.immutData = this.dataImmut[this.cur + 1].defaultUsers.immutable||(this.dataImmut[this.cur + 1].defaultUsers.mutable)//审核人员bug
}
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
type(i) {
if (i < this.cur) {
return 'primary'
} else if (i == this.cur) {
return 'info'
} else if (i == this.cur + 1) {
return 'warning'
} else {
return 'normal'
}
},
edit(record) {
// alert(record.id)
this.$emit('node-click', record)
console.log(record)
},
com(items) {
if(items)
return items.filter((u) => {
return [2, 3, 5, 6].indexOf(u.status) > -1
})
else
return [];
}, },
l(key) { computed: {},
key = 'orderInfo' + '.' + key watch: {}
return this.$t(key)
}
},
computed: {},
watch: {}
} }
</script> </script>
\ No newline at end of file
...@@ -57,8 +57,9 @@ ...@@ -57,8 +57,9 @@
<Detail :row="rowData" /> <Detail :row="rowData" />
</Modal> </Modal>
<Modal v-model="splitModal" title="订单分解" width="1200"> <Modal v-model="splitModal" title="订单分解" width="1200">
<Split :row="rowData" ref="orderSplit" /> <Split :row="rowData" ref="orderSplit" @on-amount="getAmount" />
<div slot="footer"> <div slot="footer">
<span class="pr240">剩余产品数量:{{amountNew}}</span>
<Button @click="splitModal = false">取消</Button> <Button @click="splitModal = false">取消</Button>
<Button type="primary" @click="orderSplitOk">确定分解</Button> <Button type="primary" @click="orderSplitOk">确定分解</Button>
</div> </div>
...@@ -487,7 +488,8 @@ export default { ...@@ -487,7 +488,8 @@ export default {
codeList: [], //订单编号List codeList: [], //订单编号List
operatorIdList: [] //操作员id operatorIdList: [] //操作员id
}, //确定后返回数据 }, //确定后返回数据
wfstatu: 1 //流程是否启用1 禁用 0启用 wfstatu: 1, //流程是否启用1 禁用 0启用
amountNew: 0,
}; };
}, },
created() { created() {
...@@ -575,11 +577,16 @@ export default { ...@@ -575,11 +577,16 @@ export default {
split(row) { split(row) {
if (row.quantity > 1) { if (row.quantity > 1) {
this.splitModal = true; this.splitModal = true;
this.amountNew = row.quantity
this.rowData = row; this.rowData = row;
} else { } else {
this.$Message.error("数量为1,不能进行分解"); this.$Message.error("数量为1,不能进行分解");
} }
}, },
//获取可分解剩余条数
getAmount(val) {
this.amountNew = val
},
onHide() { onHide() {
// this.$Message.info("收起左侧树") // this.$Message.info("收起左侧树")
this.showMenu = false; this.showMenu = false;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</Col> </Col>
<Col span="12"> <Col span="12">
<FormItem label="分解数量" style="width:100%" prop="splitQuantity"> <FormItem label="分解数量" style="width:100%" prop="splitQuantity">
<InputNumber :min="2" :max="orderForm.quantity" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber> <InputNumber :min="1" :max="orderForm.quantity" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber>
<Button type="primary" @click="addSplitOrder" v-noClick>确定</Button> <Button type="primary" @click="addSplitOrder" v-noClick>确定</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
<DatePicker v-model="row.demandDate" type="daterange" placeholder="请选择日期" style="width:240px" :transfer="true" :options="optionsDate" @on-change="inputOrderCat(row,index)"></DatePicker> <DatePicker v-model="row.demandDate" type="daterange" placeholder="请选择日期" style="width:240px" :transfer="true" :options="optionsDate" @on-change="inputOrderCat(row,index)"></DatePicker>
</template> </template>
</Table> </Table>
<div class="cellblock">
<p>剩余产品数量:{{amount}}</p>
</div>
</div> </div>
</template> </template>
...@@ -81,14 +77,14 @@ export default { ...@@ -81,14 +77,14 @@ export default {
productName: "", //产品名称 productName: "", //产品名称
drawingNo: "", //图号 drawingNo: "", //图号
orderCat: "", //任务类型 orderCat: "", //任务类型
quantity: "", //数量 quantity: 0, //数量
remark: "" //备注 remark: "" //备注
}, },
orderForm: { orderForm: {
mesCode: "", //订单编号 mesCode: "", //订单编号
productName: "", //产品名称 productName: "", //产品名称
stage: "", //阶段 stage: "", //阶段
quantity: "", //数量 quantity: 0, //数量
planStartTime: "", //计划开始时间 planStartTime: "", //计划开始时间
planEndTime: "", //计划结束时间 planEndTime: "", //计划结束时间
splitQuantity: 2, //分解数量 splitQuantity: 2, //分解数量
...@@ -153,7 +149,7 @@ export default { ...@@ -153,7 +149,7 @@ export default {
//打开modal层时给订单list赋值 //打开modal层时给订单list赋值
//alert(JSON.stringify(data)) //alert(JSON.stringify(data))
this.dataListRetrun.id = data[0].id; this.dataListRetrun.id = data[0].id;
this.dataListRetrun.quantity = data[0].quantity; this.dataListRetrun.quantity = Number(data[0].quantity);
this.dataListRetrun.mesCode = data[0].mesCode; this.dataListRetrun.mesCode = data[0].mesCode;
this.orderInfo = []; this.orderInfo = [];
this.dataList = []; this.dataList = [];
...@@ -162,7 +158,7 @@ export default { ...@@ -162,7 +158,7 @@ export default {
mesCode: this.orderInfo.mesCode, //订单编号 mesCode: this.orderInfo.mesCode, //订单编号
productName: this.orderInfo.productName, //产品名称 productName: this.orderInfo.productName, //产品名称
stage: this.orderInfo.stage, //阶段 stage: this.orderInfo.stage, //阶段
quantity: this.orderInfo.quantity, //数量 quantity: Number(this.orderInfo.quantity), //数量
planStartTime: this.orderInfo.demandStartDate, //计划开始时间 planStartTime: this.orderInfo.demandStartDate, //计划开始时间
planEndTime: this.orderInfo.demandFinishDate, //计划结束时间 planEndTime: this.orderInfo.demandFinishDate, //计划结束时间
splitQuantity: 2, //分解数量 splitQuantity: 2, //分解数量
...@@ -190,7 +186,7 @@ export default { ...@@ -190,7 +186,7 @@ export default {
this.dataList.push({ this.dataList.push({
mesCode: i + 1 < 10 ? mesCode: i + 1 < 10 ?
mesCodeSon + "0" + (i + 1) : mesCodeSon + "" + (i + 1), mesCodeSon + "0" + (i + 1) : mesCodeSon + "" + (i + 1),
quantity: "", quantity: 0,
demandDate: [planStartTime, planEndTime], demandDate: [planStartTime, planEndTime],
demandStartDate: planStartTime, demandStartDate: planStartTime,
demandFinishDate: planEndTime demandFinishDate: planEndTime
...@@ -209,7 +205,7 @@ export default { ...@@ -209,7 +205,7 @@ export default {
let forDemandStartDate = this.getFormatDate(row.demandDate[0]); let forDemandStartDate = this.getFormatDate(row.demandDate[0]);
let forDemandFinishDate = this.getFormatDate(row.demandDate[1]); let forDemandFinishDate = this.getFormatDate(row.demandDate[1]);
this.dataListRetrun.items[index].mesCode = row.mesCode; this.dataListRetrun.items[index].mesCode = row.mesCode;
this.dataListRetrun.items[index].quantity = row.quantity; this.dataListRetrun.items[index].quantity = Number(row.quantity);
this.dataListRetrun.items[index].demandStartDate = forDemandStartDate; this.dataListRetrun.items[index].demandStartDate = forDemandStartDate;
this.dataListRetrun.items[index].demandFinishDate = forDemandFinishDate; this.dataListRetrun.items[index].demandFinishDate = forDemandFinishDate;
this.dataList[index].demandDate = [ this.dataList[index].demandDate = [
...@@ -220,10 +216,11 @@ export default { ...@@ -220,10 +216,11 @@ export default {
this.dataList.forEach(el => { this.dataList.forEach(el => {
splitAmount = Number(splitAmount) + Number(el.quantity) splitAmount = Number(splitAmount) + Number(el.quantity)
}) })
this.amount = this.orderForm.quantity - splitAmount this.amount = Number(this.orderForm.quantity) - splitAmount
this.$emit("on-amount", this.amount);
}, },
inputFocus(row, index) { inputFocus(row, index) {
this.amountMax = this.amount + row.quantity this.amountMax = this.amount + Number(row.quantity)
}, },
getFormatDate(dates) { getFormatDate(dates) {
const d = new Date(dates); const d = new Date(dates);
...@@ -259,7 +256,7 @@ export default { ...@@ -259,7 +256,7 @@ export default {
mesCode: this.orderInfo.mesCode, //订单编号 mesCode: this.orderInfo.mesCode, //订单编号
productName: "", //产品名称 productName: "", //产品名称
stage: "", //阶段 stage: "", //阶段
quantity: "", //数量 quantity: 0, //数量
planStartTime: "", //计划开始时间 planStartTime: "", //计划开始时间
planEndTime: "", //计划结束时间 planEndTime: "", //计划结束时间
splitQuantity: 2, //分解数量 splitQuantity: 2, //分解数量
...@@ -275,11 +272,11 @@ export default { ...@@ -275,11 +272,11 @@ export default {
this.orderForm.planEndTime = this.orderForm.demandFinishDate; this.orderForm.planEndTime = this.orderForm.demandFinishDate;
//this.orderForm.splitQuantity = 2; //this.orderForm.splitQuantity = 2;
this.dataListRetrun.id = this.orderForm.id; this.dataListRetrun.id = this.orderForm.id;
this.dataListRetrun.quantity = this.orderForm.quantity; this.dataListRetrun.quantity = Number(this.orderForm.quantity);
this.dataListRetrun.mesCode = this.orderForm.mesCode; this.dataListRetrun.mesCode = this.orderForm.mesCode;
this.dataList = [] this.dataList = []
this.amount = this.orderForm.quantity this.amount = Number(this.orderForm.quantity)
} }
} }
} }
......
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