|
|
|
|
@ -20,14 +20,32 @@ |
|
|
|
|
> |
|
|
|
|
<template #menu-left="row"> |
|
|
|
|
<!-- <el-button type="primary" @click="handleAdd">需求申报</el-button>--> |
|
|
|
|
<el-button type="primary" @click="addQuantityClick" v-if="permission.addition_quantity_declaration">添加量申报</el-button> |
|
|
|
|
<el-button type="primary" @click="handleApprove" v-if="permission.addition_quantity_batch_audit">批量审核</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="addQuantityClick" |
|
|
|
|
v-if="permission.addition_quantity_declaration" |
|
|
|
|
>添加量申报</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleApprove" |
|
|
|
|
v-if="permission.addition_quantity_batch_audit" |
|
|
|
|
>批量一级审核</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="secondHandleApprove" |
|
|
|
|
v-if="permission.second_addition_quantity_batch_audit" |
|
|
|
|
>批量二级审核</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="warning" @click="pendingReviewFn()">待审核</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="{ row }"> |
|
|
|
|
<el-button type="text" @click="handleView(row)" v-if="permission.addition_quantity_details">详情</el-button> |
|
|
|
|
<el-button type="text" @click="handleView(row)" v-if="permission.addition_quantity_details" |
|
|
|
|
>详情</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
<add-quantity :add-quantity="addQuantity" @closeDialog="closeDialog"></add-quantity> |
|
|
|
|
@ -35,10 +53,22 @@ |
|
|
|
|
<el-dialog append-to-body width="550px" title="审批" v-model="approveDialog"> |
|
|
|
|
<el-form ref="approveForm" :model="approveForm" :rules="approveRules"> |
|
|
|
|
<el-form-item label="审批结果" prop="approvalStatus"> |
|
|
|
|
<el-radio-group v-model="approveForm.approvalStatus" @input="changeType"> |
|
|
|
|
<el-radio-group |
|
|
|
|
v-model="approveForm.approvalStatus" |
|
|
|
|
@input="changeType" |
|
|
|
|
v-if="rowItem.status == 10000" |
|
|
|
|
> |
|
|
|
|
<el-radio :label="10001">审批通过</el-radio> |
|
|
|
|
<el-radio :label="10005">审批不通过</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<el-radio-group |
|
|
|
|
v-model="approveForm.approvalStatus" |
|
|
|
|
@input="changeType" |
|
|
|
|
v-if="rowItem.status == 10001" |
|
|
|
|
> |
|
|
|
|
<el-radio :label="10007">审批通过</el-radio> |
|
|
|
|
<el-radio :label="10008">审批不通过</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="审批意见" prop="approvalMemo"> |
|
|
|
|
<el-input type="textarea" v-model="approveForm.approvalMemo"></el-input> |
|
|
|
|
@ -55,7 +85,11 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, confirmBatch } from '@/api/productionManagement/addRequirements'; |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
confirmBatch, |
|
|
|
|
secondConfirmBatch, |
|
|
|
|
} from '@/api/productionManagement/addRequirements'; |
|
|
|
|
import coatingColumnData from '../../js/coatingColumnData'; |
|
|
|
|
import addQuantity from '../addQuantity.vue'; |
|
|
|
|
import addDialog from '../addDialog.vue'; |
|
|
|
|
@ -65,8 +99,8 @@ export default { |
|
|
|
|
addQuantity, |
|
|
|
|
addDialog, |
|
|
|
|
}, |
|
|
|
|
computed:{ |
|
|
|
|
...mapGetters([ 'permission']), |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -323,6 +357,7 @@ export default { |
|
|
|
|
headerAlign: 'center', |
|
|
|
|
align: 'center', |
|
|
|
|
searchLabelWidth: 50, |
|
|
|
|
width: 120, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
@ -334,10 +369,12 @@ export default { |
|
|
|
|
// { label: '待领取', value: 1 }, |
|
|
|
|
// { label: '已领取', value: 2 }, |
|
|
|
|
// { label: '已过期', value: 3 }, |
|
|
|
|
{ label: '待审核', value: 10000 }, |
|
|
|
|
{ label: '审核通过', value: 10001 }, |
|
|
|
|
{ label: '待一级审核', value: 10000 }, |
|
|
|
|
{ label: '一级审核通过', value: 10001 }, |
|
|
|
|
{ label: '使用中', value: 10002 }, |
|
|
|
|
{ label: '审核不通过', value: 10005 }, |
|
|
|
|
{ label: '一级审核不通过', value: 10005 }, |
|
|
|
|
{ label: '二级审核通过', value: 10007 }, |
|
|
|
|
{ label: '二级审核不通过', value: 10008 }, |
|
|
|
|
{ label: '已完成', value: 10004 }, |
|
|
|
|
{ label: '已超期', value: 10003 }, |
|
|
|
|
{ label: '已关闭', value: 10006 }, |
|
|
|
|
@ -367,7 +404,7 @@ export default { |
|
|
|
|
search: false, |
|
|
|
|
headerAlign: 'center', |
|
|
|
|
align: 'center', |
|
|
|
|
width:160, |
|
|
|
|
width: 160, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
@ -390,7 +427,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
selectionList: [], |
|
|
|
|
query: {}, |
|
|
|
|
|
|
|
|
|
rowItem: {}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -463,16 +500,33 @@ export default { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
// 批量一级审核 |
|
|
|
|
handleApprove() { |
|
|
|
|
if(this.selectionList.length == 0){ |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error('请至少选择一条数据!'); |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let tmp = this.selectionList.find(item => item.status != 10000) |
|
|
|
|
if(tmp){ |
|
|
|
|
this.$message.error('请选择状态为【待审核】的数据') |
|
|
|
|
return |
|
|
|
|
let tmp = this.selectionList.find(item => item.status != 10000); |
|
|
|
|
if (tmp) { |
|
|
|
|
this.$message.error('请选择状态为【待一级审核】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.rowItem = this.selectionList[0]; |
|
|
|
|
this.approveDialog = true; |
|
|
|
|
}, |
|
|
|
|
// 批量二级审核 |
|
|
|
|
secondHandleApprove() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error('请至少选择一条数据!'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let tmp = this.selectionList.find(item => item.status != 10001); |
|
|
|
|
if (tmp) { |
|
|
|
|
this.$message.error('请选择状态为【一级审核通过】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.rowItem = this.selectionList[0]; |
|
|
|
|
|
|
|
|
|
this.approveDialog = true; |
|
|
|
|
}, |
|
|
|
|
submitApprove() { |
|
|
|
|
@ -480,14 +534,27 @@ export default { |
|
|
|
|
console.log('valid==============', valid); |
|
|
|
|
if (valid) { |
|
|
|
|
const ids = this.selectionList.map(item => item.id).join(','); |
|
|
|
|
confirmBatch({ ...{ ids }, ...this.approveForm }).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('审核成功'); |
|
|
|
|
this.approveDialog = false; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (this.rowItem.status === 10000) { |
|
|
|
|
confirmBatch({ ...{ ids }, ...this.approveForm }).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('审核成功'); |
|
|
|
|
this.approveDialog = false; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.rowItem.status === 10001) { |
|
|
|
|
secondConfirmBatch({ ...{ ids }, ...this.approveForm }).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('审核成功'); |
|
|
|
|
this.approveDialog = false; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// this.approveDialog = false; |
|
|
|
|
// this.$refs.crud.toggleSelection(); |
|
|
|
|
// this.onLoad(this.page); |
|
|
|
|
|