维修单查看
This commit is contained in:
		
							parent
							
								
									1084497d4d
								
							
						
					
					
						commit
						526646f27c
					
				| 
						 | 
				
			
			@ -256,7 +256,14 @@ export function getLeaseCostDetails(query) {
 | 
			
		|||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 维修单查看
 | 
			
		||||
export function viewRepairCodeApi(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/slt_agreement_info/viewRepairCode',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,34 +5,45 @@
 | 
			
		|||
                <treeselect
 | 
			
		||||
                    ref="treeselectRef"
 | 
			
		||||
                    v-model="unitIds"
 | 
			
		||||
                    :options="unitList" :normalizer="normalizer"
 | 
			
		||||
                    :show-count="true"         style="width: 300px;"
 | 
			
		||||
                    :options="unitList"
 | 
			
		||||
                    :normalizer="normalizer"
 | 
			
		||||
                    :show-count="true"
 | 
			
		||||
                    style="width: 300px"
 | 
			
		||||
                    :disable-branch-nodes="true"
 | 
			
		||||
                    noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
			
		||||
                    placeholder="请选择结算单位" @select="unitChange"
 | 
			
		||||
                    noChildrenText="没有数据了"
 | 
			
		||||
                    noOptionsText="没有数据"
 | 
			
		||||
                    noResultsText="没有搜索结果"
 | 
			
		||||
                    placeholder="请选择结算单位"
 | 
			
		||||
                    @select="unitChange"
 | 
			
		||||
                    :multiple="true"
 | 
			
		||||
                >
 | 
			
		||||
            </treeselect>
 | 
			
		||||
                ></treeselect>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <el-form-item prop="projectIds">
 | 
			
		||||
                <treeselect
 | 
			
		||||
                    v-model="queryParams.projectId"
 | 
			
		||||
                    :options="proList" :normalizer="normalizer"
 | 
			
		||||
                    :show-count="true" style="width: 240px" :disable-branch-nodes="true"
 | 
			
		||||
                    noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
			
		||||
                    placeholder="请选择结算工程" @select="proChange" :disabled="unitIds.length == 0"
 | 
			
		||||
                    :options="proList"
 | 
			
		||||
                    :normalizer="normalizer"
 | 
			
		||||
                    :show-count="true"
 | 
			
		||||
                    style="width: 240px"
 | 
			
		||||
                    :disable-branch-nodes="true"
 | 
			
		||||
                    noChildrenText="没有数据了"
 | 
			
		||||
                    noOptionsText="没有数据"
 | 
			
		||||
                    noResultsText="没有搜索结果"
 | 
			
		||||
                    placeholder="请选择结算工程"
 | 
			
		||||
                    @select="proChange"
 | 
			
		||||
                    :disabled="unitIds.length == 0"
 | 
			
		||||
                />
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <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 prop="sltStatus">
 | 
			
		||||
                <el-select
 | 
			
		||||
                    v-model="queryParams.sltStatus"
 | 
			
		||||
                    placeholder="请选择结算状态"
 | 
			
		||||
                    clearable
 | 
			
		||||
                    filterable
 | 
			
		||||
                >
 | 
			
		||||
                <el-select v-model="queryParams.sltStatus" placeholder="请选择结算状态" clearable filterable>
 | 
			
		||||
                    <el-option
 | 
			
		||||
                        v-for="dict in dict.type.cost_status"
 | 
			
		||||
                        v-if="dict.value !== '2' && dict.value !== '1'"
 | 
			
		||||
| 
						 | 
				
			
			@ -43,36 +54,21 @@
 | 
			
		|||
                </el-select>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <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-button
 | 
			
		||||
                    type="primary"
 | 
			
		||||
                    plain
 | 
			
		||||
                    size="mini"
 | 
			
		||||
                    @click="handleApplyList"
 | 
			
		||||
                    >批量结算</el-button
 | 
			
		||||
                >
 | 
			
		||||
                <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-button type="primary" plain size="mini" @click="handleApplyList">批量结算</el-button>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
        </el-form>
 | 
			
		||||
 | 
			
		||||
        <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">
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <span>{{
 | 
			
		||||
                        (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
 | 
			
		||||
                    }}</span>
 | 
			
		||||
                    <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
            <el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
 | 
			
		||||
| 
						 | 
				
			
			@ -83,9 +79,7 @@
 | 
			
		|||
                    <span v-if="scope.row.costs != null && scope.row.costs != ''">
 | 
			
		||||
                        {{ scope.row.costs.toFixed(2) }}
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <span v-else style="color: #909399;">
 | 
			
		||||
                        无待结费用
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <span v-else style="color: #909399">无待结费用</span>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
            <el-table-column label="结算状态" align="center" prop="sltStatus" :show-overflow-tooltip="true">
 | 
			
		||||
| 
						 | 
				
			
			@ -107,19 +101,18 @@
 | 
			
		|||
            <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">
 | 
			
		||||
                <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)"
 | 
			
		||||
                        v-if="scope.row.isSlt == '0' || (scope.row.isSlt == '2')"
 | 
			
		||||
                        >结算申请
 | 
			
		||||
                        v-if="scope.row.isSlt == '0' || scope.row.isSlt == '2'"
 | 
			
		||||
                    >
 | 
			
		||||
                        结算申请
 | 
			
		||||
                    </el-button>
 | 
			
		||||
 | 
			
		||||
                    <el-button
 | 
			
		||||
                        type="primary"
 | 
			
		||||
                        plain
 | 
			
		||||
                        size="mini"
 | 
			
		||||
                        @click="openPrintDialog(scope.row)"
 | 
			
		||||
                        >协议书</el-button
 | 
			
		||||
                    >
 | 
			
		||||
                    <el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button>
 | 
			
		||||
                    <el-button type="primary" plain size="mini" @click="handleDetails(scope.row)">维修单查看</el-button>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
        </el-table>
 | 
			
		||||
| 
						 | 
				
			
			@ -141,61 +134,83 @@
 | 
			
		|||
                            机具设备有偿使用费结算协议书
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <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" style=" width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
 | 
			
		||||
                            <div
 | 
			
		||||
                                class="item"
 | 
			
		||||
                                style="width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px"
 | 
			
		||||
                            ></div>
 | 
			
		||||
                            <div class="item" style="width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
 | 
			
		||||
                                <span>协议号:{{ agreementContent.agreementCode }}</span>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 20%;">工程名称:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 80%;">{{ agreementContent.projectName }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 20%">工程名称:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 80%">{{ agreementContent.projectName }}</div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 20%;">承租单位:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">{{ agreementContent.unitName }}</div>
 | 
			
		||||
                    <div class="columnLabel" style="width: 10%;border-left: 1px solid #9c9c9c;">日期:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 30%;">{{ agreementContent.applyTime || newData }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 20%">承租单位:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">{{ agreementContent.unitName }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 10%; border-left: 1px solid #9c9c9c">日期:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 30%">
 | 
			
		||||
                                {{ agreementContent.applyTime || newData }}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 100%;">结算项目及金额(元)</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 100%">结算项目及金额(元)</div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 60%;">一、施工机具有偿使用费:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">¥ {{ agreementContent.leaseCost ? agreementContent.leaseCost.toFixed(2) : '0.00' }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 60%">一、施工机具有偿使用费:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">
 | 
			
		||||
                                ¥ {{ agreementContent.leaseCost ? agreementContent.leaseCost.toFixed(2) : '0.00' }}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 60%;">二、施工机具维修费:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">¥ {{ agreementContent.repairCost ? agreementContent.repairCost.toFixed(2) : '0.00' }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 60%">二、施工机具维修费:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">
 | 
			
		||||
                                ¥ {{ agreementContent.repairCost ? agreementContent.repairCost.toFixed(2) : '0.00' }}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 60%;">三、施工机具丢失费:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">¥ {{ agreementContent.loseCost ? agreementContent.loseCost.toFixed(2) : '0.00' }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 60%">三、施工机具丢失费:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">
 | 
			
		||||
                                ¥ {{ agreementContent.loseCost ? agreementContent.loseCost.toFixed(2) : '0.00' }}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 60%;">四、施工机具损坏赔偿费:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">¥ {{ agreementContent.scrapCost ? agreementContent.scrapCost.toFixed(2) : '0.00' }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 60%">四、施工机具损坏赔偿费:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">
 | 
			
		||||
                                ¥ {{ agreementContent.scrapCost ? agreementContent.scrapCost.toFixed(2) : '0.00' }}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="tabelColumn">
 | 
			
		||||
                    <div class="columnLabel" style="width: 60%;">五、施工机具租赁减免费:</div>
 | 
			
		||||
                    <div class="columnContent" style="width: 40%;">¥ {{ agreementContent.reductionCost ? agreementContent.reductionCost.toFixed(2) : '0.00' }}</div>
 | 
			
		||||
                            <div class="columnLabel" style="width: 60%">五、施工机具租赁减免费:</div>
 | 
			
		||||
                            <div class="columnContent" style="width: 40%">
 | 
			
		||||
                                ¥
 | 
			
		||||
                                {{
 | 
			
		||||
                                    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 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 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 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="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between">
 | 
			
		||||
                            <div class="item" style="width: 33%">
 | 
			
		||||
                                <div>
 | 
			
		||||
                                    <span>部门负责人:</span>
 | 
			
		||||
| 
						 | 
				
			
			@ -223,21 +238,89 @@
 | 
			
		|||
                <el-button @click="openPrint = false">关 闭</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </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>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
    // getProjectList,
 | 
			
		||||
  getUnitList, getUnitListFilterTeam,
 | 
			
		||||
    getUnitList,
 | 
			
		||||
    getUnitListFilterTeam
 | 
			
		||||
    // getAgreementInfoById,
 | 
			
		||||
} 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 vueEasyPrint from "vue-easy-print";
 | 
			
		||||
import Treeselect from "@riophae/vue-treeselect";
 | 
			
		||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 | 
			
		||||
import vueEasyPrint from 'vue-easy-print'
 | 
			
		||||
import Treeselect from '@riophae/vue-treeselect'
 | 
			
		||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
			
		||||
import printJS from 'print-js'
 | 
			
		||||
export default {
 | 
			
		||||
    name: 'ApplyHome',
 | 
			
		||||
| 
						 | 
				
			
			@ -265,7 +348,7 @@ export default {
 | 
			
		|||
                children: 'children',
 | 
			
		||||
                label: 'name',
 | 
			
		||||
                value: 'id',
 | 
			
		||||
                multiple: true,//false
 | 
			
		||||
                multiple: true //false
 | 
			
		||||
            },
 | 
			
		||||
            // 表格数据
 | 
			
		||||
            tableList: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -278,7 +361,7 @@ export default {
 | 
			
		|||
                unitId: null,
 | 
			
		||||
                projectId: null,
 | 
			
		||||
                agreementId: [],
 | 
			
		||||
                agreementCode: '',
 | 
			
		||||
                agreementCode: ''
 | 
			
		||||
            },
 | 
			
		||||
            openPrint: false,
 | 
			
		||||
            // 协议书内容
 | 
			
		||||
| 
						 | 
				
			
			@ -292,9 +375,24 @@ export default {
 | 
			
		|||
                scrapCost: '', // 报废费用
 | 
			
		||||
                reductionCost: '', // 减免费用
 | 
			
		||||
                costAll: '', // 合计费用
 | 
			
		||||
                costAllUpper: '', // 合计费用大写
 | 
			
		||||
                costAllUpper: '' // 合计费用大写
 | 
			
		||||
            },
 | 
			
		||||
            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() {
 | 
			
		||||
| 
						 | 
				
			
			@ -326,13 +424,13 @@ export default {
 | 
			
		|||
        /** 转换菜单数据结构 */
 | 
			
		||||
        normalizer(node) {
 | 
			
		||||
            if (node.children && !node.children.length) {
 | 
			
		||||
                delete node.children;
 | 
			
		||||
                delete node.children
 | 
			
		||||
            }
 | 
			
		||||
            return {
 | 
			
		||||
                id: node.id,
 | 
			
		||||
                label: node.name,
 | 
			
		||||
                children: node.children,
 | 
			
		||||
            };
 | 
			
		||||
                children: node.children
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 获取 来往单位 列表数据
 | 
			
		||||
        async GetUnitData() {
 | 
			
		||||
| 
						 | 
				
			
			@ -340,16 +438,16 @@ export default {
 | 
			
		|||
                // projectId: this.queryParams.projectId /*  */,
 | 
			
		||||
            }
 | 
			
		||||
            const res = await getUnitListFilterTeam(params)
 | 
			
		||||
                this.unitList = res.data;
 | 
			
		||||
            this.unitList = res.data
 | 
			
		||||
 | 
			
		||||
            if (this.queryParams.projectId) {
 | 
			
		||||
                this.getAgreementInfo()
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        unitChange(val) {
 | 
			
		||||
            console.log('Selected values:', val); // 检查选中的值
 | 
			
		||||
            console.log("xxxxxxxxx",this.queryParams.unitId)
 | 
			
		||||
            console.log("yyyyyyyyy",this.unitIds)
 | 
			
		||||
            console.log('Selected values:', val) // 检查选中的值
 | 
			
		||||
            console.log('xxxxxxxxx', this.queryParams.unitId)
 | 
			
		||||
            console.log('yyyyyyyyy', this.unitIds)
 | 
			
		||||
            setTimeout(() => {
 | 
			
		||||
                this.queryParams.projectId = null
 | 
			
		||||
                this.queryParams.agreementId = null
 | 
			
		||||
| 
						 | 
				
			
			@ -359,12 +457,12 @@ export default {
 | 
			
		|||
        },
 | 
			
		||||
        // 获取 工程名称 列表数据
 | 
			
		||||
        async GetProData() {
 | 
			
		||||
                const unitIdsAsNumbers = this.unitIds.map(id => Number(id));
 | 
			
		||||
            const unitIdsAsNumbers = this.unitIds.map(id => Number(id))
 | 
			
		||||
            const params = {
 | 
			
		||||
                    unitIds: unitIdsAsNumbers,
 | 
			
		||||
                unitIds: unitIdsAsNumbers
 | 
			
		||||
            }
 | 
			
		||||
            const res = await getProjectListByUnitIds(params)
 | 
			
		||||
                this.proList = res.data;
 | 
			
		||||
            this.proList = res.data
 | 
			
		||||
 | 
			
		||||
            this.getAgreementInfo()
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -378,19 +476,19 @@ export default {
 | 
			
		|||
            if (this.unitIds && this.unitIds.length > 0 && this.queryParams.projectId) {
 | 
			
		||||
                const params = {
 | 
			
		||||
                    unitIds: this.unitIds,
 | 
			
		||||
                    projectId: this.queryParams.projectId,
 | 
			
		||||
                    projectId: this.queryParams.projectId
 | 
			
		||||
                }
 | 
			
		||||
                const res = await getAgreementInfoById(params)
 | 
			
		||||
                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.queryParams.unitId = null
 | 
			
		||||
                    this.queryParams.projectId = null
 | 
			
		||||
                    this.GetUnitData()
 | 
			
		||||
                    this.GetProData()
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.queryParams.agreementId = res.data.map(item => item.agreementId);
 | 
			
		||||
                    this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(',');
 | 
			
		||||
                    this.queryParams.agreementId = res.data.map(item => item.agreementId)
 | 
			
		||||
                    this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(',')
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -404,10 +502,9 @@ export default {
 | 
			
		|||
                sltStatus: this.queryParams.sltStatus,
 | 
			
		||||
                agreementCode: this.queryParams.agreementCode,
 | 
			
		||||
                // ...this.queryParams,
 | 
			
		||||
                unitIds: this.unitIds,
 | 
			
		||||
 | 
			
		||||
                unitIds: this.unitIds
 | 
			
		||||
            }
 | 
			
		||||
            getSltAgreementInfo(params).then((response) => {
 | 
			
		||||
            getSltAgreementInfo(params).then(response => {
 | 
			
		||||
                this.tableList = response.data.rows
 | 
			
		||||
                this.total = response.data.total
 | 
			
		||||
                this.loading = false
 | 
			
		||||
| 
						 | 
				
			
			@ -430,21 +527,21 @@ export default {
 | 
			
		|||
                unitId: null,
 | 
			
		||||
                projectId: null,
 | 
			
		||||
                agreementId: [],
 | 
			
		||||
                agreementCode: '',
 | 
			
		||||
                agreementCode: ''
 | 
			
		||||
            }
 | 
			
		||||
            this.resetForm('queryForm')
 | 
			
		||||
            this.handleQuery()
 | 
			
		||||
        },
 | 
			
		||||
        //结算申请
 | 
			
		||||
        handleApply(row) {
 | 
			
		||||
            console.log('🚀 handleApply 被调用,传入数据:', row);
 | 
			
		||||
            let arr = [];
 | 
			
		||||
            arr.push(row);
 | 
			
		||||
            console.log('🚀 准备发送的数据:', arr);
 | 
			
		||||
            console.log('🚀 JSON化后的数据:', JSON.stringify(arr));
 | 
			
		||||
            console.log('🚀 handleApply 被调用,传入数据:', row)
 | 
			
		||||
            let arr = []
 | 
			
		||||
            arr.push(row)
 | 
			
		||||
            console.log('🚀 准备发送的数据:', arr)
 | 
			
		||||
            console.log('🚀 JSON化后的数据:', JSON.stringify(arr))
 | 
			
		||||
            // 注意:'/cost/costApplyDetail' 路由不存在,使用组件切换方式
 | 
			
		||||
            this.$emit("goDetail",JSON.stringify(arr));
 | 
			
		||||
            console.log('🚀 goDetail 事件已发出');
 | 
			
		||||
            this.$emit('goDetail', JSON.stringify(arr))
 | 
			
		||||
            console.log('🚀 goDetail 事件已发出')
 | 
			
		||||
        },
 | 
			
		||||
        handleApplyList() {
 | 
			
		||||
            if (this.ids.length < 1) {
 | 
			
		||||
| 
						 | 
				
			
			@ -453,12 +550,12 @@ export default {
 | 
			
		|||
            }
 | 
			
		||||
            if (this.ids.length > 0) {
 | 
			
		||||
                let arr = this.ids
 | 
			
		||||
                this.$emit("goDetail",JSON.stringify(arr));
 | 
			
		||||
                this.$emit('goDetail', JSON.stringify(arr))
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 多选框选中数据
 | 
			
		||||
        handleSelectionChange(selection) {
 | 
			
		||||
            this.ids = selection.map((item) => item)
 | 
			
		||||
            this.ids = selection.map(item => item)
 | 
			
		||||
            this.single = selection.length != 1
 | 
			
		||||
            this.multiple = !selection.length
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -470,16 +567,51 @@ export default {
 | 
			
		|||
                if (!res.data) return
 | 
			
		||||
                this.agreementContent = res.data
 | 
			
		||||
                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 中文大写
 | 
			
		||||
                this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
 | 
			
		||||
            } catch (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() {
 | 
			
		||||
          this.$refs.remarksPrintRef.print();
 | 
			
		||||
            this.$refs.remarksPrintRef.print()
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        /** 删除按钮操作 */
 | 
			
		||||
| 
						 | 
				
			
			@ -500,8 +632,8 @@ export default {
 | 
			
		|||
            // this.download('material/agreementInfo/export', {
 | 
			
		||||
            //   ...this.queryParams
 | 
			
		||||
            // }, `协议_${new Date().getTime()}.xlsx`)
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue