494 lines
11 KiB
Vue
Raw Normal View History

2025-02-25 17:30:50 +08:00
<template>
2025-02-28 16:45:42 +08:00
<CustomCard>
<avue-crud
2025-03-05 17:30:00 +08:00
ref="crudRef"
2025-02-28 16:45:42 +08:00
v-model:page="page"
v-model:search="searchData"
:option="option"
:data="data"
:table-loading="_loading"
@current-change="handlePageChange"
@size-change="handleSizeChange"
@search-change="handleSearch"
@row-save="handleRowSave"
2025-03-05 17:30:00 +08:00
@row-update="handleExamine"
2025-02-28 16:45:42 +08:00
>
<template #menu="{ row }">
<el-button type="primary" @click="handleInfo(row)">登记处理</el-button>
</template>
2025-03-05 17:30:00 +08:00
<template #sceneProof-form>
2025-03-10 17:32:04 +08:00
<section class="proof_content_">
2025-03-05 17:30:00 +08:00
<span>照片视频</span>
2025-03-10 17:32:04 +08:00
<Attrs v-model:attrs="examineForm.proof" type="add" :limit="5" :file-num="5" accept="image/*,video/*" />
2025-03-05 17:30:00 +08:00
</section>
</template>
<template #attrs_-form>
2025-03-10 17:32:04 +08:00
<FileUpload v-model:attrs="examineForm.attrs" :format="['rar', 'zip', 'doc', 'docx', 'pdf']" />
2025-03-05 17:30:00 +08:00
</template>
2025-02-28 16:45:42 +08:00
</avue-crud>
</CustomCard>
<Register v-model:visible="caseInfo.visible" />
2025-02-25 17:30:50 +08:00
</template>
2025-02-28 16:45:42 +08:00
<script setup>
2025-03-10 17:32:04 +08:00
import { ref, reactive, h, onMounted } from 'vue';
2025-02-28 16:45:42 +08:00
import { CRUD_OPTIONS } from '@/config';
import CustomCard from '@/components/CustomCard.vue';
import { useUserStore } from '@/store/modules/user';
import Register from './common/Register.vue';
2025-03-05 17:30:00 +08:00
import FileUpload from './common/FileUpload.vue';
2025-03-10 17:32:04 +08:00
import { getLandIllegal, createLandIllegal, registerLandIllegal, illegalInfo } from '@/apis/land';
import { ElMessage, ElMessageBox } from 'element-plus';
import Attrs from '../../common/Attrs.vue';
2025-02-28 16:45:42 +08:00
const { VITE_APP_BASE_API } = import.meta.env;
const UserStore = useUserStore();
2025-02-25 17:30:50 +08:00
2025-03-10 17:32:04 +08:00
onMounted(() => {
getList();
});
2025-02-25 17:30:50 +08:00
/* --------------- data --------------- */
// #region
2025-03-05 17:30:00 +08:00
const crudRef = ref();
2025-02-28 16:45:42 +08:00
const searchData = ref({
2025-03-10 17:32:04 +08:00
caseId: '',
caseResult: '',
2025-02-28 16:45:42 +08:00
});
const page = ref({
currentPage: 1,
pageSize: 10,
total: 3,
});
const _loading = ref(false);
2025-03-10 17:32:04 +08:00
const data = ref([]);
const landsArr = ref([]);
2025-02-28 16:45:42 +08:00
const option = ref({
...CRUD_OPTIONS,
refreshBtn: false,
2025-03-10 17:32:04 +08:00
rowKey: 'caseId',
2025-03-05 17:30:00 +08:00
editTitle: '案件登记处理',
2025-02-28 16:45:42 +08:00
column: [
{
label: '案件编号',
2025-03-10 17:32:04 +08:00
prop: 'caseId',
2025-02-28 16:45:42 +08:00
search: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-03-10 17:32:04 +08:00
rules: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
2025-02-28 16:45:42 +08:00
},
{
label: '案件名称',
2025-03-10 17:32:04 +08:00
prop: 'caseName',
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-03-10 17:32:04 +08:00
rules: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
2025-02-28 16:45:42 +08:00
},
{
label: '关联单位',
2025-03-10 17:32:04 +08:00
prop: 'relatedUnit',
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '关联土地·',
2025-03-10 17:32:04 +08:00
prop: 'landId',
2025-02-28 16:45:42 +08:00
type: 'select',
addDisplay: true,
hide: true,
dicUrl: `${VITE_APP_BASE_API}/land-resource/landManage/page`,
dicQuery: {
current: 1,
size: 9999,
},
props: {
value: 'id',
label: 'landName',
},
dicMethod: 'get',
dicHeaders: {
authorization: UserStore.token,
},
2025-03-10 17:32:04 +08:00
dicFormatter: (res) => {
landsArr.value = res?.data?.records ?? [];
return res?.data?.records ?? [];
},
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-03-10 17:32:04 +08:00
rules: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
2025-02-28 16:45:42 +08:00
},
{
label: '联系电话',
prop: 'phone',
hide: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '法定代表人',
2025-03-10 17:32:04 +08:00
prop: 'legalPerson',
2025-02-28 16:45:42 +08:00
addDisplay: true,
hide: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '统一社会信用代码',
2025-03-10 17:32:04 +08:00
prop: 'usciCode',
2025-02-28 16:45:42 +08:00
addDisplay: true,
hide: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '违法情况',
2025-03-10 17:32:04 +08:00
prop: 'violationSituation',
2025-02-28 16:45:42 +08:00
type: 'textarea',
addDisplay: true,
hide: true,
width: '100%',
span: 24,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '负责人',
2025-03-10 17:32:04 +08:00
prop: 'responsiblePerson',
2025-02-28 16:45:42 +08:00
display: false,
addDisplay: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '案件进度',
2025-03-10 17:32:04 +08:00
prop: 'caseResult',
2025-02-28 16:45:42 +08:00
display: false,
search: true,
addDisplay: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '案件结果',
2025-03-10 17:32:04 +08:00
prop: 'caseResult',
2025-02-28 16:45:42 +08:00
display: false,
addDisplay: true,
2025-03-05 17:30:00 +08:00
editDisplay: false,
viewDisplay: false,
2025-02-28 16:45:42 +08:00
},
{
label: '处理时间',
2025-03-10 17:32:04 +08:00
prop: 'updateTime',
2025-02-28 16:45:42 +08:00
display: false,
addDisplay: false,
editDisplay: true,
2025-03-05 17:30:00 +08:00
viewDisplay: false,
},
],
group: [
{
label: '案件信息>',
prop: 'caseInfo',
addDisplay: false,
column: [
{
label: '案件名称',
2025-03-10 17:32:04 +08:00
prop: 'caseName',
2025-03-05 17:30:00 +08:00
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.caseName);
2025-03-05 17:30:00 +08:00
},
},
{
label: '案件编号',
2025-03-10 17:32:04 +08:00
prop: 'caseId',
2025-03-05 17:30:00 +08:00
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.caseId);
2025-03-05 17:30:00 +08:00
},
},
{
label: '关联单位',
2025-03-10 17:32:04 +08:00
prop: 'relatedUnit',
2025-03-05 17:30:00 +08:00
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.relatedUnit);
2025-03-05 17:30:00 +08:00
},
},
{
label: '关联地块',
prop: 'land',
render: ({ row }) => {
return h('span', {}, row.land);
},
},
{
label: '法定代表人',
2025-03-10 17:32:04 +08:00
prop: 'legalPerson',
2025-03-05 17:30:00 +08:00
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.legalPerson);
2025-03-05 17:30:00 +08:00
},
},
{
label: '联系电话',
prop: 'phone',
render: ({ row }) => {
return h('span', {}, row.phone);
},
},
{
label: '统一社会信用代码',
2025-03-10 17:32:04 +08:00
prop: 'usciCode',
2025-03-05 17:30:00 +08:00
span: 24,
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.usciCode);
2025-03-05 17:30:00 +08:00
},
},
{
label: '违法情况',
2025-03-10 17:32:04 +08:00
prop: 'violationSituation',
2025-03-05 17:30:00 +08:00
span: 24,
render: ({ row }) => {
2025-03-10 17:32:04 +08:00
return h('span', {}, row.violationSituation);
2025-03-05 17:30:00 +08:00
},
},
],
},
{
label: '案件处理>',
prop: 'caseHandle',
addDisplay: false,
column: [
{
label: '案情记录',
2025-03-10 17:32:04 +08:00
prop: 'caseRecord',
2025-03-05 17:30:00 +08:00
type: 'textarea',
span: 24,
display: true,
editDisplay: true,
},
{
label: '现场取证',
prop: 'sceneProof',
span: 24,
display: true,
editDisplay: true,
},
{
label: '执法文书',
2025-03-10 17:32:04 +08:00
prop: 'lawDocument',
2025-03-05 17:30:00 +08:00
labelSuffix: '件',
span: 24,
display: true,
type: 'radio',
editDisplay: true,
dicData: [
{
label: '协助调查函',
2025-03-10 17:32:04 +08:00
value: 1,
2025-03-05 17:30:00 +08:00
},
{
label: '抽样取样凭证',
2025-03-10 17:32:04 +08:00
value: 2,
2025-03-05 17:30:00 +08:00
},
{
label: '检测报告',
2025-03-10 17:32:04 +08:00
value: 3,
2025-03-05 17:30:00 +08:00
},
{
label: '其他文书',
2025-03-10 17:32:04 +08:00
value: 4,
2025-03-05 17:30:00 +08:00
},
],
},
{
label: '',
prop: 'attrs_',
},
],
},
{
label: '处理结果>',
prop: 'caseResult_',
addDisplay: false,
column: [
{
label: '案件处理结果',
prop: 'caseResult',
type: 'radio',
2025-03-10 17:32:04 +08:00
value: 1,
2025-03-05 17:30:00 +08:00
dicData: [
{
label: '正常营业,无违规行为',
2025-03-10 17:32:04 +08:00
value: 1,
2025-03-05 17:30:00 +08:00
},
{
label: '简易程序,当场行政处罚',
2025-03-10 17:32:04 +08:00
value: 2,
2025-03-05 17:30:00 +08:00
},
{
label: '普通程序,当场处罚立案审批',
2025-03-10 17:32:04 +08:00
value: 3,
2025-03-05 17:30:00 +08:00
},
{
label: '移送程序,案件移送',
2025-03-10 17:32:04 +08:00
value: 4,
2025-03-05 17:30:00 +08:00
},
{
label: '特殊程序,案件终止',
2025-03-10 17:32:04 +08:00
value: 5,
2025-03-05 17:30:00 +08:00
},
],
span: 24,
display: true,
editDisplay: true,
},
],
2025-02-28 16:45:42 +08:00
},
],
});
const caseInfo = ref({
visible: false,
});
2025-03-05 17:30:00 +08:00
const examineForm = reactive({
2025-03-10 17:32:04 +08:00
caseId: '',
2025-03-05 17:30:00 +08:00
proof: [],
attrs: [],
});
2025-02-25 17:30:50 +08:00
// #endregion
/* --------------- methods --------------- */
2025-02-28 16:45:42 +08:00
// #region
2025-03-10 17:32:04 +08:00
async function getList() {
let params = {
current: page.value.currentPage,
size: page.value.pageSize,
...searchData.value,
};
console.log('params -- ', params);
let res = await getLandIllegal(params);
console.log('res -- ', res);
if (res.code == 200) {
data.value = res.data.records;
page.value.total = res.data.total;
}
}
2025-02-28 16:45:42 +08:00
function handlePageChange(val) {
console.log('page', val);
page.value.currentPage = val;
2025-03-10 17:32:04 +08:00
getList();
2025-02-28 16:45:42 +08:00
}
function handleSizeChange(val) {
2025-03-10 17:32:04 +08:00
page.value.currentPage = 1;
2025-02-28 16:45:42 +08:00
page.value.pageSize = val;
2025-03-10 17:32:04 +08:00
getList();
2025-02-28 16:45:42 +08:00
}
function handleInfo(row) {
console.log('row', row);
2025-03-10 17:32:04 +08:00
examineForm.caseId = row.caseId;
2025-03-05 17:30:00 +08:00
// caseInfo.value.visible = true;
crudRef.value.rowEdit(row);
// crudRef.value.rowView(row);
2025-02-28 16:45:42 +08:00
}
function handleSearch(form, done) {
console.log('search', form);
let t = setTimeout(() => {
clearTimeout(t);
done();
}, 1000);
}
2025-03-10 17:32:04 +08:00
async function handleRowSave(val, done, loading) {
let data = {
caseId: val.caseId,
caseName: val.caseName,
relatedUnit: val.relatedUnit,
relatedLand: val.landId,
phone: val.phone,
legalPerson: val.legalPerson,
usciCode: val.usciCode,
violationSituation: val.violationSituation,
};
if (val.landId) {
data.relatedLandname = landsArr.value.find((item) => item.id == val.landId).landName;
}
console.log('val', data);
let res = await createLandIllegal(data);
if (res.code == 200) {
ElMessage.success('创建成功');
getList();
2025-02-28 16:45:42 +08:00
done();
2025-03-10 17:32:04 +08:00
ElMessageBox.confirm('土地违法案件信息已添加,是否现在添加案件处理信息与结果。后续也可以单独添加。', '案件信息已添加', {
confirmButtonText: '是,现在添加',
cancelButtonText: '否,后续添加',
type: 'success',
})
.then(() => {
// getDetails('c-1');
})
.catch(() => {});
}
loading();
2025-02-28 16:45:42 +08:00
}
2025-03-05 17:30:00 +08:00
2025-03-10 17:32:04 +08:00
async function handleExamine(val, done, loading) {
let data = {
caseId: examineForm.caseId,
caseRecord: val.caseRecord,
caseResult: val.caseResult,
lawDocument: val.lawDocument,
};
if (examineForm.proof.length > 0) {
data.evidenceFile = examineForm.proof.map((v) => v.url).join();
}
if (examineForm.attrs.length > 0) {
data.lawFile = examineForm.attrs.map((v) => `${v.name}&${v.url}`).join();
}
console.log('val', data);
let res = await registerLandIllegal(data);
console.log('res --', res);
2025-03-05 17:30:00 +08:00
loading();
2025-03-10 17:32:04 +08:00
if (res.code == 200) {
ElMessage.success('提交成功');
getList();
}
}
async function getDetails(id) {
let res = await illegalInfo(id);
console.log('detaile', res);
2025-03-05 17:30:00 +08:00
}
2025-02-25 17:30:50 +08:00
// #endregion
</script>
2025-03-05 17:30:00 +08:00
<style lang="scss" scoped>
2025-03-10 17:32:04 +08:00
.proof_content_ {
display: flex;
> section {
flex: 1;
}
}
2025-03-05 17:30:00 +08:00
::v-deep() {
.attrs_ {
.el-form-item__label {
opacity: 0;
}
}
}
</style>