费用推送模块页面接口对接
This commit is contained in:
parent
3c65e40340
commit
52690f9fc0
|
|
@ -181,6 +181,15 @@ export function getCostPushLeaseListApi(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询租赁弹窗列表
|
||||
export function getConsumeDetailsListApi(query) {
|
||||
return request({
|
||||
url: '/material/backstage/costPush/getConsumeDetailsByAgreementId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 费用推送审核提交
|
||||
export function submitPushCosts(params){
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
show-summary
|
||||
ref="multipleTable"
|
||||
row-key="id"
|
||||
:summary-method="ge---tSummaries"
|
||||
:summary-method="getSummaries"
|
||||
style="width: 100%"
|
||||
:max-height="650"
|
||||
@selection-change="selectionChange"
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
|
||||
<script>
|
||||
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
|
||||
import { getConsumPushCheckList, getConsumPushCheckListCount, submitPushSafetyConsumeCosts } from '@/api/costPush/costPush'
|
||||
import { getConsumPushCheckList, getConsumPushCheckListCount, submitPushSafetyConsumeCosts,getConsumeDetailsListApi } from '@/api/costPush/costPush'
|
||||
import TreeSelect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
|
|
@ -216,10 +216,10 @@ export default {
|
|||
dialogTableList: [],
|
||||
dialogColumns: [
|
||||
{ label: '机具名称', prop: 'typeName' },
|
||||
{ label: '规格型号', prop: 'typeModelName' },
|
||||
{ label: '领料时间', prop: 'leaseTime' },
|
||||
{ label: '规格型号', prop: 'modelName' },
|
||||
{ label: '领料时间', prop: 'leaseDate' },
|
||||
{ label: '消耗品数量', prop: 'num' },
|
||||
{ label: '消耗品费用', prop: 'costs' }
|
||||
{ label: '消耗品费用', prop: 'consMoney' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -254,7 +254,7 @@ export default {
|
|||
this.tableList = res.rows
|
||||
this.total = res.total
|
||||
const res2 = await getConsumPushCheckListCount()
|
||||
this.totalCost = res2.data.money
|
||||
this.totalCost = res2.data.leaseMoney
|
||||
loading.close()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
||||
|
|
@ -412,11 +412,22 @@ export default {
|
|||
// 弹框
|
||||
openDialog(row, type) {
|
||||
this.dialogVisible = true
|
||||
this.dialogForm.agreementId = row.agreementId
|
||||
this.dialogForm.taskId = row.taskId
|
||||
this.getDiaList()
|
||||
},
|
||||
// 弹框列表
|
||||
async getDiaList() {
|
||||
const params = { ...this.dialogForm }
|
||||
try {
|
||||
const res = await getConsumeDetailsListApi(params)
|
||||
this.dialogTableList = res.rows
|
||||
console.log("xxxxxxxxxxxx",this.dialogTableList)
|
||||
// else if (this.costIndex === 2) {
|
||||
// res = await
|
||||
// } else if (this.costIndex === 3) {
|
||||
// res = await
|
||||
// }
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getDiaList ~ error:', error)
|
||||
}
|
||||
|
|
@ -436,9 +447,9 @@ export default {
|
|||
sums[0] = '合计'
|
||||
let total = 0
|
||||
data.forEach((column, index) => {
|
||||
total += Number(column.costs)
|
||||
total += Number(column.consMoney)
|
||||
})
|
||||
sums[5] = total
|
||||
sums[5] = total ==0 ? 0:total.toFixed(5)
|
||||
return sums
|
||||
},
|
||||
// 弹框导出数据
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@
|
|||
width="55"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="index => (dialogForm.pageNum - 1) * dialogForm.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
v-for="(column, index) in dialogColumns"
|
||||
|
|
@ -162,16 +161,26 @@
|
|||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
>
|
||||
<template slot-scope="scope" >
|
||||
<span v-if="(column.prop == 'leaseDate' || column.prop == 'backDate') && costIndex == 1">
|
||||
{{ formatDate(scope.row[column.prop]) }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ scope.row[column.prop] }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
<!-- <pagination
|
||||
v-show="dialogTotal > 0"
|
||||
:total="dialogTotal"
|
||||
:page.sync="dialogForm.pageNum"
|
||||
:limit.sync="dialogForm.pageSize"
|
||||
@pagination="getDiaList"
|
||||
/>
|
||||
/> -->
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -242,22 +251,19 @@ export default {
|
|||
dialogForm: {
|
||||
name: '',
|
||||
type: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
dialogTotal: 0,
|
||||
dialogTableList: [],
|
||||
dialogColumns: [],
|
||||
dialogColumns1: [
|
||||
{ label: '机具名称', prop: 'typeName' },
|
||||
{ label: '规格型号', prop: 'typeModelName' },
|
||||
{ label: '领料时间', prop: 'leaseTime' },
|
||||
{ label: '退料时间', prop: 'backTime' },
|
||||
{ label: '租赁天数', prop: 'leaseDays' },
|
||||
{ label: '机具名称', prop: 'modelName' },
|
||||
{ label: '规格型号', prop: 'typeName' },
|
||||
{ label: '领料时间', prop: 'leaseDate' },
|
||||
{ label: '退料时间', prop: 'backDate' },
|
||||
{ label: '租赁天数', prop: 'dayNum' },
|
||||
{ label: '租赁价格', prop: 'leasePrice' },
|
||||
{ label: '租赁数量', prop: 'num' },
|
||||
{ label: '租赁费用', prop: 'costs' },
|
||||
{ label: '费用结算时间', prop: 'settleTime' }
|
||||
{ label: '租赁费用', prop: 'leaseMoney' },
|
||||
],
|
||||
dialogColumns2: [
|
||||
{ label: '机具名称', prop: 'typeName' },
|
||||
|
|
@ -282,6 +288,15 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
formatDate(dateStr) {
|
||||
if (!dateStr) return '';
|
||||
// 处理日期格式,只保留年月日部分
|
||||
const date = new Date(dateStr);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
// 查询
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
|
|
@ -482,6 +497,9 @@ export default {
|
|||
// 弹框
|
||||
openDialog(row, type) {
|
||||
this.costIndex = type
|
||||
this.dialogForm.agreementId = row.agreementId
|
||||
this.dialogForm.taskId = row.taskId
|
||||
this.dialogForm.settlementType = 2,
|
||||
this.dialogColumns = []
|
||||
if (type === 1) {
|
||||
this.dialogColumns = this.dialogColumns1
|
||||
|
|
@ -502,7 +520,7 @@ export default {
|
|||
try {
|
||||
if (this.costIndex === 1) {
|
||||
res = await getCostPushLeaseListApi(params)
|
||||
this.dialogTableList = res.data
|
||||
this.dialogTableList = res.rows
|
||||
}
|
||||
// else if (this.costIndex === 2) {
|
||||
// res = await
|
||||
|
|
@ -523,18 +541,25 @@ export default {
|
|||
},
|
||||
// 弹框合计
|
||||
getDiaSummaries(param) {
|
||||
console.log('xxxxxxxxxxxxxx', param)
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
sums[0] = '合计'
|
||||
let total = 0
|
||||
data.forEach((column, index) => {
|
||||
total += Number(column.costs)
|
||||
})
|
||||
if (this.costIndex == 1) {
|
||||
sums[8] = total
|
||||
data.forEach((column, index) => {
|
||||
total += Number(column.leaseMoney)
|
||||
})
|
||||
sums[8] = total == 0 ? 0 : total.toFixed(2)
|
||||
} else if (this.costIndex == 2) {
|
||||
data.forEach((column, index) => {
|
||||
total += Number(column.costs)
|
||||
})
|
||||
sums[5] = total
|
||||
} else if (this.costIndex == 3) {
|
||||
data.forEach((column, index) => {
|
||||
total += Number(column.costs)
|
||||
})
|
||||
sums[4] = total
|
||||
}
|
||||
return sums
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="是否结算" align="center" prop="isSettlement" width="100" >
|
||||
<template slot-scope="scope" >
|
||||
<span v-if="scope.row.isSettlement==1" style="color: #67c23a">已结算</span>
|
||||
<span v-if="scope.row.isSettlement==1 || scope.row.isSettlement==2" style="color: #67c23a">已结算</span>
|
||||
<span v-if="scope.row.isSettlement==0" style="color: #f56c6c">未结算</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -299,19 +299,13 @@
|
|||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dialogRepairList" border>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(dialogRepair.pageNum - 1) * dialogRepair.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" />
|
||||
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="维修数量" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="维修费用" align="center" width="130px" prop="repairMoney" :show-overflow-tooltip="true">
|
||||
<el-table-column label="维修费用" align="center" width="130px" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
|
|
@ -320,7 +314,7 @@
|
|||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计费用</div>
|
||||
<div class="columnAll">
|
||||
{{ 2530.55 }}
|
||||
{{ repairAllMoney.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -359,19 +353,13 @@
|
|||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dialogScrapList" border>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(dialogScrap.pageNum - 1) * dialogScrap.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" />
|
||||
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="报废费用" align="center" width="130px" prop="scrapMoney" :show-overflow-tooltip="true">
|
||||
<el-table-column label="报废费用" align="center" width="130px" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
|
|
@ -380,7 +368,7 @@
|
|||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计费用</div>
|
||||
<div class="columnAll">
|
||||
{{ 2530.55 }}
|
||||
{{ scrapAllMoney.toFixed(2)}}
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -419,18 +407,12 @@
|
|||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dialogLoseList" border>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(dialogLose.pageNum - 1) * dialogLose.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" align="center" width="80" type="index" />
|
||||
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="丢失数量" align="center" prop="num" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="丢失费用" align="center" width="130px" prop="loseMoney" :show-overflow-tooltip="true">
|
||||
<el-table-column label="丢失费用" align="center" width="130px" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
|
|
@ -439,7 +421,7 @@
|
|||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计费用</div>
|
||||
<div class="columnAll">
|
||||
{{ 2530.55 }}
|
||||
{{ loseAllMoney.toFixed(2)}}
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -538,7 +520,7 @@ export default {
|
|||
dialogScrapList: [], //报废费用列表
|
||||
dialogScrap: {
|
||||
typeName: undefined,
|
||||
modelName: undefined,
|
||||
modelName: undefined
|
||||
},
|
||||
dialogScrapTotal: 0,
|
||||
scrapAllMoney: 0,
|
||||
|
|
@ -683,6 +665,11 @@ export default {
|
|||
this.moneyAll = 0;
|
||||
|
||||
console.log(this.queryParams.month)
|
||||
if(this.queryParams.isSettlement == 1){
|
||||
this.queryParams.isSettlement = true;
|
||||
}else if(this.queryParams.isSettlement == 0){
|
||||
this.queryParams.isSettlement = false;
|
||||
}
|
||||
getPushReviewList(this.queryParams).then((response) => {
|
||||
this.pushReviewList = response.rows;
|
||||
this.originalMonthTrue = this.queryParams.month;
|
||||
|
|
@ -817,17 +804,31 @@ export default {
|
|||
this.dialogRepair.typeName = ""
|
||||
this.dialogRepair.modelName = ""
|
||||
this.dialogRepair.id = row.id;
|
||||
this.dialogRepair.agreementId = row.agreementId;
|
||||
this.currentRepairRow = row; // 保存当前行数据
|
||||
this.getRepairList()
|
||||
},
|
||||
//查询维修费用
|
||||
getRepairList() {
|
||||
this.loading = true;
|
||||
getRepairList(this.dialogRepaire).then((response) => {
|
||||
let params = {
|
||||
agreementId: this.dialogRepair.agreementId,
|
||||
settlementType: 1,
|
||||
}
|
||||
|
||||
getRepairList(params).then((response) => {
|
||||
this.dialogRepairList = response.rows;
|
||||
this.repairAllMoney = 0;
|
||||
this.dialogRepairList.forEach(item => {
|
||||
if(item.partType == '收费'){
|
||||
this.repairAllMoney += Number(item.costs);
|
||||
}
|
||||
})
|
||||
this.dialogRepairTotal = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
handleQueryRepair() {
|
||||
this.getRepairList()
|
||||
},
|
||||
|
|
@ -849,13 +850,27 @@ export default {
|
|||
this.dialogScrap.typeName = ""
|
||||
this.dialogScrap.modelName = ""
|
||||
this.dialogScrap.id = row.id;
|
||||
this.dialogScrap.agreementId = row.agreementId;
|
||||
this.currentScrapRow = row; // 保存当前行数据
|
||||
this.getScrapList()
|
||||
},
|
||||
//查询报废费用
|
||||
getScrapList() {
|
||||
this.loading = true;
|
||||
getScrapList(this.dialogScrap).then((response) => {
|
||||
|
||||
let params = {
|
||||
agreementId: this.dialogScrap.agreementId,
|
||||
settlementType: 1,
|
||||
}
|
||||
|
||||
getScrapList(params).then((response) => {
|
||||
this.dialogScrapList = response.rows;
|
||||
this.scrapAllMoney = 0;
|
||||
this.dialogScrapList.forEach(item => {
|
||||
if(item.partType == '收费'){
|
||||
this.scrapAllMoney += Number(item.costs);
|
||||
}
|
||||
})
|
||||
this.dialogScrapTotal = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
@ -881,13 +896,24 @@ export default {
|
|||
this.dialogLose.typeName = ""
|
||||
this.dialogLose.modelName = ""
|
||||
this.dialogLose.id = row.id;
|
||||
this.dialogLose.agreementId = row.agreementId;
|
||||
this.getLoseList()
|
||||
},
|
||||
//查询丢失费用
|
||||
getLoseList() {
|
||||
this.loading = true;
|
||||
getLoseList(this.dialogLose).then((response) => {
|
||||
|
||||
let params = {
|
||||
agreementId: this.dialogLose.agreementId,
|
||||
settlementType: 1,
|
||||
}
|
||||
|
||||
getLoseList(params).then((response) => {
|
||||
this.dialogLoseList = response.rows;
|
||||
this.loseAllMoney = 0;
|
||||
this.dialogLoseList.forEach(item => {
|
||||
this.loseAllMoney += Number(item.costs);
|
||||
})
|
||||
this.dialogLoseTotal = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue