修试审核页面联调

This commit is contained in:
jjLv 2024-11-25 14:02:34 +08:00
parent e37a66e623
commit 9b4999fe00
4 changed files with 449 additions and 38 deletions

View File

@ -0,0 +1,387 @@
<template>
<div>
<el-form
:model="maForm"
ref="maForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="退料单位" prop="unitName">
<el-input
v-model="maForm.unitName"
placeholder="请输入退料单位"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<el-form-item label="工程名称" prop="projectName">
<el-input
v-model="maForm.projectName"
placeholder="请输入工程名称"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<el-form-item label="维修单号" prop="repairNum">
<el-input
v-model="maForm.repairNum"
placeholder="请输入维修单号"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
@click="handlePassAll"
>通过</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-close"
size="mini"
@click="handleFailAll"
>驳回</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="equipmentList"
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/>
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="类型名称"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="machineTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计量单位"
align="center"
prop="unitName"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="退料数量"
align="center"
prop="repairNum"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="已修数量"
align="center"
prop="repairedNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="待修数量"
align="center"
prop="waitNum"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div>
{{ scope.row.repairNum - scope.row.repairedNum }}
</div>
</template>
</el-table-column>
<el-table-column
label="管理模式"
align="center"
prop="alNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核状态"
align="center"
prop="status"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div v-if="scope.row.status == '0'" style="color: #e6a23c">
{{ "未审核" }}
</div>
<div v-if="scope.row.status == '1'" style="color: #67c23a">
{{ "已审核" }}
</div>
<div v-if="scope.row.status == '2'" style="color: #f56c6c">
{{ "驳回" }}
</div>
<!-- <div v-else style="color: red;"></div> -->
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
style="margin-bottom: 10px"
type="success"
v-if="scope.row.status == '0'"
@click="handlePass(scope.row)"
>通过
</el-button>
<el-button
size="mini"
type="danger"
@click="handleFail(scope.row)"
v-if="scope.row.status == '0'"
>驳回
</el-button>
<div v-if="scope.row.status != '0'">-</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="maForm.pageNum"
:limit.sync="maForm.pageSize"
@pagination="getTaskInfo"
/>
</div>
</template>
<script>
import { getAuditInfo, auditPass } from "@/api/repair/testExamine";
import { getToken } from "@/utils/auth";
export default {
name: "AddTools",
components: {
// UploadImg,
},
props: {
isEdit: {
type: Boolean,
default: () => {
return false;
},
},
queryTaskId: {
type: [String, Number],
default: () => {
return "";
},
},
queryId: {
type: [String, Number],
default: () => {
return "";
},
},
param: {
type: Object,
default: () => {
return "";
},
},
},
data() {
return {
paramTemp: {},
//ID
taskId: "",
//
loading: true,
total: 0,
//
uniteList: [],
//
projectList: [],
//
equipmentList: [],
passTemp: [],
faliTemp: [],
//
ids: [],
//
single: true,
//
multiple: true,
//
open: false,
rowData: {},
maForm: {
pageNum: 1,
pageSize: 10,
unitName: undefined,
projectName: undefined,
repairNum: undefined,
},
};
},
computed: {},
mounted() {
this.taskId = this.queryTaskId;
this.paramTemp = this.param;
this.getTaskInfo();
},
methods: {
//
selectable(row) {
if (row.status == "0") {
return true;
} else {
return false;
}
},
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.id);
selection.forEach((item) => {
this.passTemp.push({ id: item.id, status: "1",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId, });
});
selection.forEach((item) => {
this.failTemp.push({ id: item.id, status: "2",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId, });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//-
getTaskInfo() {
this.loading = true;
getAuditInfo({ taskId: this.taskId }).then((response) => {
this.maForm = this.paramTemp;
this.equipmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handlePass(row) {
const param = [];
param.push({ id: row.id, status: "1" });
this.$modal
.confirm("是否确认通过所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("通过成功");
})
.catch(() => {});
},
//
handleFail(row) {
const param = [];
param.push({ id: row.id, status: "2",specificationType: row.specificationType,machineTypeName:row.machineTypeName,
unitName:row.unitName,repairNum:row.repairNum,repairedNum:row.repairedNum,typeId:row.typeId,taskId:row.taskId,
});
this.$modal
.confirm("是否确认驳回所选择的数据项?")
.then(function () {
return auditPass(param);
})
.then(() => {
this.getTaskInfo();
this.$modal.msgSuccess("驳回成功");
})
.catch(() => {});
},
//
handlePassAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.passTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
}
this.getTaskInfo();
});
}
},
//
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.failTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
}
this.getTaskInfo();
});
}
},
},
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
.custom-textarea {
width: 300px;
height: 100px;
}
.accept-img {
color: #409eff;
.a-two {
margin-left: 20px;
}
}
.left-tip {
font-size: 16px;
letter-spacing: 1px;
}
</style>

View File

@ -66,21 +66,21 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="success"
plain plain
icon="el-icon-user-solid" icon="el-icon-check"
size="mini" size="mini"
@click="handleAdd" @click="handlePassAll"
>通过 >通过
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success" type="danger"
plain plain
icon="el-icon-close" icon="el-icon-close"
size="mini" size="mini"
@click="handleSendAll" @click="handleFailAll"
>驳回 >驳回
</el-button> </el-button>
</el-col> </el-col>
@ -200,16 +200,16 @@
type="primary" type="primary"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-if="scope.row.status != '2'" v-if="scope.row.status != '2'"
>通过 >审核
</el-button> </el-button>
<el-button <!-- <el-button
size="mini" size="mini"
type="danger" type="danger"
@click="handleDeletePurchase(scope.row)" @click="handleDeletePurchase(scope.row)"
v-if="scope.row.status == '0'" v-if="scope.row.status == '0'"
>驳回 >驳回
</el-button> </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -304,7 +304,8 @@ export default {
leaseApplyDetails: [], leaseApplyDetails: [],
// //
leaseApplyData: {}, leaseApplyData: {},
sendTemp: [], passTemp: [],
faliTemp: [],
}; };
}, },
created() { created() {
@ -313,10 +314,14 @@ export default {
methods: { methods: {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.sendTemp = []; this.passTemp = [];
this.ids = selection.map((item) => item.id); this.failTemp = [];
this.ids = selection.map((item) => item.taskId);
selection.forEach((item) => { selection.forEach((item) => {
this.sendTemp.push({ id: item.id, taskId: item.taskId }); this.passTemp.push({ status: "1",taskId:item.taskId, });
});
selection.forEach((item) => {
this.failTemp.push({ status: "2",taskId:item.taskId, });
}); });
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
@ -359,17 +364,48 @@ export default {
this.queryParams.keyword = ""; this.queryParams.keyword = "";
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 通过按钮操作 */
handleAdd() { handlePassAll() {
this.$emit("addTools"); if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.passTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
}
this.getTaskInfo();
});
}
}, },
/** 驳回按钮操作 */
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条审核数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
auditPass(this.failTemp).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("驳回成功");
}
this.getTaskInfo();
});
}
},
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.$emit("queryTools", row.taskId, row.id, row); this.$emit("queryTools", row.taskId, row.id, row);
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$emit("editTools", row.taskId, row.id); this.$emit("addTools", row.taskId, row.id,row);
}, },
//---- //----

View File

@ -99,7 +99,7 @@
<el-table-column <el-table-column
label="退料数量" label="退料数量"
align="center" align="center"
prop="scrapNum" prop="repairNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
@ -147,7 +147,7 @@
<!-- <div v-else style="color: red;"></div> --> <!-- <div v-else style="color: red;"></div> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <!-- <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -167,7 +167,7 @@
</el-button> </el-button>
<div v-if="scope.row.status != '0'">-</div> <div v-if="scope.row.status != '0'">-</div>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"

View File

@ -18,7 +18,6 @@
:codingTaskId="codingTaskId" :codingTaskId="codingTaskId"
@addTools="addTools" @addTools="addTools"
@editTools="editTools" @editTools="editTools"
@addToolsSuccess="addToolsSuccess"
@queryTools="queryTools" @queryTools="queryTools"
/> />
</div> </div>
@ -27,13 +26,13 @@
<script> <script>
import PageHeaderApply from "@/components/pageHeaderApply"; import PageHeaderApply from "@/components/pageHeaderApply";
import Home from "./component/homeApply.vue"; // import Home from "./component/homeApply.vue"; //
// import AddTools from "./component/addToolsApply.vue"; // import AddTools from "./component/addToolsApply.vue"; //
import QueryTools from "./component/queryToolsApply.vue"; // import QueryTools from "./component/queryToolsApply.vue"; //
export default { export default {
components: { components: {
Home, Home,
PageHeaderApply, PageHeaderApply,
// AddTools, AddTools,
QueryTools, QueryTools,
}, },
data() { data() {
@ -52,24 +51,13 @@ export default {
}, },
methods: { methods: {
/* 新增工机具 */
addTools() {
this.isEdit = false;
this.editTaskId = "";
this.queryTaskId = "";
this.pageContent = "领料申请";
this.isShowComponent = "AddTools";
},
/* 新增成功 */
addToolsSuccess() {
this.isShowComponent = "Home";
},
/* 编辑工机具 */ /* 编辑工机具 */
editTools(taskId, id) { addTools(taskId, id,row) {
this.isEdit = true; this.isEdit = true;
this.pageContent = "领料编辑"; this.pageContent = "审核";
this.editTaskId = taskId; this.queryTaskId = taskId;
this.editId = id; this.queryId = id;
this.param = row;
this.isShowComponent = "AddTools"; this.isShowComponent = "AddTools";
}, },
/* 查询工机具 */ /* 查询工机具 */