相关配套文件

This commit is contained in:
hongchao 2025-01-10 15:40:24 +08:00
parent 6a3da83a4c
commit 02485efff3
6 changed files with 294 additions and 108 deletions

View File

@ -53,3 +53,12 @@ export function deletePartInfo(data) {
data: data,
})
}
//根据任务id查询报告附件
export function getPartTypeFileList(query) {
return request({
url: '/material/part_arrived/getPartFilelist',
method: 'get',
params: query
})
}

View File

@ -8,9 +8,9 @@
v-show="showSearch"
label-width="90px"
>
<el-form-item label="类型规格:" prop="typeId">
<el-form-item label="类型规格:" prop="partId">
<el-select
v-model="queryParams.typeId"
v-model="queryParams.partId"
placeholder="请选择类型规格"
clearable
>
@ -36,8 +36,8 @@
<el-date-picker
v-model="queryParams.productionTime"
placeholder="请选择出厂日期"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
value-format="yyyy-MM-dd"
type="date"
>
</el-date-picker>
</el-form-item>
@ -154,6 +154,12 @@
prop="supplierName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出厂日期"
align="center"
prop="productionTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
@ -179,10 +185,6 @@
</el-table-column>
</el-table>
<!-- 验收弹窗 -->
<el-dialog title="验收" :visible.sync="confirmShow" width="600px" height="300px">
<div style="width: 100%; height: 80%; display: flex;margin-bottom: 10px;">
@ -204,10 +206,8 @@
</template>
<script>
import { getDeviceType } from "@/api/ma/device";
import { getManufacturerSelect } from "@/api/ma/supplier";
import {
getPurchaseDetailsList,
acceptInnerVerifyer,
getPurchaseFileList,
uploadPurchaseFile,
@ -260,7 +260,7 @@ export default {
queryParams: {
// pageNum: 1,
// pageSize: 10,
typeId: undefined,
partId: undefined,
supplierId: undefined,
productionTime: undefined,
},

View File

@ -298,7 +298,7 @@
</template>
<script>
import { getPurchaseList, acceptOuterVerify, getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
import { getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
import { getListNewBuy } from '@/api/part/partArrived';
import { passAll,rejectAll } from '@/api/part/partAccept';
import { downloadFile } from '@/utils/download'

View File

@ -183,8 +183,8 @@
prop="bmFileInfos"
>
<template slot-scope="scope">
<div style="color: #02A7F0;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==1">报告管理</div>
<div style="color: #02A7F0;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==1">报告管理</div>
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
@ -217,15 +217,14 @@
<el-table :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" :show-overflow-tooltip="true">
<template>
<div>{{this.rowData.maTypeName}}</div>
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" :show-overflow-tooltip="true">
<template>
<div>{{this.rowData.typeName}}</div>
<div>{{this.rowData.partName}}</div>
</template>
</el-table-column>
<!-- <el-table-column label="报告日期" align="center" prop="orgName" :show-overflow-tooltip="true"/>
@ -233,16 +232,17 @@
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: space-between;">
<el-upload ref="upload" :limit="3" :headers="upload.headers"
<el-upload ref="upload" :headers="upload.headers"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess" :auto-upload="true"
:on-success="(response, file, fileList) => handleFileSuccess(scope.row, response, file, fileList)" :auto-upload="true"
:before-upload="(file) => beforeUpload(scope.row, file)"
>
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
上传
</el-button>
</el-upload>
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url" style="margin-left: 20px;">
<el-button size="mini" type="text" @click="picturePreviewFile(scope.row)" v-if="scope.row.fileListTemp!=0" style="margin-left: 20px;">
查看
</el-button>
</div>
@ -254,25 +254,36 @@
</el-dialog>
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
<el-dialog :visible.sync="dialogVisible" width="800px" >
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
<!-- 文件查看列表 -->
<el-dialog title="文件列表" :visible.sync="dialogVisibleFile" width="500px" height="500px" >
<el-table :data="fileListInfo" width="100%" height="350px">
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="文件名称" align="center" prop="name" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" >
<template slot-scope="scope">
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url" >
查看
</el-button>
<el-button size="mini" type="text" @click="pictureDelete(scope.row,scope.$index)" v-if="scope.row.url" style="color:red">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import {
getPurchaseCheckInfo,
equipmentTypeTree,
addPurchaseCheckInfo,
updatePurchaseCheckInfo,
} from '@/api/purchase/goodsArrived';
import { getTypeTree,addPartInfo,getPartTypeCheckInfo,updatePartInfo } from '@/api/part/partArrived';
import { getTypeTree,addPartInfo,getPartTypeCheckInfo,updatePartInfo,getPartTypeFileList } from '@/api/part/partArrived';
import { getListFacturer } from '@/api/ma/supplier';
import { getToken } from '@/utils/auth'
import { uploadPurchaseFile,getPurchaseFileList } from "@/api/purchase/goodsAccept";
// import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -331,15 +342,17 @@ export default {
open: false,
rowData:{},
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:""},
{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]},
],
fileListInfo: [],
//
dialogImageUrl: '',
dialogVisible: false,
dialogVisibleFile: false,
//
upload: {
//
@ -394,6 +407,7 @@ export default {
},
deviceType: [],
propsKey: 1000,
fileId: '',
// taxRate:0,
}
},
@ -411,22 +425,22 @@ export default {
watch: {
},
mounted() {
async mounted() {
if (this.isEdit) {
console.log('isEdit',this.isEdit)
this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo()
await this.getTaskInfo()
}
this.supplierInfoList()
this.equipmentType()
await this.supplierInfoList()
await this.equipmentType()
},
methods: {
//
taxRateChange(val){
this.maForm.taxRate = val.replace(/[^\d.]/g,'')
this.equipmentList.forEach(item=>{
if(item.status==1||item.status==12){
if(item.status==0){
item.purchasePrice = ((item.purchaseTaxPrice/(100 + Number(this.maForm.taxRate)))*100).toFixed(10)
}
})
@ -529,6 +543,7 @@ export default {
obj.purchaseTaxPrice = 0
obj.purchaseNum = 1
obj.status = 0
obj.isExitFile = '0',
obj.bmFileInfos=[]
tempList.push(obj);
break
@ -645,14 +660,15 @@ export default {
}
},
//
openFileDialog(row){
async openFileDialog(row) {
console.log('1111111',row)
this.rowData = row;
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:""}]
if (this.taskId == "") {
this.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]}]
// console.log(this.rowData)
// console.log(this.rowData.bmFileInfos)
if(this.rowData.bmFileInfos.length>0){
@ -660,26 +676,94 @@ export default {
let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
this.fileDataList[index].fileList.push({
"name": item.name,
"url": item.url,
})
this.fileDataList[index].fileListTemp.push({
"name": item.name,
"url": item.url,
})
})
}
} else {
this.getFileData()
}
this.open=true
},
getFileData(){
let param = {
modelId:this.rowData.typeId,
taskType:0,
taskId:this.rowData.taskId
}
getPurchaseFileList(param).then((response) => {
if(response.rows.length>0){
response.rows.forEach(item=>{
this.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]}]
if (this.rowData.bmFileInfos == null) {
await this.getFileData()
if (this.rowData.bmFileInfos.length > 0) {
this.rowData.bmFileInfos.forEach(item=>{
let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
this.fileDataList[index].fileList.push({
"name": item.name,
"url": item.url,
})
this.fileDataList[index].fileListTemp.push({
"name": item.name,
"url": item.url,
})
})
}
} else {
if(this.rowData.bmFileInfos.length>0){
this.rowData.bmFileInfos.forEach(item=>{
let index = this.fileDataList.findIndex(v=>v.fileType==item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
this.fileDataList[index].fileList.push({
"name": item.name,
"url": item.url,
})
this.fileDataList[index].fileListTemp.push({
"name": item.name,
"url": item.url,
})
})
}
}
}
this.open=true
},
async getFileData(){
let param = {
modelId:this.rowData.partId,
taskType:13,
taskId:this.rowData.taskId
}
this.rowData.bmFileInfos = []
await getPartTypeFileList(param).then((response) => {
if(response.data.length>0){
response.data.forEach(item=>{
let index = this.fileDataList.findIndex(v => v.fileType == item.fileType)
item.fileDetailList.forEach(item2=>{
// this.fileDataList[index].fileList.push({
// name:item2.name,
// url:item2.url
// })
// this.fileDataList[index].fileListTemp.push({
// name:item2.name,
// url:item2.url
// })
const obj = {
"taskId": this.taskId,
"taskType": "13",
"name": item2.name,
"url": item2.url,
"modelId": this.rowData.partId,
"fileType": item2.fileType,
}
this.rowData.bmFileInfos.push(obj)
console.log('77777777',this.rowData)
})
})
}
}).catch(() => {
})
@ -687,19 +771,36 @@ export default {
beforeFileUpload(row){
this.rowData.fileType=row.fileType;
},
beforeUpload(row, file) {
row.fileList.push(file);
console.log('6666666',row.fileList)
if (row.fileList.length > 3) {
this.$message.warning('最多只能上传三张图片');
//
row.fileList.pop();
return false; //
}
return true; //
},
//
handleFileSuccess(response, file, fileList) {
handleFileSuccess(row,response, file, fileList) {
if (response.code == 200) {
if (this.taskId == "") {//
row.fileListTemp.push({
"name": response.data.name,
"url": response.data.url,
})
// console.log(response)
// console.log(this.rowData)
// console.log(this.rowData.bmFileInfos)
let obj = {
"taskId": this.taskId,
"taskType": "0",
"taskType": "13",
"name": response.data.name,
"url": response.data.url,
"modelId": this.rowData.typeId,
"modelId": this.rowData.partId,
"fileType": this.rowData.fileType,
// "dictLabel": this.rowData.dictLabel,
}
@ -720,24 +821,58 @@ export default {
}
} else {//
let param = {
"taskId": this.taskId,
"taskType": "0",
row.fileListTemp.push({
"name": response.data.name,
"url": response.data.url,
"modelId": this.rowData.typeId,
})
let obj = {
"taskId": this.taskId,
"taskType": "13",
"name": response.data.name,
"url": response.data.url,
"modelId": this.rowData.partId,
"fileType": this.rowData.fileType,
// "dictLabel": this.rowData.dictLabel,
}
uploadPurchaseFile(param).then((response) => {
this.$modal.msgSuccess('上传成功')
this.getFileData()
}).catch(() => {
this.$modal.msgError('上传失败')
})
//
let index = this.fileDataList.findIndex(v=>v.fileType==this.rowData.fileType)
this.fileDataList[index].name = response.data.name
this.fileDataList[index].url = response.data.url
//-
if(this.rowData.bmFileInfos.length>0){
let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
if(index2>-1){//-
this.rowData.bmFileInfos.splice(index2,0,obj)
}else{//-
this.rowData.bmFileInfos.push(obj)
}
}else{
this.rowData.bmFileInfos.push(obj)
}
// uploadPurchaseFile(param).then((response) => {
// this.$modal.msgSuccess('')
// }).catch(() => {
// this.$modal.msgError('')
// })
}
}
},
picturePreviewFile(row) {
row.fileList = []
row.fileListTemp.forEach(item=>{
row.fileList.push({
"name": item.name,
"url": item.url,
})
})
this.fileId = row.fileType
this.fileListInfo = row.fileListTemp
this.dialogVisibleFile = true
},
//
picturePreview(file) {
this.dialogImageUrl = file.url;
@ -751,6 +886,25 @@ export default {
}
},
//
pictureDelete(row, id) {
let index = id
this.fileListInfo = this.fileListInfo.filter(item => item.url !== row.url);
this.fileDataList[this.fileId].fileList = this.fileDataList[this.fileId].fileList.filter(item => item.url !== row.url);
this.fileDataList[this.fileId].fileListTemp = this.fileDataList[this.fileId].fileListTemp.filter(item => item.url !== row.url);
let bmFiles = []
this.rowData.bmFileInfos.forEach((item)=>{
if (item.fileType != this.fileId) {
bmFiles.push(item)
}else{
if (item.url!= row.url) {
bmFiles.push(item)
}
}
})
this.rowData.bmFileInfos = bmFiles;
},
/** 删除按钮操作 */
handleDelete(row) {
// console.log(row.id)

View File

@ -368,14 +368,8 @@
<script>
import {
getPurchaseCheckInfo,
getAcceptanceForm,
purchaseCheckInfoRemove,
getNoticePeople,
getListUnSelected,
addNoticeUser,
bmNoticeInfo,
delPeople,
} from "@/api/purchase/goodsArrived";
import { getListNewBuy,deletePartInfo } from '@/api/part/partArrived';
export default {

View File

@ -67,8 +67,8 @@
prop=""
>
<template slot-scope="scope">
<div style="color: #02A7F0;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==1">报告管理</div>
<div style="color: #02A7F0;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==1">报告管理</div>
<div style="color: red;cursor: pointer;" @click="openFileDialog(scope.row)" v-if="scope.row.isExitFile==0">报告管理</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
@ -83,7 +83,6 @@
<el-table :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">
<template>
<div>{{this.rowData.maTypeName}}</div>
@ -91,14 +90,14 @@
</el-table-column>
<el-table-column label="规格型号" align="center" :show-overflow-tooltip="true">
<template>
<div>{{this.rowData.typeName}}</div>
<div>{{this.rowData.partName}}</div>
</template>
</el-table-column>
<!-- <el-table-column label="报告日期" align="center" prop="orgName" :show-overflow-tooltip="true"/>
<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: space-between;">
<div style="display: flex;align-items: center;justify-content: center;">
<!-- <el-upload ref="upload" :limit="1" :headers="upload.headers"
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess" :auto-upload="true"
@ -108,7 +107,7 @@
</el-button>
</el-upload> -->
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url">
<el-button size="mini" type="text" @click="picturePreviewFile(scope.row)" v-if="scope.row.fileListTemp!=0">
查看
</el-button>
</div>
@ -124,15 +123,27 @@
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
<!-- 文件查看列表 -->
<el-dialog title="文件列表" :visible.sync="dialogVisibleFile" width="500px" height="500px" >
<el-table :data="fileListInfo" width="100%" height="350px">
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="文件名称" align="center" prop="name" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" >
<template slot-scope="scope">
<el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.url" >
查看
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
// import {
// getPartTypeCheckInfo
// } from '@/api/purchase/goodsArrived'
import { getPartTypeCheckInfo } from '@/api/part/partArrived';
import { uploadPurchaseFile,getPurchaseFileList } from "@/api/purchase/goodsAccept";
import { getPartTypeCheckInfo,getPartTypeFileList } from '@/api/part/partArrived';
import { uploadPurchaseFile, } from "@/api/purchase/goodsAccept";
import { getToken } from '@/utils/auth'
export default {
name: 'QueryTools',
@ -191,6 +202,8 @@ export default {
//
dialogImageUrl: '',
dialogVisible: false,
dialogVisibleFile: false,
fileListInfo:[],
}
},
computed: {
@ -217,26 +230,34 @@ export default {
//
openFileDialog(row){
this.rowData=row;
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.fileDataList = [{dictLabel:"合格证",fileType:"0",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"型式试验报告",fileType:"1",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"出厂检测报告",fileType:"2",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"第三方监测报告",fileType:"3",name:"",url:"",fileList:[],fileListTemp:[]},
{dictLabel:"其他",fileType:"4",name:"",url:"",fileList:[],fileListTemp:[]}]
this.getFileData()
this.open=true
},
getFileData(){
let param = {
modelId:this.rowData.typeId,
taskType:0,
modelId:this.rowData.partId,
taskType:13,
taskId:this.rowData.taskId
}
getPurchaseFileList(param).then((response) => {
if(response.rows.length>0){
response.rows.forEach(item=>{
getPartTypeFileList(param).then((response) => {
if(response.data.length>0){
response.data.forEach(item=>{
let index = this.fileDataList.findIndex(v => v.fileType == item.fileType)
this.fileDataList[index].name = item.name
this.fileDataList[index].url = item.url
item.fileDetailList.forEach(item2=>{
this.fileDataList[index].fileList.push({
name:item2.name,
url:item2.url
})
this.fileDataList[index].fileListTemp.push({
name:item2.name,
url:item2.url
})
})
})
}
}).catch(() => {
@ -296,6 +317,13 @@ export default {
}
}
},
picturePreviewFile(row) {
this.fileListInfo = row.fileListTemp
this.dialogVisibleFile = true
},
//
picturePreview(file) {
this.dialogImageUrl = file.url;
@ -308,6 +336,7 @@ export default {
this.dialogVisible = true
}
},
/** 导出按钮操作 */
handleExport() {
this.download('/material/part_arrived/exportDetails',{taskId:this.taskId},`配件到货详情_${new Date().getTime()}.xlsx`)