配件管理
This commit is contained in:
parent
fcd4d29585
commit
6a3da83a4c
|
|
@ -0,0 +1,46 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取配件类型下拉框-三级
|
||||
export function getPartType(query) {
|
||||
return request({
|
||||
url: '/material/part_accept/partTypeThree',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件入库API
|
||||
export function partTypeWarehouse(data) {
|
||||
return request({
|
||||
url: '/material/part_accept/partTypeWarehouse',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件驳回API
|
||||
export function partTypeReject(data) {
|
||||
return request({
|
||||
url: '/material/part_accept/partTypeReject',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 外层配件入库API
|
||||
export function passAll(data) {
|
||||
return request({
|
||||
url: '/material/part_accept/passAll',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 外层配件驳回API
|
||||
export function rejectAll(data) {
|
||||
return request({
|
||||
url: '/material/part_accept/rejectAll',
|
||||
method: 'post',
|
||||
data: data ,
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取配件类型树
|
||||
export function getTypeTree(query) {
|
||||
return request({
|
||||
url: '/material/part_arrived/typeTree',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件新购到货-新增
|
||||
export function addPartInfo(data) {
|
||||
return request({
|
||||
url: '/material/part_arrived',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
//配件新购到货-列表
|
||||
export function getListNewBuy(query) {
|
||||
return request({
|
||||
url: '/material/part_arrived/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//配件新购到货-列表详情
|
||||
export function getPartTypeCheckInfo(query) {
|
||||
return request({
|
||||
url: '/material/part_arrived/getInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件新购到货-编辑
|
||||
export function updatePartInfo(data) {
|
||||
return request({
|
||||
url: '/material/part_arrived',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件新购到货--删除
|
||||
export function deletePartInfo(data) {
|
||||
return request({
|
||||
url: '/material/part_arrived/delete' ,
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,558 @@
|
|||
<template>
|
||||
<div class="app-container" id="acceptDetail">
|
||||
<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-option
|
||||
v-for="dict in materialModelList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="机具厂家:" prop="supplierId">
|
||||
<el-select v-model="queryParams.supplierId" placeholder="请选择机具厂家" clearable>
|
||||
<el-option
|
||||
v-for="dict in supplierList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="出厂日期:" prop="productionTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.productionTime"
|
||||
placeholder="请选择出厂日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-back"
|
||||
@click="jumpList"
|
||||
>新购到货验收</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<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
|
||||
>
|
||||
</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
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
ref="multipleTable"
|
||||
row-key="partId"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center" :selectable="selectable"
|
||||
:reserve-selection="true"
|
||||
/>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="配件类型"
|
||||
align="center"
|
||||
prop="maName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="配件名称"
|
||||
align="center"
|
||||
prop="maTypeName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="partName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="到货数量"
|
||||
align="center"
|
||||
prop="purchaseNum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center"
|
||||
prop="unitName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="供应商"
|
||||
align="center"
|
||||
prop="supplierName"
|
||||
: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.part_task_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="180" v-if="!isView">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="success" @click="pass(scope.row)" v-if="scope.row.status==0">
|
||||
入库
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="reject(scope.row)" v-if="scope.row.status==0">
|
||||
驳回
|
||||
</el-button>
|
||||
</template>
|
||||
</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;">
|
||||
<div style="width:15%;">验收结论:</div>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3" style="width:80%;"
|
||||
placeholder="请输入结论"
|
||||
v-model="checkResult"
|
||||
maxlength="100">
|
||||
</el-input>
|
||||
</div>
|
||||
<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>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDeviceType } from "@/api/ma/device";
|
||||
import { getManufacturerSelect } from "@/api/ma/supplier";
|
||||
import {
|
||||
getPurchaseDetailsList,
|
||||
acceptInnerVerifyer,
|
||||
getPurchaseFileList,
|
||||
uploadPurchaseFile,
|
||||
} from "@/api/purchase/goodsAccept";
|
||||
import { getPartType,partTypeWarehouse,partTypeReject } from '@/api/part/partAccept';
|
||||
import { getPartTypeCheckInfo } from '@/api/part/partArrived';
|
||||
import { downloadFile } from "@/utils/download";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "AcceptDetail",
|
||||
dicts: ["part_task_status"],
|
||||
data() {
|
||||
return {
|
||||
Id: "",
|
||||
taskId: "",
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
dialogLoading: false,
|
||||
isView: false,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showHouse: false,
|
||||
materialModelList: [], //规格型号下拉
|
||||
supplierList: [], //厂家下拉
|
||||
ids: [],
|
||||
infos: [],
|
||||
checkList: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
//表格数据
|
||||
tableList: [],
|
||||
fixCodeList: ["否", "是"],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
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: "" },
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
typeId: undefined,
|
||||
supplierId: undefined,
|
||||
productionTime: undefined,
|
||||
},
|
||||
//确认弹窗
|
||||
confirmShow: false,
|
||||
taskStatus: "", //3合格、1不合格
|
||||
checkResult: "",
|
||||
verifyPass: true, //true合格、false不合格
|
||||
//图片查看弹窗
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
//上传
|
||||
upload: {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
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;
|
||||
this.taskId = taskId;
|
||||
this.Id = Id;
|
||||
if (isView == "true") {
|
||||
this.isView = true;
|
||||
} else {
|
||||
this.isView = false;
|
||||
}
|
||||
this.getPartType();
|
||||
console.log(this.isView);
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
if (row.status == 0) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 返回列表页
|
||||
jumpList() {
|
||||
const obj = { path: "/part/partAccept" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
},
|
||||
getPartType() {
|
||||
getPartType({ level: 3 }).then((response) => {
|
||||
let matModelRes = response.data;
|
||||
this.materialModelList = matModelRes.map((item) => {
|
||||
return {
|
||||
label: item.partName,
|
||||
value: item.partId,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
getSupplierList() {
|
||||
getManufacturerSelect().then((response) => {
|
||||
let arrRes = response.rows;
|
||||
this.supplierList = arrRes.map((item) => {
|
||||
return {
|
||||
label: item.supplier,
|
||||
value: item.supplierId,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.id = this.Id;
|
||||
this.queryParams.taskId = this.taskId;
|
||||
getPartTypeCheckInfo(this.queryParams).then((response) => {
|
||||
this.tableList = response.data.partTypeCheckDetailsList;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.keyWord = null;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection;
|
||||
this.infos = [];
|
||||
selection.forEach((item) => {
|
||||
this.infos.push({id:item.id,partId:item.partId,purchaseNum:item.purchaseNum,taskId:item.taskId});
|
||||
});
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
//入库
|
||||
pass(row) {
|
||||
// if(this.infos==0){
|
||||
// this.$modal.msgError("请选择配件");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
|
||||
this.$modal.confirm('是否确认入库该配件?')
|
||||
.then(function() {
|
||||
return partTypeWarehouse(infos)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('入库成功')
|
||||
this.getList()
|
||||
}).catch(() => {});
|
||||
},
|
||||
//驳回
|
||||
reject(row) {
|
||||
const infos=[{id:row.id,partId:row.partId,purchaseNum:row.purchaseNum,taskId:this.taskId}]
|
||||
this.$modal.confirm('是否确认驳回该配件?')
|
||||
.then(function() {
|
||||
return partTypeReject(infos)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('驳回成功')
|
||||
this.getList()
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
//批量入库
|
||||
batchPass() {
|
||||
if(this.infos==0){
|
||||
this.$modal.msgError("请选择配件");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('是否确认入库该配件?')
|
||||
.then(() => {
|
||||
return partTypeWarehouse(this.infos)
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('入库成功')
|
||||
this.getList()
|
||||
// 清除表格的选中状态
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
//批量驳回
|
||||
batchReject() {
|
||||
if(this.infos==0){
|
||||
this.$modal.msgError("请选择配件");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('是否确认驳回该配件?')
|
||||
.then(() => {
|
||||
return partTypeReject(this.infos)
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('驳回成功')
|
||||
this.getList()
|
||||
// 清除表格的选中状态
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
//验收确认请求
|
||||
confirmCheck() {
|
||||
this.checkList.forEach((item) => {
|
||||
item.checkResult = this.checkResult;
|
||||
});
|
||||
let param = {
|
||||
purchaseCheckDetailsList:this.checkList,
|
||||
verifyPass:this.verifyPass
|
||||
}
|
||||
console.log(param);
|
||||
acceptInnerVerifyer(param).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("验收成功");
|
||||
this.confirmShow = false;
|
||||
this.getList();
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
});
|
||||
},
|
||||
//文件管理
|
||||
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.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;
|
||||
// this.rowData.dictLabel=row.dictLabel;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
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("上传失败");
|
||||
});
|
||||
}
|
||||
},
|
||||
//图片查看
|
||||
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;
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"/material/part_arrived/exportDetails",
|
||||
{ taskId: this.taskId },
|
||||
`新购到货详情_${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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,500 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
maxlength="20"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="taskStatus">
|
||||
<el-select
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
placeholder="状态筛选"
|
||||
v-model="queryParams.taskStatus"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
v-for="dict in taskStatusList"
|
||||
/>
|
||||
</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">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success" plain
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="passAll"
|
||||
>
|
||||
入库
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger" plain
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="rejectAll"
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning" plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出数据</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="taskId" @selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="selectable"/>
|
||||
<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="arrivalTime" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购单号" align="center" prop="code" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购配件" align="center" prop="purchaseMaTypeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购数量" align="center" prop="purchaseMaNumber" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="物资厂家" align="center" prop="supplier" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="状态" align="center" prop="taskStatusName" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleView(scope.row)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary" v-if="scope.row.taskStatusName == '未完成'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>
|
||||
入库
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handlePrint(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"
|
||||
/>
|
||||
|
||||
<!-- 验收单弹窗 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="openPrint"
|
||||
width="1100px"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 500px; overflow-y: scroll">
|
||||
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
||||
<div
|
||||
class="title"
|
||||
style="
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
"
|
||||
>
|
||||
机具设备到货验收单
|
||||
</div>
|
||||
<div
|
||||
class="info"
|
||||
style="margin-top: 10px; display: flex; flex-wrap: wrap"
|
||||
>
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>单据编号:{{printData.code}}</span>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>生产厂家(供应商):{{printData.supplierName}}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="item"
|
||||
style="
|
||||
width: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
"
|
||||
>
|
||||
<span>到货日期:{{printData.arrivalDate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="printTableData"
|
||||
class="table"
|
||||
style="
|
||||
margin-top: 20px;
|
||||
width: 1000px;
|
||||
padding-bottom: 1px;
|
||||
"
|
||||
border
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
row=2
|
||||
/>
|
||||
<el-table-column
|
||||
label="物资名称"
|
||||
align="center"
|
||||
prop="maTypeName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="typeName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center"
|
||||
prop="unitName"
|
||||
/>
|
||||
<el-table-column label="配送信息" align="center">
|
||||
<el-table-column
|
||||
label="采购数量"
|
||||
align="center"
|
||||
prop="purchaseNum"
|
||||
/>
|
||||
<el-table-column
|
||||
label="验收结论"
|
||||
align="center"
|
||||
prop="checkResult"
|
||||
/>
|
||||
<el-table-column label="质保质量" align="center">
|
||||
<el-table-column
|
||||
label="实收份数"
|
||||
align="center"
|
||||
prop="checkNum"
|
||||
/>
|
||||
<el-table-column
|
||||
label="符合要求"
|
||||
align="center"
|
||||
/>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
/>
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="合格证及技术资料"-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop=""-->
|
||||
<!-- />-->
|
||||
<!-- <el-table-column label="包装" align="center" prop="" />-->
|
||||
</el-table>
|
||||
|
||||
<div
|
||||
class="fillIn"
|
||||
style="
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>供应科:{{printData.supplyDept}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>生产技术科:{{printData.productionTechDept}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>库管班:{{printData.warehouseTeam}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="print">打 印</el-button>
|
||||
<el-button @click="openPrint = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPurchaseList, acceptOuterVerify, getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
|
||||
import { getListNewBuy } from '@/api/part/partArrived';
|
||||
import { passAll,rejectAll } from '@/api/part/partAccept';
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: "PartAcceptList",
|
||||
dicts: ['part_task_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showHouse: false,
|
||||
dateRange:[],
|
||||
taskStatusList:[{id:'0',name:'未完成'},{id:'1',name:'已完成'}],
|
||||
ids: [],
|
||||
infos: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
//表格数据
|
||||
tableList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord:undefined,
|
||||
taskStatus:undefined,
|
||||
},
|
||||
openPrint: false,
|
||||
printData: {},
|
||||
printTableData: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
console.log(row)
|
||||
if (row.taskStatusName == '未完成') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if(this.dateRange.length>0){
|
||||
this.queryParams.startTime=this.dateRange[0]
|
||||
this.queryParams.endTime=this.dateRange[1]
|
||||
}else{
|
||||
this.queryParams.startTime=undefined
|
||||
this.queryParams.endTime=undefined
|
||||
}
|
||||
getListNewBuy(this.queryParams).then(response => {
|
||||
this.tableList = response.data.rows;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.dateRange=[]
|
||||
this.queryParams.keyWord=null;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.taskId)
|
||||
this.infos = [];
|
||||
selection.forEach((item) => {
|
||||
this.infos.push({taskId:item.taskId});
|
||||
});
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleUpdate(row){
|
||||
console.log(row)
|
||||
let query = { Id:row.id,taskId: row.taskId,isView:"false" }
|
||||
this.$tab.closeOpenPage({
|
||||
path: '/part/partAcceptDetail',
|
||||
query,
|
||||
})
|
||||
},
|
||||
//查看
|
||||
handleView(row){
|
||||
console.log(row)
|
||||
let query = { Id:row.id,taskId: row.taskId,isView:"true" }
|
||||
this.$tab.closeOpenPage({
|
||||
path: '/part/partAcceptDetail',
|
||||
query,
|
||||
})
|
||||
},
|
||||
//批量入库
|
||||
passAll(){
|
||||
passAll(this.infos).then((response) => {
|
||||
if(response.code==200){
|
||||
this.$modal.msgSuccess('入库成功')
|
||||
}else{
|
||||
this.$modal.msgSuccess('入库失败')
|
||||
}
|
||||
this.getList()
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}).catch(() => {
|
||||
this.$modal.msgError('入库失败')
|
||||
})
|
||||
},
|
||||
//批量驳回
|
||||
rejectAll(){
|
||||
rejectAll(this.infos).then((response) => {
|
||||
if(response.code==200){
|
||||
this.$modal.msgSuccess('驳回成功')
|
||||
}else{
|
||||
this.$modal.msgSuccess('驳回失败')
|
||||
}
|
||||
this.getList()
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}).catch(() => {
|
||||
this.$modal.msgError('驳回失败')
|
||||
})
|
||||
},
|
||||
//查看验收单
|
||||
handlePrint(row) {
|
||||
// this.query.taskId = row.taskId
|
||||
this.getPrintTable(row.taskId)
|
||||
this.openPrint = true
|
||||
this.title = '新购工机具验收单'
|
||||
},
|
||||
//获取验收单数据
|
||||
getPrintTable(taskId) {
|
||||
getPurchaseCheckFormByTaskId(taskId).then((response) => {
|
||||
this.printData = response.data
|
||||
this.printTableData = response.data.materialList
|
||||
// let supplierList = []
|
||||
// this.printTableData.forEach((e) => {
|
||||
// if (e.supplier) {
|
||||
// supplierList.push(e.supplier)
|
||||
// }
|
||||
// })
|
||||
// supplierList = [...new Set(supplierList)]
|
||||
// this.supplierStr = supplierList.join(',')
|
||||
})
|
||||
},
|
||||
//打印
|
||||
print() {
|
||||
this.$refs.remarksPrintRef.print()
|
||||
},
|
||||
handleExport() {
|
||||
this.download(
|
||||
"/material/part_arrived/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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -108,14 +108,14 @@
|
|||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="物资名称"
|
||||
label="配件名称"
|
||||
prop="maTypeName"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="规格型号"
|
||||
prop="typeName"
|
||||
prop="partName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column align="center" label="单位" prop="unitName" />
|
||||
|
|
@ -124,8 +124,8 @@
|
|||
<el-input
|
||||
v-model.number="scope.row.purchaseNum"
|
||||
controls-position="right" type="number"
|
||||
style="width: 100%" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||
:min="0" @input="(v)=>(scope.row.unitValue==1?scope.row.purchaseNum=Number(v.replace(/[^\d.]/g,'')) : scope.row.purchaseNum=Number(v.replace(/[^\d]/g,'')))"
|
||||
style="width: 100%" :disabled="scope.row.status!=0"
|
||||
:min="0"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
v-model="scope.row.purchaseTaxPrice"
|
||||
controls-position="right"
|
||||
style="width: 100%" @blur="scope.row.purchaseTaxPrice = scope.row.purchaseTaxPrice>0? scope.row.purchaseTaxPrice:0"
|
||||
:min="0" :step="1" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||
:min="0" :step="1" :disabled="scope.row.status!=0"
|
||||
@change="purchaseTaxPriceChange(scope.row,scope.$index)"
|
||||
></el-input-number>
|
||||
</template>
|
||||
|
|
@ -159,18 +159,6 @@
|
|||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁价(元/天)" prop="rentPrice"
|
||||
align="center" width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.rentPrice"
|
||||
controls-position="right"
|
||||
style="width: 100%" @blur="scope.row.rentPrice = scope.row.rentPrice>0? Number(scope.row.rentPrice.toFixed(2)) :0"
|
||||
:min="0" :step="1" :disabled="(scope.row.status!=1&&scope.row.status!=12)||scope.row.rentPriceDisabled"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="出厂日期"
|
||||
align="center"
|
||||
|
|
@ -182,7 +170,7 @@
|
|||
v-model="scope.row.productionTime"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||
type="date" :disabled="scope.row.status!=0"
|
||||
placeholder="出厂日期"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
|
|
@ -201,7 +189,7 @@
|
|||
</el-table-column>
|
||||
<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.part_task_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
|
@ -215,7 +203,7 @@
|
|||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.status==1||scope.row.status==12"
|
||||
type="text" v-if="scope.row.status==0"
|
||||
icon="el-icon-delete"
|
||||
style="color: red"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
|
@ -281,6 +269,7 @@ import {
|
|||
addPurchaseCheckInfo,
|
||||
updatePurchaseCheckInfo,
|
||||
} from '@/api/purchase/goodsArrived';
|
||||
import { getTypeTree,addPartInfo,getPartTypeCheckInfo,updatePartInfo } from '@/api/part/partArrived';
|
||||
import { getListFacturer } from '@/api/ma/supplier';
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { uploadPurchaseFile,getPurchaseFileList } from "@/api/purchase/goodsAccept";
|
||||
|
|
@ -291,7 +280,7 @@ import { uploadPurchaseFile,getPurchaseFileList } from "@/api/purchase/goodsAcce
|
|||
|
||||
export default {
|
||||
name: 'AddTools',
|
||||
dicts: ['purchase_task_status'],
|
||||
dicts: ['part_task_status'],
|
||||
// components: { Treeselect, HoldingpoleDialog },
|
||||
props: {
|
||||
isEdit: {
|
||||
|
|
@ -398,9 +387,9 @@ export default {
|
|||
},
|
||||
deviceTypeTreeProps: {
|
||||
children: 'children',
|
||||
label: 'typeName',
|
||||
label: 'partName',
|
||||
// multiple: false,
|
||||
value: 'typeId',
|
||||
value: 'partId',
|
||||
multiple: true,
|
||||
},
|
||||
deviceType: [],
|
||||
|
|
@ -470,24 +459,19 @@ export default {
|
|||
// },
|
||||
/** 机具类型 */
|
||||
equipmentType() {
|
||||
equipmentTypeTree().then((response) => {
|
||||
getTypeTree().then((response) => {
|
||||
this.equipmentTypeList = response.data
|
||||
this.equipmentTypeList.forEach((item, index) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((item2, index2) => {
|
||||
if (item2.children && item2.children.length > 0) {
|
||||
item2.children.forEach((item3) => {
|
||||
if (
|
||||
item3.children &&
|
||||
item3.children.length > 0
|
||||
) {
|
||||
item3.children.forEach((item4) => {
|
||||
item4.maTypeName = item3.typeName
|
||||
item4.specificationType = item4.typeName
|
||||
this.$set(item4, 'purchaseTaxPrice', 0)
|
||||
this.$set(item4, 'purchasePrice', 0)
|
||||
item2.children.forEach((item3) => {
|
||||
item3.maTypeName = item2.partName
|
||||
item3.specificationType = item3.partName
|
||||
this.$set(item3, 'purchaseTaxPrice', 0)
|
||||
this.$set(item3, 'purchasePrice', 0)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
@ -495,31 +479,30 @@ export default {
|
|||
})
|
||||
//反显
|
||||
let selectList = []
|
||||
console.log(this.equipmentList)
|
||||
console.log(this.equipmentTypeList)
|
||||
this.equipmentList.forEach((e) => {
|
||||
console.log(this.equipmentList)
|
||||
selectList.push(this.getParentsById(this.equipmentTypeList, e.typeId, e.status))
|
||||
selectList.push(this.getParentsById(this.equipmentTypeList, e.partId))
|
||||
})
|
||||
this.deviceType = selectList
|
||||
})
|
||||
},
|
||||
//树结构数据获取父
|
||||
getParentsById(list, id, status) {
|
||||
getParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].typeId == id) {
|
||||
if (list[i].partId == id) {
|
||||
console.log(id)
|
||||
console.log(status)
|
||||
if(status!=1&&status!=12){
|
||||
list[i].disabled=true
|
||||
}
|
||||
// if(status!=1&&status!=12){
|
||||
// list[i].disabled=true
|
||||
// }
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].typeId]
|
||||
return [list[i].partId]
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.getParentsById(list[i].children, id, status)
|
||||
let node = this.getParentsById(list[i].children, id)
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].typeId)
|
||||
node.unshift(list[i].partId)
|
||||
return node
|
||||
}
|
||||
}
|
||||
|
|
@ -532,11 +515,11 @@ export default {
|
|||
let tempList = []
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
return e[2]
|
||||
})
|
||||
for (let i of items) {
|
||||
for (let z of deviceTypeList) {
|
||||
if (z.data.typeId === i) {
|
||||
if (z.data.partId === i) {
|
||||
const obj = JSON.parse(JSON.stringify(z.data))
|
||||
console.log(z.data)
|
||||
// obj.supplierId = ''
|
||||
|
|
@ -545,15 +528,9 @@ export default {
|
|||
obj.purchaseTaxPrice = 0
|
||||
obj.purchaseTaxPrice = 0
|
||||
obj.purchaseNum = 1
|
||||
obj.fixCode = "0"
|
||||
obj.status=1
|
||||
obj.status=0
|
||||
obj.bmFileInfos=[]
|
||||
if(obj.rentPrice>0){//判断是否有租赁价格:有禁用;无修改;
|
||||
obj.rentPriceDisabled=true
|
||||
}else{
|
||||
obj.rentPriceDisabled=false
|
||||
}
|
||||
tempList.push(obj)
|
||||
tempList.push(obj);
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -561,15 +538,15 @@ export default {
|
|||
const newDataListNew = [...this.equipmentList, ...tempList]
|
||||
const map = new Map()
|
||||
for (let item of newDataListNew) {
|
||||
if (!map.has(item.typeId)) {
|
||||
map.set(item.typeId, item)
|
||||
if (!map.has(item.partId)) {
|
||||
map.set(item.partId, item)
|
||||
}
|
||||
}
|
||||
const newArray = [...map.values()]
|
||||
let newArray_array = []
|
||||
items.forEach((e) => {
|
||||
newArray.forEach((j) => {
|
||||
if (e == j.typeId) {
|
||||
if (e == j.partId) {
|
||||
newArray_array.push(j)
|
||||
}
|
||||
})
|
||||
|
|
@ -591,17 +568,17 @@ export default {
|
|||
//获取任务详情--- 编辑回显数据
|
||||
async getTaskInfo() {
|
||||
// this.loading = true;
|
||||
await getPurchaseCheckInfo({taskId:this.taskId,id:this.id,statusList:[1],taskStage: 1}).then((response) => {
|
||||
this.maForm = response.data.purchaseCheckInfo
|
||||
this.maForm.id = response.data.purchaseCheckInfo.id
|
||||
this.maForm.taskId = response.data.purchaseCheckInfo.taskId
|
||||
this.maForm.arrivalTime = response.data.purchaseCheckInfo.arrivalTime
|
||||
this.maForm.supplierId = response.data.purchaseCheckInfo.supplierId
|
||||
this.maForm.remark = response.data.purchaseCheckInfo.remark
|
||||
this.maForm.taxRate = response.data.purchaseCheckInfo.taxRate
|
||||
await getPartTypeCheckInfo({taskId:this.taskId,id:this.id}).then((response) => {
|
||||
this.maForm = response.data.partTypeCheckInfo
|
||||
this.maForm.id = response.data.partTypeCheckInfo.id
|
||||
this.maForm.taskId = response.data.partTypeCheckInfo.taskId
|
||||
this.maForm.arrivalTime = response.data.partTypeCheckInfo.arrivalTime
|
||||
this.maForm.supplierId = response.data.partTypeCheckInfo.supplierId
|
||||
this.maForm.remark = response.data.partTypeCheckInfo.remark
|
||||
this.maForm.taxRate = response.data.partTypeCheckInfo.taxRate
|
||||
// this.maForm.purchaseNumber = response.data.purchaseNumber
|
||||
// this.maForm.productionTime = response.data.purchaseCheckInfo.productionTime
|
||||
this.equipmentList = response.data.purchaseCheckDetailsList;
|
||||
this.equipmentList = response.data.partTypeCheckDetailsList;
|
||||
this.equipmentList.forEach(item=>{
|
||||
item.rentPriceDisabled=true
|
||||
})
|
||||
|
|
@ -622,19 +599,16 @@ export default {
|
|||
if (valid) {
|
||||
this.maForm.taskId = this.taskId;
|
||||
let index =this.equipmentList.findIndex(item=>item.purchaseNum==0)
|
||||
let index1 =this.equipmentList.findIndex(item=>item.rentPrice==0)
|
||||
let index2 =this.equipmentList.findIndex(item=>item.purchaseTaxPrice==0)
|
||||
if(index>-1){
|
||||
this.$modal.msgError('采购数量不能为0!')
|
||||
}else if(index1>-1){
|
||||
this.$modal.msgError('租赁价格不能为0!')
|
||||
}else{
|
||||
this.$modal.confirm('是否确认保存当前页面').then(function () {})
|
||||
.then(() => {
|
||||
if (this.isEdit) {
|
||||
console.log('编辑')
|
||||
this.loading = true
|
||||
updatePurchaseCheckInfo({purchaseCheckDetailsList: this.equipmentList,purchaseCheckInfo:this.maForm}).then((response) => {
|
||||
updatePartInfo({partTypeCheckDetailsList: this.equipmentList,partTypeCheckInfo:this.maForm}).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess(
|
||||
'编辑成功',
|
||||
|
|
@ -649,7 +623,7 @@ export default {
|
|||
console.log('新增')
|
||||
// console.log(this.equipmentList)
|
||||
this.loading = true
|
||||
addPurchaseCheckInfo({purchaseCheckDetailsList: this.equipmentList,purchaseCheckInfo:this.maForm}).then((response) => {
|
||||
addPartInfo({partTypeCheckDetailsList: this.equipmentList,partTypeCheckInfo:this.maForm}).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess(
|
||||
'新增成功',
|
||||
|
|
@ -784,13 +758,13 @@ export default {
|
|||
.confirm('是否确认删除所选择的数据项?')
|
||||
.then(() => {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
if (e[2] === row.partId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
this.equipmentList.forEach((item, index) => {
|
||||
if (item.typeId == row.typeId) {
|
||||
if (item.partId == row.partId) {
|
||||
this.equipmentList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
|
@ -799,7 +773,7 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('/material/purchase_check_info/exportDetails',{taskId:this.taskId},`新购到货详情_${new Date().getTime()}.xlsx`)
|
||||
this.download('/material/part_arrived/exportDetails',{taskId:this.taskId},`配件新购到货详情_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -810,7 +784,7 @@ export default {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
.el-cascader-panel .el-scrollbar:nth-child(3) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,20 +30,20 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="isFinish">
|
||||
<el-form-item prop="taskStatus">
|
||||
<el-select
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
placeholder="状态筛选"
|
||||
v-model="queryParams.isFinish"
|
||||
v-model="queryParams.taskStatus"
|
||||
>
|
||||
|
||||
<el-option
|
||||
v-for="dict in dict.type.part_task_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in taskStatusList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -165,25 +165,12 @@
|
|||
prop="taskStatusName"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag-->
|
||||
<!-- :options="dict.type.purchase_task_status"-->
|
||||
<!-- :value="scope.row.taskStatus"-->
|
||||
<!-- />-->
|
||||
<!-- </template>-->
|
||||
<!-- <template slot-scope="scope">
|
||||
<span v-if="scope.row.taskStatus==0">待提交</span>
|
||||
<span v-if="scope.row.taskStatus==1">待通知</span>
|
||||
<span v-if="scope.row.taskStatus==2">待验收</span>
|
||||
<span v-if="scope.row.taskStatus==3">待绑定</span>
|
||||
<span v-if="scope.row.taskStatus==4">待入库</span>
|
||||
<span v-if="scope.row.taskStatus==5">已完成</span>
|
||||
<span v-if="scope.row.taskStatus==6">驳回待验收</span>
|
||||
<span v-if="scope.row.taskStatus==7">驳回待绑定</span>
|
||||
<span v-if="scope.row.taskStatus==8">驳回待入库</span>
|
||||
<span v-if="scope.row.taskStatus==9">入库进行中</span>
|
||||
<span v-if="scope.row.taskStatus==10">未完成</span>
|
||||
</template> -->
|
||||
<!-- <template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.part_task_status"
|
||||
:value="scope.row.taskStatus"
|
||||
/>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
|
|
@ -218,7 +205,7 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDeletePurchase(scope.row)"
|
||||
@click="handleDeletePart(scope.row)"
|
||||
v-hasPermi="['purchase:info:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
|
|
@ -381,7 +368,6 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
getListNewBuy,
|
||||
getPurchaseCheckInfo,
|
||||
getAcceptanceForm,
|
||||
purchaseCheckInfoRemove,
|
||||
|
|
@ -391,7 +377,7 @@ import {
|
|||
bmNoticeInfo,
|
||||
delPeople,
|
||||
} from "@/api/purchase/goodsArrived";
|
||||
|
||||
import { getListNewBuy,deletePartInfo } from '@/api/part/partArrived';
|
||||
export default {
|
||||
name: "Home",
|
||||
dicts: ["part_task_status"],
|
||||
|
|
@ -438,8 +424,8 @@ export default {
|
|||
time: null, //申请时间
|
||||
name: undefined,
|
||||
status: undefined,
|
||||
isFinish: undefined,
|
||||
typeId: "",
|
||||
taskStatus: undefined,
|
||||
partId: "",
|
||||
keyWord: "",
|
||||
},
|
||||
form: {
|
||||
|
|
@ -478,8 +464,8 @@ export default {
|
|||
keyWord: this.queryParams.keyWord,
|
||||
startTime: this.queryParams.time && this.queryParams.time[0],
|
||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||
isFinish: this.queryParams.isFinish,
|
||||
typeId: this.queryParams.typeId,
|
||||
taskStatus: this.queryParams.taskStatus,
|
||||
partId: this.queryParams.partId,
|
||||
pageSize: this.queryParams.pageSize,
|
||||
pageNum: this.queryParams.pageNum,
|
||||
statusList: [1],
|
||||
|
|
@ -585,12 +571,11 @@ export default {
|
|||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDeletePurchase(row) {
|
||||
// console.log(row)
|
||||
handleDeletePart(row) {
|
||||
this.$modal
|
||||
.confirm("是否确认删除所选择的数据项?")
|
||||
.then(function () {
|
||||
return purchaseCheckInfoRemove(row.id);
|
||||
return deletePartInfo({id:row.id,taskId:row.taskId});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
|
@ -602,9 +587,9 @@ export default {
|
|||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"/material/purchase_check_info/export",
|
||||
{ ...this.queryParams,statusList: [1],taskStage: 1 },
|
||||
`新购到货_${new Date().getTime()}.xlsx`
|
||||
"/material/part_arrived/export",
|
||||
{ ...this.queryParams},
|
||||
`配件新购到货__${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,13 @@
|
|||
>
|
||||
<el-table-column label="序号" align="center" type="index" />
|
||||
<el-table-column
|
||||
label="物资名称"
|
||||
label="配件类型"
|
||||
align="center"
|
||||
prop="maName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="配件名称"
|
||||
align="center"
|
||||
prop="maTypeName"
|
||||
:show-overflow-tooltip="true"
|
||||
|
|
@ -20,7 +26,7 @@
|
|||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="typeName"
|
||||
prop="partName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
|
|
@ -49,18 +55,6 @@
|
|||
prop="purchasePrice"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="租赁价(元/天)"
|
||||
align="center"
|
||||
prop="rentPrice"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="是否未固定资产"
|
||||
align="center"
|
||||
prop="fixCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="出厂日期"
|
||||
align="center"
|
||||
|
|
@ -79,7 +73,7 @@
|
|||
</el-table-column>
|
||||
<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.part_task_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -134,14 +128,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPurchaseCheckInfo
|
||||
} from '@/api/purchase/goodsArrived'
|
||||
// import {
|
||||
// getPartTypeCheckInfo
|
||||
// } from '@/api/purchase/goodsArrived'
|
||||
import { getPartTypeCheckInfo } from '@/api/part/partArrived';
|
||||
import { uploadPurchaseFile,getPurchaseFileList } from "@/api/purchase/goodsAccept";
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'QueryTools',
|
||||
dicts: ['purchase_task_status'],
|
||||
dicts: ['part_task_status'],
|
||||
components: {
|
||||
// UploadImg,
|
||||
},
|
||||
|
|
@ -210,9 +205,9 @@ export default {
|
|||
//获取任务详情-列表数据
|
||||
getTaskInfo() {
|
||||
this.loading = true
|
||||
getPurchaseCheckInfo({taskId:this.taskId,id:this.id,statusList:[1],taskStage: 1}).then((response) => {
|
||||
getPartTypeCheckInfo({taskId:this.taskId,id:this.id}).then((response) => {
|
||||
this.taskInfo = response.data
|
||||
this.equipmentList = response.data.purchaseCheckDetailsList
|
||||
this.equipmentList = response.data.partTypeCheckDetailsList
|
||||
this.equipmentList.forEach((item) => {
|
||||
item.fixCode = this.fixCodeList[Number(item.fixCode)]
|
||||
})
|
||||
|
|
@ -315,7 +310,7 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('/material/purchase_check_info/exportDetails',{taskId:this.taskId},`新购到货详情_${new Date().getTime()}.xlsx`)
|
||||
this.download('/material/part_arrived/exportDetails',{taskId:this.taskId},`配件到货详情_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue