添加量申报增加二级审核

dev-scheduling
zhangdi 4 weeks ago
parent 934b5fe63d
commit dface4b25a
  1. 9
      src/api/productionManagement/addRequirements.js
  2. 93
      src/views/productionManagement/components/coatingMater/addRequirements.vue

@ -66,3 +66,12 @@ export const getWorkCenter = () =>{
})
}
//二级审核通过 /order/plateGoodsApply/secondConfirmBatch
export const secondConfirmBatch = (row) =>{
return request({
url:'/blade-desk/order/plateGoodsApply/secondConfirmBatch',
method:'post',
data:row
})
}

@ -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';
@ -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 },
@ -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) {
this.$message.error('请至少选择一条数据!');
return
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 != 10000)
let tmp = this.selectionList.find(item => item.status != 10001);
if (tmp) {
this.$message.error('请选择状态为【待审核】的数据')
return
this.$message.error('请选择状态为【一级审核通过】的数据');
return;
}
this.rowItem = this.selectionList[0];
this.approveDialog = true;
},
submitApprove() {
@ -480,6 +534,7 @@ export default {
console.log('valid==============', valid);
if (valid) {
const ids = this.selectionList.map(item => item.id).join(',');
if (this.rowItem.status === 10000) {
confirmBatch({ ...{ ids }, ...this.approveForm }).then(res => {
if (res.data.code === 200) {
this.$message.success('审核成功');
@ -488,6 +543,18 @@ export default {
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);

Loading…
Cancel
Save