种植规划已经行政信息修改
This commit is contained in:
parent
329b47255c
commit
1ad5d1a430
@ -209,9 +209,17 @@ export function savelandInspection(data) {
|
||||
});
|
||||
}
|
||||
|
||||
export function editlandInspection(data = {}) {
|
||||
return request('land-resource/landInspection/update', {
|
||||
export function enrolllandInspection(data = {}) {
|
||||
return request('land-resource/landInspection/registrationResult', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function exportlandInspection(params = {}) {
|
||||
return request('/land-resource/landInspection/export', {
|
||||
method: 'GET',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
<el-text class="mx-1" size="large">种植阶段详情</el-text>
|
||||
<div style="margin-top: 16px">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
ref="stateCrudRef"
|
||||
v-model="stageState.form"
|
||||
v-model:search="stageState.query"
|
||||
v-model:page="stageState.pageData"
|
||||
@ -48,6 +48,8 @@
|
||||
@current-change="stageCurrent"
|
||||
@size-change="stageSize"
|
||||
@row-del="stageRowDel"
|
||||
@row-save="stageRowSave"
|
||||
@row-update="stageRowUpdate"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" icon="Plus" @click="onStateAdd">新增</el-button>
|
||||
@ -61,61 +63,6 @@
|
||||
<custom-table-operate :actions="stageState.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog v-model="stageInfoVisible" title="种植阶段" width="800" center>
|
||||
<el-form ref="stageInfoRef" :model="stageInfoData" :rules="stageInfoRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地块:" prop="landName">
|
||||
<el-input v-model="stageInfoData.landName" placeholder="请输入地块" style="width: 240px" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="种植产物" prop="crop">
|
||||
<el-input v-model="stageInfoData.crop" placeholder="请输入种植产物" style="width: 240px" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="种植阶段" prop="stage">
|
||||
<CustomSelect
|
||||
v-model:value="stageInfoData.stage"
|
||||
:set="{
|
||||
url: '',
|
||||
options: stageOptions,
|
||||
props: {
|
||||
value: 'value',
|
||||
label: 'label',
|
||||
},
|
||||
}"
|
||||
placeholder="请选择种植阶段"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作业计划" prop="workId">
|
||||
<CustomSelect
|
||||
v-model:value="stageInfoData.workId"
|
||||
:set="{
|
||||
url: '',
|
||||
options: workOptions,
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'planName',
|
||||
},
|
||||
}"
|
||||
placeholder="请选择作业计划"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="stageCancel">取消</el-button>
|
||||
<el-button type="primary" @click="subMitStateInfo(stageInfoRef)"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -140,6 +87,7 @@ const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
const stateCrudRef = ref(null);
|
||||
const handleLandChange = async (value, form, done) => {
|
||||
if (!value || !value.item || !value.item.id) return; // 如果没有选择任何地块,则直接返回
|
||||
let val = {};
|
||||
@ -157,17 +105,21 @@ const handleLandChange = async (value, form, done) => {
|
||||
state.form.address = val?.county + val?.town + val?.village || value.item?.address;
|
||||
};
|
||||
|
||||
const jobTypeOptions = reactive([
|
||||
{ label: '施肥', value: '0' },
|
||||
{ label: '杀虫', value: '1' },
|
||||
{ label: '灌溉', value: '2' },
|
||||
]);
|
||||
|
||||
const stageOptions = reactive([
|
||||
{ value: '0', label: '苗期' },
|
||||
{ value: '1', label: '花果期' },
|
||||
{ value: '2', label: '采收期' },
|
||||
]);
|
||||
|
||||
const stageObj = reactive({
|
||||
0: '苗期',
|
||||
1: '花果期',
|
||||
2: '采收期',
|
||||
});
|
||||
const workOptions = reactive([
|
||||
{ planName: '作业计划1', id: '000001' },
|
||||
{ planName: '作业计划2', id: '000002' },
|
||||
]);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -246,21 +198,6 @@ const state = reactive({
|
||||
data: [],
|
||||
currentRow: {},
|
||||
});
|
||||
const infoVisible = ref(false);
|
||||
const infoRef = ref();
|
||||
const infoData = reactive({
|
||||
num: '',
|
||||
name: '',
|
||||
member: [],
|
||||
type: '',
|
||||
mark: '',
|
||||
target: '',
|
||||
});
|
||||
|
||||
const infoRules = reactive({
|
||||
num: [{ required: true, message: '请选择是否违法', trigger: 'blur' }],
|
||||
mark: [{ required: true, message: '请输入巡查情况', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
const stageState = reactive({
|
||||
loading: false,
|
||||
@ -286,9 +223,20 @@ const stageState = reactive({
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '作业计划', prop: 'area', disabled: true },
|
||||
{ label: '作业时间', prop: 'coordinate', disabled: true },
|
||||
{ label: '结束时间', prop: 'createTime', disabled: true },
|
||||
{
|
||||
label: '作业计划',
|
||||
prop: 'workId',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: workOptions,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '作业时间', prop: 'coordinate', disabled: true, addDisplay: false, editDisplay: false },
|
||||
{ label: '结束时间', prop: 'createTime', disabled: true, addDisplay: false, editDisplay: false },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
@ -313,32 +261,6 @@ const stageState = reactive({
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
const stageObj = reactive({
|
||||
0: '苗期',
|
||||
1: '花果期',
|
||||
2: '采收期',
|
||||
});
|
||||
const workOptions = reactive([
|
||||
{ planName: '作业计划1', id: '000001' },
|
||||
{ planName: '作业计划2', id: '000002' },
|
||||
]);
|
||||
|
||||
let stageInfoVisible = ref(false);
|
||||
const stageInfoRef = ref();
|
||||
let stageInfoData = reactive({
|
||||
landId: '', //土地主键id
|
||||
planId: '', //种植规划主键id
|
||||
crop: '', //种植产物
|
||||
stage: '', //所属阶段
|
||||
workId: '', //作业计划Id
|
||||
landName: '', //地块
|
||||
});
|
||||
|
||||
const stageInfoRules = reactive({
|
||||
stage: [{ required: true, message: '请选择所属阶段', trigger: 'blur' }],
|
||||
workId: [{ required: true, message: '请选择作业计划', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
// state.loading = true;
|
||||
@ -444,27 +366,6 @@ const onExport = () => {
|
||||
// });
|
||||
};
|
||||
|
||||
const subMitInfo = (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
infoHide();
|
||||
console.log('submit!');
|
||||
} else {
|
||||
console.log('error submit!');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const infoCancel = () => {
|
||||
infoHide();
|
||||
};
|
||||
|
||||
const infoHide = () => {
|
||||
infoRef.value && infoRef.value.resetFields();
|
||||
infoVisible.value = false;
|
||||
};
|
||||
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
console.info('更新');
|
||||
// editOperationRecord(row)
|
||||
@ -564,61 +465,7 @@ const stageRowDel = (row, index, done) => {
|
||||
.catch(() => {});
|
||||
};
|
||||
const stageRowEdit = (row) => {
|
||||
stageInfoData.landName = row.landName ? row.landName : state.currentRow.landName || '';
|
||||
stageInfoData.landId = row.landId ? row.landId : state.currentRow.landId || '';
|
||||
stageInfoData.crop = row.crop ? row.crop : state.currentRow.crop || '';
|
||||
stageInfoData.stage = row.stage.toString() || '0';
|
||||
stageInfoVisible.value = true;
|
||||
};
|
||||
|
||||
const stageinfoHide = () => {
|
||||
stageInfoRef.value && stageInfoRef.value.resetFields();
|
||||
stageInfoVisible.value = false;
|
||||
};
|
||||
|
||||
const subMitStateInfo = (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
let parmer = {
|
||||
planId: state.currentRow.id || '', //种植规划主键id
|
||||
stage: stageInfoData.stage || 0, //种植阶段:0->苗期,1>花果期,2->采收期
|
||||
workId: stageInfoData.workId || '',
|
||||
};
|
||||
|
||||
console.info('新增种植阶段', parmer);
|
||||
|
||||
if (parmer.id) {
|
||||
// editPlantingStage(parmer)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// app.$message.success('编辑成功!');
|
||||
// getStageList();
|
||||
// stageinfoHide();
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {});
|
||||
} else {
|
||||
// savePlantingStage(parmer)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// getStageList();
|
||||
// stageinfoHide();
|
||||
// app.$message.success('添加成功!');
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {});
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!');
|
||||
}
|
||||
});
|
||||
stateCrudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const onStateAdd = () => {
|
||||
@ -626,8 +473,46 @@ const onStateAdd = () => {
|
||||
app.$message.error('请选择种植产物');
|
||||
return;
|
||||
}
|
||||
stageInfoData.landName = state.currentRow.landName || '';
|
||||
stageInfoData.crop = state.currentRow.crop || '';
|
||||
stageInfoVisible.value = true;
|
||||
// stageInfoData.landName = state.currentRow.landName || '';
|
||||
// stageInfoData.crop = state.currentRow.crop || '';
|
||||
// stageInfoVisible.value = true;
|
||||
stateCrudRef.value.rowAdd();
|
||||
};
|
||||
|
||||
const stageRowSave = (row, done, loading) => {
|
||||
row.planId = state.currentRow.planId;
|
||||
console.info('stageRowSave', row);
|
||||
// savePlantingStage({ ...row })
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// app.$message.success('添加成功!');
|
||||
// done();
|
||||
// getStageList();
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading();
|
||||
// });
|
||||
};
|
||||
|
||||
const stageRowUpdate = (row, index, done, loading) => {
|
||||
console.info('stageRowUpdate');
|
||||
// editPlantingStage(row)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// app.$message.success('更新成功!');
|
||||
// done();
|
||||
// getStageList();
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading();
|
||||
// });
|
||||
};
|
||||
</script>
|
||||
|
@ -21,6 +21,8 @@
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@row-del="rowDel"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" icon="Plus" @click="onAdd">新增</el-button>
|
||||
@ -34,44 +36,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-dialog v-model="infoVisible" title="新增土地分类" width="800" center>
|
||||
<div>
|
||||
<el-form ref="infoRef" :model="infoData" :rules="infoRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col v-if="infoData.classifyId == ''" :span="12">
|
||||
<el-form-item label="土地分类:" prop="classifyName">
|
||||
<el-input v-model="infoData.classifyName" placeholder="请输入" style="width: 240px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="infoData.classifyId != ''" :span="12">
|
||||
<el-form-item label="土地分类" prop="classifyId">
|
||||
<el-select
|
||||
v-model="infoData.classifyId"
|
||||
placeholder="请选择土地分类"
|
||||
:disabled="true"
|
||||
style="width: 240px"
|
||||
:clearable="true"
|
||||
:multiple="false"
|
||||
>
|
||||
<el-option v-for="item in landUsedOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="土地类别:" prop="category">
|
||||
<el-input v-model="infoData.category" placeholder="请输入" style="width: 240px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="infoCancel">取消</el-button>
|
||||
<el-button type="primary" @click="subMitInfo(infoRef)"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</CustomCard>
|
||||
</template>
|
||||
<script setup>
|
||||
@ -85,6 +49,12 @@ const app = useApp();
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const crudRef = ref(null);
|
||||
const landUsedOptions = reactive([
|
||||
{ label: '农用地', value: '0' },
|
||||
{ label: '建设用地', value: '1' },
|
||||
{ label: '住宅用地', value: '2' },
|
||||
]);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -98,10 +68,20 @@ const state = reactive({
|
||||
addBtnText: '',
|
||||
addBtn: false,
|
||||
column: [
|
||||
{ label: '编号', prop: 'gridManager' },
|
||||
{ label: '土地分类', prop: 'gridManager' },
|
||||
{ label: '编号', prop: 'gridManager', addDisplay: false, editDisplay: false },
|
||||
{
|
||||
label: '土地分类',
|
||||
prop: 'gridManager',
|
||||
dicData: landUsedOptions,
|
||||
multiple: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '土地类别', prop: 'gridManager' },
|
||||
{ label: '状态', prop: 'gridManager' },
|
||||
{ label: '状态', prop: 'gridManager', addDisplay: false, editDisplay: false },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
@ -152,24 +132,6 @@ let typeTree = reactive([
|
||||
},
|
||||
]);
|
||||
|
||||
const infoVisible = ref(false);
|
||||
const infoRef = ref();
|
||||
const landUsedOptions = reactive([
|
||||
{ label: '农用地', value: '0' },
|
||||
{ label: '建设用地', value: '1' },
|
||||
{ label: '住宅用地', value: '2' },
|
||||
]);
|
||||
|
||||
let infoData = reactive({
|
||||
classifyId: '',
|
||||
category: '',
|
||||
classifyName: '',
|
||||
});
|
||||
|
||||
const infoRules = reactive({
|
||||
planName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
@ -232,8 +194,7 @@ const selectionChange = (rows) => {
|
||||
};
|
||||
|
||||
const handleNodeClick = (data) => {
|
||||
infoData.classifyId = data.pId ? data.pId : data.id;
|
||||
console.log(infoData);
|
||||
console.log('handleNodeClick', data);
|
||||
};
|
||||
// 编辑
|
||||
const rowStatus = (row) => {
|
||||
@ -251,22 +212,48 @@ const getStatusButtonText = (status) => {
|
||||
}
|
||||
};
|
||||
|
||||
const rowEdit = () => {};
|
||||
const rowEdit = (row) => {
|
||||
crudRef.value && crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const onAdd = () => {
|
||||
infoVisible.value = true;
|
||||
crudRef.value && crudRef.value.rowAdd();
|
||||
};
|
||||
const onExport = () => {};
|
||||
|
||||
const subMitInfo = (formEl) => {};
|
||||
|
||||
const infoCancel = () => {
|
||||
infoHide();
|
||||
const rowSave = (row, done, loading) => {
|
||||
// console.info('新增', row);
|
||||
// saveOperationRecord(row)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// app.$message.success('添加成功!');
|
||||
// done();
|
||||
// loadData();
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading();
|
||||
// });
|
||||
};
|
||||
|
||||
const infoHide = () => {
|
||||
infoRef.value && infoRef.value.resetFields();
|
||||
infoVisible.value = false;
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
console.info('更新');
|
||||
// editOperationRecord(row)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// app.$message.success('更新成功!');
|
||||
// done();
|
||||
// loadData();
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading();
|
||||
// });
|
||||
};
|
||||
|
||||
// #region
|
||||
|
@ -34,46 +34,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-dialog v-model="infoVisible" title="新增行政区域信息" width="800" center>
|
||||
<div>
|
||||
<el-form ref="infoRef" :model="infoData" :rules="infoRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col v-if="infoData.countyId != ''" :span="12">
|
||||
<el-form-item label="县" prop="countyId">
|
||||
<el-select
|
||||
v-model="infoData.countyId"
|
||||
placeholder="请选择县"
|
||||
:disabled="true"
|
||||
style="width: 240px"
|
||||
:clearable="true"
|
||||
:multiple="false"
|
||||
>
|
||||
<el-option v-for="item in countyOptions" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="infoData.townId != ''" :span="12">
|
||||
<el-form-item label="镇" prop="townId">
|
||||
<el-select v-model="infoData.townId" placeholder="请选择镇" :disabled="true" style="width: 240px" :clearable="true" :multiple="false">
|
||||
<el-option v-for="item in townOptions" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="infoData.name" placeholder="请输入" style="width: 240px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="infoCancel">取消</el-button>
|
||||
<el-button type="primary" @click="subMitInfo(infoRef)"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</CustomCard>
|
||||
</template>
|
||||
<script setup>
|
||||
@ -81,12 +41,16 @@ import { ref, reactive, onMounted } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import CustomCard from '@/components/CustomCard.vue';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
const crudRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -100,11 +64,32 @@ const state = reactive({
|
||||
addBtnText: '',
|
||||
addBtn: false,
|
||||
column: [
|
||||
{ label: '编号', prop: 'gridManager' },
|
||||
{ label: '所属区县', prop: 'gridManager' },
|
||||
{ label: '所属乡镇', prop: 'gridManager' },
|
||||
{ label: '村名', prop: 'gridManager' },
|
||||
{ label: '状态', prop: 'gridManager' },
|
||||
{ label: '编号', prop: 'gridManager', addDisplay: false, editDisplay: false },
|
||||
{
|
||||
label: '所属上级',
|
||||
prop: 'villageCode',
|
||||
type: 'cascader',
|
||||
checkStrictly: true,
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data ?? [],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{ label: '名称', prop: 'gridManager' },
|
||||
{ label: '状态', prop: 'gridManager', addDisplay: false, editDisplay: false },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
@ -160,13 +145,6 @@ let typeTree = reactive([
|
||||
children: [{ label: '镇1', children: [], id: '11', pId: '10', level: '1' }],
|
||||
},
|
||||
]);
|
||||
|
||||
const infoVisible = ref(false);
|
||||
const infoRef = ref();
|
||||
const countyOptions = reactive([
|
||||
{ label: '耿马县', id: '0' },
|
||||
{ label: '县1', id: '1' },
|
||||
]);
|
||||
let townOptions = reactive([]);
|
||||
|
||||
let infoData = reactive({
|
||||
@ -175,10 +153,6 @@ let infoData = reactive({
|
||||
name: '',
|
||||
});
|
||||
|
||||
const infoRules = reactive({
|
||||
planName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
@ -278,24 +252,15 @@ const getStatusButtonText = (status) => {
|
||||
}
|
||||
};
|
||||
|
||||
const rowEdit = () => {};
|
||||
const rowEdit = (row) => {
|
||||
crudRef.value && crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const onAdd = () => {
|
||||
infoVisible.value = true;
|
||||
// infoVisible.value = true;
|
||||
crudRef.value && crudRef.value.rowAdd();
|
||||
};
|
||||
const onExport = () => {};
|
||||
|
||||
const subMitInfo = (formEl) => {};
|
||||
|
||||
const infoCancel = () => {
|
||||
infoHide();
|
||||
};
|
||||
|
||||
const infoHide = () => {
|
||||
infoRef.value && infoRef.value.resetFields();
|
||||
infoVisible.value = false;
|
||||
};
|
||||
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
@ -24,6 +24,16 @@
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
|
||||
<template #isIllegal="{ row }">
|
||||
<el-tag v-if="row.isIllegal == '1'" type="danger">是</el-tag>
|
||||
<el-tag v-if="row.isIllegal == '0'" type="success">否</el-tag>
|
||||
</template>
|
||||
|
||||
<template #inspectionStatus="{ row }">
|
||||
<el-tag v-if="row.inspectionStatus == '1'" type="success">已结束</el-tag>
|
||||
<el-tag v-if="row.inspectionStatus == '0'">进行中</el-tag>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog v-model="infoVisible" title="巡查任务" width="800" center>
|
||||
@ -69,13 +79,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { reactive, ref, h } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { compact } from 'lodash';
|
||||
import { getlandInspection, savelandInspection, editlandInspection, exportOperationRecord, getAddrCropByLand } from '@/apis/land';
|
||||
import { getlandInspection, savelandInspection, enrolllandInspection, exportlandInspection, getAddrCropByLand } from '@/apis/land';
|
||||
import { progressProps } from 'element-plus';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
@ -103,6 +113,7 @@ const jobTypeOptions = reactive([
|
||||
{ label: '杀虫', value: '1' },
|
||||
{ label: '灌溉', value: '2' },
|
||||
]);
|
||||
const isDisabled = ref(false);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -117,12 +128,14 @@ const state = reactive({
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtnText: '新增',
|
||||
updateBtnText: '确定',
|
||||
column: [
|
||||
{
|
||||
label: '任务编号',
|
||||
prop: 'taskCode',
|
||||
fixed: true,
|
||||
search: true,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
@ -135,6 +148,7 @@ const state = reactive({
|
||||
search: true,
|
||||
width: '240px',
|
||||
showOverflowTooltip: true,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
@ -146,6 +160,7 @@ const state = reactive({
|
||||
search: true,
|
||||
prop: 'taskMembers',
|
||||
disabled: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
@ -155,6 +170,7 @@ const state = reactive({
|
||||
{
|
||||
label: '巡查类型',
|
||||
prop: 'inspectionType',
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
@ -164,6 +180,7 @@ const state = reactive({
|
||||
{
|
||||
label: '巡查对象',
|
||||
prop: 'inspectionTarget',
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
@ -174,6 +191,9 @@ const state = reactive({
|
||||
label: '注意事项',
|
||||
prop: 'notes',
|
||||
type: 'textarea',
|
||||
minRows: 2, // 设置最小行数
|
||||
maxRows: 5, // 设置最大行数
|
||||
editDisplay: false,
|
||||
rows: 1,
|
||||
rules: {
|
||||
required: true,
|
||||
@ -181,6 +201,111 @@ const state = reactive({
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否违法',
|
||||
prop: 'isIllegal',
|
||||
editDisplay: false,
|
||||
addDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'inspectionStatus',
|
||||
editDisplay: false,
|
||||
addDisplay: false,
|
||||
},
|
||||
],
|
||||
group: [
|
||||
{
|
||||
label: '任务信息>',
|
||||
prop: 'caseInfo',
|
||||
addDisplay: false,
|
||||
column: [
|
||||
{
|
||||
label: '任务编号',
|
||||
prop: 'taskCode',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '任务名称',
|
||||
prop: 'taskName',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '任务成员',
|
||||
prop: 'taskMembers',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '巡查类型',
|
||||
prop: 'inspectionType',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '巡查对象',
|
||||
prop: 'inspectionTarget',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '注意事项',
|
||||
prop: 'notes',
|
||||
render: ({ row }) => {
|
||||
return h('span', {}, row.taskCode);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '巡查信息登记>',
|
||||
prop: 'caseInfo',
|
||||
addDisplay: false,
|
||||
column: [
|
||||
{
|
||||
label: '是否违法',
|
||||
prop: 'isIllegal',
|
||||
span: 24,
|
||||
display: true,
|
||||
type: 'radio',
|
||||
editDisplay: true,
|
||||
disabled: isDisabled,
|
||||
dicData: [
|
||||
{
|
||||
label: '是',
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
label: '否',
|
||||
value: '0',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '巡查情况',
|
||||
prop: 'inspectionSituation',
|
||||
type: 'textarea',
|
||||
disabled: isDisabled,
|
||||
span: 24,
|
||||
minRows: 3, // 设置最小行数
|
||||
maxRows: 5, // 设置最大行数
|
||||
display: true,
|
||||
editDisplay: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
searchColumn: [],
|
||||
actions: [
|
||||
@ -295,15 +420,21 @@ const rowSave = (row, done, loading) => {
|
||||
const doEnroll = (row) => {
|
||||
console.info('doEnroll', row);
|
||||
// infoVisible.value = true;
|
||||
isDisabled.value = row.inspectionStatus == '1';
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
console.info('更新');
|
||||
editlandInspection(row)
|
||||
console.info('登记结果');
|
||||
let parmer = {
|
||||
id: row.id || '',
|
||||
isIllegal: row.isIllegal || '0', //巡查结果是否违法(0 否,1 是)
|
||||
inspectionSituation: row.inspectionSituation || '', //巡查情况
|
||||
};
|
||||
enrolllandInspection(parmer)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
app.$message.success('登记结果成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
@ -324,7 +455,7 @@ const onExport = () => {
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '土地巡查明细表';
|
||||
exportOperationRecord(state.query)
|
||||
exportlandInspection(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
|
@ -83,57 +83,6 @@
|
||||
<custom-table-operate :actions="stageState.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<!-- <el-dialog v-model="stageInfoVisible" title="种植阶段" width="800" center>
|
||||
<el-form ref="stageInfoRef" :model="stageInfoData" :rules="stageInfoRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地块:" prop="landName">
|
||||
<el-input v-model="stageInfoData.landName" placeholder="请输入地块" style="width: 240px" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="种植产物" prop="crop">
|
||||
<el-input v-model="stageInfoData.crop" placeholder="请输入种植产物" style="width: 240px" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="种植阶段" prop="stage">
|
||||
<CustomSelect
|
||||
v-model:value="stageInfoData.stage"
|
||||
:set="{
|
||||
url: '',
|
||||
options: stageOptions,
|
||||
props: {
|
||||
value: 'value',
|
||||
label: 'label',
|
||||
},
|
||||
}"
|
||||
placeholder="请选择种植阶段"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作业计划" prop="workId">
|
||||
<CustomSelect
|
||||
v-model:value="stageInfoData.workId"
|
||||
:set="{
|
||||
url: '',
|
||||
options: workOptions,
|
||||
}"
|
||||
placeholder="请选择作业计划"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="stageCancel">取消</el-button>
|
||||
<el-button type="primary" @click="subMitStateInfo(stageInfoRef)"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -142,7 +91,6 @@ import { reactive, ref } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { compact } from 'lodash';
|
||||
import {
|
||||
getPlanList,
|
||||
savePlan,
|
||||
@ -154,8 +102,6 @@ import {
|
||||
editPlantingStage,
|
||||
delPlantingStage,
|
||||
} from '@/apis/land.js';
|
||||
import CustomCard from '@/components/CustomCard.vue';
|
||||
import CustomSelect from '@/components/CustomSelect.vue';
|
||||
import { isEmpty, imageToBase64, getAssetsFile, downloadFile } from '@/utils';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
@ -393,35 +339,12 @@ let infoFirst = ref({
|
||||
planDate: '',
|
||||
});
|
||||
|
||||
const infoRules = reactive({
|
||||
crop: [{ required: true, message: '请输入种植产物', trigger: 'blur' }],
|
||||
planId: [{ required: true, message: '请选择种植计划', trigger: 'blur' }],
|
||||
seedSupplier: [{ required: true, message: '请输入供应商', trigger: 'blur' }],
|
||||
planDate: [{ required: true, message: '请选择种植时间', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
const stageObj = reactive({
|
||||
0: '苗期',
|
||||
1: '花果期',
|
||||
2: '采收期',
|
||||
});
|
||||
|
||||
let stageInfoVisible = ref(false);
|
||||
const stageInfoRef = ref();
|
||||
let stageInfoData = reactive({
|
||||
landId: '', //土地主键id
|
||||
planId: '', //种植规划主键id
|
||||
crop: '', //种植产物
|
||||
stage: '', //所属阶段
|
||||
workId: '', //作业计划Id
|
||||
landName: '', //地块
|
||||
});
|
||||
|
||||
const stageInfoRules = reactive({
|
||||
stage: [{ required: true, message: '请选择所属阶段', trigger: 'blur' }],
|
||||
workId: [{ required: true, message: '请选择作业计划', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
@ -571,20 +494,20 @@ const onExport = () => {
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '种植记录明细表';
|
||||
// exportPlan(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.status === 200) {
|
||||
// downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
// app.$message.success('导出成功!');
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error('导出失败!');
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
const fileName = '种植规划明细表';
|
||||
exportPlan(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
app.$message.success('导出成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导出失败!');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
const onAdd = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user