bonus-ui/src/views/material/repair/testedInBound/component/home.vue

316 lines
8.1 KiB
Vue
Raw Normal View History

2024-12-12 18:21:08 +08:00
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="关键字" prop="keyword">
<el-input
v-model="queryParams.keyword"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
placeholder="请选择状态"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.repair_end_task_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
2024-12-13 13:12:37 +08:00
<!-- <el-col :span="1.5">
2024-12-12 18:21:08 +08:00
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
2024-12-13 13:12:37 +08:00
</el-col> -->
<el-col :span="1.5">
<el-button
type="success"
plain
size="mini" :disabled="multiple"
2024-12-20 21:08:45 +08:00
@click="handleSuccessAll"
2024-12-13 13:12:37 +08:00
>批量入库
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain :disabled="multiple"
size="mini"
2024-12-20 21:08:45 +08:00
@click="handleFailAll"
2024-12-13 13:12:37 +08:00
>批量驳回
</el-button>
2024-12-12 18:21:08 +08:00
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
2024-12-13 13:12:37 +08:00
<el-table v-loading="loading" :data="testedList" ref="multipleTable" row-key="taskId" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :selectable="selectable"/>
2024-12-12 18:21:08 +08:00
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column label="退料单位" align="center" prop="backUnit" />
<el-table-column label="退料工程" align="center" prop="backPro" />
2024-12-20 21:08:45 +08:00
<el-table-column label="入库单号" align="center" prop="inputCode" />
<el-table-column label="物资类型" align="center" prop="materialType" />
<el-table-column label="维修单号" align="center" prop="repairCode" />
2024-12-12 18:21:08 +08:00
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="状态" align="center" prop="taskStatus" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.repair_end_task_status"
:value="scope.row.taskStatus"
/>
</template>
</el-table-column>
2024-12-20 21:08:45 +08:00
2024-12-12 18:21:08 +08:00
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
style="margin-bottom: 10px"
type="normal"
@click="handleView(scope.row)"
>查看
</el-button>
<el-button
size="mini"
style="margin-bottom: 10px"
type="primary"
2024-12-20 21:08:45 +08:00
2024-12-12 18:21:08 +08:00
@click="handleUpdate(scope.row)"
>入库
</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"
/>
</div>
2024-12-20 21:08:45 +08:00
</template>
2024-12-12 18:21:08 +08:00
<script>
import {
2024-12-13 13:12:37 +08:00
getTestedListApi,repairInputWarehouseApi,rejectWarehouseApi
2024-12-20 21:08:45 +08:00
} from "@/api/repair/testedInBound";
2024-12-12 18:21:08 +08:00
export default {
name: "testedInBound",
dicts: ["repair_end_task_status"],
data() {
return {
// 遮罩层
loading: false,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 查看页面
showView: false,
// 总条数
total: 0,
//二级页面总条数
totalView:0,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
},
queryInBoundInfo:{
pageNum: 1,
pageSize: 10,
},
2024-12-13 13:12:37 +08:00
ids:[],
2024-12-12 18:21:08 +08:00
//修试入库列表
testedList:[],
//审核入库列表
getInBoundInfo:[]
};
},
created() {
2024-12-25 18:02:54 +08:00
if(this.$route.query.code){
this.queryParams.keyWord=this.$route.query.code
}
2024-12-12 18:21:08 +08:00
this.getList();
},
components: {},
2024-12-20 21:08:45 +08:00
methods: {
2024-12-12 18:21:08 +08:00
/** 查询修试入库列表 */
getList() {
this.loading = true;
getTestedListApi(this.queryParams).then((response) => {
this.testedList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord = null;
this.handleQuery();
},
//一级页面审核按钮
handleUpdate(row){
this.$emit("editApply",row.id,row);
},
//一级页面查看按钮
handleView(row){
this.$emit("queryApply",row.id,row);
2024-12-20 21:08:45 +08:00
},
2024-12-13 13:12:37 +08:00
//是否可用勾选框
selectable(row) {
if (row.taskStatus == "1"||row.taskStatus == "2") {
2024-12-13 13:12:37 +08:00
return false;
} else {
return true;
}
2024-12-20 21:08:45 +08:00
},
2024-12-13 13:12:37 +08:00
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => {
let obj = {
agreementId:item.agreementId,
taskId:item.taskId
}
return obj
});
2024-12-13 13:12:37 +08:00
this.single = selection.length != 1;
this.multiple = !selection.length;
},
2024-12-12 18:21:08 +08:00
//批量通过
handleSuccessAll(){
2024-12-13 13:12:37 +08:00
console.log(this.ids)
// repairInputWarehouseApi
let param = {
2024-12-20 21:08:45 +08:00
outTaskList:this.ids
2024-12-13 13:12:37 +08:00
}
this.$modal.confirm("是否确认入库所选择的设备编码?")
.then(function () {
return repairInputWarehouseApi(param);
}).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("入库成功");
this.getList();
}
})
.catch(() => {});
2024-12-20 21:08:45 +08:00
},
2024-12-12 18:21:08 +08:00
//批量不通过
handleFailAll(){
2024-12-20 21:08:45 +08:00
console.log(this.ids)
2024-12-13 13:12:37 +08:00
let param = {
outTaskList:this.ids
2024-12-13 13:12:37 +08:00
}
this.$modal.confirm("是否确认驳回所选择的设备编码?")
.then(function () {
return rejectWarehouseApi(param);
}).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("驳回成功");
this.getList();
}
})
2024-12-20 21:08:45 +08:00
.catch(() => {});
2024-12-12 18:21:08 +08:00
},
handleExport() {
// this.download(
// "/material/wh_house_info/export",
// {
// ...this.queryParams,
// },
// `修饰入库_${new Date().getTime()}.xlsx`
// );
},
},
};
</script>
<style lang="scss" scoped>
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::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;
}
}
2024-12-20 21:08:45 +08:00
</style>