减免记录查询管理,盘点报废

This commit is contained in:
hongchao 2025-02-20 19:12:04 +08:00
parent 95ba75749e
commit 7cc568adae
9 changed files with 284 additions and 375 deletions

View File

@ -45,3 +45,49 @@ export function getMachineListByCode(query) {
params: query
})
}
//盘带报废列表查询
export function getInventoryList(query) {
return request({
url: '/material/scrap_apply_details/inventoryList',
method: 'get',
params: query
})
}
//盘带报废新增
export function addScrapInfo(query) {
return request({
url: '/material/scrap_apply_details/addList',
method: 'post',
data: query
})
}
//盘带报废编辑
export function editScrapInfo(query) {
return request({
url: '/material/scrap_apply_details/updateList',
method: 'post',
data: query
})
}
//盘带报废查看接口
export function getScrapInfo(query) {
return request({
url: '/material/scrap_apply_details/getDetailsList',
method: 'get',
params: query
})
}
//报废台账列表
export function getScrapList(query) {
return request({
url: '/material/scrap_apply_details/getScrapList',
method: 'get',
params: query
})
}

View File

@ -394,7 +394,7 @@ export default {
Number(item.repairCost) +
Number(item.scrapCost) +
Number(item.loseCost) +
Number(item.reductionCost)
Number(item.reductionCost) +
Number(item.addCost) -
Number(item.subCost)
})
@ -403,7 +403,7 @@ export default {
Number(this.leaseCost) +
Number(this.repairCost) +
Number(this.scrapCost) +
Number(this.loseCost) +
Number(this.loseCost) -
Number(this.reducCost)
this.costAll = costSum
this.finishCostName = this.numberToChinese(this.costAll.toFixed(2));

View File

@ -474,6 +474,7 @@ export default {
time: null,
}
this.resetForm('queryForm')
this.queryParams.pageNum = 1;
this.handleQuery()
},

View File

@ -413,7 +413,7 @@ import { getToken } from '@/utils/auth'
getPrintTable(params) {
getInBoundForm({ id: params.id,taskId:params.taskId }).then((response) => {
this.printData = response.data.partTypeCheckInfo;
this.printTableData = response.data.partTypeCheckDetailsList;
this.printTableData = response.data.partTypeCheckDetailsList.filter(item => item.inputNum !== 0);
});
},

View File

@ -122,7 +122,6 @@
<el-table
v-loading="loading"
:data="equipmentList"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column align="center" label="序号" type="index" width="55" />
@ -140,16 +139,26 @@
/>
<el-table-column align="center" label="计量单位" prop="unitName" />
<el-table-column align="center" label="当前库存" prop="storageNum" />
<el-table-column label="报废数量" prop="preNum" align="center">
<el-table-column label="报废数量" prop="scrapNum" align="center">
<template v-slot="scope">
<span>{{ scope.row.preNum }}</span>
<template v-if="scope.row.manageType === '1'">
<el-input
v-model.number="scope.row.scrapNum"
controls-position="right" type="number"
style="width: 100%"
:min="0" @input="v =>scope.row.scrapNum = Number(v.replace(/[^\d.]/g, ''))"
></el-input>
</template>
<template v-else>
<span>{{ scope.row.scrapNum }}</span>
</template>
</template>
</el-table-column>
<el-table-column label="设备编号" align="center" prop="deviceCode" width="200px">
<el-table-column label="设备编号" align="center" prop="maCodeList" width="200px">
<template v-slot="scope">
<template v-if="scope.row.manageType === '0'">
<el-select
v-model="scope.row.deviceCode"
v-model="scope.row.maCodeList"
placeholder="请选择设备编号"
multiple
collapse-tags
@ -161,7 +170,7 @@
v-for="item in scope.row.deviceCodeOptions"
:key="item.id"
:label="item.code"
:value="item.code"
:value="item.id"
></el-option>
</el-select>
</template>
@ -169,20 +178,20 @@
<span>计数</span>
</template>
<template v-else>
<span>{{ scope.row.deviceCode }}</span>
<span>{{ scope.row.maCodeList }}</span>
</template>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="出库数量" prop="alNum" /> -->
<el-table-column
label="备注"
prop="remark"
label="报废原因"
prop="scrapReason"
align="center"
label-width="500px"
>
<template v-slot="scope">
<el-input
v-model="scope.row.remark"
v-model="scope.row.scrapReason"
controls-position="right"
style="width: 100%"
></el-input>
@ -215,14 +224,7 @@ import {
getPurchaseCheckInfo,
equipmentTypeTree,
} from "@/api/purchase/goodsArrived";
import {
getListProject,
getListUnite,
addApplyInfo,
updateApplyInfo,
getApplyInfo,
getAgreement,
} from "@/api/lease/apply";
import { getToken } from "@/utils/auth";
import {
uploadPurchaseFile,
@ -232,7 +234,10 @@ import {downloadFile, downloadFileData} from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {
getMachineListByCode
getMachineListByCode,
addScrapInfo,
getScrapInfo,
editScrapInfo
} from "@/api/repair/scrapLedgerReview";
export default {
@ -312,7 +317,7 @@ export default {
bmFileInfos: [
{
required: true,//()
message: '请上传委托书',
message: '请上传附件',
trigger: 'change'
}
],
@ -391,8 +396,8 @@ export default {
},
methods: {
handleDeviceCodeChange(row) {
const newDeviceCount = row.deviceCode.length;
row.preNum = newDeviceCount;
const newDeviceCount = row.maCodeList.length;
row.scrapNum = newDeviceCount;
},
/** 机具类型 */
@ -475,7 +480,7 @@ export default {
} else {
const newItem = {
...typeData,
preNum: 0,
scrapNum: 0,
};
//
this.equipmentList.unshift(newItem);
@ -500,9 +505,10 @@ export default {
getDeviceCodeOptions(row) {
// handleTypeChange
// this.equipmentList
console.log('xxxxxxxxxxxxxxxxx')
return getMachineListByCode({"typeId":row.typeId}).then((response) => {
console.log("response", response);
const relatedData = response.data.map(item => ({ id: item.maId, code: item.maCode,type: item.typeId }));
const relatedData = response.data.map(item => ({ id: item.maId, code: item.maCode,typeId: item.typeId }));
console.log("relatedData", relatedData);
return relatedData;
});
@ -512,16 +518,22 @@ export default {
//---
async getTaskInfo() {
// this.loading = true;
await getApplyInfo(this.id).then((response) => {
this.maForm = response.data.leaseApplyInfo;
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId;
this.maForm.projectId = response.data.leaseApplyInfo.leaseProjectId;
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
this.projectId = this.treeParentsById(
this.projectList,
this.maForm.projectId
);
this.equipmentList = response.data.leaseApplyDetailsList;
await getScrapInfo({'taskId':this.taskId}).then(async (response) => {
this.maForm.bmFileInfos = response.data.fileList;
this.equipmentList = response.data.scrapApplyDetailsList.map(item => {
return {
...item,
manageType: item.manageType + '',
deviceCodeOptions: [] //
};
});
//
for (let i = 0; i < this.equipmentList.length; i++) {
if(this.equipmentList[i].manageType == 0){
const options = await this.getDeviceCodeOptions(this.equipmentList[i]);
this.$set(this.equipmentList[i], 'deviceCodeOptions', options);
}
}
// this.loading = false;
});
// await this.projectInfoList();
@ -534,76 +546,67 @@ export default {
// row.preNum = maxNum-1
// }
},
//
treeParentsById(list, id) {
for (let i in list) {
if (list[i].id == id) {
//value
return [list[i].id];
}
if (list[i].children) {
let node = this.treeParentsById(list[i].children, id);
if (node !== undefined) {
//
node.unshift(list[i].id);
return node;
}
}
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.roleId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 保存按钮操作 */
handleSave() {
// console.log(this.equipmentList)
console.log("maForm", this.maForm);
if (this.equipmentList.length > 0) {
// if(this.bmFileInfos.length > 0){
// console.log(33333333333333333333333333333333333)
// this.$refs["maForm"].clearValidate('bmFileInfos');
// }
this.$refs["maForm"].validate(async (valid) => {
if (valid) {
for(let i = 0;i<this.equipmentList.length;i++){
if(this.equipmentList[i].preNum<=0){
this.$message.error(`${i + 1} 行的 ${'预领数量必须大于0'} `);
if(this.equipmentList[i].scrapNum<=0){
this.$message.error(`${i + 1} 行的 ${'报废数量必须大于0'} `);
return
}
if(this.equipmentList[i].preNum>this.equipmentList[i].storageNum){
this.$message.error(`${i + 1} 行的 ${'预领数量不可大于库存量'} `);
if(this.equipmentList[i].scrapNum>this.equipmentList[i].storageNum){
this.$message.error(`${i + 1} 行的 ${'报废数量不可大于库存量'} `);
return
}
}
console.log("projectId", this.projectTemp);
await getAgreement({
unitId: this.maForm.unitId,
projectId: this.maForm.projectId,
}).then((response) => {
this.agreementId = response.data.agreementId;
this.maForm.agreementId = this.agreementId;
});
this.maForm.taskId = this.taskId;
// this.maForm.taskId = this.taskId;
// this.maForm.checkDetailsList = this.equipmentList
await this.$modal
.confirm("是否确认保存当前页面")
.then(function () {})
.then(() => {
if (this.isEdit) {
this.maForm.leaseUnitId = this.maForm.unitId;
this.maForm.leaseProjectId = this.maForm.projectId;
console.log("编辑");
this.loading = true;
updateApplyInfo({
leaseApplyDetailsList: this.equipmentList,
leaseApplyInfo: this.maForm,
}).then((response) => {
let dataList = []
this.equipmentList.forEach((item) => {
if(item.manageType == 0){
let maCodeList = []
item.maCodeList.forEach((param) => {
maCodeList.push({'maId': param})
})
console.log('maCodeListxxxxxxxxxxxxxxx', maCodeList)
dataList.push({
"typeId": item.typeId,
"scrapNum": item.scrapNum,
'storageNum' : item.storageNum,
'maCodeList': maCodeList,
'scrapReason': item.scrapReason,
})
}else{
dataList.push({
"typeId": item.typeId,
"scrapNum": item.scrapNum,
'storageNum' : item.storageNum,
'scrapReason': item.scrapReason,
})
}
})
let list = {
"fileList": this.maForm.bmFileInfos,
"scrapApplyDetailsList":dataList,
"taskId": this.taskId
}
editScrapInfo(list).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("编辑成功");
this.$modal.msgSuccess("修改成功");
// this.$tab.closeOpenPage({
// path: '/store/newBuy/newDevicesList',
// })
@ -616,10 +619,35 @@ export default {
console.log("新增");
// console.log(this.equipmentList)
this.loading = true;
addApplyInfo({
leaseApplyDetailsList: this.equipmentList,
leaseApplyInfo: this.maForm,
}).then((response) => {
let dataList = []
this.equipmentList.forEach((item) => {
if(item.manageType == 0){
let maCodeList = []
item.maCodeList.forEach((param) => {
maCodeList.push({'maId': param})
})
console.log('maCodeListxxxxxxxxxxxxxxx', maCodeList)
dataList.push({
"typeId": item.typeId,
"scrapNum": item.scrapNum,
'storageNum' : item.storageNum,
'maCodeList': maCodeList,
'scrapReason': item.scrapReason,
})
}else{
dataList.push({
"typeId": item.typeId,
"scrapNum": item.scrapNum,
'storageNum' : item.storageNum,
'scrapReason': item.scrapReason,
})
}
})
let list = {
"fileList": this.maForm.bmFileInfos,
"scrapApplyDetailsList":dataList
}
addScrapInfo(list).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("新增成功");
// this.$tab.closeOpenPage({

View File

@ -34,7 +34,7 @@
style="width: 240px"
>
<el-option
v-for="dict in dict.type.lease_task_status"
v-for="dict in dict.type.inventory_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -80,13 +80,13 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="报废单号" align="center" prop="createTime" width="160" :show-overflow-tooltip="true"/>
<el-table-column label="物资类型" align="center" prop="createBy" :show-overflow-tooltip="true"/>
<el-table-column label="提交人" align="center" prop="impUnitName" :show-overflow-tooltip="true"/>
<el-table-column label="提交时间" align="center" prop="contractPart" :show-overflow-tooltip="true"/>
<el-table-column label="报废单号" align="center" prop="scrapCode" width="160" :show-overflow-tooltip="true"/>
<el-table-column label="物资类型" align="center" prop="type" :show-overflow-tooltip="true"/>
<el-table-column label="提交人" align="center" prop="createName" :show-overflow-tooltip="true"/>
<el-table-column label="提交时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" prop="taskStatus" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
<dict-tag :options="dict.type.lease_task_status" :value="scope.row.taskStatus"/>
<dict-tag :options="dict.type.inventory_status" :value="scope.row.taskStatus"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" >
@ -128,13 +128,13 @@ import {
applySendAll,
getCheckInfo
} from "@/api/lease/apply";
import { getInventoryList, } from '@/api/repair/scrapLedgerReview';
import vueEasyPrint from "vue-easy-print";
import printJS from 'print-js';
export default {
name: "Home",
dicts: ["lease_task_status", "ma_type_manage_type"],
dicts: ["inventory_status", ],
components: { vueEasyPrint },
data() {
return {
@ -163,8 +163,7 @@ export default {
getListPeople: [],
configUserList: [],
phoneNumbers: [],
//
chosenUserList: [],
userList: [],
//
title: "",
@ -182,16 +181,13 @@ export default {
form: {
remark: "",
},
openPrint: false,
open: false,
printData: {},
printTableData: [],
checkDataInfo: {},
//
supplierStr: "",
//
leaseApplyDetails: [],
//
leaseApplyData: {},
sendTemp: [],
@ -239,14 +235,12 @@ export default {
this.loading = true;
const params = {
keyWord: this.queryParams.keyWord,
taskStatus: this.queryParams.taskStatus,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
statusList:[this.queryParams.taskStatus]
};
getListLeaseApply(params).then((response) => {
getInventoryList(params).then((response) => {
this.typeList = response.data.rows;
this.total = response.data.total;
this.loading = false;
@ -270,21 +264,14 @@ export default {
},
/** 查看按钮操作 */
handleView(row) {
this.$emit("queryTools", row.taskId, row.id);
this.$emit("queryTools", row.taskId);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$emit("editTools", row.taskId, row.id);
},
//----
getNowTime() {
var today = new Date();
var year = today.getFullYear(); //
var month = today.getMonth() + 1; //
var day = today.getDate(); //
return year + "-" + month + "-" + day;
},
//
reset() {
@ -295,23 +282,6 @@ export default {
this.resetForm("form");
},
//
getPrintTable(taskId) {
getAcceptanceForm({ taskId: taskId }).then((response) => {
this.printData = response.data;
this.printTableData = response.data.checkDetailsList;
let supplierList = [];
this.printTableData.forEach((e) => {
if (e.supplier) {
supplierList.push(e.supplier);
}
});
supplierList = [...new Set(supplierList)];
this.supplierStr = supplierList.join(",");
});
},

View File

@ -7,54 +7,27 @@
:inline="true"
label-width="120px"
>
<el-form-item label="租赁单位" prop="unitId">
<el-cascader
v-model="unitId"
:show-all-levels="false"
:options="uniteList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
disabled
placeholder="请选择租赁单位"
></el-cascader>
</el-form-item>
<el-form-item label="租赁工程" prop="projectId">
<el-cascader
v-model="projectId"
:show-all-levels="false"
:options="projectList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
disabled
placeholder="请选择租赁工程"
></el-cascader>
</el-form-item>
<el-form-item label="领料人" prop="leasePerson">
<el-form-item prop="keyWord">
<el-input
v-model="maForm.leasePerson"
placeholder="请输入领料人"
v-model="maForm.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="maForm.phone"
placeholder="请输入联系电话"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
disabled
/>
<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>
@ -73,15 +46,15 @@
<el-table v-loading="loading" :data="equipmentList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="类型名称"
label="物资类型"
align="center"
prop="maTypeName"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeName"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column
@ -99,21 +72,21 @@
>
</el-table-column>
<el-table-column
label="预领数量"
label="报废数量"
align="center"
prop="preNum"
prop="scrapNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出库数量"
label="设备编码"
align="center"
prop="alNum"
prop="maCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="备注"
label="报废原因"
align="center"
prop="remark"
prop="scrapReason"
:show-overflow-tooltip="true"
/>
</el-table>
@ -121,12 +94,10 @@
</template>
<script>
import { getPurchaseCheckInfo } from "@/api/purchase/goodsArrived";
import {
uploadPurchaseFile,
getPurchaseFileList,
} from "@/api/purchase/goodsAccept";
import { getApplyInfo, getListProject, getListUnite } from "@/api/lease/apply";
getScrapInfo
} from "@/api/repair/scrapLedgerReview";
import { getToken } from "@/utils/auth";
export default {
name: "QueryTools",
@ -160,87 +131,51 @@ export default {
taskId: "",
//
loading: true,
//
uniteList: [],
//
projectList: [],
//
equipmentList: [],
unitId: null,
projectId: null,
//
open: false,
rowData: {},
maForm: {
unitId: undefined,
projectId: undefined,
},
selectTreeProps: {
children: "children",
label: "name",
// multiple: false,
value: "id",
// multiple: true,
keyWord: "",
},
};
},
computed: {},
mounted() {
this.taskId = this.queryTaskId;
this.id = this.queryId;
this.projectInfoList();
this.getTaskInfo();
},
methods: {
/** 租赁单位和工程-下拉选 */
projectInfoList() {
getListUnite({ id: null }).then((response) => {
this.uniteList = response.data;
});
getListProject({ id: null }).then((response) => {
this.projectList = response.data;
});
/** 搜索按钮操作 */
handleQuery() {
this.getTaskInfo();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord = "";
this.handleQuery();
},
//-
getTaskInfo() {
this.loading = true;
getApplyInfo(this.id).then((response) => {
this.maForm = response.data.leaseApplyInfo;
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId;
this.maForm.projectId = response.data.leaseApplyInfo.leaseProjectId;
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
this.projectId = this.treeParentsById(
this.projectList,
this.maForm.projectId
);
this.equipmentList = response.data.leaseApplyDetailsList;
console.log('xxxxxxxxxxxxxxxxxxxxx',this.taskId)
getScrapInfo({'taskId':this.taskId,'keyWord':this.maForm.keyWord}).then((response) => {
this.equipmentList = response.data.scrapApplyDetailsList;
this.loading = false;
});
},
//
treeParentsById(list, id) {
for (let i in list) {
if (list[i].id == id) {
//value
return [list[i].id];
}
if (list[i].children) {
let node = this.treeParentsById(list[i].children, id);
if (node !== undefined) {
//
node.unshift(list[i].id);
return node;
}
}
}
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/material/lease_apply_info/exportDetails",
{ id: this.id },
`领料申请详情_${new Date().getTime()}.xlsx`
`盘点报废详情_${new Date().getTime()}.xlsx`
);
},
},

View File

@ -66,41 +66,43 @@
v-loading="loading"
:data="tableList"
ref="multipleTable"
row-key="partId"
row-key="id"
>
<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="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="productionTime" :show-overflow-tooltip="true" />
<el-table-column label="损坏类型" align="center" prop="productionTime" :show-overflow-tooltip="true" />
<el-table-column label="审核人" align="center" prop="productionTime" :show-overflow-tooltip="true" />
<el-table-column label="审核日期" align="center" prop="productionTime" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="status" :show-overflow-tooltip="true" />
<el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true" />
<el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true" />
<el-table-column label="报废类型" align="center" prop="scrapStyle" :show-overflow-tooltip="true" />
<el-table-column label="损坏类型" align="center" prop="scrapType" :show-overflow-tooltip="true" />
<el-table-column label="审核人" align="center" prop="auditName" :show-overflow-tooltip="true" />
<el-table-column label="审核日期" align="center" prop="month" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getManufacturerSelect } from "@/api/ma/supplier";
import {
acceptInnerVerifyer,
getPurchaseFileList,
uploadPurchaseFile,
} from "@/api/purchase/goodsAccept";
import { getPartType,partTypeWarehouse,partTypeReject,innerVerify } from '@/api/part/partAccept';
import { getPartTypeCheckInfo,getPartTypeFileList } from '@/api/part/partArrived';
import { getScrapDetailsList } from '@/api/repair/scrapLedgerReview';
import { downloadFile } from "@/utils/download";
import { getToken } from "@/utils/auth";
export default {
name: "ScrapLedgerDetail",
data() {
return {
Id: "",
taskId: "",
month: "",
//
loading: false,
dialogLoading: false,
@ -111,69 +113,35 @@ export default {
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,
partId: undefined,
supplierId: undefined,
productionTime: undefined,
time:null,
keyWord,
pageNum: 1,
pageSize: 10,
},
//
confirmShow: false,
taskStatus: "", //31
checkResult: "",
verifyPass: true, //truefalse
//
dialogImageUrl: "",
dialogVisible: false,
//
upload: {
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/file/upload",
},
fileListInfo:[],
dialogVisibleFile: false,
};
},
mounted() {
const taskId = this.$route.query && this.$route.query.taskId;
const Id = this.$route.query && this.$route.query.Id;
const month = this.$route.query && this.$route.query.month;
const isView = this.$route.query && this.$route.query.isView;
this.taskId = taskId;
this.Id = Id;
this.month = month;
if (isView == "true") {
this.isView = true;
} else {
this.isView = false;
}
this.getPartType();
console.log(this.isView);
this.getList();
},
methods: {
@ -183,36 +151,22 @@ export default {
const obj = { path: "/repair/scrapLedger" };
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;
const params = {
month: this.month,
keyWord: this.queryParams.keyWord,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
getScrapDetailsList(params).then((response) => {
this.tableList = response.data;
this.total = response.total;
this.loading = false;
});
},
@ -220,6 +174,7 @@ export default {
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord = null;
this.queryParams.time = null;
this.handleQuery();
},
/** 搜索按钮操作 */
@ -231,10 +186,16 @@ export default {
/** 导出按钮操作 */
handleExport() {
const params = {
month: this.month,
keyWord: this.queryParams.keyWord,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
}
this.download(
"/material/part_arrived/exportDetails",
{ taskId: this.taskId },
`新购到货详情_${new Date().getTime()}.xlsx`
"/material/scrap_apply_details/getScrapDetailsList",
{ params },
`报废台账明细_${new Date().getTime()}.xlsx`
);
},
},

View File

@ -3,7 +3,7 @@
<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="queryParams.time"
v-model="queryParams.month"
type="month"
placeholder="请选择月份">
</el-date-picker>
@ -41,9 +41,9 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="月份" align="center" prop="arrivalTime" :show-overflow-tooltip="true"/>
<el-table-column label="报废数量" align="center" prop="code" :show-overflow-tooltip="true"/>
<el-table-column label="报废费用(万元)" align="center" prop="purchaseMaTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="月份" align="center" prop="month" :show-overflow-tooltip="true"/>
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
<el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="230">
<template slot-scope="scope">
<el-button
@ -70,15 +70,12 @@
</template>
<script>
import { getListNewBuy,getInBoundForm } from '@/api/part/partArrived';
import { passAll, rejectAll } from '@/api/part/partAccept';
import vueEasyPrint from "vue-easy-print";
import { getScrapList } from '@/api/repair/scrapLedgerReview';
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
name: "ScrapLedgerList",
dicts: ['part_task_status'],
components: { vueEasyPrint },
data() {
return {
//
@ -91,7 +88,6 @@ import { getToken } from '@/utils/auth'
showSearch: true,
showHouse: false,
dateRange:[],
taskStatusList:[{id:'0',name:'未完成'},{id:'1',name:'已完成'}],
ids: [],
infos: [],
//
@ -107,44 +103,18 @@ import { getToken } from '@/utils/auth'
pageNum: 1,
pageSize: 10,
keyWord:undefined,
taskStatus:undefined,
month:undefined,
},
openPrint: false,
printData: {},
printDataSign: {},
printTableData: [],
productionTechDeptOptions: [
{ value: '0', label: '张三' },
{ value: '1', label: '李四' },
{ value: '2', label: '王五' },
],
};
},
created() {
this.getList();
},
methods: {
//
selectable(row) {
console.log(row)
if (row.taskStatusName == '未完成') {
return true
} else {
return false
}
},
/** 查询列表 */
getList() {
this.loading = true;
this.queryParams.taskStage = 2;
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 => {
getScrapList(this.queryParams).then(response => {
this.tableList = response.data.rows;
this.total = response.data.total;
this.loading = false;
@ -153,8 +123,6 @@ import { getToken } from '@/utils/auth'
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
this.queryParams.keyWord=null;
this.handleQuery();
},
/** 搜索按钮操作 */
@ -165,7 +133,7 @@ import { getToken } from '@/utils/auth'
//
handleView(row){
console.log(row)
let query = { Id:row.id,taskId: row.taskId,isView:"true" }
let query = { "month":row.month,isView:"true" }
this.$tab.closeOpenPage({
path: '/repair/scrapLedgerDetail',
query,
@ -173,9 +141,9 @@ import { getToken } from '@/utils/auth'
},
handleExport() {
this.download(
"/material/part_arrived/export",
"/material/scrap_apply_details/exportScrapList",
{ ...this.queryParams},
`配件新购到货_${new Date().getTime()}.xlsx`
`报废台账查询_${new Date().getTime()}.xlsx`
);
},