feat
This commit is contained in:
parent
547c825e17
commit
491bb5df40
@ -13,6 +13,13 @@ export function saveLand(params = {}) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
export function exportLands(params = {}) {
|
||||
return request('/land-resource/landManage/export', {
|
||||
method: 'GET',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
export function getAnnualList(params = {}) {
|
||||
return request('land-resource/annualManage/page', {
|
||||
|
@ -76,7 +76,7 @@ import { reactive, ref, watch } from 'vue';
|
||||
import LandClassificationType from '@/components/LandClassificationType.vue';
|
||||
import CustomSelect from '@/components/CustomSelect.vue';
|
||||
import LandIsTranfer from '@/components/LandIsTranfer.vue';
|
||||
import { lnadSave, exportLands } from '@/apis/land';
|
||||
import { saveLand } from '@/apis/land';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { CommonUpload } from '@/apis';
|
||||
|
||||
@ -85,6 +85,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
landType: {
|
||||
type: String,
|
||||
default: '0',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['close']);
|
||||
/* --------------- data --------------- */
|
||||
@ -155,11 +159,12 @@ async function handleSubmit() {
|
||||
...baseInfo,
|
||||
...propertyInfo,
|
||||
isDraftsSave: 0,
|
||||
landType: props.landType,
|
||||
};
|
||||
let ids = '';
|
||||
propertyInfo.propertyCertificateUrl.map((item) => (ids += item.id));
|
||||
data.propertyCertificateUrl = ids;
|
||||
const res = await lnadSave(data);
|
||||
const res = await saveLand(data);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('保存成功');
|
||||
resFrom();
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<CustCard>
|
||||
<el-radio-group v-model="searchCondition.draftsSaveType" class="lands_types" style="margin-bottom: 30px" @change="getList()">
|
||||
<el-radio-group v-model="searchCondition.landType" class="lands_types" style="margin-bottom: 30px" @change="getList()">
|
||||
<el-radio-button v-for="item in landsType" :key="'landsType_' + item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</el-radio-button>
|
||||
@ -29,7 +29,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="options_btns">
|
||||
<el-button v-for="(item, i) in btns" :key="'btns_' + i" type="primary" :disabled="item.needKey && item.disabled" @click="item.method">
|
||||
<el-button v-for="(item, i) in btns" :key="'btns_' + i" type="primary" @click="item.method">
|
||||
{{ item.label }}
|
||||
</el-button>
|
||||
</div>
|
||||
@ -53,19 +53,25 @@
|
||||
<el-table-column label="是否上传附件" prop="isUpload" width="110">
|
||||
<template #default="{ row }">{{ !row.isUpload ? '是' : '否' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="200" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button type="info" link @click="handleInfo(row)">详情</el-button>
|
||||
<el-button type="danger" link @click="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<Pagina :page-data="pageData" @page-change="(v) => handlePaginaChange(v, true)" @size-hange="(v) => handlePaginaChange(v)" />
|
||||
</CustCard>
|
||||
<CreateLand :visible="addFlag" @close="addFlag = false" />
|
||||
<CreateLand :visible="addFlag" :row-data="rowData" :land-type="searchCondition.landType" @close="addFlag = false" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import Pagina from '@/components/pagina.vue';
|
||||
import CustCard from '@/components/CustCard.vue';
|
||||
import { getLandsList } from '@/apis/land.js';
|
||||
import { getLandsList, exportLands } from '@/apis/land.js';
|
||||
import CreateLand from './common/CreateLand.vue';
|
||||
|
||||
onMounted(() => {
|
||||
@ -90,7 +96,7 @@ const landsType = ref([
|
||||
},
|
||||
]);
|
||||
const searchCondition = reactive({
|
||||
draftsSaveType: '0',
|
||||
landType: '0',
|
||||
landName: '',
|
||||
gridName: '',
|
||||
owner: '',
|
||||
@ -121,19 +127,13 @@ const btns = reactive([
|
||||
// },
|
||||
{
|
||||
label: '导入',
|
||||
needKey: true,
|
||||
disabled: true,
|
||||
method: function () {
|
||||
console.log('import');
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
needKey: true,
|
||||
disabled: true,
|
||||
method: function () {
|
||||
console.log('export');
|
||||
},
|
||||
method: handleExport,
|
||||
},
|
||||
]);
|
||||
|
||||
@ -177,6 +177,24 @@ function handlePaginaChange(v, t = false) {
|
||||
}
|
||||
getList();
|
||||
}
|
||||
const attrNames = ref(['农用地', '住宅用地', '园林']);
|
||||
async function handleExport() {
|
||||
let res = await exportLands({
|
||||
landType: searchCondition.landType,
|
||||
});
|
||||
if (res) {
|
||||
let a = document.createElement('a');
|
||||
a.download = attrNames.value[Number(searchCondition.landType)] + '.xlsx';
|
||||
let blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
let link = window.URL.createObjectURL(blob);
|
||||
a.href = link;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(link);
|
||||
}
|
||||
console.log('res', res);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user