bug修复

This commit is contained in:
hongchao 2025-03-19 18:14:18 +08:00
parent 2d6cffa4a2
commit b0212fcc5e
4 changed files with 88 additions and 40 deletions

View File

@ -128,7 +128,14 @@ export function getProjectListByUnitIds(params){
}) })
} }
// 协议
export function getAgreementInfoById(data) {
return request({
url: '/material/slt_agreement_info/getAgreementInfoById',
method: 'post',
data: data,
})
}

View File

@ -99,4 +99,13 @@ export function getScrapDetailsList(query) {
method: 'get', method: 'get',
params: query params: query
}) })
}
//盘点报废通过与驳回
export function inventoryPass(data) {
return request({
url: '/material/scrap_apply_details/inventoryApprove',
method: 'post',
data: data
})
} }

View File

@ -44,7 +44,12 @@
></el-cascader> --> ></el-cascader> -->
</el-form-item> </el-form-item>
<el-form-item prop="agreementCode"> <el-form-item prop="agreementCode">
<el-input v-model="queryParams.agreementCode" placeholder="请输入协议号" clearable disabled/> <el-tooltip content="协议编号" placement="top" :disabled="!queryParams.agreementCode">
<template #content>
{{ queryParams.agreementCode }}
</template>
<el-input v-model="queryParams.agreementCode" placeholder="请输入协议号" clearable disabled/>
</el-tooltip>
</el-form-item> </el-form-item>
<el-form-item prop="sltStatus"> <el-form-item prop="sltStatus">
<el-select <el-select
@ -238,9 +243,9 @@
import { import {
// getProjectList, // getProjectList,
getUnitList, getUnitList,
getAgreementInfoById, // getAgreementInfoById,
} from '@/api/back/index.js' } from '@/api/back/index.js'
import { getSltAgreementInfo,getProjectListByUnitIds } from '@/api/cost/cost' import { getSltAgreementInfo,getProjectListByUnitIds,getAgreementInfoById } from '@/api/cost/cost'
import vueEasyPrint from "vue-easy-print"; import vueEasyPrint from "vue-easy-print";
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";
@ -288,7 +293,7 @@ export default {
isCommit:'', isCommit:'',
unitId: null, unitId: null,
projectId: null, projectId: null,
agreementId: '', agreementId: [],
agreementCode: '', agreementCode: '',
}, },
openPrint:false openPrint:false
@ -329,8 +334,10 @@ export default {
} }
const res = await getUnitList(params) const res = await getUnitList(params)
this.unitList = res.data; this.unitList = res.data;
if(this.queryParams.projectId){
this.getAgreementInfo()
}
this.getAgreementInfo()
}, },
unitChange(val){ unitChange(val){
console.log('Selected values:', val); // console.log('Selected values:', val); //
@ -374,29 +381,38 @@ export default {
}, },
// id // id
async getAgreementInfo() { async getAgreementInfo() {
if (this.queryParams.unitId && this.queryParams.projectId) { if (this.unitIds && this.unitIds.length > 0 && this.queryParams.projectId) {
const params = { const params = {
unitId: this.queryParams.unitId, unitIds: this.unitIds,
projectId: this.queryParams.projectId, projectId: this.queryParams.projectId,
} }
const res = await getAgreementInfoById(params) const res = await getAgreementInfoById(params)
console.log(res) console.log(res)
if (!(res.data && res.data.agreementId)) { if ((!res.data && res.data.some(item => !item.agreementId))) {
this.$message.error('当前单位和工程无协议!') this.$message.error('当前单位和工程无协议!')
this.queryParams.unitId = null this.queryParams.unitId = null
this.queryParams.projectId = null this.queryParams.projectId = null
this.GetUnitData() this.GetUnitData()
this.GetProData() this.GetProData()
} else { } else {
this.queryParams.agreementId = res.data.agreementId this.queryParams.agreementId = res.data.map(item => item.agreementId);
this.queryParams.agreementCode = res.data.agreementCode this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(',');
} }
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true this.loading = true
getSltAgreementInfo(this.queryParams).then((response) => { const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
projectId: this.queryParams.projectId,
sltStatus: this.queryParams.sltStatus,
// ...this.queryParams,
unitIds: this.unitIds,
}
getSltAgreementInfo(params).then((response) => {
this.tableList = response.rows this.tableList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
@ -418,7 +434,7 @@ export default {
isCommit:'', isCommit:'',
unitId: null, unitId: null,
projectId: null, projectId: null,
agreementId: '', agreementId: [],
agreementCode: '', agreementCode: '',
} }
this.resetForm('queryForm') this.resetForm('queryForm')
@ -440,17 +456,12 @@ export default {
}, },
handleApplyList() { handleApplyList() {
if (this.ids.length < 1) { if (this.ids.length < 1) {
this.$message.error('请选需要结算的数据!') this.$message.error('请选需要结算的数据!')
return return
} }
if (this.ids.length > 0) { if (this.ids.length > 0) {
let arr = this.ids let arr = this.ids
this.$tab.closeOpenPage({ this.$emit("goDetail",JSON.stringify(arr));
path: '/cost/cost/costApplyAdd',
query: {
rowData: JSON.stringify(arr),
},
})
} }
}, },
// //

View File

@ -138,18 +138,10 @@
<script> <script>
import { import {
getListLeaseApply,
getPurchaseCheckInfo,
getAcceptanceForm,
purchaseCheckInfoRemove,
queryStatusDataApi,
getApplyInfo,
applyRemove, applyRemove,
applySend,
applySendAll,
getCheckInfo
} from "@/api/lease/apply"; } from "@/api/lease/apply";
import { getInventoryList, } from '@/api/repair/scrapLedgerReview'; import { getInventoryList,inventoryPass } 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';
@ -236,17 +228,17 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.sendTemp = []; this.sendTemp = [];
this.ids = selection.map((item) => item.id); this.ids = selection.map((item) => item.taskId);
selection.forEach((item) => { // selection.forEach((item) => {
this.sendTemp.push({ id: item.id, taskId: item.taskId }); // this.sendTemp.push({ id: item.id, taskId: item.taskId });
}); // });
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
// //
selectable(row) { selectable(row) {
if (row.taskStatus != 1) { if (row.taskStatus != 1 && row.taskStatus!= 2) {
return true; return true;
} else { } else {
return false; return false;
@ -293,8 +285,6 @@ export default {
this.$emit("editTools", row.taskId, row.id); this.$emit("editTools", row.taskId, row.id);
}, },
// //
reset() { reset() {
this.form = { this.form = {
@ -304,9 +294,6 @@ export default {
this.resetForm("form"); this.resetForm("form");
}, },
// //
closeDialogAndRefresh() { closeDialogAndRefresh() {
this.openPrint = false; this.openPrint = false;
@ -335,6 +322,40 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//
batchPass() {
if (this.ids.length == 0) {
this.$alert("未勾选数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
}
inventoryPass({taskIdList:this.ids,status:1}).then((response) => {
this.$modal.msgSuccess("通过成功");
this.ids = [];
this.getList();
this.$refs.multipleTable.clearSelection();
});
},
//
batchReject(){
if (this.ids.length == 0) {
this.$alert("未勾选数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
}
inventoryPass({taskIdList:this.ids,status:2}).then((response) => {
this.$modal.msgSuccess("驳回成功");
this.ids = [];
this.getList();
this.$refs.multipleTable.clearSelection();
});
}
}, },
}; };