农产品流通溯源管理 - 采收质检赋码管理模块对接后台联调
This commit is contained in:
		
							parent
							
								
									a1a5e80187
								
							
						
					
					
						commit
						5b52c343ef
					
				| @ -27,3 +27,31 @@ export function deleteTraceCompany(ids) { | |||||||
|     method: 'GET', |     method: 'GET', | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | // 原材料质检管理 - 列表
 | ||||||
|  | export function getQualityManageList(params) { | ||||||
|  |   return request('/trace/code/qualityManage/page', { | ||||||
|  |     method: 'GET', | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | // 原材料质检管理 - 详情
 | ||||||
|  | export function getQualityInfo(ids) { | ||||||
|  |   return request('/trace/code/qualityManage/qualityInfo/' + ids, { | ||||||
|  |     method: 'GET', | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 包装赋码管理 - 列表
 | ||||||
|  | export function getTraceMangePageList(params) { | ||||||
|  |   return request('/trace/traceMange/traceMangePage', { | ||||||
|  |     method: 'GET', | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | // 包装赋码管理 - 详情
 | ||||||
|  | export function getTraceProductInfo(ids) { | ||||||
|  |   return request('/trace/traceMange/traceProductInfo/' + ids, { | ||||||
|  |     method: 'GET', | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | |||||||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 417 KiB | 
| @ -239,15 +239,9 @@ const dialogFormRules = ref({ | |||||||
|   yield: [{ required: true, message: '请输入亩产量', trigger: ['change', 'blur'] }], |   yield: [{ required: true, message: '请输入亩产量', trigger: ['change', 'blur'] }], | ||||||
|   detectionTime: [{ required: true, message: '请选择使用时间', trigger: 'blur' }], |   detectionTime: [{ required: true, message: '请选择使用时间', trigger: 'blur' }], | ||||||
| }); | }); | ||||||
| watch( | watch([() => dialogForm.yield, () => dialogForm.area], ([newYield, newArea], [oldYield, oldArea]) => { | ||||||
|   () => dialogForm.yield, |   dialogForm.totalYield = (newYield * newArea).toFixed(2); | ||||||
|   (val) => { | }); | ||||||
|     console.log(val); |  | ||||||
|     console.log(dialogForm.area); |  | ||||||
|     console.log(val * dialogForm.area); |  | ||||||
|     dialogForm.totalYield = val * dialogForm.area; |  | ||||||
|   } |  | ||||||
| ); |  | ||||||
| const addItem = async () => { | const addItem = async () => { | ||||||
|   // ElMessage.success('点击新增!'); |   // ElMessage.success('点击新增!'); | ||||||
|   restDialogForm(); |   restDialogForm(); | ||||||
|  | |||||||
| @ -14,17 +14,17 @@ | |||||||
|                   <el-option v-for="item in seedTypeList" :key="item.id" :value="item.id" :label="item.dataName" /> |                   <el-option v-for="item in seedTypeList" :key="item.id" :value="item.id" :label="item.dataName" /> | ||||||
|                 </el-select> |                 </el-select> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="产品名称" prop="name"> |               <el-form-item label="产品名称" prop="productName"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入产品名称" clearable /> |                 <el-input v-model="formInline.productName" placeholder="请输入产品名称" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="采收日期" prop="date1"> |               <el-form-item label="质检时间" prop="qualityTime"> | ||||||
|                 <el-date-picker v-model="formInline.date1" type="date" placeholder="请选择采收时间" style="width: 100%" /> |                 <el-date-picker v-model="formInline.qualityTime" type="date" placeholder="请选择质检时间" style="width: 100%" /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="原场地" prop="name"> |               <el-form-item label="原产地" prop="countryOfOrigin"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入原场地" clearable /> |                 <el-input v-model="formInline.countryOfOrigin" placeholder="请输入原产地" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="经营主体" prop="name"> |               <el-form-item label="经营主体" prop="businessEntity"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入经营主体" clearable /> |                 <el-input v-model="formInline.businessEntity" placeholder="请输入经营主体" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label=""> |               <el-form-item label=""> | ||||||
|                 <el-button type="primary" icon="Search" @click="onSubmit">查询</el-button> |                 <el-button type="primary" icon="Search" @click="onSubmit">查询</el-button> | ||||||
| @ -50,10 +50,8 @@ | |||||||
|           @page-change="handlePaginationChange" |           @page-change="handlePaginationChange" | ||||||
|         > |         > | ||||||
|           <!-- 自定义-质检报告 --> |           <!-- 自定义-质检报告 --> | ||||||
|           <template #purchaseDate="slotProps"> |           <template #qualityReportUrl="slotProps"> | ||||||
|             <el-button text type="primary" |             <el-icon style="font-size: 20px; cursor: pointer" color="#3685fe" @click="seeImg(slotProps.row)"><MessageBox /></el-icon> | ||||||
|               ><el-icon style="font-size: 20px"><MessageBox /></el-icon> |  | ||||||
|             </el-button> |  | ||||||
|           </template> |           </template> | ||||||
|           <!-- 自定义-操作 --> |           <!-- 自定义-操作 --> | ||||||
|           <template #action="slotProps"> |           <template #action="slotProps"> | ||||||
| @ -142,6 +140,8 @@ | |||||||
|         </div> |         </div> | ||||||
|       </template> |       </template> | ||||||
|     </el-dialog> |     </el-dialog> | ||||||
|  | 
 | ||||||
|  |     <el-image-viewer v-if="showPreview" :url-list="srcList" show-progress :initial-index="0" @close="showPreview = false" /> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| @ -152,23 +152,25 @@ import { ElMessage } from 'element-plus'; | |||||||
| import inputSuppliesApi from '@/apis/inputSuppliesApi'; | import inputSuppliesApi from '@/apis/inputSuppliesApi'; | ||||||
| const { getMaterailTypes } = inputSuppliesApi; | const { getMaterailTypes } = inputSuppliesApi; | ||||||
| import { | import { | ||||||
|   getFertilizeUseRegulatoryRecords, |  | ||||||
|   fertilizeUseRegulatorySave, |   fertilizeUseRegulatorySave, | ||||||
|   editFertilizeUseRegulatory, |   editFertilizeUseRegulatory, | ||||||
|   delFertilizeUseRegulatory, |   delFertilizeUseRegulatory, | ||||||
|   getLandList, |   getLandList, | ||||||
| } from '@/apis/inputSuppliesApi/supervisionOfInputs'; | } from '@/apis/inputSuppliesApi/supervisionOfInputs'; | ||||||
| import request from '@/utils/axios'; | import { getQualityManageList, getQualityInfo } from '@/apis/trace/products'; | ||||||
| import { GetDictTypeInfo } from '@/apis/system/dictType'; | import { GetDictTypeInfo } from '@/apis/system/dictType'; | ||||||
| import { useApp } from '@/hooks'; | import { useApp } from '@/hooks'; | ||||||
| const app = useApp(); | const app = useApp(); | ||||||
|  | import imgUrl from '@/assets/images/trace/testReport.png'; | ||||||
| 
 | 
 | ||||||
| // 查询条件 | // 查询条件 | ||||||
| const formInline = reactive({ | const formInline = reactive({ | ||||||
|   harvestBatch: '', |   harvestBatch: '', | ||||||
|   name: '', |   productName: '', | ||||||
|   seedTypeId: '', |   seedTypeId: '', | ||||||
|   date1: '', |   qualityTime: '', | ||||||
|  |   countryOfOrigin: '', | ||||||
|  |   businessEntity: '', | ||||||
|   current: 1, |   current: 1, | ||||||
|   size: 10, |   size: 10, | ||||||
| }); | }); | ||||||
| @ -182,120 +184,21 @@ const resetForm = () => { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // 表格数据 | // 表格数据 | ||||||
| const tableData = ref([ | const tableData = ref(); | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025041201', |  | ||||||
|     productTypes: '黄皮甘蔗', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告1', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '李红梅', |  | ||||||
|     plotCode: '2025-04-13 00:00:00', |  | ||||||
|     plotName: '未检出农药残留,符合国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025041802', |  | ||||||
|     productTypes: '圆茄', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告2', |  | ||||||
|     number: '微生物检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '大肠杆菌、沙门氏菌', |  | ||||||
|     baseName: '刀玉兰', |  | ||||||
|     plotCode: '2025-04-19 00:00:00', |  | ||||||
|     plotName: '未检出有害微生物,符合国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025041503', |  | ||||||
|     productTypes: '小米辣', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告3', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '马晓芳', |  | ||||||
|     plotCode: '2025-04-16 00:00:00', |  | ||||||
|     plotName: '农药残留量低于国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025042004', |  | ||||||
|     productTypes: '丝瓜', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告4', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '黄文斌', |  | ||||||
|     plotCode: '2025-04-21 00:00:00', |  | ||||||
|     plotName: '未检出农药残留,符合国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025041705', |  | ||||||
|     productTypes: '苦瓜', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告5', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '李四', |  | ||||||
|     plotCode: '2025-04-18 00:00:00', |  | ||||||
|     plotName: '农药残留量低于国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025042206', |  | ||||||
|     productTypes: '香蕉', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告6', |  | ||||||
|     number: '微生物检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '大肠杆菌、沙门氏菌', |  | ||||||
|     baseName: '杨志明', |  | ||||||
|     plotCode: '2025-04-23 00:00:00', |  | ||||||
|     plotName: '未检出有害微生物,符合国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025041907', |  | ||||||
|     productTypes: '榴莲', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告7', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '张丽华', |  | ||||||
|     plotCode: '2025-04-20 00:00:00', |  | ||||||
|     plotName: '农药残留量低于国家标准', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM2025042108', |  | ||||||
|     productTypes: '芒果', |  | ||||||
|     name: '合格', |  | ||||||
|     purchaseDate: '质检报告8', |  | ||||||
|     number: '农残检测', |  | ||||||
|     Unit: '耿马县农产品质检中心', |  | ||||||
|     baseCode: '农药残留量', |  | ||||||
|     baseName: '周建国', |  | ||||||
|     plotCode: '2025-04-22 00:00:00', |  | ||||||
|     plotName: '未检出农药残留,符合国家标准', |  | ||||||
|   }, |  | ||||||
| ]); |  | ||||||
| const selectedIds = ref([]); | const selectedIds = ref([]); | ||||||
| const tableLoading = ref(false); | const tableLoading = ref(false); | ||||||
| const tableTotal = ref(0); | const tableTotal = ref(0); | ||||||
| const columns = ref([ | const columns = ref([ | ||||||
|   { prop: 'batchCode', label: '采收批次编码' }, |   { prop: 'harvestBatch', label: '采收批次编码' }, | ||||||
|   { prop: 'productTypes', label: '原材料名称' }, |   { prop: 'productName', label: '原材料名称' }, | ||||||
|   { prop: 'name', label: '质检结果' }, |   { prop: 'qualityReportUrl', label: '质检报告', slotName: 'qualityReportUrl' }, | ||||||
|   { prop: 'purchaseDate', label: '质检报告', slotName: 'purchaseDate' }, |   { prop: 'qualityTypeName', label: '质检类型' }, | ||||||
|   { prop: 'number', label: '质检类型' }, |   { prop: 'qualityUnit', label: '质检机构' }, | ||||||
|   { prop: 'Unit', label: '质检机构' }, |   { prop: 'qualityProject', label: '质检项目' }, | ||||||
|   { prop: 'baseCode', label: '质检项目' }, |   { prop: 'qualityPerson', label: '质检人' }, | ||||||
|   { prop: 'baseName', label: '质检人' }, |   { prop: 'qualityTime', label: '质检时间' }, | ||||||
|   // { prop: 'baseAddress', label: '基地地址' }, |   { prop: 'qualityDescribe', label: '质检说明', width: 200 }, | ||||||
|   { prop: 'plotCode', label: '质检时间' }, |   // { prop: 'action', label: '操作', slotName: 'action', width: 100, fixed: 'right' }, | ||||||
|   { prop: 'plotName', label: '质检说明', width: 200 }, |  | ||||||
|   { prop: 'action', label: '操作', slotName: 'action', width: 100, fixed: 'right' }, |  | ||||||
| ]); | ]); | ||||||
| const handlePaginationChange = ({ page, pageSize }) => { | const handlePaginationChange = ({ page, pageSize }) => { | ||||||
|   formInline.current = page; |   formInline.current = page; | ||||||
| @ -303,18 +206,18 @@ const handlePaginationChange = ({ page, pageSize }) => { | |||||||
|   loadData(); |   loadData(); | ||||||
| }; | }; | ||||||
| const loadData = async () => { | const loadData = async () => { | ||||||
|   // tableLoading.value = true; |   tableLoading.value = true; | ||||||
|   // try { |   try { | ||||||
|   //   let response = await getFertilizeUseRegulatoryRecords(formInline); |     let response = await getQualityManageList(formInline); | ||||||
|   //   tableLoading.value = false; |     tableLoading.value = false; | ||||||
|   //   if (response.code == 200) { |     if (response.code == 200) { | ||||||
|   //     tableData.value = response.data.records; |       tableData.value = response.data.records; | ||||||
|   //     tableTotal.value = response.data.total; |       tableTotal.value = response.data.total; | ||||||
|   //   } |     } | ||||||
|   // } catch (error) { |   } catch (error) { | ||||||
|   //   tableLoading.value = false; |     tableLoading.value = false; | ||||||
|   //   console.error(error); |     console.error(error); | ||||||
|   // } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const extractThirdLevelChildren = (dataArray) => { | const extractThirdLevelChildren = (dataArray) => { | ||||||
| @ -383,6 +286,15 @@ const dialogFormRules = ref({ | |||||||
|   detectionUnit: [{ required: true, message: '请输入检测单位', trigger: 'blur' }], |   detectionUnit: [{ required: true, message: '请输入检测单位', trigger: 'blur' }], | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | const srcList = ref([]); | ||||||
|  | const showPreview = ref(false); | ||||||
|  | 
 | ||||||
|  | const seeImg = (row) => { | ||||||
|  |   console.log(row); | ||||||
|  |   srcList.value = [row.qualityReportUrl ?? imgUrl]; | ||||||
|  |   showPreview.value = true; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| const addItem = async () => { | const addItem = async () => { | ||||||
|   ElMessage.success('点击新增!'); |   ElMessage.success('点击新增!'); | ||||||
|   // restDialogForm(); |   // restDialogForm(); | ||||||
| @ -435,9 +347,7 @@ const setDialogForm2 = (row) => { | |||||||
| }; | }; | ||||||
| // 获取地块信息 | // 获取地块信息 | ||||||
| const getDetails = async () => { | const getDetails = async () => { | ||||||
|   let response = await request({ |   let response = await getQualityInfo(dialogForm.landId); | ||||||
|     url: `/land-resource/landManage/getLandInfo?landId=${dialogForm.landId}`, |  | ||||||
|   }); |  | ||||||
|   console.log(response); |   console.log(response); | ||||||
|   if (response.code == 200) { |   if (response.code == 200) { | ||||||
|     if (response.data) { |     if (response.data) { | ||||||
| @ -599,7 +509,7 @@ onMounted(() => { | |||||||
|   onSubmit(); |   onSubmit(); | ||||||
|   getLandsList(); |   getLandsList(); | ||||||
|   getEntityOptions(); |   getEntityOptions(); | ||||||
|   // getSeedTypeList(); |   getSeedTypeList(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
|  | |||||||
| @ -7,25 +7,43 @@ | |||||||
|           <div class="search-bar-left"> |           <div class="search-bar-left"> | ||||||
|             <el-form ref="searchForm" :inline="true" :model="formInline" class="demo-form-inline" :label-width="'auto'"> |             <el-form ref="searchForm" :inline="true" :model="formInline" class="demo-form-inline" :label-width="'auto'"> | ||||||
|               <el-form-item label="产品溯源码" prop="harvestBatch"> |               <el-form-item label="产品溯源码" prop="harvestBatch"> | ||||||
|                 <el-input v-model="formInline.harvestBatch" placeholder="请输入采收批次" clearable /> |                 <el-input v-model="formInline.harvestBatch" placeholder="请输入产品溯源码" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="产品名称" prop="name"> |               <el-form-item label="产品名称" prop="productName"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入产品名称" clearable /> |                 <el-input v-model="formInline.productName" placeholder="请输入产品名称" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="原场地" prop="name"> |               <el-form-item label="原产地" prop="traceArea"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入原场地" clearable /> |                 <el-input v-model="formInline.traceArea" placeholder="请输入原产地" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="经营主体" prop="name"> |               <el-form-item label="经营主体" prop="businessEntityName"> | ||||||
|                 <el-input v-model="formInline.name" placeholder="请输入经营主体" clearable /> |                 <el-input v-model="formInline.businessEntityName" placeholder="请输入经营主体" clearable /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="产品种类" prop="seedTypeId"> |               <el-form-item label="产品种类" prop="seedTypeId"> | ||||||
|                 <el-select v-model="formInline.seedTypeId" placeholder="请选择" clearable @change="seedTypeChange"> |                 <el-select v-model="formInline.seedTypeId" placeholder="请选择产品种类" clearable @change="seedTypeChange"> | ||||||
|                   <el-option v-for="item in seedTypeList" :key="item.id" :value="item.id" :label="item.dataName" /> |                   <el-option v-for="item in seedTypeList" :key="item.id" :value="item.id" :label="item.dataName" /> | ||||||
|                 </el-select> |                 </el-select> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
| 
 | 
 | ||||||
|               <el-form-item label="采收日期" prop="date1"> |               <el-form-item label="采收时间" prop="startTime" style="margin-right: 0"> | ||||||
|                 <el-date-picker v-model="formInline.date1" type="date" placeholder="请选择采收时间" style="width: 100%" /> |                 <el-date-picker | ||||||
|  |                   v-model="formInline.startTime" | ||||||
|  |                   type="date" | ||||||
|  |                   value-format="YYYY-MM-DD" | ||||||
|  |                   placeholder="请选择起始日期" | ||||||
|  |                   clearable | ||||||
|  |                   :disabled-date="disableStartDate" | ||||||
|  |                   style="width: 160px" | ||||||
|  |                 /> | ||||||
|  |                 <span style="width: 30px; text-align: center; display: inline-block"> - </span> | ||||||
|  |                 <el-date-picker | ||||||
|  |                   v-model="formInline.endTime" | ||||||
|  |                   type="date" | ||||||
|  |                   value-format="YYYY-MM-DD" | ||||||
|  |                   placeholder="请选择截止日期" | ||||||
|  |                   clearable | ||||||
|  |                   :disabled-date="disableEndDate" | ||||||
|  |                   style="width: 160px" | ||||||
|  |                 /> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
| 
 | 
 | ||||||
|               <el-form-item label=""> |               <el-form-item label=""> | ||||||
| @ -52,8 +70,8 @@ | |||||||
|           @page-change="handlePaginationChange" |           @page-change="handlePaginationChange" | ||||||
|         > |         > | ||||||
|           <!-- 自定义-产品溯源码 --> |           <!-- 自定义-产品溯源码 --> | ||||||
|           <template #batchCode="slotProps"> |           <template #traceCode="slotProps"> | ||||||
|             <el-link underline="always" type="primary">{{ slotProps.row.batchCode }}</el-link> |             <el-link underline="always" type="primary" @click="seeImg(slotProps.row)">{{ slotProps.row.traceCode }}</el-link> | ||||||
|           </template> |           </template> | ||||||
|           <!-- 自定义-操作 --> |           <!-- 自定义-操作 --> | ||||||
|           <template #action="slotProps"> |           <template #action="slotProps"> | ||||||
| @ -65,75 +83,48 @@ | |||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <el-dialog v-model="dialogFormVisible" :title="dialogTitle" width="800" :close-on-click-modal="false" align-center> |     <el-dialog v-model="dialogFormVisible" :title="dialogTitle" width="800" :close-on-click-modal="false" align-center> | ||||||
|       <el-form :inline="true" :label-width="'auto'"> |       <div style="margin-bottom: 20px; text-align: center"> | ||||||
|         <LandSelect ref="landSelectRef" v-model="dialogForm.landId" :options="landSelectList" :disabled="formDisabled" @change="handleLandChange" /> |         <el-radio-group v-model="tabsRadio"> | ||||||
|       </el-form> |           <el-radio-button label="产品信息" :value="1" /> | ||||||
|       <el-descriptions title="地块信息" border class="mb-20 custom-descriptions" :column="2"> |           <el-radio-button label="溯源信息" :value="2" /> | ||||||
|         <el-descriptions-item label="行政区域编码">{{ dialogForm.regionCode }}</el-descriptions-item> |         </el-radio-group> | ||||||
|         <el-descriptions-item label="行政区域名称">{{ dialogForm.regionName }}</el-descriptions-item> |       </div> | ||||||
|         <el-descriptions-item label="网格编码">{{ dialogForm.gridId }}</el-descriptions-item> |       <el-descriptions v-if="tabsRadio == 1" title="" border class="mb-20 custom-descriptions" :column="2"> | ||||||
|         <el-descriptions-item label="网格名称">{{ dialogForm.gridName }}</el-descriptions-item> |         <el-descriptions-item label="产品编码">{{ dialogForm.traceCode }}</el-descriptions-item> | ||||||
|         <el-descriptions-item label="地块编码">{{ dialogForm.landId }}</el-descriptions-item> |         <el-descriptions-item label="产品名称">{{ dialogForm.productName }}</el-descriptions-item> | ||||||
|         <el-descriptions-item label="地块名称">{{ dialogForm.landName }}</el-descriptions-item> |         <el-descriptions-item label="产品规格">{{ dialogForm.specs }}</el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="生产日期">{{ dialogForm.produceDate }}</el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="保质期">{{ dialogForm.expiryDateTime }}</el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="生产商编码">{{ dialogForm.manufacturerCode }}</el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="生产商">{{ dialogForm.manufacturer }}</el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="厂址">{{ dialogForm.factoryAddress }}</el-descriptions-item> | ||||||
|  |       </el-descriptions> | ||||||
|  |       <div v-else> | ||||||
|  |         <el-descriptions title="种植基地信息" border class="mb-20 custom-descriptions" :column="2"> | ||||||
|  |           <el-descriptions-item label="基地编码">{{ dialogForm.plantationInfoVO?.id ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="基地名称">{{ dialogForm.plantationInfoVO?.name ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="所属行政区域">{{ dialogForm.plantationInfoVO?.regionName ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="所属网格">{{ dialogForm.plantationInfoVO?.gridName ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="具体位置">{{ dialogForm.plantationInfoVO?.location ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="经纬度">{{ dialogForm.plantationInfoVO?.coordinate ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="气候条件">{{ dialogForm.plantationInfoVO?.climate ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="海拔">{{ dialogForm.plantationInfoVO?.altitude ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="地块编码">{{ dialogForm.plantationInfoVO?.landNumber ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="地块名称">{{ dialogForm.plantationInfoVO?.landName ?? '' }}</el-descriptions-item> | ||||||
|         </el-descriptions> |         </el-descriptions> | ||||||
|         <el-descriptions title="经营主体信息" border class="mb-20 custom-descriptions" :column="2"> |         <el-descriptions title="经营主体信息" border class="mb-20 custom-descriptions" :column="2"> | ||||||
|         <el-descriptions-item label="经营主体编码">{{ dialogForm.businessEntityCode }}</el-descriptions-item> |           <el-descriptions-item label="经营主体代码">{{ dialogForm.enterpriseCooperativeVO?.id ?? '' }}</el-descriptions-item> | ||||||
|         <el-descriptions-item label="经营主体名称">{{ dialogForm.businessEntityName }}</el-descriptions-item> |           <el-descriptions-item label="经营主体类型">{{ dialogForm.enterpriseCooperativeVO?.comType ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="经营主体名称">{{ dialogForm.enterpriseCooperativeVO?.businessName ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="联系人">{{ dialogForm.enterpriseCooperativeVO?.contactPerson ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="联系电话">{{ dialogForm.enterpriseCooperativeVO?.phone ?? '' }}</el-descriptions-item> | ||||||
|  |         </el-descriptions> | ||||||
|  |         <el-descriptions title="种植批次" border class="mb-20 custom-descriptions" :column="2"> | ||||||
|  |           <el-descriptions-item label="种植批次编码">{{ dialogForm.enterpriseCooperativeVO?.id ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="种植批次名称">{{ dialogForm.enterpriseCooperativeVO?.comType ?? '' }}</el-descriptions-item> | ||||||
|  |           <el-descriptions-item label="种植作物">{{ dialogForm.enterpriseCooperativeVO?.businessName ?? '' }}</el-descriptions-item> | ||||||
|         </el-descriptions> |         </el-descriptions> | ||||||
|       <el-form |  | ||||||
|         ref="dialogRef" |  | ||||||
|         :model="dialogForm" |  | ||||||
|         :inline="true" |  | ||||||
|         :label-width="'100'" |  | ||||||
|         :rules="dialogFormRules" |  | ||||||
|         :disabled="formDisabled" |  | ||||||
|         class="dialog-form-container" |  | ||||||
|       > |  | ||||||
|         <div class="el-descriptions__title" style="margin-bottom: 16px">农药用药详情</div> |  | ||||||
|         <el-form-item label="肥料编号" prop="fertilizeId" class="dialog-form-item"> |  | ||||||
|           <el-input v-model="dialogForm.fertilizeId" clearable placeholder="请输入肥料编号" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="肥料名称" prop="fertilizeName" class="dialog-form-item"> |  | ||||||
|           <el-input v-model="dialogForm.fertilizeName" clearable placeholder="请输入肥料名称" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="使用量" required prop="useNumber" class="dialog-form-item"> |  | ||||||
|           <el-input-number v-model="dialogForm.useNumber" :min="1" controls-position="right" placeholder="请输入使用量" style="width: 150px" /> |  | ||||||
|           <el-select v-model="dialogForm.useUnit" placeholder="请选择" style="width: 80px"> |  | ||||||
|             <el-option v-for="el in unitList" :key="el.dictValue" :value="el.dictValue" :label="el.dictValue" /> |  | ||||||
|           </el-select> |  | ||||||
|         </el-form-item> |  | ||||||
|         <el-form-item label="使用时间" prop="useTime" class="dialog-form-item"> |  | ||||||
|           <el-date-picker v-model="dialogForm.useTime" :clearable="false" type="date" value-format="YYYY-MM-DD" placeholder="请选择使用时间" /> |  | ||||||
|         </el-form-item> |  | ||||||
|         <div class="el-descriptions__title" style="margin-bottom: 16px">检测信息</div> |  | ||||||
|         <div style="display: flex"> |  | ||||||
|           <div style="display: inline-block; width: 48%"> |  | ||||||
|             <el-form-item label="检测时间" prop="detectionTime" class="dialog-form-item" :label-width="'100'"> |  | ||||||
|               <el-date-picker |  | ||||||
|                 v-model="dialogForm.detectionTime" |  | ||||||
|                 :clearable="false" |  | ||||||
|                 type="date" |  | ||||||
|                 value-format="YYYY-MM-DD" |  | ||||||
|                 placeholder="请选择检测时间" |  | ||||||
|               /> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="检测结果" prop="detectionResult" class="dialog-form-item" :label-width="'100'"> |  | ||||||
|               <el-select v-model="dialogForm.detectionResult" placeholder="请选择"> |  | ||||||
|                 <el-option value="合格" label="合格" /> |  | ||||||
|                 <el-option value="不合格" label="不合格" /> |  | ||||||
|               </el-select> |  | ||||||
|             </el-form-item> |  | ||||||
|             <el-form-item label="检测单位" prop="detectionUnit" class="dialog-form-item" :label-width="'100'"> |  | ||||||
|               <el-input v-model="dialogForm.detectionUnit" clearable placeholder="请输入检测单位" /> |  | ||||||
|             </el-form-item> |  | ||||||
|       </div> |       </div> | ||||||
|           <div style="display: inline-block; width: 50%"> |  | ||||||
|             <el-form-item label="检测报告" prop="detectionReport" class="dialog-form-item" :label-width="'80'"> |  | ||||||
|               <FileUploader v-model="dialogForm.detectionReport" :limit="1" /> |  | ||||||
|             </el-form-item> |  | ||||||
|           </div> |  | ||||||
|         </div> |  | ||||||
|       </el-form> |  | ||||||
|       <template #footer> |       <template #footer> | ||||||
|         <div class="dialog-footer"> |         <div class="dialog-footer"> | ||||||
|           <el-button v-if="!formDisabled" type="primary" @click="onSaveCategory">保存</el-button> |           <el-button v-if="!formDisabled" type="primary" @click="onSaveCategory">保存</el-button> | ||||||
| @ -142,6 +133,8 @@ | |||||||
|         </div> |         </div> | ||||||
|       </template> |       </template> | ||||||
|     </el-dialog> |     </el-dialog> | ||||||
|  | 
 | ||||||
|  |     <el-image-viewer v-if="showPreview" :url-list="srcList" show-progress :initial-index="0" @close="showPreview = false" /> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| @ -152,12 +145,12 @@ import { ElMessage } from 'element-plus'; | |||||||
| import inputSuppliesApi from '@/apis/inputSuppliesApi'; | import inputSuppliesApi from '@/apis/inputSuppliesApi'; | ||||||
| const { getMaterailTypes } = inputSuppliesApi; | const { getMaterailTypes } = inputSuppliesApi; | ||||||
| import { | import { | ||||||
|   getFertilizeUseRegulatoryRecords, |  | ||||||
|   fertilizeUseRegulatorySave, |   fertilizeUseRegulatorySave, | ||||||
|   editFertilizeUseRegulatory, |   editFertilizeUseRegulatory, | ||||||
|   delFertilizeUseRegulatory, |   delFertilizeUseRegulatory, | ||||||
|   getLandList, |   getLandList, | ||||||
| } from '@/apis/inputSuppliesApi/supervisionOfInputs'; | } from '@/apis/inputSuppliesApi/supervisionOfInputs'; | ||||||
|  | import { getTraceMangePageList, getTraceProductInfo } from '@/apis/trace/products'; | ||||||
| import request from '@/utils/axios'; | import request from '@/utils/axios'; | ||||||
| import { GetDictTypeInfo } from '@/apis/system/dictType'; | import { GetDictTypeInfo } from '@/apis/system/dictType'; | ||||||
| import { useApp } from '@/hooks'; | import { useApp } from '@/hooks'; | ||||||
| @ -166,9 +159,12 @@ const app = useApp(); | |||||||
| // 查询条件 | // 查询条件 | ||||||
| const formInline = reactive({ | const formInline = reactive({ | ||||||
|   harvestBatch: '', |   harvestBatch: '', | ||||||
|   name: '', |   productName: '', | ||||||
|  |   traceArea: '', | ||||||
|  |   businessEntityName: '', | ||||||
|   seedTypeId: '', |   seedTypeId: '', | ||||||
|   date1: '', |   startTime: '', | ||||||
|  |   endTime: '', | ||||||
|   current: 1, |   current: 1, | ||||||
|   size: 10, |   size: 10, | ||||||
| }); | }); | ||||||
| @ -179,140 +175,42 @@ const onSubmit = () => { | |||||||
| }; | }; | ||||||
| const resetForm = () => { | const resetForm = () => { | ||||||
|   searchForm.value.resetFields(); |   searchForm.value.resetFields(); | ||||||
|  |   formInline.endTime = ''; | ||||||
|  | }; | ||||||
|  | // 禁用开始日期的逻辑(不能晚于已选的结束日期) | ||||||
|  | const disableStartDate = (time) => { | ||||||
|  |   if (!formInline.endTime) return false; | ||||||
|  |   const endDate = new Date(formInline.endTime); | ||||||
|  |   return time.getTime() > endDate.getTime(); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 禁用结束日期的逻辑(不能早于已选的开始日期) | ||||||
|  | const disableEndDate = (time) => { | ||||||
|  |   if (!formInline.startTime) return false; | ||||||
|  |   const startDate = new Date(formInline.startTime).setHours(0, 0, 0, 0); | ||||||
|  |   const currentDate = new Date(time).setHours(0, 0, 0, 0); | ||||||
|  |   return currentDate < startDate; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // 表格数据 | // 表格数据 | ||||||
| const tableData = ref([ | const tableData = ref([]); | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504120101', |  | ||||||
|     productTypes: '黄皮甘蔗', |  | ||||||
|     name: '5kg/袋', |  | ||||||
|     purchaseDate: '2024-04-12 00:00:00', |  | ||||||
|     number: '6个月', |  | ||||||
|     Unit: '云南农业发展有限公司', |  | ||||||
|     plotName: '云南省耿马县南华村工业区', |  | ||||||
|     baseName: '黄皮甘蔗', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '耿马镇甘蔗基地', |  | ||||||
|     businessEntity: '耿马镇南华村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '耿马县农业合作社', |  | ||||||
|     createDate: '2024-04-12 08:30:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504180202', |  | ||||||
|     productTypes: '圆茄', |  | ||||||
|     name: '1kg/盒', |  | ||||||
|     purchaseDate: '2024-04-18 00:00:00', |  | ||||||
|     number: '15天', |  | ||||||
|     Unit: '云南绿色蔬菜有限公司', |  | ||||||
|     plotName: '云南省耿马县红星村蔬菜加工园', |  | ||||||
|     baseName: '圆茄', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '勐永镇蔬菜基地', |  | ||||||
|     businessEntity: '勐永镇红星村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '勐永镇蔬菜种植合作社', |  | ||||||
|     createDate: '2024-04-18 09:45:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504150303', |  | ||||||
|     productTypes: '小米辣', |  | ||||||
|     name: '500g/袋', |  | ||||||
|     purchaseDate: '2024-04-15 00:00:00', |  | ||||||
|     number: '30天', |  | ||||||
|     Unit: '云南辣味食品有限公司', |  | ||||||
|     plotName: '云南省耿马县光明村辣椒加工区', |  | ||||||
|     baseName: '小米辣', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '四排山乡辣椒基地', |  | ||||||
|     businessEntity: '四排山乡光明村', |  | ||||||
|     record: '个体户', |  | ||||||
|     type: '王五辣椒种植场', |  | ||||||
|     createDate: '2024-04-15 10:20:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504200404', |  | ||||||
|     productTypes: '丝瓜', |  | ||||||
|     name: '2kg/箱', |  | ||||||
|     purchaseDate: '2024-04-20 00:00:00', |  | ||||||
|     number: '10天', |  | ||||||
|     Unit: '云南鲜蔬有限公司', |  | ||||||
|     plotName: '云南省耿马县建设村蔬菜基地', |  | ||||||
|     baseName: '丝瓜', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '勐撒镇蔬菜园', |  | ||||||
|     businessEntity: '勐撒镇建设村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '勐撒镇蔬菜种植合作社', |  | ||||||
|     createDate: '2024-04-20 11:55:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504170501', |  | ||||||
|     productTypes: '苦瓜', |  | ||||||
|     name: '1kg/袋', |  | ||||||
|     purchaseDate: '2024-04-17 00:00:00', |  | ||||||
|     number: '20天', |  | ||||||
|     Unit: '云南苦瓜加工有限公司', |  | ||||||
|     plotName: '云南省耿马县民主村苦瓜加工区', |  | ||||||
|     baseName: '苦瓜', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '耿马镇苦瓜基地', |  | ||||||
|     businessEntity: '耿马镇民主村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '耿马苦瓜种植合作社', |  | ||||||
|     createDate: '2024-04-17 12:30:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504220601', |  | ||||||
|     productTypes: '香蕉', |  | ||||||
|     name: '2kg/箱', |  | ||||||
|     purchaseDate: '2024-04-22 00:00:00', |  | ||||||
|     number: '7天', |  | ||||||
|     Unit: '云南香蕉集团有限公司', |  | ||||||
|     plotName: '云南省耿马县幸福村香蕉加工园', |  | ||||||
|     baseName: '香蕉', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '勐永镇香蕉园', |  | ||||||
|     businessEntity: '勐永镇幸福村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '勐永香蕉种植合作社', |  | ||||||
|     createDate: '2024-04-22 13:05:00', |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     batchCode: 'GM202504190701', |  | ||||||
|     productTypes: '榴莲', |  | ||||||
|     name: '1kg/盒', |  | ||||||
|     purchaseDate: '2024-04-19 00:00:00', |  | ||||||
|     number: '5天', |  | ||||||
|     Unit: '云南热带水果有限公司', |  | ||||||
|     plotName: '云南省耿马县团结村榴莲加工基地', |  | ||||||
|     baseName: '榴莲', |  | ||||||
|     baseAddress: '耿马县', |  | ||||||
|     plotCode: '勐撒镇榴莲园', |  | ||||||
|     businessEntity: '勐撒镇团结村', |  | ||||||
|     record: '合作社', |  | ||||||
|     type: '勐撒榴莲种植合作社', |  | ||||||
|     createDate: '2024-04-19 14:40:00', |  | ||||||
|   }, |  | ||||||
| ]); |  | ||||||
| const selectedIds = ref([]); | const selectedIds = ref([]); | ||||||
| const tableLoading = ref(false); | const tableLoading = ref(false); | ||||||
| const tableTotal = ref(0); | const tableTotal = ref(0); | ||||||
| const columns = ref([ | const columns = ref([ | ||||||
|   { prop: 'batchCode', label: '产品溯源码', slotName: 'batchCode', width: 150 }, |   { prop: 'traceCode', label: '产品溯源码', slotName: 'traceCode', width: 150 }, | ||||||
|   { prop: 'productTypes', label: '产品名称' }, |   { prop: 'productName', label: '产品名称' }, | ||||||
|   { prop: 'name', label: '包装规格' }, |   { prop: 'specs', label: '包装规格' }, | ||||||
|   { prop: 'purchaseDate', label: '生产日期', width: 150 }, |   { prop: 'produceDate', label: '生产日期', width: 150 }, | ||||||
|   { prop: 'number', label: '保质期' }, |   { prop: 'expiryDateTime', label: '保质期' }, | ||||||
|   { prop: 'Unit', label: '生产商', width: 200 }, |   { prop: 'manufacturer', label: '生产商', width: 200 }, | ||||||
|   { prop: 'plotName', label: '厂址' }, |   { prop: 'factoryAddress', label: '厂址' }, | ||||||
|   { prop: 'baseName', label: '原材料' }, |   { prop: 'rawMaterial', label: '原材料' }, | ||||||
|   { prop: 'baseAddress', label: '原产地' }, |   { prop: 'traceArea', label: '原产地' }, | ||||||
|   { prop: 'plotCode', label: '种植基地' }, |   { prop: 'name', label: '种植基地' }, | ||||||
|   { prop: 'businessEntity', label: '种植基地地址' }, |   { prop: 'location', label: '种植基地地址' }, | ||||||
|   { prop: 'record', label: '生产经营主体类型' }, |   { prop: 'comType', label: '生产经营主体类型' }, | ||||||
|   { prop: 'type', label: '生产经营主体名称' }, |   { prop: 'businessName', label: '生产经营主体名称' }, | ||||||
|   { prop: 'createDate', label: '创建日期', width: 150 }, |   { prop: 'createDate', label: '创建日期', width: 150 }, | ||||||
|   { prop: 'action', label: '操作', slotName: 'action', width: 100, fixed: 'right' }, |   { prop: 'action', label: '操作', slotName: 'action', width: 100, fixed: 'right' }, | ||||||
| ]); | ]); | ||||||
| @ -322,18 +220,18 @@ const handlePaginationChange = ({ page, pageSize }) => { | |||||||
|   loadData(); |   loadData(); | ||||||
| }; | }; | ||||||
| const loadData = async () => { | const loadData = async () => { | ||||||
|   // tableLoading.value = true; |   tableLoading.value = true; | ||||||
|   // try { |   try { | ||||||
|   //   let response = await getFertilizeUseRegulatoryRecords(formInline); |     let response = await getTraceMangePageList(formInline); | ||||||
|   //   tableLoading.value = false; |     tableLoading.value = false; | ||||||
|   //   if (response.code == 200) { |     if (response.code == 200) { | ||||||
|   //     tableData.value = response.data.records; |       tableData.value = response.data.records; | ||||||
|   //     tableTotal.value = response.data.total; |       tableTotal.value = response.data.total; | ||||||
|   //   } |     } | ||||||
|   // } catch (error) { |   } catch (error) { | ||||||
|   //   tableLoading.value = false; |     tableLoading.value = false; | ||||||
|   //   console.error(error); |     console.error(error); | ||||||
|   // } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const extractThirdLevelChildren = (dataArray) => { | const extractThirdLevelChildren = (dataArray) => { | ||||||
| @ -359,32 +257,24 @@ const seedTypeChange = () => { | |||||||
|   // 重新获取表格数据,需添加参数 |   // 重新获取表格数据,需添加参数 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const dialogFormVisible = ref(false); | const tabsRadio = ref(2); | ||||||
|  | const dialogFormVisible = ref(true); | ||||||
| const dialogRef = ref(null); | const dialogRef = ref(null); | ||||||
| const dialogTitle = ref('新增'); | const dialogTitle = ref('溯源产品详情'); | ||||||
| const formDisabled = ref(false); | const formDisabled = ref(false); | ||||||
| const landSelectRef = ref(null); | const landSelectRef = ref(null); | ||||||
| const nowSelectRow = ref({}); | const nowSelectRow = ref({}); | ||||||
| const dialogForm = reactive({ | const dialogForm = reactive({ | ||||||
|   regionCode: '', //所属行政区域代码 |   traceCode: '', | ||||||
|   regionName: '', //所属行政区域名称 |   productName: '', | ||||||
|   gridId: '', //所属网格代码 |   specs: '', | ||||||
|   gridName: '', //所属网格名称 |   produceDate: '', | ||||||
|   landId: '', //地块id |   expiryDateTime: '', | ||||||
|   landName: '', //地块名称 |   manufacturerCode: '', | ||||||
|   name: '', //姓名 |   manufacturer: '', | ||||||
|   phone: '', //联系方式 |   factoryAddress: '', | ||||||
|   fertilizeId: '', //肥料名称id |   plantationInfoVO: {}, //种植基地信息 | ||||||
|   fertilizeName: '', //肥料名称 |   enterpriseCooperativeVO: {}, //经营主体信息 | ||||||
|   useNumber: 1, //使用量 |  | ||||||
|   useUnit: 'g', //使用量单位 |  | ||||||
|   useTime: '', //使用时间 |  | ||||||
|   businessEntityCode: '', //经营主体编码 |  | ||||||
|   businessEntityName: '', //经营主体名称 |  | ||||||
|   detectionTime: '', //检测时间 |  | ||||||
|   detectionResult: '', //检测结果' |  | ||||||
|   detectionUnit: '', //检测单位 |  | ||||||
|   detectionReport: '', //检测报告 |  | ||||||
| }); | }); | ||||||
| const dialogFormRules = ref({ | const dialogFormRules = ref({ | ||||||
|   fertilizeId: [{ required: true, message: '请输入肥料编号', trigger: 'blur' }], |   fertilizeId: [{ required: true, message: '请输入肥料编号', trigger: 'blur' }], | ||||||
| @ -402,6 +292,14 @@ const dialogFormRules = ref({ | |||||||
|   detectionUnit: [{ required: true, message: '请输入检测单位', trigger: 'blur' }], |   detectionUnit: [{ required: true, message: '请输入检测单位', trigger: 'blur' }], | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | const srcList = ref([]); | ||||||
|  | const showPreview = ref(false); | ||||||
|  | const seeImg = (row) => { | ||||||
|  |   console.log(row); | ||||||
|  |   let imgUrl = row.traceUrl ?? 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/backend/4363f93aa6f64e77b604e90906d03db6.jpg'; | ||||||
|  |   srcList.value = [imgUrl]; | ||||||
|  |   showPreview.value = true; | ||||||
|  | }; | ||||||
| const addItem = async () => { | const addItem = async () => { | ||||||
|   ElMessage.success('点击新增!'); |   ElMessage.success('点击新增!'); | ||||||
|   // restDialogForm(); |   // restDialogForm(); | ||||||
| @ -410,13 +308,13 @@ const addItem = async () => { | |||||||
|   // dialogFormVisible.value = true; |   // dialogFormVisible.value = true; | ||||||
| }; | }; | ||||||
| const seeDetails = async (row) => { | const seeDetails = async (row) => { | ||||||
|   ElMessage.success('查看详情!'); |   // ElMessage.success('查看详情!'); | ||||||
|   // dialogTitle.value = '详情'; |   console.log('查看详情的行: ', row); | ||||||
|   // formDisabled.value = true; |   dialogTitle.value = '溯源产品详情'; | ||||||
|   // dialogForm.landId = row.landId; |   formDisabled.value = true; | ||||||
|   // getDetails(); |   dialogForm.id = row.id; | ||||||
|   // setDialogForm2(); |   await getDetails(); | ||||||
|   // dialogFormVisible.value = true; |   dialogFormVisible.value = true; | ||||||
| }; | }; | ||||||
| const handleEdit = (row) => { | const handleEdit = (row) => { | ||||||
|   ElMessage.success('点击编辑!'); |   ElMessage.success('点击编辑!'); | ||||||
| @ -424,39 +322,16 @@ const handleEdit = (row) => { | |||||||
|   // nowSelectRow.value = row; |   // nowSelectRow.value = row; | ||||||
|   // dialogTitle.value = '编辑'; |   // dialogTitle.value = '编辑'; | ||||||
|   // formDisabled.value = false; |   // formDisabled.value = false; | ||||||
|   // dialogForm.landId = row.landId; |   // dialogForm.id = row.id; | ||||||
|   // getDetails(); |   // getDetails(); | ||||||
|   // setDialogForm2(); |  | ||||||
|   // dialogFormVisible.value = true; |   // dialogFormVisible.value = true; | ||||||
| }; | }; | ||||||
| const setDialogForm = (row) => { | const setDialogForm = (row) => { | ||||||
|   dialogForm.regionCode = row.gridAreaCode; |   Object.assign(dialogForm, row); | ||||||
|   dialogForm.regionName = row.fullRegionName; |  | ||||||
|   dialogForm.gridId = row.gridId; |  | ||||||
|   dialogForm.gridName = row.gridName; |  | ||||||
|   dialogForm.landId = row.id; |  | ||||||
|   dialogForm.landName = row.landName; |  | ||||||
|   dialogForm.name = row.propertyName; |  | ||||||
|   dialogForm.phone = row.propertyPhone; |  | ||||||
|   dialogForm.businessEntityCode = row.businessEntityCode ?? ''; |  | ||||||
|   dialogForm.businessEntityName = row.businessEntityName ?? ''; |  | ||||||
| }; |  | ||||||
| const setDialogForm2 = (row) => { |  | ||||||
|   dialogForm.fertilizeId = row.fertilizeId; |  | ||||||
|   dialogForm.fertilizeName = row.fertilizeName; |  | ||||||
|   dialogForm.useNumber = row.useNumber; |  | ||||||
|   dialogForm.useUnit = row.useUnit; |  | ||||||
|   dialogForm.useTime = row.useTime; |  | ||||||
|   dialogForm.detectionTime = row.detectionTime; |  | ||||||
|   dialogForm.detectionResult = row.detectionResult; |  | ||||||
|   dialogForm.detectionUnit = row.detectionUnit; |  | ||||||
|   dialogForm.detectionReport = row.detectionReport ?? ''; |  | ||||||
| }; | }; | ||||||
| // 获取地块信息 | // 获取地块信息 | ||||||
| const getDetails = async () => { | const getDetails = async () => { | ||||||
|   let response = await request({ |   let response = await getTraceProductInfo(dialogForm.id); | ||||||
|     url: `/land-resource/landManage/getLandInfo?landId=${dialogForm.landId}`, |  | ||||||
|   }); |  | ||||||
|   console.log(response); |   console.log(response); | ||||||
|   if (response.code == 200) { |   if (response.code == 200) { | ||||||
|     if (response.data) { |     if (response.data) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user