验收管理模式

This commit is contained in:
jjLv 2024-11-15 17:37:34 +08:00
parent f6bad9b43d
commit 499dd3fe78
1 changed files with 633 additions and 456 deletions

View File

@ -1,8 +1,19 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="类型规格:" prop="typeId">
<el-select v-model="queryParams.typeId" placeholder="请选择类型规格" clearable>
<el-select
v-model="queryParams.typeId"
placeholder="请选择类型规格"
clearable
>
<el-option
v-for="dict in materialModelList"
:key="dict.value"
@ -26,14 +37,22 @@
v-model="queryParams.productionTime"
placeholder="请选择出厂日期"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime">
type="datetime"
>
</el-date-picker>
</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-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>
@ -48,50 +67,140 @@
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success" @click="batchPass"
icon="el-icon-check" v-show="!isView"
size="mini" :disabled="multiple"
>合格</el-button>
type="success"
@click="batchPass"
icon="el-icon-check"
v-show="!isView"
size="mini"
:disabled="multiple"
>合格</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger" @click="batchReject"
icon="el-icon-close" v-show="!isView"
size="mini" :disabled="multiple"
>不合格</el-button>
type="danger"
@click="batchReject"
icon="el-icon-close"
v-show="!isView"
size="mini"
:disabled="multiple"
>不合格</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="typeId" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" v-if="!isView"/>
<el-table
v-loading="loading"
:data="tableList"
ref="multipleTable"
row-key="typeId"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
v-if="!isView"
/>
<el-table-column label="序号" align="center" width="80" type="index">
</el-table-column>
<el-table-column label="物资名称" align="center" prop="maTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true"/>
<el-table-column label="购置单价(元含税)" align="center" prop="purchaseTaxPrice" :show-overflow-tooltip="true"/>
<el-table-column label="购置单价(元不含税)" align="center" prop="purchasePrice" :show-overflow-tooltip="true"/>
<el-table-column
label="物资名称"
align="center"
prop="maTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="购置单价(元含税)"
align="center"
prop="purchaseTaxPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="购置单价(元不含税)"
align="center"
prop="purchasePrice"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="供应商" align="center" prop="supplierName" /> -->
<el-table-column label="是否未固定资产" align="center" prop="fixCodeStr" :show-overflow-tooltip="true"/>
<el-table-column label="出厂日期" align="center" prop="productionTime" :show-overflow-tooltip="true"/>
<el-table-column label="相关配套资料" align="center" prop="" :show-overflow-tooltip="true">
<el-table-column
label="是否未固定资产"
align="center"
prop="fixCodeStr"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出厂日期"
align="center"
prop="productionTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="相关配套资料"
align="center"
prop=""
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<div style="color: rgb(2, 167, 240);cursor: pointer;" @click="openFileDialog(scope.row)">报告管理</div>
<div
style="color: rgb(2, 167, 240); cursor: pointer"
@click="openFileDialog(scope.row)"
>
报告管理
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
<el-table-column
label="状态"
align="center"
prop="status"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.purchase_task_status" :value="scope.row.status"/>
<dict-tag
:options="dict.type.purchase_task_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="验收结论" align="center" prop="checkResult" :show-overflow-tooltip="true"/>
<el-table-column
label="验收结论"
align="center"
prop="checkResult"
: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)">
@ -112,17 +221,45 @@
@pagination="getList"
/> -->
<el-dialog title="报告管理" :visible.sync="open" width="900px" append-to-body>
<el-table v-loading="dialogLoading" :data="fileDataList" width="100%" height="350px">
<el-dialog
title="报告管理"
:visible.sync="open"
width="900px"
append-to-body
>
<el-table
v-loading="dialogLoading"
:data="fileDataList"
width="100%"
height="350px"
>
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column label="报告类型" align="center" prop="dictLabel" :show-overflow-tooltip="true"/>
<el-table-column label="文件名称" align="center" prop="name" :show-overflow-tooltip="true"/>
<el-table-column label="类型名称" align="center" :show-overflow-tooltip="true">
<el-table-column
label="报告类型"
align="center"
prop="dictLabel"
:show-overflow-tooltip="true"
/>
<el-table-column
label="文件名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column
label="类型名称"
align="center"
:show-overflow-tooltip="true"
>
<template>
<div>{{ this.rowData.maTypeName }}</div>
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" :show-overflow-tooltip="true">
<el-table-column
label="规格型号"
align="center"
:show-overflow-tooltip="true"
>
<template>
<div>{{ this.rowData.typeName }}</div>
</template>
@ -131,7 +268,13 @@
<el-table-column label="截止有效期" align="center" prop="orgName" :show-overflow-tooltip="true"/> -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<!-- <el-upload ref="upload" :limit="1" :headers="upload.headers" v-show="!isView"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess" :auto-upload="true"
@ -141,12 +284,16 @@
</el-button>
</el-upload> -->
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url" style="margin-left: 10px;">
<el-button
size="mini"
type="text"
@click="picturePreview(scope.row)"
v-if="scope.row.url"
style="margin-left: 10px"
>
查看
</el-button>
</div>
</template>
</el-table-column>
</el-table>
@ -159,12 +306,26 @@
<!-- 验收弹窗 -->
<el-dialog :visible.sync="confirmShow" width="500px" height="300px">
<div style="width: 100%;height: 80%;display: flex;">
<div style="width: 100%; height: 80%; display: flex">
<div>验收结论</div>
<el-input type="textarea" :rows="2" placeholder="请输入结论" v-model="checkResult" maxlength="100">
<el-input
type="textarea"
:rows="2"
placeholder="请输入结论"
v-model="checkResult"
maxlength="100"
>
</el-input>
</div>
<div style="width: 100%;height: 20%;display: flex;justify-content: flex-end;align-items: center;">
<div
style="
width: 100%;
height: 20%;
display: flex;
justify-content: flex-end;
align-items: center;
"
>
<el-button type="primary" @click="confirmCheck">确认</el-button>
<el-button size="mini" @click="confirmShow = false">取消</el-button>
</div>
@ -175,16 +336,21 @@
<script>
import { getDeviceType } from "@/api/ma/device";
import { getManufacturerSelect } from "@/api/ma/supplier";
import { getPurchaseDetailsList,acceptInnerVerifyer,getPurchaseFileList,uploadPurchaseFile } from "@/api/purchase/goodsAccept";
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
import {
getPurchaseDetailsList,
acceptInnerVerifyer,
getPurchaseFileList,
uploadPurchaseFile,
} from "@/api/purchase/goodsAccept";
import { downloadFile } from "@/utils/download";
import { getToken } from "@/utils/auth";
export default {
name: "GoodsAcceptDetail",
dicts: ['purchase_task_status'],
dicts: ["purchase_task_status"],
data() {
return {
Id:'',
taskId:'',
Id: "",
taskId: "",
//
loading: false,
dialogLoading: false,
@ -230,42 +396,41 @@
taskStatus: "", //31
checkResult: "",
//
dialogImageUrl: '',
dialogImageUrl: "",
dialogVisible: false,
//
upload: {
//
headers: { Authorization: 'Bearer ' + getToken() },
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
url: process.env.VUE_APP_BASE_API + "/file/upload",
},
};
},
mounted() {
const taskId = this.$route.query && this.$route.query.taskId
const Id = this.$route.query && this.$route.query.Id
const isView = this.$route.query && this.$route.query.isView
const taskId = this.$route.query && this.$route.query.taskId;
const Id = this.$route.query && this.$route.query.Id;
const isView = this.$route.query && this.$route.query.isView;
this.taskId = taskId;
this.Id = Id;
if(isView=='true'){
if (isView == "true") {
this.isView = true;
} else {
this.isView = false;
}
this.getDeviceType()
this.getDeviceType();
// this.getSupplierList()
console.log(this.isView)
this.getList()
console.log(this.isView);
this.getList();
},
methods: {
//
jumpList() {
const obj = { path: '/purchase/goodsAccept' }
this.$tab.closeOpenPage(obj)
const obj = { path: "/purchase/goodsAccept" };
this.$tab.closeOpenPage(obj);
},
getDeviceType() {
getDeviceType({level:4,skipPermission:1}).then(response => {
getDeviceType({ level: 4, skipPermission: 1 }).then((response) => {
let matModelRes = response.data;
this.materialModelList = matModelRes.map((item) => {
return {
@ -276,7 +441,7 @@
});
},
getSupplierList() {
getManufacturerSelect().then(response => {
getManufacturerSelect().then((response) => {
let arrRes = response.rows;
this.supplierList = arrRes.map((item) => {
return {
@ -289,15 +454,15 @@
/** 查询列表 */
getList() {
this.loading = true;
this.queryParams.id=this.Id
this.queryParams.taskId=this.taskId
this.queryParams.taskStatus=2
this.queryParams.statusList=[2,12]
getPurchaseDetailsList(this.queryParams).then(response => {
this.queryParams.id = this.Id;
this.queryParams.taskId = this.taskId;
this.queryParams.taskStatus = 2;
this.queryParams.statusList = [2, 12];
getPurchaseDetailsList(this.queryParams).then((response) => {
this.tableList = response.data.purchaseCheckDetailsList;
this.tableList.forEach((item) => {
item.fixCodeStr = this.fixCodeList[Number(item.fixCode)]
})
item.fixCodeStr = this.fixCodeList[Number(item.fixCode)];
});
// this.total = response.total;
this.loading = false;
});
@ -315,113 +480,120 @@
},
//
handleSelectionChange(selection) {
this.ids = selection
this.single = selection.length != 1
this.multiple = !selection.length
this.ids = selection;
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//
pass(row) {
this.taskStatus='3';
this.taskStatus = "3";
this.checkResult = "合格";
let obj = {
taskId: row.taskId,
typeId: row.typeId,
status: this.taskStatus,
checkResult:this.checkResult
}
this.checkList=[]
this.checkList.push(obj)
checkResult: this.checkResult,
};
this.checkList = [];
this.checkList.push(obj);
this.confirmShow = true;
},
//
reject(row) {
this.taskStatus='1';
this.taskStatus = "1";
this.checkResult = "不合格";
let obj = {
taskId: row.taskId,
typeId: row.typeId,
status: this.taskStatus,
checkResult:this.checkResult
}
this.checkList=[]
this.checkList.push(obj)
checkResult: this.checkResult,
};
this.checkList = [];
this.checkList.push(obj);
this.confirmShow = true;
},
//
batchPass() {
this.taskStatus='3';
this.taskStatus = "3";
this.checkResult = "合格";
this.checkList=[]
this.checkList=this.ids.map(item=>{
this.checkList = [];
this.checkList = this.ids.map((item) => {
let obj = {
taskId: item.taskId,
typeId: item.typeId,
status: this.taskStatus,
checkResult:this.checkResult
}
return obj
})
checkResult: this.checkResult,
managerType: item.managerType,
};
return obj;
});
this.confirmShow = true;
},
//
batchReject() {
this.taskStatus='1';
this.taskStatus = "1";
this.checkResult = "不合格";
this.checkList=[]
this.checkList=this.ids.map(item=>{
this.checkList = [];
this.checkList = this.ids.map((item) => {
let obj = {
taskId: item.taskId,
typeId: item.typeId,
status: this.taskStatus,
checkResult:this.checkResult
}
return obj
})
checkResult: this.checkResult,
managerType: item.checkList,
};
return obj;
});
this.confirmShow = true;
},
//
confirmCheck() {
this.checkList.forEach(item=>{
item.checkResult=this.checkResult
})
console.log(this.checkList)
acceptInnerVerifyer(this.checkList).then(response => {
this.checkList.forEach((item) => {
item.checkResult = this.checkResult;
});
console.log(this.checkList);
acceptInnerVerifyer(this.checkList).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('验收成功')
this.$modal.msgSuccess("验收成功");
this.confirmShow = false;
this.getList()
this.$refs.multipleTable.clearSelection()
this.getList();
this.$refs.multipleTable.clearSelection();
}
});
},
//
openFileDialog(row) {
this.rowData = row;
this.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:""},
this.fileDataList = [
{ dictLabel: "合格证", fileType: "0", name: "", url: "" },
{ dictLabel: "型式试验报告", fileType: "1", name: "", url: "" },
{ dictLabel: "出厂检测报告", fileType: "2", name: "", url: "" },
{ dictLabel: "第三方监测报告", fileType: "3", name: "", url: "" },
{dictLabel:"其他报告",fileType:"4",name:"",url:""}]
this.getFileData()
this.open=true
{ dictLabel: "其他报告", fileType: "4", name: "", url: "" },
];
this.getFileData();
this.open = true;
},
//
getFileData() {
let param = {
modelId: this.rowData.typeId,
taskType: 0,
taskId:this.rowData.taskId
}
getPurchaseFileList(param).then((response) => {
taskId: this.rowData.taskId,
};
getPurchaseFileList(param)
.then((response) => {
if (response.rows.length > 0) {
response.rows.forEach(item=>{
let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
})
response.rows.forEach((item) => {
let index = this.fileDataList.findIndex(
(v) => v.fileType == item.fileType
);
this.fileDataList[index].name = item.name;
this.fileDataList[index].url = item.url;
});
}
}).catch(() => {
})
.catch(() => {});
},
//
beforeFileUpload(row) {
@ -432,40 +604,45 @@
handleFileSuccess(response, file, fileList) {
if (response.code == 200) {
let param = {
"taskId": this.taskId,
"taskType": "0",
"name": response.data.name,
"url": response.data.url,
"modelId": this.rowData.typeId,
"fileType": this.rowData.fileType,
}
console.log(param)
uploadPurchaseFile(param).then((response) => {
this.$modal.msgSuccess('上传成功')
this.getFileData()
}).catch(() => {
this.$modal.msgError('上传失败')
taskId: this.taskId,
taskType: "0",
name: response.data.name,
url: response.data.url,
modelId: this.rowData.typeId,
fileType: this.rowData.fileType,
};
console.log(param);
uploadPurchaseFile(param)
.then((response) => {
this.$modal.msgSuccess("上传成功");
this.getFileData();
})
.catch(() => {
this.$modal.msgError("上传失败");
});
}
},
//
picturePreview(file) {
this.dialogImageUrl = file.url;
const parts = file.name.split('.');
const parts = file.name.split(".");
const extension = parts.pop();
if(extension === 'doc'||extension === 'docx'||extension === 'pdf'){
if (extension === "doc" || extension === "docx" || extension === "pdf") {
const windowName = file.name;
window.open(file.url,windowName)
window.open(file.url, windowName);
} else {
this.dialogVisible = true
this.dialogVisible = true;
}
},
/** 导出按钮操作 */
handleExport() {
this.download('/material/purchase_check_info/exportDetails',{taskId:this.taskId},`新购到货详情_${new Date().getTime()}.xlsx`)
this.download(
"/material/purchase_check_info/exportDetails",
{ taskId: this.taskId },
`新购到货详情_${new Date().getTime()}.xlsx`
);
},
},
}
};
</script>
<style lang="scss" scoped>