From 1ad5d1a430ded26a55e15421e3bc61024ba51be3 Mon Sep 17 00:00:00 2001 From: lzc Date: Thu, 6 Mar 2025 16:20:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=8D=E6=A4=8D=E8=A7=84=E5=88=92=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E8=A1=8C=E6=94=BF=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/apis/land.js | 12 +- .../views/dict/component/dictCrop/index.vue | 255 +++++------------- .../component/landCassification/index.vue | 129 ++++----- .../src/views/dict/component/region/index.vue | 105 +++----- .../landManage/component/landPartol/index.vue | 145 +++++++++- .../landManage/component/plantPlan/index.vue | 105 +------- 6 files changed, 325 insertions(+), 426 deletions(-) diff --git a/sub-government-affairs-service/src/apis/land.js b/sub-government-affairs-service/src/apis/land.js index e1425e4..242ed92 100644 --- a/sub-government-affairs-service/src/apis/land.js +++ b/sub-government-affairs-service/src/apis/land.js @@ -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', + }); +} diff --git a/sub-government-affairs-service/src/views/dict/component/dictCrop/index.vue b/sub-government-affairs-service/src/views/dict/component/dictCrop/index.vue index feddd81..86a48c9 100644 --- a/sub-government-affairs-service/src/views/dict/component/dictCrop/index.vue +++ b/sub-government-affairs-service/src/views/dict/component/dictCrop/index.vue @@ -34,7 +34,7 @@ 种植阶段详情
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -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(); + // }); }; diff --git a/sub-government-affairs-service/src/views/dict/component/landCassification/index.vue b/sub-government-affairs-service/src/views/dict/component/landCassification/index.vue index 0fffd60..b2bef4e 100644 --- a/sub-government-affairs-service/src/views/dict/component/landCassification/index.vue +++ b/sub-government-affairs-service/src/views/dict/component/landCassification/index.vue @@ -21,6 +21,8 @@ @current-change="currentChange" @size-change="sizeChange" @row-del="rowDel" + @row-save="rowSave" + @row-update="rowUpdate" >