投入品需求模块列表对接接口
This commit is contained in:
		
							parent
							
								
									21c8eea167
								
							
						
					
					
						commit
						91f372d7cd
					
				| @ -32,7 +32,7 @@ export function getRowDetails({ url, id }) { | |||||||
| 
 | 
 | ||||||
| /* 肥料需求-列表 */ | /* 肥料需求-列表 */ | ||||||
| export function getFertilizeDemandRecords(params) { | export function getFertilizeDemandRecords(params) { | ||||||
|   return request('/inputGoods/supervise/fertilize/page', { |   return request('/inputGoods/demand/fertilize/page', { | ||||||
|     params, |     params, | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
| @ -57,7 +57,7 @@ export function delFertilizeDemand(ids) { | |||||||
| 
 | 
 | ||||||
| /* 农药需求-列表 */ | /* 农药需求-列表 */ | ||||||
| export function getPesticideDemandRecords(params) { | export function getPesticideDemandRecords(params) { | ||||||
|   return request('/inputGoods/supervise/pesticide/page', { |   return request('/inputGoods/demand/pesticide/page', { | ||||||
|     params, |     params, | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
|  | |||||||
| @ -165,12 +165,12 @@ const columns = ref([ | |||||||
|   { prop: 'regionName', label: '行政区域名称' }, |   { prop: 'regionName', label: '行政区域名称' }, | ||||||
|   { prop: 'gridId', label: '网格编码' }, |   { prop: 'gridId', label: '网格编码' }, | ||||||
|   { prop: 'gridName', label: '网格名称' }, |   { prop: 'gridName', label: '网格名称' }, | ||||||
|   { prop: 'landId', label: '地块编码' }, |   { prop: 'landNumber', label: '地块编码' }, | ||||||
|   { prop: 'landName', label: '地块名称' }, |   { prop: 'landName', label: '地块名称' }, | ||||||
|   { prop: 'extent', label: '面积(亩)' }, |   { prop: 'area', label: '面积(亩)' }, | ||||||
|   { prop: 'useNumber', label: '肥料需求', slotName: 'useNumber' }, |   { prop: 'useNumber', label: '肥料需求', slotName: 'useNumber' }, | ||||||
|   { prop: 'businessEntityCode', label: '生产经营主体编码' }, |   { prop: 'subjectName', label: '生产经营主体编码' }, | ||||||
|   { prop: 'businessEntityName', label: '生产经营主体名称' }, |   { prop: 'subjectNumber', label: '生产经营主体名称' }, | ||||||
|   // { prop: 'action', label: '操作', slotName: 'action', width: 230, fixed: 'right' }, |   // { prop: 'action', label: '操作', slotName: 'action', width: 230, fixed: 'right' }, | ||||||
| ]); | ]); | ||||||
| const handlePaginationChange = ({ page, pageSize }) => { | const handlePaginationChange = ({ page, pageSize }) => { | ||||||
| @ -181,14 +181,14 @@ const handlePaginationChange = ({ page, pageSize }) => { | |||||||
| let landNums = ref(0); | let landNums = ref(0); | ||||||
| let totalArea = computed(() => { | let totalArea = computed(() => { | ||||||
|   const sum = selectedRows.value.reduce((sum, item) => { |   const sum = selectedRows.value.reduce((sum, item) => { | ||||||
|     return sum + Math.round(item.extent * 100); |     return sum + Math.round(item.area * 100); | ||||||
|   }, 0); |   }, 0); | ||||||
|   const result = sum / 100; |   const result = sum / 100; | ||||||
|   return parseFloat(result.toFixed(2)); |   return parseFloat(result.toFixed(2)); | ||||||
| }); | }); | ||||||
| let totalSeed = computed(() => { | let totalSeed = computed(() => { | ||||||
|   const sum = selectedRows.value.reduce((sum, item) => { |   const sum = selectedRows.value.reduce((sum, item) => { | ||||||
|     return sum + Math.round(item.useNumber * 100); |     return sum + Math.round(item.demandCount * 100); | ||||||
|   }, 0); |   }, 0); | ||||||
|   const result = sum / 100; |   const result = sum / 100; | ||||||
|   return parseFloat(result.toFixed(2)); |   return parseFloat(result.toFixed(2)); | ||||||
| @ -211,9 +211,9 @@ const loadData = async () => { | |||||||
|       tableTotal.value = response.data.total; |       tableTotal.value = response.data.total; | ||||||
| 
 | 
 | ||||||
|       // 没有接口,添加模拟数据 |       // 没有接口,添加模拟数据 | ||||||
|       tableData.value.forEach((el, index) => { |       // tableData.value.forEach((el, index) => { | ||||||
|         el.extent = extentArr[index].extent; |       //   el.extent = extentArr[index].extent; | ||||||
|       }); |       // }); | ||||||
|     } |     } | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     tableLoading.value = false; |     tableLoading.value = false; | ||||||
|  | |||||||
| @ -165,12 +165,12 @@ const columns = ref([ | |||||||
|   { prop: 'regionName', label: '行政区域名称' }, |   { prop: 'regionName', label: '行政区域名称' }, | ||||||
|   { prop: 'gridId', label: '网格编码' }, |   { prop: 'gridId', label: '网格编码' }, | ||||||
|   { prop: 'gridName', label: '网格名称' }, |   { prop: 'gridName', label: '网格名称' }, | ||||||
|   { prop: 'landId', label: '地块编码' }, |   { prop: 'landNumber', label: '地块编码' }, | ||||||
|   { prop: 'landName', label: '地块名称' }, |   { prop: 'landName', label: '地块名称' }, | ||||||
|   { prop: 'extent', label: '面积(亩)' }, |   { prop: 'area', label: '面积(亩)' }, | ||||||
|   { prop: 'useNumber', label: '农药需求', slotName: 'useNumber' }, |   { prop: 'useNumber', label: '农药需求', slotName: 'useNumber' }, | ||||||
|   { prop: 'businessEntityCode', label: '生产经营主体编码' }, |   { prop: 'subjectName', label: '生产经营主体编码' }, | ||||||
|   { prop: 'businessEntityName', label: '生产经营主体名称' }, |   { prop: 'subjectNumber', label: '生产经营主体名称' }, | ||||||
|   // { prop: 'action', label: '操作', slotName: 'action', width: 230, fixed: 'right' }, |   // { prop: 'action', label: '操作', slotName: 'action', width: 230, fixed: 'right' }, | ||||||
| ]); | ]); | ||||||
| const handlePaginationChange = ({ page, pageSize }) => { | const handlePaginationChange = ({ page, pageSize }) => { | ||||||
| @ -181,14 +181,14 @@ const handlePaginationChange = ({ page, pageSize }) => { | |||||||
| let landNums = ref(0); | let landNums = ref(0); | ||||||
| let totalArea = computed(() => { | let totalArea = computed(() => { | ||||||
|   const sum = selectedRows.value.reduce((sum, item) => { |   const sum = selectedRows.value.reduce((sum, item) => { | ||||||
|     return sum + Math.round(item.extent * 100); |     return sum + Math.round(item.area * 100); | ||||||
|   }, 0); |   }, 0); | ||||||
|   const result = sum / 100; |   const result = sum / 100; | ||||||
|   return parseFloat(result.toFixed(2)); |   return parseFloat(result.toFixed(2)); | ||||||
| }); | }); | ||||||
| let totalSeed = computed(() => { | let totalSeed = computed(() => { | ||||||
|   const sum = selectedRows.value.reduce((sum, item) => { |   const sum = selectedRows.value.reduce((sum, item) => { | ||||||
|     return sum + Math.round(item.useNumber * 100); |     return sum + Math.round(item.demandCount * 100); | ||||||
|   }, 0); |   }, 0); | ||||||
|   const result = sum / 100; |   const result = sum / 100; | ||||||
|   return parseFloat(result.toFixed(2)); |   return parseFloat(result.toFixed(2)); | ||||||
| @ -211,9 +211,9 @@ const loadData = async () => { | |||||||
|       tableTotal.value = response.data.total; |       tableTotal.value = response.data.total; | ||||||
| 
 | 
 | ||||||
|       // 没有接口,添加模拟数据 |       // 没有接口,添加模拟数据 | ||||||
|       tableData.value.forEach((el, index) => { |       // tableData.value.forEach((el, index) => { | ||||||
|         el.extent = extentArr[index].extent; |       //   el.extent = extentArr[index].extent; | ||||||
|       }); |       // }); | ||||||
|     } |     } | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     tableLoading.value = false; |     tableLoading.value = false; | ||||||
|  | |||||||
| @ -166,8 +166,28 @@ const loadData = async () => { | |||||||
|       // tableData.value = response.data.records; |       // tableData.value = response.data.records; | ||||||
|       // tableTotal.value = response.data.total; |       // tableTotal.value = response.data.total; | ||||||
| 
 | 
 | ||||||
|       tableData.value = createMockData; |       let analogData = [ | ||||||
|       tableTotal.value = createMockData.length; |         { | ||||||
|  |           provenanceId: 'GMZZ001', | ||||||
|  |           provenanceName: '黄皮甘蔗', | ||||||
|  |           varietyName: '黄蔗', | ||||||
|  |           brand: '云蔗牌', | ||||||
|  |           manufacturer: '耿马县农业发展公司', | ||||||
|  |           seedTypeName: '水果种子', | ||||||
|  |           productUnit: '500克/袋', | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           provenanceId: 'GMZZ002', | ||||||
|  |           provenanceName: '圆茄', | ||||||
|  |           varietyName: '绿圆', | ||||||
|  |           brand: '绿圆牌', | ||||||
|  |           manufacturer: '云南绿色蔬菜有限公司', | ||||||
|  |           seedTypeName: '蔬菜种子', | ||||||
|  |           productUnit: '200粒/包', | ||||||
|  |         }, | ||||||
|  |       ]; | ||||||
|  |       tableData.value = analogData; | ||||||
|  |       tableTotal.value = analogData.length; | ||||||
|     } |     } | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     tableLoading.value = false; |     tableLoading.value = false; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user