Commit 92e1727d authored by renjintao's avatar renjintao

userProcess.load

parent 7d0b08b0
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="修复文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此修复文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此修复文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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'
}]
}
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
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)
},
//审批终止
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
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) {
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) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="支撑文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此支撑文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此支撑文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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'
}]
}
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
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)
},
//审批终止
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
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) {
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) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="切片文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此切片文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此切片文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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'
}]
}
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
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)
},
//审批终止
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
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) {
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) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="物料审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此物料审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此物料审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "../api";
import Detail from "./detail";
import Process from "../process";
export default {
layout: "empty",
name: "Index",
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: "通过",
comment: "",
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: "", //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: "",
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: "请选择驳回节点",
type: "number",
trigger: "change"
}
],
comment: [
{
required: true,
message: "请输入原因",
trigger: "blur"
}
]
}
};
},
props: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.currentUserId = this.$store.state.userInfo.userId;
this.detailId = this.$http.common.getquerystring("id");
this.footerStatu = this.$http.common.getquerystring("statu");
this.getDetailInfos(this.detailId);
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {
}
});
} else {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {
}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error("加载失败");
}
});
layout: "empty",
name: "Index",
components: {
Detail,
Process
},
//获取流程节点
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;
}
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"
}]
}
};
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
props: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
};
// alert(JSON.stringify(param))
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success("审批通过成功");
this.modalCheckNo = false;
} else {
this.$Message.error("审批通过失败");
this.modalCheckNo = true;
}
});
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);
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
};
// alert(JSON.stringify(param))
Api.reject(param).then(r => {
if (r.success) {
this.$Message.success("驳回审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error("加载失败");
this.modalCheckNo = true;
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {}
});
} else {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error("加载失败");
}
});
},
//获取流程节点
getNodes(nodes) {
this.nodeList = [];
nodes.forEach(data => {
let nodeObj = {};
nodeObj.value = data.id;
nodeObj.label = data.name;
nodeObj.statu = 1;
this.nodeList.push(nodeObj);
});
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value;
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
item => item.value == this.currentNodeID
);
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value;
} else {
this.preNodeID = this.nodeList[0].value;
}
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
};
// alert(JSON.stringify(param))
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success("审批通过成功");
this.$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) {
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
watch: {}
};
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="文档审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此文档审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此文档审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "../api";
import Detail from "./detail";
import Process from "../process";
export default {
layout: "empty",
name: "Index",
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: "通过",
comment: "",
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: "", //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: "",
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: "请选择驳回节点",
type: "number",
trigger: "change"
}
],
comment: [
{
required: true,
message: "请输入原因",
trigger: "blur"
}
]
}
};
},
props: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.currentUserId = this.$store.state.userInfo.userId;
this.detailId = this.$http.common.getquerystring("id");
this.footerStatu = this.$http.common.getquerystring("statu");
this.getDetailInfos(this.detailId);
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {
}
});
} else {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {
}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error("加载失败");
}
});
layout: "empty",
name: "Index",
components: {
Detail,
Process
},
//获取流程节点
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;
}
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"
}]
}
};
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
props: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
};
// alert(JSON.stringify(param))
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success("审批通过成功");
this.modalCheckNo = false;
} else {
this.$Message.error("审批通过失败");
this.modalCheckNo = true;
}
});
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);
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
};
// alert(JSON.stringify(param))
Api.reject(param).then(r => {
if (r.success) {
this.$Message.success("驳回审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error("加载失败");
this.modalCheckNo = true;
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {}
});
} else {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error("加载失败");
}
});
},
//获取流程节点
getNodes(nodes) {
this.nodeList = [];
nodes.forEach(data => {
let nodeObj = {};
nodeObj.value = data.id;
nodeObj.label = data.name;
nodeObj.statu = 1;
this.nodeList.push(nodeObj);
});
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value;
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
item => item.value == this.currentNodeID
);
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value;
} else {
this.preNodeID = this.nodeList[0].value;
}
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
};
// alert(JSON.stringify(param))
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success("审批通过成功");
this.$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) {
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
watch: {}
};
</script>
......@@ -193,6 +193,7 @@ export default {
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
......@@ -212,6 +213,7 @@ export default {
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
......@@ -230,6 +232,7 @@ export default {
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
......
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal
v-model="modalCheckNo"
title="订单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此工艺规程审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此工艺规程审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((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() {
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'
}]
}
}
})
},
//获取流程节点
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: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批通过
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.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
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)
},
//审批驳回
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.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.footerStatu = 3
} else {
this.$Message.error('加载失败')
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) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((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: 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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj"/>
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'">
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select
v-if="formMyCheck.radioSp === '驳回'"
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
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>
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select v-if="formMyCheck.radioSp === '驳回'" 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 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>
<Modal
v-model="modalCheckNo"
title="材料消耗单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此材料消耗单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<Modal v-model="modalCheckNo" title="材料消耗单审批" width="800" :scrollable="true">
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此材料消耗单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
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 = '终止'
// }
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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: {}
}
})
},
//获取流程节点
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: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
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
})
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)
},
//审批终止
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('加载失败')
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) {
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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<!-- <Modal v-model="modalCheckOk" title="订单审里" width="800" :scrollable="true">
......@@ -104,234 +74,235 @@
</div>
</Modal>-->
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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'
}]
}
}
})
},
//获取流程节点
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.footerStatu=3
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批驳回
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
})
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)
},
//审批终止
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('加载失败')
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) {
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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<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'">
<Form :model="formMyCheck" :label-width="150">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select
v-if="formMyCheck.radioSp === '驳回'"
style="width:200px" clearable ransfer
placeholder="请选择驳回节点" class="selectBox"
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
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 === '驳回' ||
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>
<Form :model="formMyCheck" :label-width="150">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select v-if="formMyCheck.radioSp === '驳回'" style="width:200px" clearable ransfer placeholder="请选择驳回节点" class="selectBox" 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 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 === '驳回' ||
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>
<!-- 不合格品通过form -->
<Modal
v-model="modalCheckOk"
title="不合格品审理"
width="800" :mask-closable="false"
:scrollable="true">
<div v-if="showSize==2">
<Form :model="formMyCheck" ref="formMyCheck" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="问题产生原因分析:" prop="causeAnalysis" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.causeAnalysis"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理结论:" prop="conclusion" style="width:100%">
<CheckboxGroup v-model="formMyCheck.conclusion">
<Checkbox label="返工" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="返修" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="降级使用" value='3' :disabled="disabledFlag"></Checkbox>
<Checkbox label="让步" value='4' :disabled="disabledFlag"></Checkbox>
<Checkbox label="报废" value='5' :disabled="disabledFlag"></Checkbox>
<Checkbox label="通知顾客" value='6' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="纠正措施:" prop="measures" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.measures"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理级别:" prop="triaLevel" style="width:100%">
<CheckboxGroup v-model="formMyCheck.triaLevel">
<Checkbox label="一级审理" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="二级审理" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="三级审理" value='3' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div v-if="showSize==4">
<Form :model="formResultText" ref="formResultText" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="落实情况验证结果:" prop="resultText" style="width:100%">
<Input type="textarea" :autosize="{minRows:3,maxRows: 7}" v-model="formResultText.resultText"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="cancelFn">取消</Button>
<Button type="primary" @click="checkOk()" v-show="footerStatue">确定</Button>
</div>
<Modal v-model="modalCheckOk" title="不合格品审理" width="800" :mask-closable="false" :scrollable="true">
<div v-if="showSize==2">
<Form :model="formMyCheck" ref="formMyCheck" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="问题产生原因分析:" prop="causeAnalysis" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.causeAnalysis" :disabled="disabledFlag" style="width: 600px" />
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理结论:" prop="conclusion" style="width:100%">
<CheckboxGroup v-model="formMyCheck.conclusion">
<Checkbox label="返工" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="返修" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="降级使用" value='3' :disabled="disabledFlag"></Checkbox>
<Checkbox label="让步" value='4' :disabled="disabledFlag"></Checkbox>
<Checkbox label="报废" value='5' :disabled="disabledFlag"></Checkbox>
<Checkbox label="通知顾客" value='6' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="纠正措施:" prop="measures" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.measures" :disabled="disabledFlag" style="width: 600px" />
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理级别:" prop="triaLevel" style="width:100%">
<CheckboxGroup v-model="formMyCheck.triaLevel">
<Checkbox label="一级审理" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="二级审理" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="三级审理" value='3' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div v-if="showSize==4">
<Form :model="formResultText" ref="formResultText" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="落实情况验证结果:" prop="resultText" style="width:100%">
<Input type="textarea" :autosize="{minRows:3,maxRows: 7}" v-model="formResultText.resultText" :disabled="disabledFlag" style="width: 600px" />
</FormItem>
</Col>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="cancelFn">取消</Button>
<Button type="primary" @click="checkOk()" v-show="footerStatue">确定</Button>
</div>
</Modal>
<Modal
v-model="ResultModal"
title="测试步骤"
width="800" :scrollable="true">
<div>
{{'第'+this.showSize+'布'}}
{{'id'+this.typeId}}
</div>
<div slot="footer">
<Button @click="cancelFn02">取消</Button>
<Button type="primary" @click="checkOk6">确定</Button>
</div>
<Modal v-model="ResultModal" title="测试步骤" width="800" :scrollable="true">
<div>
{{'第'+this.showSize+'布'}}
{{'id'+this.typeId}}
</div>
<div slot="footer">
<Button @click="cancelFn02">取消</Button>
<Button type="primary" @click="checkOk6">确定</Button>
</div>
</Modal>
<Modal
v-model="modalCheckNo"
title="不合格品审批"
width="800" :scrollable="true">
<br/>
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此不合格品审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<Modal v-model="modalCheckNo" title="不合格品审批" width="800" :scrollable="true">
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此不合格品审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
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 = '终止'
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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 = {
Id: idVal
}
Api.getdetail(param).then((r) => {
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId = r.result.currentRecordId
this.typeId = r.result.currentIndexId
this.showSize = this.typeId + 1
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
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: {}
}
})
},
//获取流程节点
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(){
this.ResultModal = false
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
checkOk6(){
this.ResultModal = false
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)
},
//审批通过
checkOk() {
if(this.typeId==1){
this.$refs['formMyCheck'].validate((valid) => {
// console.log(valid)
if (valid) {
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) {
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 = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
causeAnalysis: this.formMyCheck.causeAnalysis,
conclusion: this.formMyCheck.conclusion,
measures: this.formMyCheck.measures,
triaLevel: this.formMyCheck.triaLevel
}
Id: idVal
}
Api.getdetail(param).then((r) => {
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId = r.result.currentRecordId
this.typeId = r.result.currentIndexId
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('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
} else {
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
})
},
//获取流程节点
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() {
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) => {
// console.log(param)
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
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
} 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
})
}
},
//审批驳回
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
})
},
//审批终止
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: {}
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
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
})
},
// 通过
passFn() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
}else if(this.formMyCheck.radioSp == '通过'){
this.passFn()
}
else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu=3
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<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;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<Modal v-model="modalCheckOk" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="闭环情况" style="width:100%">
<Input v-model="formMyCheck.close_situation" style="width:500px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="闭环情况" style="width:100%">
<Input v-model="formMyCheck.close_situation" style="width:500px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal>
<!-- 订单审里通过form -->
<!-- 订单审里通过form -->
<Modal v-model="modalCheckOk1" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100">
<Row>
<FormItem label="协调结果">
<textarea v-model="formMyCheck.coordinate_results" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="在制品处理意见">
<textarea v-model="formMyCheck.handling_suggestion" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改设计文件">
<Select v-model="formMyCheck.change_design_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改工艺文件">
<Select v-model="formMyCheck.change_process_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否编写临时工艺">
<Select
v-model="formMyCheck.compilation_temporary_process"
placeholder="请选择"
style="width:225px;"
>
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk1 = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
<Form :model="formMyCheck" :label-width="100">
<Row>
<FormItem label="协调结果">
<textarea v-model="formMyCheck.coordinate_results" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="在制品处理意见">
<textarea v-model="formMyCheck.handling_suggestion" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改设计文件">
<Select v-model="formMyCheck.change_design_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改工艺文件">
<Select v-model="formMyCheck.change_process_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否编写临时工艺">
<Select v-model="formMyCheck.compilation_temporary_process" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk1 = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal>
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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.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('加载失败')
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'
}]
}
}
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
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
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)
},
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
}
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) {
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>
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem label="原因:" v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="合格证审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此合格证审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此合格证审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.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 {
}
})
}
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
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() {
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'
}]
}
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
//审批驳回
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('驳回审批成功')
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
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)
},
//审批终止
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('终止审批成功')
} else {
this.$Message.error('加载失败')
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) {
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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
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