This commit is contained in:
bb_pan 2025-11-17 15:31:49 +08:00
parent 74370c30f9
commit 1d00227a36
4 changed files with 141 additions and 105 deletions

View File

@ -54,6 +54,15 @@ export function getListUnite(data) {
})
}
// 项目部-下拉
export function getListDepartApi(data) {
return request({
url: '/material/select/getDepartList',
method: 'post',
data: data,
})
}
// 单位-下拉
export function getMaterialUnitListApi(data) {
return request({

View File

@ -51,9 +51,9 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">
<!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">
减免申请
</el-button>
</el-button> -->
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">

View File

@ -78,7 +78,7 @@
<!-- <el-table-column label="租赁期限(天)" align="center" prop="leaseDay" width="100"/>-->
<el-table-column label="授权人" align="center" prop="authPerson" width="100" />
<el-table-column label="授权人电话" align="center" prop="phone" width="120" />
<!-- <el-table-column label="分部工程" align="center" prop="branchProIdsStr" width="150"/>-->
<!-- <el-table-column label="分部工程" align="center" prop="branchProIdsStr" width="150"/>-->
<el-table-column label="租赁单位类型" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.protocol == '1'">内部单位</span>
@ -116,11 +116,11 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="租赁单位" prop="unitId">
<el-form-item label="租赁工程" prop="projectId">
<treeselect
v-model="form.unitId"
v-model="form.projectId"
:disabled="isEdits"
:options="uniteList"
:options="projectList"
:normalizer="normalizer"
:show-count="true"
style="width: 100%"
@ -128,8 +128,8 @@
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择租赁单位"
@select="unitSelect"
placeholder="请选择租赁工程"
@select="handleSelectPro"
/>
</el-form-item>
</el-col>
@ -147,11 +147,11 @@
<el-row>
<el-col :span="12">
<el-form-item label="租赁工程" prop="projectId">
<el-form-item label="租赁单位" prop="unitId">
<treeselect
v-model="form.projectId"
v-model="form.unitId"
:disabled="isEdits"
:options="projectList"
:options="uniteList"
:normalizer="normalizer"
:show-count="true"
style="width: 100%"
@ -159,7 +159,8 @@
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择租赁工程"
placeholder="请选择租赁单位"
@select="unitSelect"
/>
</el-form-item>
</el-col>
@ -217,32 +218,32 @@
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="分部工程" prop="remark">-->
<!-- <el-select-->
<!-- clearable-->
<!-- multiple-->
<!-- filterable-->
<!-- style="width: 100%"-->
<!-- placeholder="请选择分部工程"-->
<!-- v-model="form.branchProIds"-->
<!-- >-->
<!-- <el-option-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value * 1"-->
<!-- v-for="dict in dict.type.branch_project"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="分部工程" prop="remark">-->
<!-- <el-select-->
<!-- clearable-->
<!-- multiple-->
<!-- filterable-->
<!-- style="width: 100%"-->
<!-- placeholder="请选择分部工程"-->
<!-- v-model="form.branchProIds"-->
<!-- >-->
<!-- <el-option-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value * 1"-->
<!-- v-for="dict in dict.type.branch_project"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="所属项目部" prop="projectUnitId">
<treeselect
v-model="form.projectUnitId"
:disabled="isEdits"
:options="uniteList"
:options="departList"
:normalizer="normalizer"
:show-count="true"
style="width: 100%"
@ -255,11 +256,9 @@
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
@ -362,9 +361,9 @@
<el-descriptions-item label="租赁单位类型">
{{ form.protocol === '1' ? '内部单位' : '外部单位' }}
</el-descriptions-item>
<!-- <el-descriptions-item label="分部工程">-->
<!-- {{ form.branchProIdsStr }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="分部工程">-->
<!-- {{ form.branchProIdsStr }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="备注">
{{ form.remark }}
</el-descriptions-item>
@ -494,7 +493,7 @@ import { getToken } from '@/utils/auth'
import { Base64 } from 'js-base64'
import { forEach } from 'jszip'
import { listUser } from '@/api/system/user'
import { getListProject, getListUnite } from '@/api/lease/apply'
import { getListProject, getListUnite, getListDepartApi } from '@/api/lease/apply'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -531,6 +530,7 @@ export default {
unitList: [],
//
uniteList: [],
departList: [],
selectTreeProps: {
children: 'children',
label: 'name',
@ -566,7 +566,7 @@ export default {
status: undefined,
time: null, //
startTime: undefined,
endTime: undefined,
endTime: undefined
},
fileList: [],
businessLicenseFileList: [],
@ -636,7 +636,7 @@ export default {
message: '请选择租赁类型',
trigger: 'change'
}
],
]
},
//
@ -663,8 +663,8 @@ export default {
this.queryParams.startTime = this.format(date)
this.queryParams.endTime = this.format(date)
this.getList()
this.getUnitList()
this.getProjectList()
// this.getUnitList()
// this.getProjectList()
},
methods: {
format(date) {
@ -865,7 +865,12 @@ export default {
this.maForm.unitId = ''
}
},
handleSelectPro(val) {
console.log('🚀 ~ val:', val)
this.form.projectUnitId = ''
this.departList = null
this.getListDepart(val.name)
},
projectChange(val) {
if (val && val.length > 0) {
this.maForm.projectId = this.projectId[this.projectId.length - 1]
@ -873,10 +878,22 @@ export default {
this.maForm.projectId = ''
}
},
async getListDepart(projectName) {
try {
const res = await getListDepartApi({ projectName })
console.log('🚀 ~ res:', res)
this.departList = res.data
console.log('🚀 ~ this.departList:', this.departList)
} catch (error) {
console.log('🚀 ~ error:', error)
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.getUnitList()
this.getProjectList()
this.uploadKey = Date.now()
this.delBusinessFileIdList = []
this.businessLicenseListTemp = []
@ -909,7 +926,7 @@ export default {
this.maForm.projectId = response.data.projectId
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId)
this.projectId = this.treeParentsById(this.projectList, this.maForm.projectId)
console.log("vvvvvvvvvvvvvvvvv",this.form)
console.log('vvvvvvvvvvvvvvvvv', this.form)
var taskId = this.form.taskId
console.log(taskId)
if (taskId) {
@ -1062,11 +1079,11 @@ export default {
// this.form.fileName =null;
const reqData = new FormData()
if (this.businessLicenseListTemp.length != 0) {
console.log("xxxxxxxxxxxxxx",this.form)
console.log('xxxxxxxxxxxxxx', this.form)
await this.getImaUploadEdit(), await this.editAgreementTemp(this.form)
await this.deleteFile()
} else {
console.log("xxxxxxxxxxxxxx",this.form)
console.log('xxxxxxxxxxxxxx', this.form)
await this.editAgreementTemp(this.form)
await this.deleteFile()
}
@ -1212,21 +1229,21 @@ export default {
},
handleExport() {
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
const formatTime = date => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
}
const currentTime = formatTime(new Date());
const currentTime = formatTime(new Date())
this.download(
'/material/bm_agreement_info/export',
{
...this.queryParams,
...this.queryParams
// startTime: this.queryParams.time ? this.queryParams.time[0] : '',
// endTime: this.queryParams.time ? this.queryParams.time[1] : ''
},

View File

@ -243,6 +243,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportDetails">导出明细数据</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -672,6 +673,15 @@ export default {
`工器具台账_${new Date().getTime()}.xlsx`
)
},
handleExportDetails() {
this.download(
'material/material_maMachine/exportRetainedEquipmentDetails',
{
...this.queryParams
},
`工器具台账详情_${new Date().getTime()}.xlsx`
)
},
//
openRecords(row) {
this.dialogList = []