This commit is contained in:
parent
576f6d11b9
commit
64fa253bcf
|
|
@ -22,6 +22,15 @@ export function getNewBuyBindListDetailsApi(query) {
|
|||
})
|
||||
}
|
||||
|
||||
//二级页面 查看
|
||||
export function getMaCodeInfo(query) {
|
||||
return request({
|
||||
url: '/material/purchase_macode_info/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//任务 详情
|
||||
export function bindAllData(data) {
|
||||
return request({
|
||||
|
|
@ -40,6 +49,7 @@ export function getListDetailById(query) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 导出
|
||||
export function exportNewBuy(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -97,12 +97,12 @@
|
|||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column align="center" label="单位" prop="unitName" />
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
align="center"
|
||||
label="供应商"
|
||||
prop="supplierName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="出厂日期"
|
||||
|
|
@ -110,12 +110,15 @@
|
|||
show-overflow-tooltip
|
||||
/>
|
||||
|
||||
<el-table-column label="相关配套资料" align="center" prop="checkUrlName">
|
||||
<!-- <template slot-scope="scope">
|
||||
<div @click="openGt(scope.row)" style="color: #02a7f0; cursor: pointer">
|
||||
{{ '报告管理' }}
|
||||
</div>
|
||||
</template> -->
|
||||
<el-table-column label="相关配套资料" align="center" prop="bmFileInfos">
|
||||
<template slot-scope="scope">
|
||||
<div
|
||||
style="color: rgb(2, 167, 240); cursor: pointer"
|
||||
@click="openFileDialog(scope.row)"
|
||||
>
|
||||
报告管理
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="状态">
|
||||
|
|
@ -181,9 +184,9 @@
|
|||
>
|
||||
<el-table border max-height="600px" :data="viewCodeList">
|
||||
<el-table-column label="序号" align="center" type="index" />
|
||||
<el-table-column align="center" label="类型名称" prop="materialName" />
|
||||
<el-table-column align="center" label="规格型号" prop="materialModel" />
|
||||
<el-table-column align="center" prop="maCode" label="设备编码" />
|
||||
<el-table-column align="center" label="类型名称" prop="maTypeName" />
|
||||
<el-table-column align="center" label="规格型号" prop="typeName" />
|
||||
<el-table-column align="center" label="设备编码" prop="maCode" />
|
||||
<el-table-column align="center" label="绑定人员" prop="createBy" />
|
||||
<el-table-column align="center" label="绑定时间" prop="createTime" />
|
||||
<el-table-column align="center" label="出厂编号" prop="outFacCode" />
|
||||
|
|
@ -247,8 +250,8 @@
|
|||
</el-form>
|
||||
<el-table border max-height="600px" :data="codeTableList">
|
||||
<el-table-column align="center" label="序号" type="index" />
|
||||
<el-table-column align="center" label="设备名称" prop="materialName" />
|
||||
<el-table-column align="center" label="规格型号" prop="materialModel" />
|
||||
<el-table-column align="center" label="设备名称" prop="maTypeName" />
|
||||
<el-table-column align="center" label="规格型号" prop="typeName" />
|
||||
<el-table-column align="center" label="设备编码">
|
||||
<template slot-scope="{ row }">
|
||||
<el-input clearable v-model="row.maCode" placeholder="请填写编码" />
|
||||
|
|
@ -286,6 +289,93 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="报告管理"
|
||||
:visible.sync="open"
|
||||
width="900px"
|
||||
append-to-body
|
||||
>
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template>
|
||||
<div>{{ this.rowData.typeName }}</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;
|
||||
"
|
||||
>
|
||||
<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"
|
||||
>
|
||||
<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"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 图片查看弹窗 -->
|
||||
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px">
|
||||
<img width="100%" height="500px" :src="dialogImageUrl" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -294,7 +384,13 @@ import {
|
|||
bindAllData,
|
||||
getListDetailById,
|
||||
getNewBuyBindListDetailsApi,
|
||||
getMaCodeInfo,
|
||||
} from "@/api/purchase/goodsBind";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {
|
||||
uploadPurchaseFile,
|
||||
getPurchaseFileList,
|
||||
} from "@/api/purchase/goodsAccept";
|
||||
|
||||
export default {
|
||||
name: "BindTools",
|
||||
|
|
@ -376,6 +472,26 @@ export default {
|
|||
productDate: "",
|
||||
taskStatus: 3,
|
||||
},
|
||||
// 是否显示弹出层
|
||||
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: "" },
|
||||
],
|
||||
//图片查看弹窗
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
//上传
|
||||
upload: {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/file/upload",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -421,6 +537,13 @@ export default {
|
|||
// 查看
|
||||
handleView(row) {
|
||||
this.viewCodeVisible = true;
|
||||
getMaCodeInfo({ taskId: row.taskId, typeId: row.typeId }).then(
|
||||
(response) => {
|
||||
this.viewCodeList = response.rows;
|
||||
this.titleBind = "查看";
|
||||
this.loadingTwo = false;
|
||||
}
|
||||
);
|
||||
// this.loadingTwo = true
|
||||
// getListDetailById({ taskId: row.taskId, typeId: row.typeId }).then(
|
||||
// (response) => {
|
||||
|
|
@ -434,7 +557,7 @@ export default {
|
|||
// 绑定
|
||||
handleBind(row) {
|
||||
this.bindCodeVisible = true;
|
||||
this.waitBindNum = row.purchaseNum;
|
||||
this.waitBindNum = row.checkNum - row.bindNum;
|
||||
this.queryBindForm.typeId = row.typeId;
|
||||
this.queryBindForm.typeName = row.typeName;
|
||||
this.queryBindForm.maTypeName = row.maTypeName;
|
||||
|
|
@ -459,6 +582,130 @@ export default {
|
|||
.then(() => {})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
//文件管理
|
||||
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: "" },
|
||||
];
|
||||
if (this.taskId == "") {
|
||||
// console.log(this.rowData)
|
||||
// console.log(this.rowData.bmFileInfos)
|
||||
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;
|
||||
});
|
||||
}
|
||||
} 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) => {
|
||||
let index = this.fileDataList.findIndex(
|
||||
(v) => v.fileType == item.fileType
|
||||
);
|
||||
this.fileDataList[index].name = item.name;
|
||||
this.fileDataList[index].url = item.url;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
beforeFileUpload(row) {
|
||||
this.rowData.fileType = row.fileType;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code == 200) {
|
||||
if (this.taskId == "") {
|
||||
//新增逻辑
|
||||
// console.log(response)
|
||||
// console.log(this.rowData)
|
||||
// console.log(this.rowData.bmFileInfos)
|
||||
let obj = {
|
||||
taskId: this.taskId,
|
||||
taskType: "0",
|
||||
name: response.data.name,
|
||||
url: response.data.url,
|
||||
modelId: this.rowData.typeId,
|
||||
fileType: this.rowData.fileType,
|
||||
// "dictLabel": this.rowData.dictLabel,
|
||||
};
|
||||
//根据文件上传返回更新文件管理弹窗内容
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
//编辑逻辑
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskType: "0",
|
||||
name: response.data.name,
|
||||
url: response.data.url,
|
||||
modelId: this.rowData.typeId,
|
||||
fileType: this.rowData.fileType,
|
||||
// "dictLabel": this.rowData.dictLabel,
|
||||
};
|
||||
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 extension = parts.pop();
|
||||
if (extension === "doc" || extension === "docx" || extension === "pdf") {
|
||||
const windowName = file.name;
|
||||
window.open(file.url, windowName);
|
||||
} else {
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 下载
|
||||
onDownloadQr() {
|
||||
console.log("二维码下载");
|
||||
|
|
@ -531,6 +778,8 @@ export default {
|
|||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
}
|
||||
this.getCodeList();
|
||||
this.bindCodeVisible = false;
|
||||
console.log(res, "编码结果--");
|
||||
},
|
||||
// 移除
|
||||
|
|
|
|||
Loading…
Reference in New Issue