报废审核台账

This commit is contained in:
hongchao 2025-02-14 15:17:53 +08:00
parent 0d70716f45
commit 83825b59a1
2 changed files with 135 additions and 82 deletions

View File

@ -0,0 +1,38 @@
import request from '@/utils/request'
// 查询报废台账审核列表
export function getTotalList(query) {
return request({
url: '/material/scrap_apply_details/getTotalList',
method: 'get',
params: query
})
}
// 查询待审核周期和审核金额
export function getTotalPrice(query) {
return request({
url: '/material/scrap_apply_details/getTotalPrice',
method: 'get',
params: query
})
}
// 通过
export function ledgerApprove(data) {
return request({
url: '/material/scrap_apply_details/ledgerApprove',
method: 'post',
data: data,
})
}
// 驳回
export function ledgerReject(data) {
return request({
url: '/material/scrap_apply_details/ledgerReject',
method: 'post',
data: data,
})
}

View File

@ -47,7 +47,6 @@
type="success"
@click="batchPass"
icon="el-icon-check"
v-show="!isView"
size="mini"
:disabled="multiple"
>通过</el-button
@ -59,7 +58,6 @@
type="danger"
@click="batchReject"
icon="el-icon-close"
v-show="!isView"
size="mini"
:disabled="multiple"
>驳回</el-button
@ -67,15 +65,15 @@
</el-col>
<el-col :span="21" style="text-align: right;">
<div style="color: red;">待审核周期{{ reviewPeriod }}</div>
<div style="color: red;">审核费用{{ 999.25 }}</div>
<div style="color: red;">审核费用(万元){{ reviewCost }}</div>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="tableList"
ref="multipleTable"
row-key="id"
ref="multipleTable"
@selection-change="handleSelectionChange"
>
<el-table-column
@ -84,29 +82,53 @@
align="center"
:reserve-selection="true"
/>
<el-table-column label="序号" align="center" width="80" type="index"/>
<el-table-column label="类型名称" align="center" prop="maTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="maName" :show-overflow-tooltip="true"/>
<el-table-column label="到货数量" align="center" prop="arrivalNum" :show-overflow-tooltip="true"/>
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
<el-table-column label="报废费用(万元)" align="center" prop="scrapPrice" :show-overflow-tooltip="true"/>
<el-table-column label="报废类型" align="center" prop="scrapType" :show-overflow-tooltip="true"/>
<el-table-column label="提交人" align="center" prop="submitName" :show-overflow-tooltip="true"/>
<el-table-column label="本次审核周期" align="center" prop="reviewTime" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="180" v-if="!isView">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<el-button size="mini" type="success" @click="pass(scope.row)" v-if="scope.row.status==0">
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
<el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true"/>
<el-table-column label="报废类型" align="center" prop="scrapStyle" :show-overflow-tooltip="true"/>
<el-table-column label="损坏类型" align="center" prop="scrapType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.scrapType==0">{{ '自然损坏' }}</span>
<span v-if="scope.row.scrapType==1">{{ '人为损坏' }}</span>
</template>
</el-table-column>
<el-table-column label="提交人" align="center" prop="createName" :show-overflow-tooltip="true"/>
<el-table-column label="本次审核周期" align="center" prop="month" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" prop="ledgerStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span style="color:#70B603">{{ '待审核'}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> -->
<el-table-column label="操作" align="center" width="180" >
<template slot-scope="scope">
<el-button size="mini" type="success" @click="pass(scope.row)" v-if="scope.row.ledgerStatus==0">
通过
</el-button>
<el-button size="mini" type="danger" @click="reject(scope.row)" v-if="scope.row.status==0">
<el-button size="mini" type="danger" @click="reject(scope.row)" v-if="scope.row.ledgerStatus==0">
驳回
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 驳回弹窗 -->
<el-dialog title="驳回" :visible.sync="confirmShow" width="600px" height="300px" @close="closeCancel">
<div style="width: 100%; height: 80%; display: flex;margin-bottom: 10px;">
@ -128,34 +150,26 @@
</template>
<script>
import { getManufacturerSelect } from "@/api/ma/supplier";
import {
acceptInnerVerifyer,
getPurchaseFileList,
uploadPurchaseFile,
} from "@/api/purchase/goodsAccept";
import { getPartType,partTypeWarehouse,partTypeReject } from '@/api/part/partAccept';
import { getPartTypeCheckInfo } from '@/api/part/partArrived';
import { getTotalList,getTotalPrice,ledgerApprove,ledgerReject } from '@/api/repair/scrapLedgerReview';
export default {
name: "AcceptDetail",
dicts: ["part_task_status"],
data() {
return {
Id: "",
taskId: "",
//
loading: false,
dialogLoading: false,
isView: false,
//
single: true,
//
multiple: true,
total: 0,
//
showSearch: true,
showHouse: false,
ids: [],
infos: [],
idList: [],
taskIds: [],
taskIdList: [],
checkList: [],
//
tableList: [],
@ -164,6 +178,8 @@ export default {
//
queryParams: {
pageNum: 1,
pageSize: 10,
time: null,
keyWord: '',
},
@ -172,10 +188,12 @@ export default {
checkResult: "", //
reviewPeriod: '', //
reviewCost: null, //
};
},
created() {
this.getTopData();
this.getList();
},
@ -202,54 +220,47 @@ export default {
/** 查询列表 */
getList() {
this.loading = true;
this.tableList = [{
maTypeName: '手扶机绞磨',
maName: '123456',
arrivalNum: '100',
scrapNum: '10',
scrapPrice: '100',
scrapType: '1',
submitName: '张三',
reviewTime: '2023-09-01',
status: '0',
remark: '无',
},
{
maTypeName: '手拉葫芦',
maName: '123456',
arrivalNum: '100',
scrapNum: '10',
scrapPrice: '100',
scrapType: '1',
submitName: '李四',
reviewTime: '2023-09-01',
status: '0',
remark: '无',
}]
this.loading = false;
// getPartTypeCheckInfo(this.queryParams).then((response) => {
// this.tableList = response.data.partTypeCheckDetailsList;
// // this.total = response.total;
// this.loading = false;
// });
getTotalList(null).then((response) => {
this.tableList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},
//
getTopData() {
getTotalPrice().then((response) => {
this.reviewPeriod = response.data.month;
this.reviewCost = response.data.totalCost;
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.$refs.multipleTable.clearSelection();
this.queryParams.keyWord = null;
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.reviewPeriod = this.formatDateRange(this.queryParams.time); //
this.queryParams.pageNum = 1;
// this.reviewPeriod = this.formatDateRange(this.queryParams.time); //
this.getTopData();
this.getList();
},
//
handleSelectionChange(selection) {
console.log('111111111',selection)
this.ids = selection;
this.infos = [];
this.idList = [];
this.taskIdList = [];
selection.forEach((item) => {
this.infos.push({id:item.id,partId:item.partId,purchaseNum:item.purchaseNum,taskId:item.taskId});
if (item.idList) {
this.idList = this.idList.concat(item.idList);
}
if (item.taskIdList) {
this.taskIdList = this.taskIdList.concat(item.taskIdList);
}
});
this.single = selection.length != 1;
this.multiple = !selection.length;
@ -261,18 +272,19 @@ export default {
// return;
// }
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
const infos={'idList':this.idList,'taskIdList':this.taskIdList}
this.$modal.confirm('是否确认通过?')
.then(function() {
return partTypeWarehouse(infos)
return ledgerApprove(infos)
}).then(() => {
this.$modal.msgSuccess('入库成功')
this.getTopData();
this.getList()
}).catch(() => {});
},
//
reject(row) {
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
this.checkResult = "不合格";
this.confirmShow = true;
// this.$modal.confirm('')
// .then(function() {
@ -283,18 +295,21 @@ export default {
// }).catch(() => {});
},
//
//
batchPass() {
if(this.infos==0){
if(this.ids.length==0){
this.$modal.msgError("请选择数据");
return;
}
const infos={'idList':this.idList,'taskIdList':this.taskIdList}
console.log('111111111infos',infos)
this.$modal.confirm('是否确认通过?')
.then(() => {
// return partTypeWarehouse(this.infos)
return ledgerApprove(infos)
})
.then(() => {
this.$modal.msgSuccess('通过成功')
this.getTopData();
this.getList()
//
this.$refs.multipleTable.clearSelection();
@ -304,26 +319,26 @@ export default {
//
batchReject() {
if(this.infos==0){
if(this.ids.length==0){
this.$modal.msgError("请选择数据");
return;
}
this.checkResult = "不合格";
this.confirmShow = true;
},
//
confirmCheck() {
let param = {
}
// acceptInnerVerifyer(param).then((response) => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// this.confirmShow = false;
// this.getList();
// this.$refs.multipleTable.clearSelection();
// }
// });
const infos={'idList':this.idList,'taskIdList':this.taskIdList,'rejectReason':this.checkResult}
ledgerReject(infos).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
this.confirmShow = false;
this.getTopData();
this.getList();
this.$refs.multipleTable.clearSelection();
}
});
},
//