feat:产品质量检查
This commit is contained in:
		
							parent
							
								
									57aa58e7d4
								
							
						
					
					
						commit
						fbc6ecaa97
					
				
							
								
								
									
										14
									
								
								main/.env.development
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								main/.env.development
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | |||||||
|  | # 开发环境 | ||||||
|  | VITE_PORT = 9000 | ||||||
|  | VITE_APP_NAME = 'daimp-front-main' | ||||||
|  | VITE_APP_TITLE = '数字农业产业管理平台' | ||||||
|  | VITE_APP_SUB_OS = '//localhost:9526/sub-operation-service/' | ||||||
|  | VITE_APP_SUB_ADMIN = '//localhost:9527/sub-admin/' | ||||||
|  | VITE_APP_SUB_GAS = '//localhost:9528/suv-government-affairs-service/' | ||||||
|  | # 接口 | ||||||
|  | VITE_APP_BASE_API = '/apis'  | ||||||
|  | VITE_APP_BASE_URL = 'http://192.168.18.99:8080' | ||||||
|  | VITE_APP_UPLOAD_API = '/uploadApis' | ||||||
|  | VITE_APP_UPLOAD_URL = 'http://192.168.18.99:9300' | ||||||
|  | VITE_APP_SYSTEM_API = '/systemApis' | ||||||
|  | VITE_APP_SYSTEM_URL = 'http://192.168.18.99:99/stage-api' | ||||||
| @ -1,11 +1,11 @@ | |||||||
| import actions from './actions'; | import actions from './actions'; | ||||||
| 
 | 
 | ||||||
| const { VITE_APP_SUB_VUE, VITE_APP_SUB_ADMIN, VITE_APP_SUB_GAS } = import.meta.env; | const { VITE_APP_SUB_OS, VITE_APP_SUB_ADMIN, VITE_APP_SUB_GAS } = import.meta.env; | ||||||
| 
 | 
 | ||||||
| export const leftApps = [ | export const leftApps = [ | ||||||
|   // {
 |   // {
 | ||||||
|   //   name: 'sub-operation-service',
 |   //   name: 'sub-operation-service',
 | ||||||
|   //   entry: VITE_APP_SUB_VUE,
 |   //   entry: VITE_APP_SUB_OS,
 | ||||||
|   //   activeRule: '/sub-operation-service/',
 |   //   activeRule: '/sub-operation-service/',
 | ||||||
|   //   title: '运营服务',
 |   //   title: '运营服务',
 | ||||||
|   //   icon: 'platform/icon-home.png',
 |   //   icon: 'platform/icon-home.png',
 | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ export const useUserStore = defineStore({ | |||||||
|   id: GenKey('userStore'), |   id: GenKey('userStore'), | ||||||
|   state: () => ({ |   state: () => ({ | ||||||
|     token: |     token: | ||||||
|       'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjU0ZGVjMzk4LTRhZmQtNDUyOS1hYjFkLTExZGZlZjU5NjJhOSIsInVzZXJuYW1lIjoiYWRtaW4ifQ._bHoqldw4oL_MqZxrHv81ShD3Z0GJYSdWietR1mHAfKluNi3SSs1PRZNrq1v-WTQyXgz1QgsBimPB48iqP7o6Q', |       'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjA5MzRhYzQ0LWUyZWEtNDNkOS1iYjZiLTg2YzBhOWZmYmJiYyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.43OzhYseqkg5KDD3WyY1xXURyuoX-00MBLrqQVsdH14jfAtL-zPCrMT_WLtHKFicLg9ohTz0oE2nHUYRS-sZBA', | ||||||
|     userInfo: {}, |     userInfo: {}, | ||||||
|     currentOrg: null, |     currentOrg: null, | ||||||
|     orgList: [], |     orgList: [], | ||||||
|  | |||||||
| @ -84,14 +84,18 @@ const state = reactive({ | |||||||
|         label: '溯源码', |         label: '溯源码', | ||||||
|         prop: 'id', |         prop: 'id', | ||||||
|         search: true, |         search: true, | ||||||
|         display: false, |         addDisplay: false, | ||||||
|  |         editDisplay: false, | ||||||
|  |         viewDisplay: true, | ||||||
|         width: 200, |         width: 200, | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         label: '采收批次', |         label: '采收批次', | ||||||
|         prop: 'harvestBatch', |         prop: 'harvestBatch', | ||||||
|         width: 200, |         width: 200, | ||||||
|         display: false, |         addDisplay: false, | ||||||
|  |         editDisplay: false, | ||||||
|  |         viewDisplay: true, | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         label: '产品名称', |         label: '产品名称', | ||||||
| @ -187,8 +191,8 @@ const state = reactive({ | |||||||
|         rangeSeparator: '至', |         rangeSeparator: '至', | ||||||
|         startPlaceholder: '开始日期', |         startPlaceholder: '开始日期', | ||||||
|         endPlaceholder: '结束日期', |         endPlaceholder: '结束日期', | ||||||
|         format: 'YYYY-MM-DD HH:mm:ss', |         format: 'YYYY-MM-DD', | ||||||
|         valueFormat: 'YYYY-MM-DD HH:mm:ss', |         valueFormat: 'YYYY-MM-DD', | ||||||
|         width: 200, |         width: 200, | ||||||
|         hide: true, |         hide: true, | ||||||
|         display: false, |         display: false, | ||||||
| @ -233,7 +237,9 @@ const state = reactive({ | |||||||
|       { |       { | ||||||
|         label: '原产地', |         label: '原产地', | ||||||
|         prop: 'originAddress', |         prop: 'originAddress', | ||||||
|         display: false, |         addDisplay: false, | ||||||
|  |         editDisplay: false, | ||||||
|  |         viewDisplay: true, | ||||||
|         overHidden: true, |         overHidden: true, | ||||||
|         width: 200, |         width: 200, | ||||||
|       }, |       }, | ||||||
| @ -243,6 +249,9 @@ const state = reactive({ | |||||||
|         type: 'cascader', |         type: 'cascader', | ||||||
|         // search: true, |         // search: true, | ||||||
|         hide: true, |         hide: true, | ||||||
|  |         addDisplay: true, | ||||||
|  |         editDisplay: true, | ||||||
|  |         viewDisplay: false, | ||||||
|         props: { |         props: { | ||||||
|           label: 'areaName', |           label: 'areaName', | ||||||
|           value: 'areaCode', |           value: 'areaCode', | ||||||
| @ -264,7 +273,7 @@ const state = reactive({ | |||||||
|         label: '原产地详细地址', |         label: '原产地详细地址', | ||||||
|         prop: 'originAddressDetail', |         prop: 'originAddressDetail', | ||||||
|         hide: true, |         hide: true, | ||||||
|         span: 24, |         // span: 24, | ||||||
|       }, |       }, | ||||||
|       // { |       // { | ||||||
|       //   label: '经营主体', |       //   label: '经营主体', | ||||||
| @ -355,6 +364,7 @@ const state = reactive({ | |||||||
| // 加载 | // 加载 | ||||||
| const loadData = async () => { | const loadData = async () => { | ||||||
|   state.loading = true; |   state.loading = true; | ||||||
|  |   delete state.query.datetime; | ||||||
|   GetEntityList(state.query) |   GetEntityList(state.query) | ||||||
|     .then((res) => { |     .then((res) => { | ||||||
|       if (res.code === 200) { |       if (res.code === 200) { | ||||||
| @ -393,11 +403,12 @@ const sizeChange = (size) => { | |||||||
| // 搜索 | // 搜索 | ||||||
| const searchChange = (params, done) => { | const searchChange = (params, done) => { | ||||||
|   if (done) done(); |   if (done) done(); | ||||||
|   state.query = params; |  | ||||||
|   if (params?.datetime) { |   if (params?.datetime) { | ||||||
|     state.query.harvestStartTime = params.datetime[0]; |     params.harvestStartTime = params.datetime[0]; | ||||||
|     state.query.harvestEndTime = params.datetime[1]; |     params.harvestEndTime = params.datetime[1]; | ||||||
|   } |   } | ||||||
|  |   delete params.datetime; | ||||||
|  |   state.query = params; | ||||||
|   state.query.current = 1; |   state.query.current = 1; | ||||||
|   loadData(); |   loadData(); | ||||||
| }; | }; | ||||||
| @ -442,19 +453,32 @@ const setCity = (row) => { | |||||||
|   } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // const setCityChange = ({ value, dic }) => { | function findLabelByValue(tree = [], targetValue) { | ||||||
| //   debugger; |   for (let i = 0; i < tree.length; i++) { | ||||||
| //   const labels = []; |     const node = tree[i]; | ||||||
| //   let currentOptions = dic; |     if (node.areaCode === targetValue) { | ||||||
| //   value.forEach((val) => { |       return node.areaName; | ||||||
| //     const option = dic.find((item) => item.areaCode === val); |     } | ||||||
| //     if (option) { |     if (node.areaChildVOS && node.areaChildVOS.length > 0) { | ||||||
| //       labels.push(option.label); |       const result = findLabelByValue(node.areaChildVOS, targetValue); | ||||||
| //       currentOptions = option.children || []; |       if (result) { | ||||||
| //     } |         return result; | ||||||
| //   }); |       } | ||||||
| //   state.form.originAddress = labels.join(' / '); |     } | ||||||
| // }; |   } | ||||||
|  |   return null; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | const setCityChange = ({ value, dic }) => { | ||||||
|  |   const labels = []; | ||||||
|  |   value.forEach((val) => { | ||||||
|  |     const label = findLabelByValue(dic, val); | ||||||
|  |     if (label) { | ||||||
|  |       labels.push(label); | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|  |   state.form.originAddress = labels.join(''); | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| // 新增 | // 新增 | ||||||
| const rowSave = (row, done, loading) => { | const rowSave = (row, done, loading) => { | ||||||
| @ -558,7 +582,7 @@ const onUploadExcel = (formData) => { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const onDownloadExcel = (url) => { | const onDownloadExcel = (url) => { | ||||||
|   downloadFile(url, `采收赋码-导入模板.xlsx`, 'blob'); |   downloadFile(url, `采收赋码-导入模板.xlsx`); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // 导出 | // 导出 | ||||||
|  | |||||||
| @ -15,6 +15,9 @@ | |||||||
|           <el-icon v-else class="custom-form__uploader__icon"><Plus /></el-icon> |           <el-icon v-else class="custom-form__uploader__icon"><Plus /></el-icon> | ||||||
|         </el-upload> |         </el-upload> | ||||||
|       </template> |       </template> | ||||||
|  |       <template #menu-form> | ||||||
|  |         <el-button icon="CircleClose" @click="state.visible = false">取消</el-button> | ||||||
|  |       </template> | ||||||
|     </avue-form> |     </avue-form> | ||||||
|   </el-dialog> |   </el-dialog> | ||||||
| </template> | </template> | ||||||
| @ -32,7 +35,6 @@ const props = defineProps({ | |||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| // const emit = defineEmits(['on-confirm']); |  | ||||||
| const app = useApp(); | const app = useApp(); | ||||||
| const formRef = ref(null); | const formRef = ref(null); | ||||||
| const state = reactive({ | const state = reactive({ | ||||||
| @ -41,6 +43,9 @@ const state = reactive({ | |||||||
|   options: { |   options: { | ||||||
|     gutter: 20, |     gutter: 20, | ||||||
|     labelWidth: 150, |     labelWidth: 150, | ||||||
|  |     submitText: '保存', | ||||||
|  |     emptyBtn: false, | ||||||
|  |     // menuPosition: 'right', | ||||||
|     column: [ |     column: [ | ||||||
|       { |       { | ||||||
|         label: '采收批次', |         label: '采收批次', | ||||||
| @ -183,6 +188,7 @@ watch( | |||||||
|   () => props.row, |   () => props.row, | ||||||
|   (val) => { |   (val) => { | ||||||
|     if (!isEmpty(val)) { |     if (!isEmpty(val)) { | ||||||
|  |       state.form.harvestId = val?.id ?? null; | ||||||
|       state.form.harvestBatch = val?.harvestBatch ?? null; |       state.form.harvestBatch = val?.harvestBatch ?? null; | ||||||
|       state.form.productName = val?.productName ?? null; |       state.form.productName = val?.productName ?? null; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -73,7 +73,7 @@ const state = reactive({ | |||||||
|         label: '溯源码', |         label: '溯源码', | ||||||
|         prop: 'id', |         prop: 'id', | ||||||
|         search: true, |         search: true, | ||||||
|         display: false, |         disabled: true, | ||||||
|         width: 200, |         width: 200, | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
| @ -174,8 +174,8 @@ const state = reactive({ | |||||||
|         rangeSeparator: '至', |         rangeSeparator: '至', | ||||||
|         startPlaceholder: '开始日期', |         startPlaceholder: '开始日期', | ||||||
|         endPlaceholder: '结束日期', |         endPlaceholder: '结束日期', | ||||||
|         format: 'YYYY-MM-DD HH:mm:ss', |         format: 'YYYY-MM-DD', | ||||||
|         valueFormat: 'YYYY-MM-DD HH:mm:ss', |         valueFormat: 'YYYY-MM-DD', | ||||||
|         width: 200, |         width: 200, | ||||||
|         hide: true, |         hide: true, | ||||||
|         display: false, |         display: false, | ||||||
| @ -193,6 +193,14 @@ const state = reactive({ | |||||||
|           trigger: 'blur', |           trigger: 'blur', | ||||||
|         }, |         }, | ||||||
|       }, |       }, | ||||||
|  |       { | ||||||
|  |         label: '创建时间', | ||||||
|  |         prop: 'createTime', | ||||||
|  |         width: 200, | ||||||
|  |         addDisplay: false, | ||||||
|  |         editDisplay: false, | ||||||
|  |         viewDisplay: true, | ||||||
|  |       }, | ||||||
|       { |       { | ||||||
|         label: '质检报告', |         label: '质检报告', | ||||||
|         prop: 'qualityReportUrl', |         prop: 'qualityReportUrl', | ||||||
| @ -216,12 +224,6 @@ const state = reactive({ | |||||||
|           trigger: 'blur', |           trigger: 'blur', | ||||||
|         }, |         }, | ||||||
|       }, |       }, | ||||||
|       { |  | ||||||
|         label: '创建时间', |  | ||||||
|         prop: 'createTime', |  | ||||||
|         width: 200, |  | ||||||
|         display: false, |  | ||||||
|       }, |  | ||||||
|     ], |     ], | ||||||
|     actions: [ |     actions: [ | ||||||
|       { |       { | ||||||
| @ -253,6 +255,7 @@ const state = reactive({ | |||||||
| // 加载 | // 加载 | ||||||
| const loadData = async () => { | const loadData = async () => { | ||||||
|   state.loading = true; |   state.loading = true; | ||||||
|  |   delete state.query.datetime; | ||||||
|   GetEntityList(state.query) |   GetEntityList(state.query) | ||||||
|     .then((res) => { |     .then((res) => { | ||||||
|       if (res.code === 200) { |       if (res.code === 200) { | ||||||
| @ -291,11 +294,12 @@ const sizeChange = (size) => { | |||||||
| // 搜索 | // 搜索 | ||||||
| const searchChange = (params, done) => { | const searchChange = (params, done) => { | ||||||
|   if (done) done(); |   if (done) done(); | ||||||
|   state.query = params; |  | ||||||
|   if (params?.datetime) { |   if (params?.datetime) { | ||||||
|     state.query.qualityStartTime = params.datetime[0]; |     params.qualityStartTime = params.datetime[0]; | ||||||
|     state.query.qualityEndTime = params.datetime[1]; |     params.qualityEndTime = params.datetime[1]; | ||||||
|   } |   } | ||||||
|  |   delete params.datetime; | ||||||
|  |   state.query = params; | ||||||
|   state.query.current = 1; |   state.query.current = 1; | ||||||
|   loadData(); |   loadData(); | ||||||
| }; | }; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user