feat
This commit is contained in:
		
							parent
							
								
									a4ef348840
								
							
						
					
					
						commit
						3f46e067fb
					
				| @ -45,6 +45,7 @@ const errorHandler = async (error) => { | ||||
|  * 请求拦截器 | ||||
|  */ | ||||
| publicAxios.interceptors.request.use(async (config) => { | ||||
|   console.log('config', config); | ||||
|   const UserStore = useUserStore(); | ||||
|   if (UserStore.hasToken()) { | ||||
|     config.headers['authorization'] = config.headers['authorization'] ?? UserStore.token; | ||||
|  | ||||
| @ -1,23 +1,23 @@ | ||||
| import request from '@/utils/axios'; | ||||
| 
 | ||||
| export function getUseSuperviseList(params) { | ||||
|   return request('/inputGoogs/supervise/list', { | ||||
|   return request('/inputGoods/supervise/page', { | ||||
|     params, | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function delUseSupervise(ids) { | ||||
|   return request(`/inputGoogs/supervise/delete/${ids}`); | ||||
|   return request(`/inputGoods/supervise/delete/${ids}`); | ||||
| } | ||||
| export function addUseSupervise(data) { | ||||
|   return request('/inputGoogs/supervise/save', { | ||||
|   return request('/inputGoods/supervise/save', { | ||||
|     method: 'POST', | ||||
|     data, | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function editUseSupervise(data) { | ||||
|   return request('/inputGoogs/supervise/edit', { | ||||
|   return request('/inputGoods/supervise/edit', { | ||||
|     method: 'PUT', | ||||
|     data, | ||||
|   }); | ||||
|  | ||||
| @ -27,7 +27,9 @@ | ||||
|         <el-button type="primary" @click="handleInfo(row)">详情</el-button> | ||||
|         <el-button @click="deleteFn(row.id, delSeed, getData)">删除</el-button> | ||||
|       </template> | ||||
|       <template #photoUrl-form="{ type }"> <Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" /> </template> | ||||
|       <template #photoUrl-form="{ type }"> | ||||
|         <Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" /> | ||||
|       </template> | ||||
|     </avue-crud> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| @ -20,21 +20,25 @@ | ||||
|       @row-save="handleRowSave" | ||||
|       @row-update="handleRowUpdate" | ||||
|     > | ||||
|       <template #land-form="{ type }"> | ||||
|       <!-- <template #land-form="{ type }"> | ||||
|         <section if="type == 'add'">地块</section> | ||||
|       </template> --> | ||||
|       <template #report-form="type"> | ||||
|         <Attrs v-model:attrs="attrs" :type="type" /> | ||||
|       </template> | ||||
|     </avue-crud> | ||||
|   </section> | ||||
| </template> | ||||
| 
 | ||||
| <script setup> | ||||
| import { reactive, ref, watch } from 'vue'; | ||||
| import { CRUD_OPTIONS, pageData } from '@/config'; | ||||
| import { reactive, ref, watch, onMounted } from 'vue'; | ||||
| import { CRUD_OPTIONS, pageData, customRules } from '@/config'; | ||||
| import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo'; | ||||
| import inputSuppliesApi from '@/apis/inputSuppliesApi'; | ||||
| import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn'; | ||||
| import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue'; | ||||
| const { deleteFn } = new assistFn(); | ||||
| const { getUseSpuserviseList, delUseSupdervise, addUseSupdervise, editUseSupdervise } = inputSuppliesApi; | ||||
| const { getUseSuperviseList, delUseSupdervise, addUseSupdervise, editUseSupdervise } = inputSuppliesApi; | ||||
| const { loadFinish, materialTypes } = useBasicInfo(); | ||||
| 
 | ||||
| watch( | ||||
| @ -45,6 +49,7 @@ watch( | ||||
|     } | ||||
|   } | ||||
| ); | ||||
| onMounted(getData); | ||||
| /* --------------- data --------------- */ | ||||
| // #region | ||||
| const crudRef = ref(null); | ||||
| @ -93,46 +98,61 @@ const option = ref({ | ||||
|       change: handleTypeChange, | ||||
|     }, | ||||
|     { | ||||
|       label: '姓名', | ||||
|       label: '名称', | ||||
|       prop: 'name', | ||||
|       rules: customRules({ msg: '请输入名称' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '联系方式', | ||||
|       prop: 'phone', | ||||
|       rules: customRules({ msg: '请输入联系方式' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '投入品名称', | ||||
|       prop: 'materialName', | ||||
|       prop: 'inputName', | ||||
|       rules: customRules({ msg: '请输入投入品名称' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '分类', | ||||
|       prop: 'type', | ||||
|       prop: 'classifyId', | ||||
|       type: 'cascader', | ||||
|       dicData: [], | ||||
|       rules: customRules({ msg: '请选择分类' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '购买量', | ||||
|       prop: 't1', | ||||
|       prop: 'buyNumber', | ||||
|       rules: customRules({ msg: '请输入购买量' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '购买时间', | ||||
|       prop: 't2', | ||||
|       type: 'date', | ||||
|       format: 'YYYY-MM-DD', | ||||
|       valueFormat: 'YYYY-MM-DD', | ||||
|       prop: 'buyTime', | ||||
|       rules: customRules({ msg: '请选择购买时间' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '使用量', | ||||
|       prop: 't3', | ||||
|       prop: 'useNumber', | ||||
|       rules: customRules({ msg: '请输入使用量' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '使用时间', | ||||
|       prop: 't4', | ||||
|       format: 'YYYY-MM-DD', | ||||
|       valueFormat: 'YYYY-MM-DD', | ||||
|       prop: 'useTime', | ||||
|       rules: customRules({ msg: '请选择使用时间' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '使用对象', | ||||
|       prop: 't5', | ||||
|       prop: 'useObject', | ||||
|       rules: customRules({ msg: '请输入使用对象' }), | ||||
|     }, | ||||
|     { | ||||
|       label: '关联地块', | ||||
|       prop: 'land', | ||||
|       prop: 'landName', | ||||
|       rules: customRules({ msg: '请输入地块名称' }), | ||||
|     }, | ||||
|   ], | ||||
|   group: [ | ||||
| @ -144,31 +164,28 @@ const option = ref({ | ||||
|       column: [ | ||||
|         { | ||||
|           label: '检测时间', | ||||
|           prop: 'checkTime', | ||||
|           span: 24, | ||||
|           prop: 'detectionTime', | ||||
|           type: 'date', | ||||
|           valueFormat: 'yyyy-MM-dd', | ||||
|           format: 'yyyy-MM-dd', | ||||
|         }, | ||||
|         { | ||||
|           label: '检测结果', | ||||
|           prop: 'result', | ||||
|           span: 24, | ||||
|           prop: 'detectionResult', | ||||
|         }, | ||||
|         { | ||||
|           label: '投入品名称', | ||||
|           prop: 'unit', | ||||
|           span: 24, | ||||
|           prop: 'detectionUnit', | ||||
|         }, | ||||
|         { | ||||
|           label: '检测报告', | ||||
|           prop: 'report', | ||||
|           span: 24, | ||||
|         }, | ||||
|       ], | ||||
|     }, | ||||
|   ], | ||||
| }); | ||||
| const attrs = ref([]); | ||||
| // #endregion | ||||
| 
 | ||||
| /* --------------- methods --------------- */ | ||||
| @ -177,14 +194,16 @@ async function getData(reset = 1) { | ||||
|   _loading.value = true; | ||||
|   reset == 1 && (pageData.value.currentPage = 1); | ||||
|   console.log('get data'); | ||||
|   let res = await getUseSpuserviseList({ | ||||
|     page: pageData.value.currentPage, | ||||
|   let res = await getUseSuperviseList({ | ||||
|     current: pageData.value.currentPage, | ||||
|     size: pageData.value.pageSize, | ||||
|     dataType: searchCondition.value.searchType, | ||||
|     name: searchCondition.value.keywords, | ||||
|   }); | ||||
|   _loading.value = false; | ||||
|   if (res.code == 200) { | ||||
|     data.value = res.data.records; | ||||
|     pageData.value.total = res.data.total; | ||||
|     console.log('res', res); | ||||
|   } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user