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

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@
style="width: 240px" style="width: 240px"
> >
<el-option <el-option
v-for="dict in dict.type.lease_task_status" v-for="dict in dict.type.inventory_status"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -80,13 +80,13 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span> <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报废单号" align="center" prop="createTime" width="160" :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="createBy" :show-overflow-tooltip="true"/> <el-table-column label="物资类型" align="center" prop="type" :show-overflow-tooltip="true"/>
<el-table-column label="提交人" align="center" prop="impUnitName" :show-overflow-tooltip="true"/> <el-table-column label="提交人" align="center" prop="createName" :show-overflow-tooltip="true"/>
<el-table-column label="提交时间" align="center" prop="contractPart" :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"> <el-table-column label="状态" align="center" prop="taskStatus" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" > <el-table-column label="操作" align="center" >
@ -128,13 +128,13 @@ import {
applySendAll, applySendAll,
getCheckInfo getCheckInfo
} from "@/api/lease/apply"; } from "@/api/lease/apply";
import { getInventoryList, } from '@/api/repair/scrapLedgerReview';
import vueEasyPrint from "vue-easy-print"; import vueEasyPrint from "vue-easy-print";
import printJS from 'print-js'; import printJS from 'print-js';
export default { export default {
name: "Home", name: "Home",
dicts: ["lease_task_status", "ma_type_manage_type"], dicts: ["inventory_status", ],
components: { vueEasyPrint }, components: { vueEasyPrint },
data() { data() {
return { return {
@ -163,8 +163,7 @@ export default {
getListPeople: [], getListPeople: [],
configUserList: [], configUserList: [],
phoneNumbers: [], phoneNumbers: [],
//
chosenUserList: [],
userList: [], userList: [],
// //
title: "", title: "",
@ -182,16 +181,13 @@ export default {
form: { form: {
remark: "", remark: "",
}, },
openPrint: false,
open: false, open: false,
printData: {},
printTableData: [],
checkDataInfo: {}, checkDataInfo: {},
// //
supplierStr: "", supplierStr: "",
//
leaseApplyDetails: [],
// //
leaseApplyData: {}, leaseApplyData: {},
sendTemp: [], sendTemp: [],
@ -239,14 +235,12 @@ export default {
this.loading = true; this.loading = true;
const params = { const params = {
keyWord: this.queryParams.keyWord, keyWord: this.queryParams.keyWord,
taskStatus: this.queryParams.taskStatus,
startTime: this.queryParams.time && this.queryParams.time[0], startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1], endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize, pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum, pageNum: this.queryParams.pageNum,
statusList:[this.queryParams.taskStatus]
}; };
getListLeaseApply(params).then((response) => { getInventoryList(params).then((response) => {
this.typeList = response.data.rows; this.typeList = response.data.rows;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
@ -270,21 +264,14 @@ export default {
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.$emit("queryTools", row.taskId, row.id); this.$emit("queryTools", row.taskId);
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$emit("editTools", row.taskId, row.id); 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() { reset() {
@ -295,23 +282,6 @@ export default {
this.resetForm("form"); 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" :inline="true"
label-width="120px" label-width="120px"
> >
<el-form-item label="租赁单位" prop="unitId"> <el-form-item prop="keyWord">
<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-input <el-input
v-model="maForm.leasePerson" v-model="maForm.keyWord"
placeholder="请输入领料人" placeholder="请输入关键字"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
disabled
/> />
</el-form-item> </el-form-item>
<el-form-item>
<el-form-item label="联系电话" prop="phone"> <el-button
<el-input type="primary"
v-model="maForm.phone" icon="el-icon-search"
placeholder="请输入联系电话" size="mini"
clearable @click="handleQuery"
maxlength="50" >搜索
style="width: 240px" </el-button>
@keyup.enter.native="handleQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
disabled >重置
/> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -73,15 +46,15 @@
<el-table v-loading="loading" :data="equipmentList"> <el-table v-loading="loading" :data="equipmentList">
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column <el-table-column
label="类型名称" label="物资类型"
align="center" align="center"
prop="maTypeName" prop="typeName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
prop="typeName" prop="typeModelName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
@ -99,21 +72,21 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="预领数量" label="报废数量"
align="center" align="center"
prop="preNum" prop="scrapNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="出库数量" label="设备编码"
align="center" align="center"
prop="alNum" prop="maCode"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="备注" label="报废原因"
align="center" align="center"
prop="remark" prop="scrapReason"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
</el-table> </el-table>
@ -121,12 +94,10 @@
</template> </template>
<script> <script>
import { getPurchaseCheckInfo } from "@/api/purchase/goodsArrived";
import { import {
uploadPurchaseFile, getScrapInfo
getPurchaseFileList, } from "@/api/repair/scrapLedgerReview";
} from "@/api/purchase/goodsAccept";
import { getApplyInfo, getListProject, getListUnite } from "@/api/lease/apply";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
name: "QueryTools", name: "QueryTools",
@ -160,87 +131,51 @@ export default {
taskId: "", taskId: "",
// //
loading: true, loading: true,
//
uniteList: [],
//
projectList: [],
// //
equipmentList: [], equipmentList: [],
unitId: null,
projectId: null,
// //
open: false, open: false,
rowData: {}, rowData: {},
maForm: { maForm: {
unitId: undefined, keyWord: "",
projectId: undefined,
},
selectTreeProps: {
children: "children",
label: "name",
// multiple: false,
value: "id",
// multiple: true,
}, },
}; };
}, },
computed: {}, computed: {},
mounted() { mounted() {
this.taskId = this.queryTaskId; this.taskId = this.queryTaskId;
this.id = this.queryId;
this.projectInfoList();
this.getTaskInfo(); this.getTaskInfo();
}, },
methods: { methods: {
/** 租赁单位和工程-下拉选 */
projectInfoList() { /** 搜索按钮操作 */
getListUnite({ id: null }).then((response) => { handleQuery() {
this.uniteList = response.data; this.getTaskInfo();
}); },
getListProject({ id: null }).then((response) => { /** 重置按钮操作 */
this.projectList = response.data; resetQuery() {
}); this.resetForm("queryForm");
this.queryParams.keyWord = "";
this.handleQuery();
}, },
//- //-
getTaskInfo() { getTaskInfo() {
this.loading = true; this.loading = true;
getApplyInfo(this.id).then((response) => { console.log('xxxxxxxxxxxxxxxxxxxxx',this.taskId)
this.maForm = response.data.leaseApplyInfo; getScrapInfo({'taskId':this.taskId,'keyWord':this.maForm.keyWord}).then((response) => {
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId; this.equipmentList = response.data.scrapApplyDetailsList;
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;
this.loading = false; 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() { handleExport() {
this.download( this.download(
"/material/lease_apply_info/exportDetails", "/material/lease_apply_info/exportDetails",
{ id: this.id }, { id: this.id },
`领料申请详情_${new Date().getTime()}.xlsx` `盘点报废详情_${new Date().getTime()}.xlsx`
); );
}, },
}, },

View File

@ -66,41 +66,43 @@
v-loading="loading" v-loading="loading"
:data="tableList" :data="tableList"
ref="multipleTable" ref="multipleTable"
row-key="partId" row-key="id"
> >
<el-table-column label="序号" align="center" width="80" type="index"> <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>
<el-table-column label="类型名称" align="center" prop="maName" :show-overflow-tooltip="true" /> <el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="maTypeName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="partName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="报废数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true" /> <el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true" />
<el-table-column label="报废费用(万元)" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true" />
<el-table-column label="报废类型" align="center" prop="productionTime" :show-overflow-tooltip="true" /> <el-table-column label="报废类型" align="center" prop="scrapStyle" :show-overflow-tooltip="true" />
<el-table-column label="损坏类型" align="center" prop="productionTime" :show-overflow-tooltip="true" /> <el-table-column label="损坏类型" align="center" prop="scrapType" :show-overflow-tooltip="true" />
<el-table-column label="审核人" align="center" prop="productionTime" :show-overflow-tooltip="true" /> <el-table-column label="审核人" align="center" prop="auditName" :show-overflow-tooltip="true" />
<el-table-column label="审核日期" align="center" prop="productionTime" :show-overflow-tooltip="true" /> <el-table-column label="审核日期" align="center" prop="month" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="status" :show-overflow-tooltip="true" />
</el-table> </el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { getManufacturerSelect } from "@/api/ma/supplier"; import { getScrapDetailsList } from '@/api/repair/scrapLedgerReview';
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 { downloadFile } from "@/utils/download"; import { downloadFile } from "@/utils/download";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
name: "ScrapLedgerDetail", name: "ScrapLedgerDetail",
data() { data() {
return { return {
Id: "", month: "",
taskId: "",
// //
loading: false, loading: false,
dialogLoading: false, dialogLoading: false,
@ -111,69 +113,35 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
showHouse: false,
materialModelList: [], //
supplierList: [], //
ids: [],
infos: [],
checkList: [],
// //
total: 0, total: 0,
// //
tableList: [], tableList: [],
fixCodeList: ["否", "是"],
// //
title: "", title: "",
// //
open: false, open: false,
rowData: {}, 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: { queryParams: {
// pageNum: 1, time:null,
// pageSize: 10, keyWord,
partId: undefined, pageNum: 1,
supplierId: undefined, pageSize: 10,
productionTime: undefined,
}, },
//
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() { mounted() {
const taskId = this.$route.query && this.$route.query.taskId; const month = this.$route.query && this.$route.query.month;
const Id = this.$route.query && this.$route.query.Id;
const isView = this.$route.query && this.$route.query.isView; const isView = this.$route.query && this.$route.query.isView;
this.taskId = taskId; this.month = month;
this.Id = Id;
if (isView == "true") { if (isView == "true") {
this.isView = true; this.isView = true;
} else { } else {
this.isView = false; this.isView = false;
} }
this.getPartType();
console.log(this.isView);
this.getList(); this.getList();
}, },
methods: { methods: {
@ -183,36 +151,22 @@ export default {
const obj = { path: "/repair/scrapLedger" }; const obj = { path: "/repair/scrapLedger" };
this.$tab.closeOpenPage(obj); 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() { getList() {
this.loading = true; this.loading = true;
this.queryParams.id = this.Id; const params = {
this.queryParams.taskId = this.taskId; month: this.month,
getPartTypeCheckInfo(this.queryParams).then((response) => { keyWord: this.queryParams.keyWord,
this.tableList = response.data.partTypeCheckDetailsList; startTime: this.queryParams.time && this.queryParams.time[0],
// this.total = response.total; 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; this.loading = false;
}); });
}, },
@ -220,6 +174,7 @@ export default {
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.keyWord = null; this.queryParams.keyWord = null;
this.queryParams.time = null;
this.handleQuery(); this.handleQuery();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -231,10 +186,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { 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( this.download(
"/material/part_arrived/exportDetails", "/material/scrap_apply_details/getScrapDetailsList",
{ taskId: this.taskId }, { params },
`新购到货详情_${new Date().getTime()}.xlsx` `报废台账明细_${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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item prop="dateRange"> <el-form-item prop="dateRange">
<el-date-picker <el-date-picker
v-model="queryParams.time" v-model="queryParams.month"
type="month" type="month"
placeholder="请选择月份"> placeholder="请选择月份">
</el-date-picker> </el-date-picker>
@ -41,9 +41,9 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span> <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="月份" align="center" prop="arrivalTime" :show-overflow-tooltip="true"/> <el-table-column label="月份" align="center" prop="month" :show-overflow-tooltip="true"/>
<el-table-column label="报废数量" align="center" prop="code" :show-overflow-tooltip="true"/> <el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
<el-table-column label="报废费用(万元)" align="center" prop="purchaseMaTypeName" :show-overflow-tooltip="true"/> <el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="230"> <el-table-column label="操作" align="center" width="230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -70,15 +70,12 @@
</template> </template>
<script> <script>
import { getListNewBuy,getInBoundForm } from '@/api/part/partArrived'; import { getScrapList } from '@/api/repair/scrapLedgerReview';
import { passAll, rejectAll } from '@/api/part/partAccept';
import vueEasyPrint from "vue-easy-print";
import { downloadFile } from '@/utils/download' import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
name: "ScrapLedgerList", name: "ScrapLedgerList",
dicts: ['part_task_status'], dicts: ['part_task_status'],
components: { vueEasyPrint },
data() { data() {
return { return {
// //
@ -91,7 +88,6 @@ import { getToken } from '@/utils/auth'
showSearch: true, showSearch: true,
showHouse: false, showHouse: false,
dateRange:[], dateRange:[],
taskStatusList:[{id:'0',name:'未完成'},{id:'1',name:'已完成'}],
ids: [], ids: [],
infos: [], infos: [],
// //
@ -107,44 +103,18 @@ import { getToken } from '@/utils/auth'
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keyWord:undefined, keyWord:undefined,
taskStatus:undefined, month:undefined,
}, },
openPrint: false,
printData: {},
printDataSign: {},
printTableData: [],
productionTechDeptOptions: [
{ value: '0', label: '张三' },
{ value: '1', label: '李四' },
{ value: '2', label: '王五' },
],
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
//
selectable(row) {
console.log(row)
if (row.taskStatusName == '未完成') {
return true
} else {
return false
}
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.taskStage = 2; getScrapList(this.queryParams).then(response => {
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.tableList = response.data.rows;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
@ -153,8 +123,6 @@ import { getToken } from '@/utils/auth'
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.dateRange=[]
this.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -165,7 +133,7 @@ import { getToken } from '@/utils/auth'
// //
handleView(row){ handleView(row){
console.log(row) console.log(row)
let query = { Id:row.id,taskId: row.taskId,isView:"true" } let query = { "month":row.month,isView:"true" }
this.$tab.closeOpenPage({ this.$tab.closeOpenPage({
path: '/repair/scrapLedgerDetail', path: '/repair/scrapLedgerDetail',
query, query,
@ -173,9 +141,9 @@ import { getToken } from '@/utils/auth'
}, },
handleExport() { handleExport() {
this.download( this.download(
"/material/part_arrived/export", "/material/scrap_apply_details/exportScrapList",
{ ...this.queryParams}, { ...this.queryParams},
`配件新购到货_${new Date().getTime()}.xlsx` `报废台账查询_${new Date().getTime()}.xlsx`
); );
}, },