维修单查看

This commit is contained in:
bb_pan 2025-09-23 18:16:29 +08:00
parent 1084497d4d
commit 526646f27c
2 changed files with 354 additions and 215 deletions

View File

@ -256,7 +256,14 @@ export function getLeaseCostDetails(query) {
}) })
} }
// 维修单查看
export function viewRepairCodeApi(query) {
return request({
url: '/material/slt_agreement_info/viewRepairCode',
method: 'get',
params: query
})
}

View File

@ -5,37 +5,48 @@
<treeselect <treeselect
ref="treeselectRef" ref="treeselectRef"
v-model="unitIds" v-model="unitIds"
:options="unitList" :normalizer="normalizer" :options="unitList"
:show-count="true" style="width: 300px;" :normalizer="normalizer"
:show-count="true"
style="width: 300px"
:disable-branch-nodes="true" :disable-branch-nodes="true"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" noChildrenText="没有数据了"
placeholder="请选择结算单位" @select="unitChange" noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择结算单位"
@select="unitChange"
:multiple="true" :multiple="true"
> ></treeselect>
</treeselect>
</el-form-item> </el-form-item>
<el-form-item prop="projectIds"> <el-form-item prop="projectIds">
<treeselect <treeselect
v-model="queryParams.projectId" v-model="queryParams.projectId"
:options="proList" :normalizer="normalizer" :options="proList"
:show-count="true" style="width: 240px" :disable-branch-nodes="true" :normalizer="normalizer"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" :show-count="true"
placeholder="请选择结算工程" @select="proChange" :disabled="unitIds.length == 0" style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择结算工程"
@select="proChange"
:disabled="unitIds.length == 0"
/> />
</el-form-item> </el-form-item>
<el-form-item prop="agreementCode"> <el-form-item prop="agreementCode">
<el-input v-model="queryParams.agreementCode" placeholder="请输入协议号" clearable style="width: 240px"/> <el-input
v-model="queryParams.agreementCode"
placeholder="请输入协议号"
clearable
style="width: 240px"
/>
</el-form-item> </el-form-item>
<el-form-item prop="sltStatus"> <el-form-item prop="sltStatus">
<el-select <el-select v-model="queryParams.sltStatus" placeholder="请选择结算状态" clearable filterable>
v-model="queryParams.sltStatus"
placeholder="请选择结算状态"
clearable
filterable
>
<el-option <el-option
v-for="dict in dict.type.cost_status" v-for="dict in dict.type.cost_status"
v-if="dict.value !== '2' && dict.value!== '1'" v-if="dict.value !== '2' && dict.value !== '1'"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -43,39 +54,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search" <el-button type="primary" plain size="mini" @click="handleApplyList">批量结算</el-button>
size="mini"
@click="handleQuery"
>查询</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
<el-button
type="primary"
plain
size="mini"
@click="handleApplyList"
>批量结算</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :max-height="650"> <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :max-height="650">
<el-table-column type="selection" align="center" :selectable="(row) => row.sltStatus == 0 || row.sltStatus == 3"/> <el-table-column
type="selection"
align="center"
:selectable="row => row.sltStatus == 0 || row.sltStatus == 3"
/>
<el-table-column label="序号" align="center" type="index"> <el-table-column label="序号" align="center" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</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="agreementCode" :show-overflow-tooltip="true"/> <el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
<el-table-column label="结算单位" align="center" prop="unitName" /> <el-table-column label="结算单位" align="center" prop="unitName" />
<el-table-column label="结算工程" align="center" prop="projectName" /> <el-table-column label="结算工程" align="center" prop="projectName" />
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true"> <el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
@ -83,43 +79,40 @@
<span v-if="scope.row.costs != null && scope.row.costs != ''"> <span v-if="scope.row.costs != null && scope.row.costs != ''">
{{ scope.row.costs.toFixed(2) }} {{ scope.row.costs.toFixed(2) }}
</span> </span>
<span v-else style="color: #909399;"> <span v-else style="color: #909399">无待结费用</span>
无待结费用
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结算状态" align="center" prop="sltStatus" :show-overflow-tooltip="true"> <el-table-column label="结算状态" align="center" prop="sltStatus" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.cost_status" :value="scope.row.isSlt"/> <dict-tag :options="dict.type.cost_status" :value="scope.row.isSlt" />
</template> </template>
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <dict-tag :value="scope.row.sltStatus">--> <!-- <dict-tag :value="scope.row.sltStatus">-->
<!-- <el-tag size="mini" type="success" v-if="scope.row.auditStatus == 1">已结算</el-tag>--> <!-- <el-tag size="mini" type="success" v-if="scope.row.auditStatus == 1">已结算</el-tag>-->
<!-- <el-tag size="mini" type="danger" v-if="scope.row.auditStatus == 2">部分结算</el-tag>--> <!-- <el-tag size="mini" type="danger" v-if="scope.row.auditStatus == 2">部分结算</el-tag>-->
<!-- <el-tag size="mini" type="primary" v-if="scope.row.auditStatus == 0">未结算</el-tag>--> <!-- <el-tag size="mini" type="primary" v-if="scope.row.auditStatus == 0">未结算</el-tag>-->
<!-- </dict-tag>--> <!-- </dict-tag>-->
<!-- <span v-if="scope.row.sltStatus == '0'">未结算</span>--> <!-- <span v-if="scope.row.sltStatus == '0'">未结算</span>-->
<!-- <span v-if="scope.row.sltStatus == '1'">已结算</span>--> <!-- <span v-if="scope.row.sltStatus == '1'">已结算</span>-->
<!-- <span v-if="scope.row.sltStatus == '2'">部分结算</span>--> <!-- <span v-if="scope.row.sltStatus == '2'">部分结算</span>-->
<!-- </template>--> <!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit" <el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleApply(scope.row)" @click="handleApply(scope.row)"
v-if="scope.row.isSlt == '0' || (scope.row.isSlt == '2')" v-if="scope.row.isSlt == '0' || scope.row.isSlt == '2'"
>结算申请 >
结算申请
</el-button> </el-button>
<el-button <el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button>
type="primary" <el-button type="primary" plain size="mini" @click="handleDetails(scope.row)">维修单查看</el-button>
plain
size="mini"
@click="openPrintDialog(scope.row)"
>协议书</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -134,110 +127,200 @@
<!-- 协议单弹窗 --> <!-- 协议单弹窗 -->
<el-dialog :visible.sync="openPrint" width="1100px" append-to-body> <el-dialog :visible.sync="openPrint" width="1100px" append-to-body>
<div id="checkId"> <div id="checkId">
<div style="height: 600px; overflow-y: scroll" > <div style="height: 600px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print"> <vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div style="text-align: center; font-weight: 600; font-size: 16px"> <div style="text-align: center; font-weight: 600; font-size: 16px">
机具设备有偿使用费结算协议书 机具设备有偿使用费结算协议书
</div> </div>
<div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap"> <div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap">
<div class="item" style=" width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;"> <div
</div> class="item"
<div class="item" style=" width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;"> style="width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px"
<span>协议号{{ agreementContent.agreementCode }}</span> ></div>
</div> <div class="item" style="width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
</div> <span>协议号{{ agreementContent.agreementCode }}</span>
<div class="tabelColumn"> </div>
<div class="columnLabel" style="width: 20%;">工程名称</div> </div>
<div class="columnContent" style="width: 80%;">{{ agreementContent.projectName }}</div> <div class="tabelColumn">
</div> <div class="columnLabel" style="width: 20%">工程名称</div>
<div class="tabelColumn"> <div class="columnContent" style="width: 80%">{{ agreementContent.projectName }}</div>
<div class="columnLabel" style="width: 20%;">承租单位</div> </div>
<div class="columnContent" style="width: 40%;">{{ agreementContent.unitName }}</div> <div class="tabelColumn">
<div class="columnLabel" style="width: 10%;border-left: 1px solid #9c9c9c;">日期</div> <div class="columnLabel" style="width: 20%">承租单位</div>
<div class="columnContent" style="width: 30%;">{{ agreementContent.applyTime || newData }}</div> <div class="columnContent" style="width: 40%">{{ agreementContent.unitName }}</div>
</div> <div class="columnLabel" style="width: 10%; border-left: 1px solid #9c9c9c">日期</div>
<div class="tabelColumn"> <div class="columnContent" style="width: 30%">
<div class="columnLabel" style="width: 100%;">结算项目及金额()</div> {{ agreementContent.applyTime || newData }}
</div> </div>
<div class="tabelColumn"> </div>
<div class="columnLabel" style="width: 60%;">施工机具有偿使用费</div> <div class="tabelColumn">
<div class="columnContent" style="width: 40%;"> {{ agreementContent.leaseCost ? agreementContent.leaseCost.toFixed(2) : '0.00' }}</div> <div class="columnLabel" style="width: 100%">结算项目及金额()</div>
</div> </div>
<div class="tabelColumn"> <div class="tabelColumn">
<div class="columnLabel" style="width: 60%;">施工机具维修费</div> <div class="columnLabel" style="width: 60%">施工机具有偿使用费</div>
<div class="columnContent" style="width: 40%;"> {{ agreementContent.repairCost ? agreementContent.repairCost.toFixed(2) : '0.00' }}</div> <div class="columnContent" style="width: 40%">
</div> {{ agreementContent.leaseCost ? agreementContent.leaseCost.toFixed(2) : '0.00' }}
<div class="tabelColumn"> </div>
<div class="columnLabel" style="width: 60%;">施工机具丢失费</div> </div>
<div class="columnContent" style="width: 40%;"> {{ agreementContent.loseCost ? agreementContent.loseCost.toFixed(2) : '0.00' }}</div> <div class="tabelColumn">
</div> <div class="columnLabel" style="width: 60%">施工机具维修费</div>
<div class="tabelColumn"> <div class="columnContent" style="width: 40%">
<div class="columnLabel" style="width: 60%;">施工机具损坏赔偿费</div> {{ agreementContent.repairCost ? agreementContent.repairCost.toFixed(2) : '0.00' }}
<div class="columnContent" style="width: 40%;"> {{ agreementContent.scrapCost ? agreementContent.scrapCost.toFixed(2) : '0.00' }}</div> </div>
</div> </div>
<div class="tabelColumn"> <div class="tabelColumn">
<div class="columnLabel" style="width: 60%;">施工机具租赁减免费</div> <div class="columnLabel" style="width: 60%">施工机具丢失费</div>
<div class="columnContent" style="width: 40%;"> {{ agreementContent.reductionCost ? agreementContent.reductionCost.toFixed(2) : '0.00' }}</div> <div class="columnContent" style="width: 40%">
</div> {{ agreementContent.loseCost ? agreementContent.loseCost.toFixed(2) : '0.00' }}
<div class="tabelColumn"> </div>
<div class="columnLabel" style="width: 20%;">费用合计金额大写</div> </div>
<div class="columnContent" style="width: 40%;">{{ agreementContent.costAllUpper }}</div> <div class="tabelColumn">
<div class="columnContent" style="width: 40%;"> {{ agreementContent.costAll ? agreementContent.costAll.toFixed(2) : '0.00' }}</div> <div class="columnLabel" style="width: 60%">施工机具损坏赔偿费</div>
</div> <div class="columnContent" style="width: 40%">
<div class="tabelColumn"> {{ agreementContent.scrapCost ? agreementContent.scrapCost.toFixed(2) : '0.00' }}
<div class="columnLabel" style="width: 20%;">说明</div> </div>
<div class="columnContent" style="width: 80%;">本协议一式三份甲方一份乙方一份经双方签字后生效</div> </div>
</div> <div class="tabelColumn">
<div class="tabelColumn" style="border: 1px solid #9c9c9c;"> <div class="columnLabel" style="width: 60%">施工机具租赁减免费</div>
<div class="columnLabel" style="width: 20%;">备注</div> <div class="columnContent" style="width: 40%">
<div class="columnContent" style="width: 80%;">此费用仅为在机具设备分公司发生费用未计从项目部领用机具费用</div>
</div> {{
agreementContent.reductionCost ? agreementContent.reductionCost.toFixed(2) : '0.00'
}}
</div>
</div>
<div class="tabelColumn">
<div class="columnLabel" style="width: 20%">费用合计金额大写</div>
<div class="columnContent" style="width: 40%">{{ agreementContent.costAllUpper }}</div>
<div class="columnContent" style="width: 40%">
{{ agreementContent.costAll ? agreementContent.costAll.toFixed(2) : '0.00' }}
</div>
</div>
<div class="tabelColumn">
<div class="columnLabel" style="width: 20%">说明</div>
<div class="columnContent" style="width: 80%">
本协议一式三份甲方一份乙方一份经双方签字后生效
</div>
</div>
<div class="tabelColumn" style="border: 1px solid #9c9c9c">
<div class="columnLabel" style="width: 20%">备注</div>
<div class="columnContent" style="width: 80%">
此费用仅为在机具设备分公司发生费用未计从项目部领用机具费用
</div>
</div>
<div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between">
<div class="item" style="width: 33%">
<div>
<span>部门负责人</span>
</div>
</div>
<div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between;"> <div class="item" style="width: 33%">
<div class="item" style="width: 33%"> <div>
<div> <span>承租负责人</span>
<span>部门负责人</span> </div>
</div> </div>
</div>
<div class="item" style="width: 33%"> <div class="item" style="width: 33%">
<div> <div>
<span>承租负责人</span> <span>核算员</span>
</div> </div>
</div> </div>
</div>
<div class="item" style="width: 33%"> </vue-easy-print>
<div>
<span>核算员</span>
</div>
</div>
</div> </div>
</vue-easy-print>
</div> </div>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button> <el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button> <el-button @click="openPrint = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 维修单查看 -->
<el-dialog :visible.sync="repairDialogVisible" width="1100px" append-to-body>
<el-form :model="repairQuery" size="small" inline @submit.native.prevent>
<el-form-item label="关键字" prop="repairCode">
<el-input
v-model="repairQuery.repairCode"
placeholder="请输入关键字"
clearable
style="width: 240px"
/>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getRepairList">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table
:data="repairList"
highlight-current-row
style="width: 100%"
v-loading="isLoading"
:max-height="650"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="index => (repairQuery.pageNum - 1) * repairQuery.pageSize + index + 1"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'repairCode'">
<span style="cursor: pointer; color: #409eff" @click="handleView(row)">
{{ row.repairCode }}
</span>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="repairTotal > 0"
:total="repairTotal"
:page.sync="repairQuery.pageNum"
:limit.sync="repairQuery.pageSize"
@pagination="getRepairList"
/>
<div slot="footer" class="dialog-footer" style="text-align: right">
<el-button @click="repairDialogVisible = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
// getProjectList, // getProjectList,
getUnitList, getUnitListFilterTeam, getUnitList,
// getAgreementInfoById, getUnitListFilterTeam
// getAgreementInfoById,
} from '@/api/back/index.js' } from '@/api/back/index.js'
import { getSltAgreementInfo,getProjectListByUnitIds,getAgreementInfoById, getSltInfo } from '@/api/cost/cost' import {
getSltAgreementInfo,
getProjectListByUnitIds,
getAgreementInfoById,
getSltInfo,
viewRepairCodeApi
} from '@/api/cost/cost'
import { toChineseAmount } from '@/utils/bonus.js' import { toChineseAmount } from '@/utils/bonus.js'
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'
import printJS from 'print-js' import printJS from 'print-js'
export default { export default {
name: 'ApplyHome', name: 'ApplyHome',
@ -265,7 +348,7 @@ export default {
children: 'children', children: 'children',
label: 'name', label: 'name',
value: 'id', value: 'id',
multiple: true,//false multiple: true //false
}, },
// //
tableList: [], tableList: [],
@ -274,13 +357,13 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
sltStatus: '', sltStatus: '',
isCommit:'', isCommit: '',
unitId: null, unitId: null,
projectId: null, projectId: null,
agreementId: [], agreementId: [],
agreementCode: '', agreementCode: ''
}, },
openPrint:false, openPrint: false,
// //
agreementContent: { agreementContent: {
agreementCode: '', agreementCode: '',
@ -292,9 +375,24 @@ export default {
scrapCost: '', // scrapCost: '', //
reductionCost: '', // reductionCost: '', //
costAll: '', // costAll: '', //
costAllUpper: '', // costAllUpper: '' //
}, },
newData: new Date().toISOString().split('T')[0], newData: new Date().toISOString().split('T')[0],
//
isLoading: false,
repairDialogVisible: false,
repairQuery: {
pageNum: 1,
pageSize: 10,
repairCode: '',
agreementId: ''
},
repairTotal: 0,
tableColumns: [
{ label: '维修单号', prop: 'repairCode' },
{ label: '状态', prop: 'repairStatus' }
],
repairList: []
} }
}, },
// updated() { // updated() {
@ -326,71 +424,71 @@ export default {
/** 转换菜单数据结构 */ /** 转换菜单数据结构 */
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
label: node.name, label: node.name,
children: node.children, children: node.children
}; }
}, },
// //
async GetUnitData() { async GetUnitData() {
const params = { const params = {
// projectId: this.queryParams.projectId /* */, // projectId: this.queryParams.projectId /* */,
} }
const res = await getUnitListFilterTeam(params) const res = await getUnitListFilterTeam(params)
this.unitList = res.data; this.unitList = res.data
if (this.queryParams.projectId) { if (this.queryParams.projectId) {
this.getAgreementInfo() this.getAgreementInfo()
} }
}, },
unitChange(val){ unitChange(val) {
console.log('Selected values:', val); // console.log('Selected values:', val) //
console.log("xxxxxxxxx",this.queryParams.unitId) console.log('xxxxxxxxx', this.queryParams.unitId)
console.log("yyyyyyyyy",this.unitIds) console.log('yyyyyyyyy', this.unitIds)
setTimeout(()=>{ setTimeout(() => {
this.queryParams.projectId=null this.queryParams.projectId = null
this.queryParams.agreementId = null this.queryParams.agreementId = null
this.queryParams.agreementCode = null this.queryParams.agreementCode = null
this.GetProData() this.GetProData()
},500) }, 500)
}, },
// //
async GetProData() { async GetProData() {
const unitIdsAsNumbers = this.unitIds.map(id => Number(id)); const unitIdsAsNumbers = this.unitIds.map(id => Number(id))
const params = { const params = {
unitIds: unitIdsAsNumbers, unitIds: unitIdsAsNumbers
} }
const res = await getProjectListByUnitIds(params) const res = await getProjectListByUnitIds(params)
this.proList = res.data; this.proList = res.data
this.getAgreementInfo() this.getAgreementInfo()
}, },
proChange(val){ proChange(val) {
setTimeout(()=>{ setTimeout(() => {
this.GetUnitData() this.GetUnitData()
},500) }, 500)
}, },
// id // id
async getAgreementInfo() { async getAgreementInfo() {
if (this.unitIds && this.unitIds.length > 0 && this.queryParams.projectId) { if (this.unitIds && this.unitIds.length > 0 && this.queryParams.projectId) {
const params = { const params = {
unitIds: this.unitIds, 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.some(item => !item.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.map(item => item.agreementId); this.queryParams.agreementId = res.data.map(item => item.agreementId)
this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(','); this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(',')
} }
} }
}, },
@ -404,10 +502,9 @@ export default {
sltStatus: this.queryParams.sltStatus, sltStatus: this.queryParams.sltStatus,
agreementCode: this.queryParams.agreementCode, agreementCode: this.queryParams.agreementCode,
// ...this.queryParams, // ...this.queryParams,
unitIds: this.unitIds, unitIds: this.unitIds
} }
getSltAgreementInfo(params).then((response) => { getSltAgreementInfo(params).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
@ -420,31 +517,31 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.unitIds=[] this.unitIds = []
this.projectIds=[] this.projectIds = []
this.queryParams={ this.queryParams = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
sltStatus: '', sltStatus: '',
isCommit:'', isCommit: '',
unitId: null, unitId: null,
projectId: null, projectId: null,
agreementId: [], agreementId: [],
agreementCode: '', agreementCode: ''
} }
this.resetForm('queryForm') this.resetForm('queryForm')
this.handleQuery() this.handleQuery()
}, },
// //
handleApply(row) { handleApply(row) {
console.log('🚀 handleApply 被调用,传入数据:', row); console.log('🚀 handleApply 被调用,传入数据:', row)
let arr = []; let arr = []
arr.push(row); arr.push(row)
console.log('🚀 准备发送的数据:', arr); console.log('🚀 准备发送的数据:', arr)
console.log('🚀 JSON化后的数据:', JSON.stringify(arr)); console.log('🚀 JSON化后的数据:', JSON.stringify(arr))
// '/cost/costApplyDetail' 使 // '/cost/costApplyDetail' 使
this.$emit("goDetail",JSON.stringify(arr)); this.$emit('goDetail', JSON.stringify(arr))
console.log('🚀 goDetail 事件已发出'); console.log('🚀 goDetail 事件已发出')
}, },
handleApplyList() { handleApplyList() {
if (this.ids.length < 1) { if (this.ids.length < 1) {
@ -453,16 +550,16 @@ export default {
} }
if (this.ids.length > 0) { if (this.ids.length > 0) {
let arr = this.ids let arr = this.ids
this.$emit("goDetail",JSON.stringify(arr)); this.$emit('goDetail', JSON.stringify(arr))
} }
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item) this.ids = selection.map(item => item)
this.single = selection.length != 1 this.single = selection.length != 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
async openPrintDialog(row){ async openPrintDialog(row) {
this.openPrint = true this.openPrint = true
try { try {
const res = await getSltInfo([row]) const res = await getSltInfo([row])
@ -470,16 +567,51 @@ export default {
if (!res.data) return if (!res.data) return
this.agreementContent = res.data this.agreementContent = res.data
this.agreementContent.agreementCode = row.agreementCode this.agreementContent.agreementCode = row.agreementCode
this.agreementContent.costAll = Number(res.data.leaseCost) + Number(res.data.repairCost) + Number(res.data.scrapCost) + Number(res.data.loseCost) - Number(res.data.reductionCost) this.agreementContent.costAll =
Number(res.data.leaseCost) +
Number(res.data.repairCost) +
Number(res.data.scrapCost) +
Number(res.data.loseCost) -
Number(res.data.reductionCost)
// costAllUpper // costAllUpper
this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2)) this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
} catch (error) { } catch (error) {
console.log('🚀 ~ openPrintDialog ~ error:', error) console.log('🚀 ~ openPrintDialog ~ error:', error)
} }
}, },
handleDetails(row) {
this.repairQuery.agreementId = row.agreementId
this.repairDialogVisible = true
this.getRepairList()
},
async getRepairList() {
try {
this.isLoading = true
const res = await viewRepairCodeApi({ ...this.repairQuery })
this.repairList = res.rows || []
this.repairTotal = res.total || 0
} catch (error) {
console.log('🚀 ~ getRepairList ~ error:', error)
} finally {
this.isLoading = false
}
},
handleReset() {
this.repairQuery.repairCode = ''
this.getRepairList()
},
handleView(row) {
this.repairDialogVisible = false
this.$router.push({
path: '/repair/repairManage',
query: {
code: row.repairCode
}
})
},
// //
print() { print() {
this.$refs.remarksPrintRef.print(); this.$refs.remarksPrintRef.print()
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -500,8 +632,8 @@ export default {
// this.download('material/agreementInfo/export', { // this.download('material/agreementInfo/export', {
// ...this.queryParams // ...this.queryParams
// }, `_${new Date().getTime()}.xlsx`) // }, `_${new Date().getTime()}.xlsx`)
}, }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -515,7 +647,7 @@ export default {
align-items: center; align-items: center;
} }
.tabelColumn { .tabelColumn {
width:1000px; width: 1000px;
height: 50px; height: 50px;
display: flex; display: flex;
align-items: center; align-items: center;