已添加31个文件
已删除1个文件
已修改12个文件
| | |
| | | # 页颿 é¢ |
| | | VITE_APP_TITLE = RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç» |
| | | VITE_APP_TITLE = å
°å®è½¦é´è´¨é管çç³»ç» |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | VITE_APP_ENV = 'development' |
| | |
| | | VITE_APP_PORT = 80 |
| | | |
| | | # æ¥å£å å¯åè½å¼å
³(å¦éå
³é å端ä¹å¿
须对åºå
³é) |
| | | VITE_APP_ENCRYPT = true |
| | | VITE_APP_ENCRYPT = false |
| | | # æ¥å£å å¯ä¼ è¾ RSA å
¬é¥ä¸å端解å¯ç§é¥å¯¹åº 妿´æ¢éåå端ä¸åæ´æ¢ |
| | | VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' |
| | | # æ¥å£ååºè§£å¯ RSA ç§é¥ä¸å端å å¯å
¬é¥å¯¹åº 妿´æ¢éåå端ä¸åæ´æ¢ |
| | |
| | | # 页颿 é¢ |
| | | VITE_APP_TITLE = RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç» |
| | | VITE_APP_TITLE = å
°å®è½¦é´è´¨é管çç³»ç» |
| | | |
| | | # ç产ç¯å¢é
ç½® |
| | | VITE_APP_ENV = 'production' |
| | |
| | | VITE_APP_PORT = 80 |
| | | |
| | | # æ¥å£å å¯åè½å¼å
³(å¦éå
³é å端ä¹å¿
须对åºå
³é) |
| | | VITE_APP_ENCRYPT = true |
| | | VITE_APP_ENCRYPT = false |
| | | # æ¥å£å å¯ä¼ è¾ RSA å
¬é¥ä¸å端解å¯ç§é¥å¯¹åº 妿´æ¢éåå端ä¸åæ´æ¢ |
| | | VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' |
| | | # æ¥å£ååºè§£å¯ RSA ç§é¥ä¸å端å å¯å
¬é¥å¯¹åº 妿´æ¢éåå端ä¸åæ´æ¢ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | *.sh |
| | | node_modules |
| | | *.md |
| | | *.woff |
| | | *.ttf |
| | | .vscode |
| | | .idea |
| | | dist |
| | | /public |
| | | /docs |
| | | .husky |
| | | .local |
| | | /bin |
| | | .eslintrc.cjs |
| | | prettier.config.js |
| | | src/assets |
| | | tailwind.config.js |
¶Ô±ÈÐÂÎļþ |
| | |
| | | module.exports = { |
| | | env: { |
| | | browser: true, |
| | | node: true, |
| | | es6: true |
| | | }, |
| | | parser: 'vue-eslint-parser', |
| | | extends: [ |
| | | 'plugin:vue/vue3-recommended', |
| | | './.eslintrc-auto-import.json', |
| | | 'plugin:@typescript-eslint/recommended', |
| | | 'prettier', |
| | | 'plugin:prettier/recommended' |
| | | ], |
| | | parserOptions: { |
| | | ecmaVersion: '2020', |
| | | sourceType: 'module', |
| | | project: './tsconfig.*?.json', |
| | | parser: '@typescript-eslint/parser' |
| | | }, |
| | | plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'], |
| | | rules: { |
| | | '@typescript-eslint/no-empty-function': 'off', |
| | | '@typescript-eslint/no-explicit-any': 'off', |
| | | '@typescript-eslint/no-unused-vars': 'off', |
| | | '@typescript-eslint/no-this-alias': 'off', |
| | | |
| | | // vue |
| | | 'vue/multi-word-component-names': 'off', |
| | | 'vue/valid-define-props': 'off', |
| | | 'vue/no-v-model-argument': 'off', |
| | | 'prefer-rest-params': 'off', |
| | | // prettier |
| | | 'prettier/prettier': 'error', |
| | | '@typescript-eslint/ban-types': [ |
| | | 'error', |
| | | { |
| | | // å
³éç©ºç±»åæ£æ¥ {} |
| | | extendDefaults: true, |
| | | types: { |
| | | '{}': false, |
| | | Function: false |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | globals: { |
| | | DialogOption: 'readonly', |
| | | OptionType: 'readonly' |
| | | } |
| | | }; |
| | |
| | | <meta name="renderer" content="webkit" /> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> |
| | | <link rel="icon" href="/favicon.ico" /> |
| | | <title>RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»</title> |
| | | <title>å
°å®è½¦é´è´¨é管çç³»ç»</title> |
| | | <!--[if lt IE 11 |
| | | ]><script> |
| | | window.location.href = '/html/ie.html'; |
| | |
| | | { |
| | | "$schema": "https://json.schemastore.org/tsconfig", |
| | | "name": "ruoyi-vue-plus", |
| | | "name": "lb-qms", |
| | | "version": "5.3.0", |
| | | "description": "RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»", |
| | | "description": "å
°å®è½¦é´è´¨é管çç³»ç»", |
| | | "author": "LionLi", |
| | | "license": "MIT", |
| | | "type": "module", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { BatchVO, BatchForm, BatchQuery } from '@/api/qms/batch/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡ç®¡çå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listBatch = (query?: BatchQuery): AxiosPromise<BatchVO[]> => { |
| | | return request({ |
| | | url: '/qms/batch/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææäº§ååå· |
| | | * @param query |
| | | */ |
| | | export const listProdModels = () => { |
| | | return request({ |
| | | url: '/qms/batch/distinctProductModels', |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡ç®¡çè¯¦ç» |
| | | * @param id |
| | | */ |
| | | export const getBatch = (id: string | number): AxiosPromise<BatchVO> => { |
| | | return request({ |
| | | url: '/qms/batch/' + id, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢æ¹æ¬¡ç®¡ç |
| | | * @param data |
| | | */ |
| | | export const addBatch = (data: BatchForm) => { |
| | | return request({ |
| | | url: '/qms/batch', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¹æ¬¡ç®¡ç |
| | | * @param data |
| | | */ |
| | | export const updateBatch = (data: BatchForm) => { |
| | | return request({ |
| | | url: '/qms/batch', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å 餿¹æ¬¡ç®¡ç |
| | | * @param id |
| | | */ |
| | | export const delBatch = (id: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/batch/' + id, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface BatchVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode: string; |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel: string; |
| | | |
| | | /** |
| | | * ç¨æ·ç¼å· |
| | | */ |
| | | userId: string | number; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode: string; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | num: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface BatchForm extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | id?: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel?: string; |
| | | |
| | | /** |
| | | * ç¨æ·ç¼å· |
| | | */ |
| | | userId?: string | number; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | num?: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface BatchQuery extends PageQuery { |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel?: string; |
| | | |
| | | /** |
| | | * ç¨æ·ç¼å· |
| | | */ |
| | | userId?: string | number; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | num?: number; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { DeviceVO, DeviceForm, DeviceQuery } from '@/api/qms/device/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯ä»ªå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listDevice = (query?: DeviceQuery): AxiosPromise<DeviceVO[]> => { |
| | | return request({ |
| | | url: '/qms/device/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯ä»ªè¯¦ç» |
| | | * @param id |
| | | */ |
| | | export const getDevice = (id: string | number): AxiosPromise<DeviceVO> => { |
| | | return request({ |
| | | url: '/qms/device/' + id, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢æµè¯ä»ª |
| | | * @param data |
| | | */ |
| | | export const addDevice = (data: DeviceForm) => { |
| | | return request({ |
| | | url: '/qms/device', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹æµè¯ä»ª |
| | | * @param data |
| | | */ |
| | | export const updateDevice = (data: DeviceForm) => { |
| | | return request({ |
| | | url: '/qms/device', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å 餿µè¯ä»ª |
| | | * @param id |
| | | */ |
| | | export const delDevice = (id: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/device/' + id, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface DeviceVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | deviceType: string; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | deviceCode: string; |
| | | |
| | | /** |
| | | * æå¨ç» |
| | | */ |
| | | deviceGroup: string; |
| | | |
| | | /** |
| | | * æå¨é¨é¨ |
| | | */ |
| | | deviceDept: string; |
| | | |
| | | /** |
| | | * æå¨å·¥ä½ |
| | | */ |
| | | deviceStation: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface DeviceForm extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | id?: string | number; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | deviceType?: string; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * æå¨ç» |
| | | */ |
| | | deviceGroup?: string; |
| | | |
| | | /** |
| | | * æå¨é¨é¨ |
| | | */ |
| | | deviceDept?: string; |
| | | |
| | | /** |
| | | * æå¨å·¥ä½ |
| | | */ |
| | | deviceStation?: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface DeviceQuery extends PageQuery { |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | deviceType?: string; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * æå¨ç» |
| | | */ |
| | | deviceGroup?: string; |
| | | |
| | | /** |
| | | * æå¨é¨é¨ |
| | | */ |
| | | deviceDept?: string; |
| | | |
| | | /** |
| | | * æå¨å·¥ä½ |
| | | */ |
| | | deviceStation?: string; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { RetestResultVO, RetestResultForm, RetestResultQuery } from '@/api/qms/retestResult/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æµè®°å½å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listRetestResult = (query?: RetestResultQuery): AxiosPromise<RetestResultVO[]> => { |
| | | return request({ |
| | | url: '/qms/retestResult/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æµè®°å½è¯¦ç» |
| | | * @param batchCode |
| | | */ |
| | | export const getRetestResult = (batchCode: string | number): AxiosPromise<RetestResultVO> => { |
| | | return request({ |
| | | url: '/qms/retestResult/' + batchCode, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢å¤æµè®°å½ |
| | | * @param data |
| | | */ |
| | | export const addRetestResult = (data: RetestResultForm) => { |
| | | return request({ |
| | | url: '/qms/retestResult', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹å¤æµè®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateRetestResult = (data: RetestResultForm) => { |
| | | return request({ |
| | | url: '/qms/retestResult', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å é¤å¤æµè®°å½ |
| | | * @param batchCode |
| | | */ |
| | | export const delRetestResult = (batchCode: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/retestResult/' + batchCode, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface RetestResultVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName: string; |
| | | |
| | | /** |
| | | * ç¯å¢æ¸©åº¦ |
| | | */ |
| | | temp: string; |
| | | |
| | | /** |
| | | * å®é
çµå |
| | | */ |
| | | voltage: number; |
| | | |
| | | /** |
| | | * å®é
çµæµ |
| | | */ |
| | | loadCurrent: number; |
| | | |
| | | /** |
| | | * æ åè·ç¦» |
| | | */ |
| | | stdDistance: number; |
| | | |
| | | /** |
| | | * æåºç© |
| | | */ |
| | | inductor: string; |
| | | |
| | | /** |
| | | * è¾åºå¼èï¼é»ï¼ç½ï¼ |
| | | */ |
| | | output: string; |
| | | |
| | | /** |
| | | * æµè¯æ°æ® |
| | | */ |
| | | testValue: number; |
| | | |
| | | /** |
| | | * 夿æ¡ä»¶ï¼æå°å¼<=çå®å¼<=æå¤§å¼ ï¼ |
| | | */ |
| | | judgeDetail: string; |
| | | |
| | | /** |
| | | * æµè¯ç»æï¼OK; NGï¼ |
| | | */ |
| | | testResult: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface RetestResultForm extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | id?: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem?: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum?: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName?: string; |
| | | |
| | | /** |
| | | * ç¯å¢æ¸©åº¦ |
| | | */ |
| | | temp?: string; |
| | | |
| | | /** |
| | | * å®é
çµå |
| | | */ |
| | | voltage?: number; |
| | | |
| | | /** |
| | | * å®é
çµæµ |
| | | */ |
| | | loadCurrent?: number; |
| | | |
| | | /** |
| | | * æ åè·ç¦» |
| | | */ |
| | | stdDistance?: number; |
| | | |
| | | /** |
| | | * æåºç© |
| | | */ |
| | | inductor?: string; |
| | | |
| | | /** |
| | | * è¾åºå¼èï¼é»ï¼ç½ï¼ |
| | | */ |
| | | output?: string; |
| | | |
| | | /** |
| | | * æµè¯æ°æ® |
| | | */ |
| | | testValue?: number; |
| | | |
| | | /** |
| | | * 夿æ¡ä»¶ï¼æå°å¼<=çå®å¼<=æå¤§å¼ ï¼ |
| | | */ |
| | | judgeDetail?: string; |
| | | |
| | | /** |
| | | * æµè¯ç»æï¼OK; NGï¼ |
| | | */ |
| | | testResult?: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface RetestResultQuery extends PageQuery { |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem?: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum?: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName?: string; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { SensorVO, SensorForm, SensorQuery } from '@/api/qms/sensor/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¼ æå¨å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listSensor = (query?: SensorQuery): AxiosPromise<SensorVO[]> => { |
| | | return request({ |
| | | url: '/qms/sensor/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¼ æå¨è¯¦ç» |
| | | * @param prodId |
| | | */ |
| | | export const getSensor = (prodId: string | number): AxiosPromise<SensorVO> => { |
| | | return request({ |
| | | url: '/qms/sensor/' + prodId, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢ä¼ æå¨ |
| | | * @param data |
| | | */ |
| | | export const addSensor = (data: SensorForm) => { |
| | | return request({ |
| | | url: '/qms/sensor', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¼ æå¨ |
| | | * @param data |
| | | */ |
| | | export const updateSensor = (data: SensorForm) => { |
| | | return request({ |
| | | url: '/qms/sensor', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å é¤ä¼ æå¨ |
| | | * @param prodId |
| | | */ |
| | | export const delSensor = (prodId: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/sensor/' + prodId, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface SensorVO { |
| | | /** |
| | | * |
| | | */ |
| | | prodId: string | number; |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel: string; |
| | | |
| | | /** |
| | | * äº§åæ¡ç |
| | | */ |
| | | prodBarcode: string; |
| | | |
| | | /** |
| | | * 产å大类 |
| | | */ |
| | | prodClass: string; |
| | | |
| | | /** |
| | | * 产åå°ç±» |
| | | */ |
| | | prodSubclass: string; |
| | | |
| | | /** |
| | | * ä¾çµçµæºï¼DC-ç´æµ;AC-交æµï¼ |
| | | */ |
| | | supply: string; |
| | | |
| | | /** |
| | | * çµåé«å¼ |
| | | */ |
| | | supplyHigh: number; |
| | | |
| | | /** |
| | | * çµåä¸å¼ |
| | | */ |
| | | supplyMiddle: string | number; |
| | | |
| | | /** |
| | | * çµåä½å¼ |
| | | */ |
| | | supplyLow: number; |
| | | |
| | | /** |
| | | * è´è½½çµæµ |
| | | */ |
| | | loadCurrent: number; |
| | | |
| | | /** |
| | | * å¼çº¿æ°é |
| | | */ |
| | | wire: number; |
| | | |
| | | /** |
| | | * è¾åºä¿¡å· |
| | | */ |
| | | outputSignal: string; |
| | | |
| | | /** |
| | | * è¾åºç±»å |
| | | */ |
| | | outputType: string; |
| | | |
| | | /** |
| | | * è¾åºææ§ |
| | | */ |
| | | outputPolarity: string; |
| | | |
| | | /** |
| | | * æåºè·ç¦» |
| | | */ |
| | | distance: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface SensorForm extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | prodId?: string | number; |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel?: string; |
| | | |
| | | /** |
| | | * äº§åæ¡ç |
| | | */ |
| | | prodBarcode?: string; |
| | | |
| | | /** |
| | | * 产å大类 |
| | | */ |
| | | prodClass?: string; |
| | | |
| | | /** |
| | | * 产åå°ç±» |
| | | */ |
| | | prodSubclass?: string; |
| | | |
| | | /** |
| | | * ä¾çµçµæºï¼DC-ç´æµ;AC-交æµï¼ |
| | | */ |
| | | supply?: string; |
| | | |
| | | /** |
| | | * çµåé«å¼ |
| | | */ |
| | | supplyHigh?: number; |
| | | |
| | | /** |
| | | * çµåä¸å¼ |
| | | */ |
| | | supplyMiddle?: string | number; |
| | | |
| | | /** |
| | | * çµåä½å¼ |
| | | */ |
| | | supplyLow?: number; |
| | | |
| | | /** |
| | | * è´è½½çµæµ |
| | | */ |
| | | loadCurrent?: number; |
| | | |
| | | /** |
| | | * å¼çº¿æ°é |
| | | */ |
| | | wire?: number; |
| | | |
| | | /** |
| | | * è¾åºä¿¡å· |
| | | */ |
| | | outputSignal?: string; |
| | | |
| | | /** |
| | | * è¾åºç±»å |
| | | */ |
| | | outputType?: string; |
| | | |
| | | /** |
| | | * è¾åºææ§ |
| | | */ |
| | | outputPolarity?: string; |
| | | |
| | | /** |
| | | * æåºè·ç¦» |
| | | */ |
| | | distance?: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface SensorQuery extends PageQuery { |
| | | |
| | | /** |
| | | * 产ååå· |
| | | */ |
| | | prodModel?: string; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { SensorResultVO, SensorResultForm, SensorResultQuery } from '@/api/qms/sensorResult/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡æç»å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listSensorResult = (query?: SensorResultQuery): AxiosPromise<SensorResultVO[]> => { |
| | | return request({ |
| | | url: '/qms/sensorResult/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡æç»è¯¦ç» |
| | | * @param batchCode |
| | | */ |
| | | export const getSensorResult = (batchCode: string | number): AxiosPromise<SensorResultVO> => { |
| | | return request({ |
| | | url: '/qms/sensorResult/' + batchCode, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢æ¹æ¬¡æç» |
| | | * @param data |
| | | */ |
| | | export const addSensorResult = (data: SensorResultForm) => { |
| | | return request({ |
| | | url: '/qms/sensorResult', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¹æ¬¡æç» |
| | | * @param data |
| | | */ |
| | | export const updateSensorResult = (data: SensorResultForm) => { |
| | | return request({ |
| | | url: '/qms/sensorResult', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å 餿¹æ¬¡æç» |
| | | * @param batchCode |
| | | */ |
| | | export const delSensorResult = (batchCode: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/sensorResult/' + batchCode, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface SensorResultVO { |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum: string; |
| | | |
| | | /** |
| | | * å¤å®ç»æ |
| | | */ |
| | | judgeResult: string; |
| | | |
| | | /** |
| | | * æ»æµè¯é¡¹æ° |
| | | */ |
| | | totalCount: number; |
| | | |
| | | /** |
| | | * OKé¡¹æ° |
| | | */ |
| | | okCount: number; |
| | | |
| | | /** |
| | | * NGé¡¹æ° |
| | | */ |
| | | ngCount: number; |
| | | |
| | | } |
| | | |
| | | export interface SensorResultForm extends BaseEntity { |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * å¤å®ç»æ |
| | | */ |
| | | judgeResult?: string; |
| | | |
| | | /** |
| | | * æ»æµè¯é¡¹æ° |
| | | */ |
| | | totalCount?: number; |
| | | |
| | | /** |
| | | * OKé¡¹æ° |
| | | */ |
| | | okCount?: number; |
| | | |
| | | /** |
| | | * NGé¡¹æ° |
| | | */ |
| | | ngCount?: number; |
| | | |
| | | } |
| | | |
| | | export interface SensorResultQuery extends PageQuery { |
| | | |
| | | /** |
| | | * å¤å®ç»æ |
| | | */ |
| | | judgeResult?: string; |
| | | |
| | | /** |
| | | * æ»æµè¯é¡¹æ° |
| | | */ |
| | | totalCount?: number; |
| | | |
| | | /** |
| | | * OKé¡¹æ° |
| | | */ |
| | | okCount?: number; |
| | | |
| | | /** |
| | | * NGé¡¹æ° |
| | | */ |
| | | ngCount?: number; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { SensorRetestVO, SensorRetestForm, SensorRetestQuery } from '@/api/qms/sensorRetest/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æµè®°å½å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listSensorRetest = (query?: SensorRetestQuery): AxiosPromise<SensorRetestVO[]> => { |
| | | return request({ |
| | | url: '/qms/sensorRetest/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æµè®°å½è¯¦ç» |
| | | * @param batchCode |
| | | */ |
| | | export const getSensorRetest = (batchCode: string | number): AxiosPromise<SensorRetestVO> => { |
| | | return request({ |
| | | url: '/qms/sensorRetest/' + batchCode, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢å¤æµè®°å½ |
| | | * @param data |
| | | */ |
| | | export const addSensorRetest = (data: SensorRetestForm) => { |
| | | return request({ |
| | | url: '/qms/sensorRetest', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹å¤æµè®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateSensorRetest = (data: SensorRetestForm) => { |
| | | return request({ |
| | | url: '/qms/sensorRetest', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å é¤å¤æµè®°å½ |
| | | * @param batchCode |
| | | */ |
| | | export const delSensorRetest = (batchCode: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/sensorRetest/' + batchCode, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface SensorRetestVO { |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName: string; |
| | | |
| | | /** |
| | | * å¤å®ç»æ |
| | | */ |
| | | judgeResult: string; |
| | | |
| | | /** |
| | | * æ»æµè¯é¡¹æ° |
| | | */ |
| | | totalCount: number; |
| | | |
| | | /** |
| | | * OKé¡¹æ° |
| | | */ |
| | | okCount: number; |
| | | |
| | | /** |
| | | * NGé¡¹æ° |
| | | */ |
| | | ngCount: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface SensorRetestForm extends BaseEntity { |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum?: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName?: string; |
| | | |
| | | /** |
| | | * å¤å®ç»æ |
| | | */ |
| | | judgeResult?: string; |
| | | |
| | | /** |
| | | * æ»æµè¯é¡¹æ° |
| | | */ |
| | | totalCount?: number; |
| | | |
| | | /** |
| | | * OKé¡¹æ° |
| | | */ |
| | | okCount?: number; |
| | | |
| | | /** |
| | | * NGé¡¹æ° |
| | | */ |
| | | ngCount?: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface SensorRetestQuery extends PageQuery { |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * 夿µæ¬¡æ° |
| | | */ |
| | | retestNum?: string; |
| | | |
| | | /** |
| | | * 设å¤å· |
| | | */ |
| | | deviceCode?: string; |
| | | |
| | | /** |
| | | * ç¨æ·å¸å· |
| | | */ |
| | | userName?: string; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | import { AxiosPromise } from 'axios'; |
| | | import { TestResultVO, TestResultForm, TestResultQuery } from '@/api/qms/testResult/types'; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯ç»æå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listTestResult = (query?: TestResultQuery): AxiosPromise<TestResultVO[]> => { |
| | | return request({ |
| | | url: '/qms/testResult/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯ç»æå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export const listTestResultAll = (query?: TestResultQuery): AxiosPromise<TestResultVO[]> => { |
| | | return request({ |
| | | url: '/qms/testResult/listAll', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | }; |
| | | /** |
| | | * æ¥è¯¢æµè¯é¡¹ç® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export const listTestItem = () => { |
| | | return request({ |
| | | url: '/qms/testResult/distinctTestItems', |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯ç»æè¯¦ç» |
| | | * @param id |
| | | */ |
| | | export const getTestResult = (id: string | number): AxiosPromise<TestResultVO> => { |
| | | return request({ |
| | | url: '/qms/testResult/' + id, |
| | | method: 'get' |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * æ°å¢æµè¯ç»æ |
| | | * @param data |
| | | */ |
| | | export const addTestResult = (data: TestResultForm) => { |
| | | return request({ |
| | | url: '/qms/testResult', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * ä¿®æ¹æµè¯ç»æ |
| | | * @param data |
| | | */ |
| | | export const updateTestResult = (data: TestResultForm) => { |
| | | return request({ |
| | | url: '/qms/testResult', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å 餿µè¯ç»æ |
| | | * @param id |
| | | */ |
| | | export const delTestResult = (id: string | number | Array<string | number>) => { |
| | | return request({ |
| | | url: '/qms/testResult/' + id, |
| | | method: 'delete' |
| | | }); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TestResultVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem: string; |
| | | |
| | | /** |
| | | * å®é
çµå |
| | | */ |
| | | voltage: number; |
| | | |
| | | /** |
| | | * å®é
çµæµ |
| | | */ |
| | | loadCurrent: number; |
| | | |
| | | /** |
| | | * æ åè·ç¦» |
| | | */ |
| | | stdDistance: number; |
| | | |
| | | /** |
| | | * æåºç© |
| | | */ |
| | | inductor: string; |
| | | |
| | | /** |
| | | * è¾åºå¼èï¼é»ï¼ç½ï¼ |
| | | */ |
| | | output: string; |
| | | |
| | | /** |
| | | * æµè¯æ°æ® |
| | | */ |
| | | testValue: number; |
| | | |
| | | /** |
| | | * 夿æ¡ä»¶ï¼æå°å¼<=çå®å¼<=æå¤§å¼ ï¼ |
| | | */ |
| | | judgeDetail: string; |
| | | |
| | | /** |
| | | * æµè¯ç»æï¼OK; NGï¼ |
| | | */ |
| | | testResult: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface TestResultForm extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | id?: string | number; |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem?: string; |
| | | |
| | | /** |
| | | * å®é
çµå |
| | | */ |
| | | voltage?: number; |
| | | |
| | | /** |
| | | * å®é
çµæµ |
| | | */ |
| | | loadCurrent?: number; |
| | | |
| | | /** |
| | | * æ åè·ç¦» |
| | | */ |
| | | stdDistance?: number; |
| | | |
| | | /** |
| | | * æåºç© |
| | | */ |
| | | inductor?: string; |
| | | |
| | | /** |
| | | * è¾åºå¼èï¼é»ï¼ç½ï¼ |
| | | */ |
| | | output?: string; |
| | | |
| | | /** |
| | | * æµè¯æ°æ® |
| | | */ |
| | | testValue?: number; |
| | | |
| | | /** |
| | | * 夿æ¡ä»¶ï¼æå°å¼<=çå®å¼<=æå¤§å¼ ï¼ |
| | | */ |
| | | judgeDetail?: string; |
| | | |
| | | /** |
| | | * æµè¯ç»æï¼OK; NGï¼ |
| | | */ |
| | | testResult?: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface TestResultQuery extends PageQuery { |
| | | |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | batchCode?: string; |
| | | |
| | | /** |
| | | * æµè¯åºå· |
| | | */ |
| | | testNum?: string; |
| | | |
| | | /** |
| | | * æµè¯é¡¹ç® |
| | | */ |
| | | testItem?: string; |
| | | |
| | | /** |
| | | * å®é
çµå |
| | | */ |
| | | voltage?: number; |
| | | |
| | | /** |
| | | * å®é
çµæµ |
| | | */ |
| | | loadCurrent?: number; |
| | | |
| | | /** |
| | | * æ åè·ç¦» |
| | | */ |
| | | stdDistance?: number; |
| | | |
| | | /** |
| | | * æåºç© |
| | | */ |
| | | inductor?: string; |
| | | |
| | | /** |
| | | * è¾åºå¼èï¼é»ï¼ç½ï¼ |
| | | */ |
| | | output?: string; |
| | | |
| | | /** |
| | | * æµè¯æ°æ® |
| | | */ |
| | | testValue?: number; |
| | | |
| | | /** |
| | | * 夿æ¡ä»¶ï¼æå°å¼<=çå®å¼<=æå¤§å¼ ï¼ |
| | | */ |
| | | judgeDetail?: string; |
| | | |
| | | /** |
| | | * æµè¯ç»æï¼OK; NGï¼ |
| | | */ |
| | | testResult?: string; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733988825570" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1518" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M902.386347 299.738453c-0.02048-0.02048 0-0.054613-0.02048-0.085333-0.4096-1.93536-1.1264-3.754667-2.048-5.471573-0.211627-0.395947-0.426667-0.771413-0.648533-1.153707-1.04448-1.723733-2.22208-3.34848-3.67616-4.73088l0-0.01024L618.038613 24.139093c-0.006827 0-0.034133-0.01024-0.034133-0.03072l-0.037547-0.027307c-0.01024-0.013653-0.044373-0.013653-0.064853-0.03072-1.419947-1.355093-3.085653-2.450773-4.840107-3.42016-0.433493-0.23552-0.853333-0.457387-1.314133-0.662187-1.764693-0.836267-3.631787-1.52576-5.618347-1.921707-0.170667-0.01024-0.324267-0.01024-0.47104-0.017067-1.344853-0.24576-2.69312-0.402773-4.12672-0.402773L201.8816 17.626453c-36.939093 0-67.003733 28.699307-67.003733 63.993173l0 864.576853c0 35.283627 30.06464 64.01024 67.003733 64.01024l633.965227 0c36.94592 0 66.993493-28.726613 66.993493-64.01024L902.84032 304.049493C902.84032 302.578347 902.66624 301.134507 902.386347 299.738453M823.197013 281.82528l-198.362453 0L624.83456 93.313707 823.197013 281.82528zM856.306347 946.213547c0 10.769067-9.17504 19.554987-20.45952 19.554987L201.8816 965.768533c-11.30496 0-20.476587-8.779093-20.476587-19.554987L181.405013 81.629867c0-10.789547 9.17504-19.551573 20.476587-19.551573l376.425813 0 0 241.96096c0 12.274347 10.43456 22.224213 23.261867 22.224213l254.743893 0L856.306347 946.213547 856.306347 946.213547z" fill="#050101" p-id="1519"></path><path d="M711.3216 738.78528 313.50784 738.78528c-12.20608 0-22.09792 10.417493-22.09792 23.27552 0 12.87168 9.888427 23.27552 22.09792 23.27552l397.810347 0c12.19584 0 22.09792-10.407253 22.09792-23.27552C733.412693 749.202773 723.51744 738.78528 711.3216 738.78528" fill="#050101" p-id="1520"></path><path d="M711.3216 585.63584 313.50784 585.63584c-12.20608 0-22.09792 10.41408-22.09792 23.261867 0 12.868267 9.888427 23.272107 22.09792 23.272107l397.810347 0c12.19584 0 22.09792-10.386773 22.09792-23.272107C733.412693 596.04992 723.51744 585.63584 711.3216 585.63584" fill="#050101" p-id="1521"></path><path d="M291.396267 455.758507c0 12.8512 9.89184 23.261867 22.09792 23.261867l397.810347 0c12.209493 0 22.104747-10.410667 22.104747-23.261867 0-12.864853-9.888427-23.268693-22.104747-23.268693L313.494187 432.489813C301.29152 432.493227 291.396267 442.893653 291.396267 455.758507" fill="#050101" p-id="1522"></path></svg> |
| | |
| | | } |
| | | }); |
| | | |
| | | const title = ref('RuoYi-Vue-Plus'); |
| | | const title = ref('LB-QMS'); |
| | | const settingsStore = useSettingsStore(); |
| | | const sideTheme = computed(() => settingsStore.sideTheme); |
| | | </script> |
| | |
| | | <div class="app-container home"> |
| | | <el-row :gutter="20"> |
| | | <el-col :sm="24" :lg="12" style="padding-left: 20px"> |
| | | <h2>RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»</h2> |
| | | <p> |
| | | RuoYi-Vue-Plus æ¯åºäº RuoYi-Vue é对 åå¸å¼é群 åºæ¯å级(ä¸å
¼å®¹åæ¡æ¶) |
| | | <br /> |
| | | * å端å¼åæ¡æ¶ Vue3ãTSãElement Plus<br /> |
| | | * å端å¼åæ¡æ¶ Spring Boot<br /> |
| | | * 容卿¡æ¶ Undertow åºäº Netty ç髿§è½å®¹å¨<br /> |
| | | * æéè®¤è¯æ¡æ¶ Sa-Token æ¯æå¤ç»ç«¯è®¤è¯ç³»ç»<br /> |
| | | * å
³ç³»æ°æ®åº MySQL éé
8.X æä½ 5.7<br /> |
| | | * ç¼åæ°æ®åº Redis éé
6.X æä½ 4.X<br /> |
| | | * æ°æ®åºæ¡æ¶ Mybatis-Plus å¿«é CRUD å¢å å¼åæç<br /> |
| | | * æ°æ®åºæ¡æ¶ p6spy æ´å¼ºå²ç SQL åæ<br /> |
| | | * 夿°æ®æºæ¡æ¶ dynamic-datasource æ¯æä¸»ä»ä¸å¤ç§ç±»æ°æ®åºå¼æ<br /> |
| | | * åºååæ¡æ¶ Jackson ç»ä¸ä½¿ç¨ jackson 髿å¯é <br /> |
| | | * Redis客æ·ç«¯ Redisson æ§è½å¼ºå²ãAPI丰å¯<br /> |
| | | * åå¸å¼éæµ Redisson å
¨å±ã请æ±IPãé群ID å¤ç§éæµ<br /> |
| | | * åå¸å¼é Lock4j 注解éãå·¥å
·é å¤ç§å¤æ ·<br /> |
| | | * åå¸å¼å¹ç Lock4j åºäºåå¸å¼éå®ç°<br /> |
| | | * åå¸å¼é¾è·¯è¿½è¸ª SkyWalking æ¯æé¾è·¯è¿½è¸ªãç½æ ¼åæã度éèåãå¯è§å<br /> |
| | | * åå¸å¼ä»»å¡è°åº¦ SnailJob 髿§è½ é«å¯é ææ©å±<br /> |
| | | * æä»¶åå¨ Minio æ¬å°åå¨<br /> |
| | | * æä»¶åå¨ ä¸çãé¿éãè
¾è®¯ äºåå¨<br /> |
| | | * çæ§æ¡æ¶ SpringBoot-Admin å
¨æ¹ä½æå¡çæ§<br /> |
| | | * æ ¡éªæ¡æ¶ Validation å¢å¼ºæ¥å£å®å
¨æ§ 严谨æ§<br /> |
| | | * Excelæ¡æ¶ Alibaba EasyExcel æ§è½ä¼å¼ æ©å±æ§å¼º<br /> |
| | | * ææ¡£æ¡æ¶ SpringDocãjavadoc æ æ³¨è§£é¶å
¥ä¾µåºäºjava注é<br /> |
| | | * å·¥å
·ç±»æ¡æ¶ HutoolãLombok åå°ä»£ç åä½ å¢å å®å
¨æ§<br /> |
| | | * 代ç çæå¨ éé
MPãSpringDocè§èå代ç ä¸é®çæåå端代ç <br /> |
| | | * é¨ç½²æ¹å¼ Docker 容å¨ç¼æ ä¸é®é¨ç½²ä¸å¡é群<br /> |
| | | * å½é
å SpringMessage Springæ åå½é
åæ¹æ¡<br /> |
| | | </p> |
| | | <p><b>å½åçæ¬:</b> <span>v5.3.0</span></p> |
| | | <p> |
| | | <el-tag type="danger">¥å
è´¹å¼æº</el-tag> |
| | | </p> |
| | | <p> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://gitee.com/dromara/RuoYi-Vue-Plus')">访é®ç äº</el-button> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://github.com/dromara/RuoYi-Vue-Plus')">访é®GitHub</el-button> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://plus-doc.dromara.org/#/ruoyi-vue-plus/changlog')" |
| | | >æ´æ°æ¥å¿</el-button |
| | | > |
| | | </p> |
| | | <h2>å
°å®è½¦é´è´¨é管çç³»ç»</h2> |
| | | |
| | | </el-col> |
| | | |
| | | <el-col :sm="24" :lg="12" style="padding-left: 20px"> |
| | | <h2>RuoYi-Cloud-Pluså¤ç§æ·å¾®æå¡ç®¡çç³»ç»</h2> |
| | | <p> |
| | | RuoYi-Cloud-Plus å¾®æå¡éç¨æé管çç³»ç» éå RuoYi-Cloud å
¨æ¹ä½å级(ä¸å
¼å®¹åæ¡æ¶) |
| | | <br /> |
| | | * å端å¼åæ¡æ¶ Vue3ãTSãElement UI<br /> |
| | | * å端å¼åæ¡æ¶ Spring Boot<br /> |
| | | * å¾®æå¡å¼åæ¡æ¶ Spring CloudãSpring Cloud Alibaba<br /> |
| | | * 容卿¡æ¶ Undertow åºäº XNIO ç髿§è½å®¹å¨<br /> |
| | | * æéè®¤è¯æ¡æ¶ Sa-TokenãJwt æ¯æå¤ç»ç«¯è®¤è¯ç³»ç»<br /> |
| | | * å
³ç³»æ°æ®åº MySQL éé
8.X æä½ 5.7<br /> |
| | | * å
³ç³»æ°æ®åº Oracle éé
11g 12c<br /> |
| | | * å
³ç³»æ°æ®åº PostgreSQL éé
13 14<br /> |
| | | * å
³ç³»æ°æ®åº SQLServer éé
2017 2019<br /> |
| | | * ç¼åæ°æ®åº Redis éé
6.X æä½ 5.X<br /> |
| | | * åå¸å¼æ³¨åä¸å¿ Alibaba Nacos éç¨2.X åºäºGRPCéä¿¡é«æ§è½<br /> |
| | | * åå¸å¼é
ç½®ä¸å¿ Alibaba Nacos éç¨2.X åºäºGRPCéä¿¡é«æ§è½<br /> |
| | | * æå¡ç½å
³ Spring Cloud Gateway ååºå¼é«æ§è½ç½å
³<br /> |
| | | * è´è½½åè¡¡ Spring Cloud Loadbalancer è´è½½åè¡¡å¤ç<br /> |
| | | * RPCè¿ç¨è°ç¨ Apache Dubbo åçæä½¿ç¨ä½éªã髿§è½<br /> |
| | | * åå¸å¼éæµçæ Alibaba Sentinel æ ä¾µå
¥ã髿©å±<br /> |
| | | * åå¸å¼äºå¡ Alibaba Seata æ ä¾µå
¥ã髿©å± æ¯æ åç§æ¨¡å¼<br /> |
| | | * åå¸å¼æ¶æ¯éå Apache Kafka 髿§è½é«é度<br /> |
| | | * åå¸å¼æ¶æ¯éå Apache RocketMQ é«å¯ç¨åè½å¤æ ·<br /> |
| | | * åå¸å¼æ¶æ¯éå RabbitMQ æ¯æåç§æ©å±æä»¶åè½å¤æ ·æ§<br /> |
| | | * åå¸å¼æç´¢å¼æ ElasticSearch ä¸çç¥å<br /> |
| | | * åå¸å¼é¾è·¯è¿½è¸ª Apache SkyWalking é¾è·¯è¿½è¸ªãç½æ ¼åæã度éèåãå¯è§å<br /> |
| | | * åå¸å¼æ¥å¿ä¸å¿ ELK ä¸çæçè§£å³æ¹æ¡<br /> |
| | | * åå¸å¼çæ§ PrometheusãGrafana å
¨æ¹ä½æ§è½çæ§<br /> |
| | | * å
¶ä½ä¸ Vue çæ¬ä¸è´<br /> |
| | | </p> |
| | | <p><b>å½åçæ¬:</b> <span>v2.3.0</span></p> |
| | | <p> |
| | | <el-tag type="danger">¥å
è´¹å¼æº</el-tag> |
| | | </p> |
| | | <p> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://gitee.com/dromara/RuoYi-Cloud-Plus')">访é®ç äº</el-button> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://github.com/dromara/RuoYi-Cloud-Plus')">访é®GitHub</el-button> |
| | | <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://plus-doc.dromara.org/#/ruoyi-cloud-plus/changlog')" |
| | | >æ´æ°æ¥å¿</el-button |
| | | > |
| | | </p> |
| | | |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider /> |
| | |
| | | <div class="login"> |
| | | <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> |
| | | <div class="title-box"> |
| | | <h3 class="title">RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»</h3> |
| | | <h3 class="title">å
°å®è½¦é´è´¨é管çç³»ç»</h3> |
| | | <lang-select /> |
| | | </div> |
| | | <el-form-item v-if="tenantEnabled" prop="tenantId"> |
| | |
| | | </el-form> |
| | | <!-- åºé¨ --> |
| | | <div class="el-login-footer"> |
| | | <span>Copyright © 2018-2024 ç¯ççç®åLi All Rights Reserved.</span> |
| | | <span>Copyright © 2018-2024 䏿µ·å
°æµ¦æºè½ç§ææéå
¬å¸ All Rights Reserved.</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | const loginForm = ref<LoginData>({ |
| | | tenantId: '000000', |
| | | username: 'admin', |
| | | password: 'admin123', |
| | | username: '', |
| | | password: '', |
| | | rememberMe: false, |
| | | code: '', |
| | | uuid: '' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="产ååå·" prop="prodModel"> |
| | | <el-input v-model="queryParams.prodModel" placeholder="请è¾å
¥äº§ååå·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <div style="display: inline" v-if="showMore"> |
| | | <el-form-item label="ç¨æ·ç¼å·" prop="userId"> |
| | | <el-input v-model="queryParams.userId" placeholder="请è¾å
¥ç¨æ·ç¼å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å·" prop="deviceCode"> |
| | | <el-input v-model="queryParams.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ°é" prop="num"> |
| | | <el-input v-model="queryParams.num" placeholder="请è¾å
¥æ°é" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | <el-button v-if="!showMore" type="text" @click="showMore = !showMore">å±å¼</el-button> |
| | | <el-button v-if="showMore" type="text" @click="showMore = !showMore">æ¶èµ·</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:batch:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:batch:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:batch:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:batch:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" :columns="columns" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="batchList" |
| | | @selection-change="handleSelectionChange" |
| | | stripe |
| | | highlight-current-row |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="ID" align="center" prop="id" v-if="columns[0].visible"/> |
| | | <el-table-column label="æ¹æ¬¡å·" align="center" prop="batchCode" v-if="columns[1].visible" /> |
| | | <el-table-column label="产ååå·" align="center" prop="prodModel" v-if="columns[2].visible" /> |
| | | <el-table-column label="ç¨æ·ç¼å·" align="center" prop="userId" v-if="columns[3].visible" /> |
| | | <el-table-column label="设å¤å·" align="center" prop="deviceCode" v-if="columns[4].visible" /> |
| | | <el-table-column label="æ°é" align="center" prop="num" v-if="columns[5].visible" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" v-if="columns[6].visible" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" v-if="columns[7].visible" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="æç»" placement="top"> |
| | | <el-button link type="primary" icon="Document" @click="handleDetail(scope.row)"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:batch:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:batch:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æ¹æ¬¡ç®¡çå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="batchFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="产ååå·" prop="prodModel"> |
| | | <el-input v-model="form.prodModel" placeholder="请è¾å
¥äº§ååå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·ç¼å·" prop="userId"> |
| | | <el-input v-model="form.userId" placeholder="请è¾å
¥ç¨æ·ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å·" prop="deviceCode"> |
| | | <el-input v-model="form.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ°é" prop="num"> |
| | | <el-input v-model="form.num" placeholder="请è¾å
¥æ°é" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Batch" lang="ts"> |
| | | import { listBatch, getBatch, delBatch, addBatch, updateBatch } from '@/api/qms/batch'; |
| | | import { BatchVO, BatchQuery, BatchForm } from '@/api/qms/batch/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const batchList = ref<BatchVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const showMore = ref(false); |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const batchFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: BatchForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | prodModel: undefined, |
| | | userId: undefined, |
| | | deviceCode: undefined, |
| | | num: undefined, |
| | | remark: undefined, |
| | | createTime: undefined, // æ·»å createTime åæ®µ |
| | | } |
| | | const data = reactive<PageData<BatchForm, BatchQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | batchCode: undefined, |
| | | prodModel: undefined, |
| | | userId: undefined, |
| | | deviceCode: undefined, |
| | | num: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | prodModel: [ |
| | | { required: true, message: "产ååå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | userId: [ |
| | | { required: true, message: "ç¨æ·ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | deviceCode: [ |
| | | { required: true, message: "设å¤å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | num: [ |
| | | { required: true, message: "æ°éä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // æ·»å columns æ°ç» |
| | | const columns = ref<FieldOption[]>([ |
| | | { key: 0, label: 'ID', align: 'center', visible: false }, |
| | | { key: 1, label: 'æ¹æ¬¡å·', align: 'center', visible: true }, |
| | | { key: 2, label: '产ååå·', align: 'center', visible: true }, |
| | | { key: 3, label: 'ç¨æ·ç¼å·', align: 'center', visible: true }, |
| | | { key: 4, label: '设å¤å·', align: 'center', visible: true }, |
| | | { key: 5, label: 'æ°é', align: 'center', visible: true }, |
| | | { key: 6, label: '夿³¨', align: 'center', visible: true }, |
| | | { key: 7, label: 'å建æ¶é´', align: 'center', visible: true }, |
| | | ]); |
| | | |
| | | /** æ¥è¯¢æ¹æ¬¡ç®¡çå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | const res = await listBatch(queryParams.value); |
| | | batchList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | batchFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: BatchVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æ¹æ¬¡ç®¡ç"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: BatchVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getBatch(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æ¹æ¬¡ç®¡ç"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | batchFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateBatch(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addBatch(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: BatchVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿¹æ¬¡ç®¡çç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delBatch(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/batch/export', { |
| | | ...queryParams.value |
| | | }, `batch_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | const handleDetail = (batch) => { |
| | | proxy.$router.push({ path: 'sensorResult', query: {batchCode: batch.batchCode} }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="设å¤ç±»å" prop="deviceType"> |
| | | <el-select v-model="queryParams.deviceType" placeholder="è¯·éæ©è®¾å¤ç±»å" clearable > |
| | | <el-option v-for="dict in lb_device_type" :key="dict.value" :label="dict.label" :value="dict.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç¼å·" prop="deviceCode"> |
| | | <el-input v-model="queryParams.deviceCode" placeholder="请è¾å
¥è®¾å¤ç¼å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨ç»" prop="deviceGroup"> |
| | | <el-input v-model="queryParams.deviceGroup" placeholder="请è¾å
¥æå¨ç»" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨é¨é¨" prop="deviceDept"> |
| | | <el-input v-model="queryParams.deviceDept" placeholder="请è¾å
¥æå¨é¨é¨" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨å·¥ä½" prop="deviceStation"> |
| | | <el-input v-model="queryParams.deviceStation" placeholder="请è¾å
¥æå¨å·¥ä½" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:device:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:device:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:device:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:device:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" stripe highlight-current-row :data="deviceList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="" align="center" prop="id" v-if="false" /> |
| | | <el-table-column label="设å¤ç±»å" align="center" prop="deviceType"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_device_type" :value="scope.row.deviceType"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="设å¤ç¼å·" align="center" prop="deviceCode" /> |
| | | <el-table-column label="æå¨ç»" align="center" prop="deviceGroup" /> |
| | | <el-table-column label="æå¨é¨é¨" align="center" prop="deviceDept" /> |
| | | <el-table-column label="æå¨å·¥ä½" align="center" prop="deviceStation" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:device:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:device:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ä»ªå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="deviceFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="设å¤ç±»å" prop="deviceType"> |
| | | <el-radio-group v-model="form.deviceType"> |
| | | <el-radio |
| | | v-for="dict in lb_device_type" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç¼å·" prop="deviceCode"> |
| | | <el-input v-model="form.deviceCode" placeholder="请è¾å
¥è®¾å¤ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨ç»" prop="deviceGroup"> |
| | | <el-input v-model="form.deviceGroup" placeholder="请è¾å
¥æå¨ç»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨é¨é¨" prop="deviceDept"> |
| | | <el-input v-model="form.deviceDept" placeholder="请è¾å
¥æå¨é¨é¨" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¨å·¥ä½" prop="deviceStation"> |
| | | <el-input v-model="form.deviceStation" placeholder="请è¾å
¥æå¨å·¥ä½" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Device" lang="ts"> |
| | | import { listDevice, getDevice, delDevice, addDevice, updateDevice } from '@/api/qms/device'; |
| | | import { DeviceVO, DeviceQuery, DeviceForm } from '@/api/qms/device/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | const { lb_device_type } = toRefs<any>(proxy?.useDict('lb_device_type')); |
| | | |
| | | const deviceList = ref<DeviceVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const deviceFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: DeviceForm = { |
| | | id: undefined, |
| | | deviceType: undefined, |
| | | deviceCode: undefined, |
| | | deviceGroup: undefined, |
| | | deviceDept: undefined, |
| | | deviceStation: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<DeviceForm, DeviceQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | deviceType: undefined, |
| | | deviceCode: undefined, |
| | | deviceGroup: undefined, |
| | | deviceDept: undefined, |
| | | deviceStation: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | deviceType: [ |
| | | { required: true, message: "设å¤ç±»åä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | deviceCode: [ |
| | | { required: true, message: "设å¤ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | deviceGroup: [ |
| | | { required: true, message: "æå¨ç»ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | deviceDept: [ |
| | | { required: true, message: "æå¨é¨é¨ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | deviceStation: [ |
| | | { required: true, message: "æå¨å·¥ä½ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢æµè¯ä»ªå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | const res = await listDevice(queryParams.value); |
| | | deviceList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | deviceFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: DeviceVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æµè¯ä»ª"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: DeviceVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getDevice(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æµè¯ä»ª"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | deviceFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateDevice(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addDevice(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: DeviceVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ä»ªç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delDevice(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/device/export', { |
| | | ...queryParams.value |
| | | }, `device_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <!-- <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">--> |
| | | <!-- <div v-show="showSearch" class="mb-[10px]">--> |
| | | <!-- <el-card shadow="hover">--> |
| | | <!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">--> |
| | | <!-- <el-form-item label="æ¹æ¬¡å·" prop="batchCode">--> |
| | | <!-- <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="æµè¯åºå·" prop="testNum">--> |
| | | <!-- <el-input v-model="queryParams.testNum" placeholder="请è¾å
¥æµè¯åºå·" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="æµè¯é¡¹ç®" prop="testItem">--> |
| | | <!-- <el-input v-model="queryParams.testItem" placeholder="请è¾å
¥æµè¯é¡¹ç®" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="夿µæ¬¡æ°" prop="retestNum">--> |
| | | <!-- <el-input v-model="queryParams.retestNum" placeholder="请è¾å
¥å¤æµæ¬¡æ°" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="设å¤å·" prop="deviceCode">--> |
| | | <!-- <el-input v-model="queryParams.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="ç¨æ·å¸å·" prop="userName">--> |
| | | <!-- <el-input v-model="queryParams.userName" placeholder="请è¾å
¥ç¨æ·å¸å·" clearable @keyup.enter="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item>--> |
| | | <!-- <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button>--> |
| | | <!-- <el-button icon="Refresh" @click="resetQuery">éç½®</el-button>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-form>--> |
| | | <!-- </el-card>--> |
| | | <!-- </div>--> |
| | | <!-- </transition>--> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:retestResult:add']">æ°å¢</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:retestResult:edit']">ä¿®æ¹</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:retestResult:remove']">å é¤</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:retestResult:export']">导åº</el-button>--> |
| | | <!-- </el-col>--> |
| | | <right-toolbar v-model:showSearch="showSearch" :columns="columns" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" stripe highlight-current-row :data="retestResultList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="" align="center" prop="id" v-if="false"/> |
| | | <!-- æ¹æ¬¡å· --> |
| | | <el-table-column |
| | | v-if="columns[0].visible" |
| | | label="æ¹æ¬¡å·" |
| | | align="center" |
| | | prop="batchCode" |
| | | /> |
| | | |
| | | <!-- æµè¯åºå· --> |
| | | <el-table-column |
| | | v-if="columns[1].visible" |
| | | label="æµè¯åºå·" |
| | | align="center" |
| | | prop="testNum" |
| | | /> |
| | | |
| | | <!-- æµè¯é¡¹ç® --> |
| | | <el-table-column |
| | | v-if="columns[2].visible" |
| | | label="æµè¯é¡¹ç®" |
| | | align="center" |
| | | prop="testItem" |
| | | /> |
| | | |
| | | <!-- 夿µæ¬¡æ° --> |
| | | <el-table-column |
| | | v-if="columns[3].visible" |
| | | label="夿µæ¬¡æ°" |
| | | align="center" |
| | | prop="retestNum" |
| | | /> |
| | | |
| | | <!-- 设å¤å· --> |
| | | <el-table-column |
| | | v-if="columns[4].visible" |
| | | label="设å¤å·" |
| | | align="center" |
| | | prop="deviceCode" |
| | | /> |
| | | |
| | | <!-- ç¨æ·å¸å· --> |
| | | <el-table-column |
| | | v-if="columns[5].visible" |
| | | label="ç¨æ·å¸å·" |
| | | align="center" |
| | | prop="userName" |
| | | /> |
| | | |
| | | <!-- ç¯å¢æ¸©åº¦ --> |
| | | <el-table-column |
| | | v-if="columns[6].visible" |
| | | label="ç¯å¢æ¸©åº¦" |
| | | align="center" |
| | | prop="temp" |
| | | /> |
| | | |
| | | <!-- å®é
çµå --> |
| | | <el-table-column |
| | | v-if="columns[7].visible" |
| | | label="å®é
çµå" |
| | | align="center" |
| | | prop="voltage" |
| | | /> |
| | | |
| | | <!-- å®é
çµæµ --> |
| | | <el-table-column |
| | | v-if="columns[8].visible" |
| | | label="å®é
çµæµ" |
| | | align="center" |
| | | prop="loadCurrent" |
| | | /> |
| | | |
| | | <!-- æ åè·ç¦» --> |
| | | <el-table-column |
| | | v-if="columns[9].visible" |
| | | label="æ åè·ç¦»" |
| | | align="center" |
| | | prop="stdDistance" |
| | | /> |
| | | |
| | | <!-- æåºç© --> |
| | | <el-table-column |
| | | v-if="columns[10].visible" |
| | | label="æåºç©" |
| | | align="center" |
| | | prop="inductor" |
| | | /> |
| | | |
| | | <!-- è¾åºå¼è --> |
| | | <el-table-column |
| | | v-if="columns[11].visible" |
| | | label="è¾åºå¼è" |
| | | align="center" |
| | | prop="output" |
| | | /> |
| | | |
| | | <!-- æµè¯æ°æ® --> |
| | | <el-table-column |
| | | v-if="columns[12].visible" |
| | | label="æµè¯æ°æ®" |
| | | align="center" |
| | | prop="testValue" |
| | | /> |
| | | |
| | | <!-- 夿æ¡ä»¶ --> |
| | | <el-table-column |
| | | v-if="columns[13].visible" |
| | | label="夿æ¡ä»¶" |
| | | align="center" |
| | | prop="judgeDetail" |
| | | /> |
| | | |
| | | <!-- æµè¯ç»æ --> |
| | | <el-table-column |
| | | v-if="columns[14].visible" |
| | | label="æµè¯ç»æ" |
| | | align="center" |
| | | prop="testResult" |
| | | /> |
| | | |
| | | <!-- 夿³¨ --> |
| | | <el-table-column |
| | | v-if="columns[15].visible" |
| | | label="夿³¨" |
| | | align="center" |
| | | prop="remark" |
| | | /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['lb-qms:retestResult:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['lb-qms:retestResult:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹å¤æµè®°å½å¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="retestResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="" prop="id"> |
| | | <el-input v-model="form.id" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿µæ¬¡æ°" prop="retestNum"> |
| | | <el-input v-model="form.retestNum" placeholder="请è¾å
¥å¤æµæ¬¡æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å·" prop="deviceCode"> |
| | | <el-input v-model="form.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·å¸å·" prop="userName"> |
| | | <el-input v-model="form.userName" placeholder="请è¾å
¥ç¨æ·å¸å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¯å¢æ¸©åº¦" prop="temp"> |
| | | <el-input v-model="form.temp" placeholder="请è¾å
¥ç¯å¢æ¸©åº¦" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="RetestResult" lang="ts"> |
| | | import { listRetestResult, getRetestResult, delRetestResult, addRetestResult, updateRetestResult } from '@/api/qms/retestResult'; |
| | | import { RetestResultVO, RetestResultQuery, RetestResultForm } from '@/api/qms/retestResult/types'; |
| | | import { watch } from 'vue'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const retestResultList = ref<RetestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const retestResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: RetestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | retestNum: undefined, |
| | | deviceCode: undefined, |
| | | userName: undefined, |
| | | temp: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<RetestResultForm, RetestResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | retestNum: undefined, |
| | | deviceCode: undefined, |
| | | userName: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testItem: [ |
| | | { required: true, message: "æµè¯é¡¹ç®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | retestNum: [ |
| | | { required: true, message: "夿µæ¬¡æ°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // å®ä¹è¡¨æ ¼åçæ¾ç¤º/éèé
ç½® |
| | | const columns = ref<FieldOption[]>([ |
| | | { key: 0, label: 'æ¹æ¬¡å·', align: 'center', visible: true }, |
| | | { key: 1, label: 'æµè¯åºå·', align: 'center', visible: true }, |
| | | { key: 2, label: 'æµè¯é¡¹ç®', align: 'center', visible: true }, |
| | | { key: 3, label: '夿µæ¬¡æ°', align: 'center', visible: true }, |
| | | { key: 4, label: '设å¤å·', align: 'center', visible: true }, |
| | | { key: 5, label: 'ç¨æ·å¸å·', align: 'center', visible: true }, |
| | | { key: 6, label: 'ç¯å¢æ¸©åº¦', align: 'center', visible: true }, |
| | | { key: 7, label: 'å®é
çµå', align: 'center', visible: true }, |
| | | { key: 8, label: 'å®é
çµæµ', align: 'center', visible: true }, |
| | | { key: 9, label: 'æ åè·ç¦»', align: 'center', visible: true }, |
| | | { key: 10, label: 'æåºç©', align: 'center', visible: true }, |
| | | { key: 11, label: 'è¾åºå¼è', align: 'center', visible: true }, |
| | | { key: 12, label: 'æµè¯æ°æ®', align: 'center', visible: true }, |
| | | { key: 13, label: '夿æ¡ä»¶', align: 'center', visible: true }, |
| | | { key: 14, label: 'æµè¯ç»æ', align: 'center', visible: true }, |
| | | { key: 15, label: '夿³¨', align: 'center', visible: true }, |
| | | ]); |
| | | |
| | | /** æ¥è¯¢å¤æµè®°å½å表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.batchCode = proxy.$route.query.batchCode; |
| | | queryParams.value.testNum = proxy.$route.query.testNum; |
| | | if (proxy.$route.query.retestNum) { |
| | | queryParams.value.retestNum = proxy.$route.query.retestNum; |
| | | } |
| | | |
| | | const res = await listRetestResult(queryParams.value); |
| | | retestResultList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | retestResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: RetestResultVO[]) => { |
| | | ids.value = selection.map(item => item.batchCode); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å 夿µè®°å½"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: RetestResultVO) => { |
| | | reset(); |
| | | const _batchCode = row?.batchCode || ids.value[0] |
| | | const res = await getRetestResult(_batchCode); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹å¤æµè®°å½"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | retestResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.batchCode) { |
| | | await updateRetestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addRetestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: RetestResultVO) => { |
| | | const _batchCodes = row?.batchCode || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å¤æµè®°å½ç¼å·ä¸º"' + _batchCodes + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delRetestResult(_batchCodes); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/retestResult/export', { |
| | | ...queryParams.value |
| | | }, `retestResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | watch( |
| | | () => proxy.$route.query.testNum, |
| | | (testNum) => { |
| | | console.log('path', proxy.$route.path); |
| | | console.log('testNum', testNum); |
| | | if (proxy.$route.path === '/qms/retestResult' && testNum) { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | } |
| | | ); |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="产ååå·" prop="prodModel"> |
| | | <el-input v-model="queryParams.prodModel" placeholder="请è¾å
¥äº§ååå·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:sensor:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:sensor:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:sensor:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:sensor:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="sensorList" |
| | | @selection-change="handleSelectionChange" |
| | | stripe |
| | | highlight-current-row |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="" align="center" prop="prodId" v-if="false" /> |
| | | <el-table-column label="产ååå·" align="center" prop="prodModel" /> |
| | | <el-table-column label="äº§åæ¡ç " align="center" prop="prodBarcode" /> |
| | | <el-table-column label="产å大类" align="center" prop="prodClass"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_sensor_class" :value="scope.row.prodClass"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产åå°ç±»" align="center" prop="prodSubclass"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_sensor_l_subclass" :value="scope.row.prodSubclass"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¾çµçµæº" align="center" prop="supply"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_power_supply" :value="scope.row.supply"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="çµåé«å¼" align="center" prop="supplyHigh" /> |
| | | <el-table-column label="çµåä¸å¼" align="center" prop="supplyMiddle" /> |
| | | <el-table-column label="çµåä½å¼" align="center" prop="supplyLow" /> |
| | | <el-table-column label="è´è½½çµæµ" align="center" prop="loadCurrent" /> |
| | | <el-table-column label="å¼çº¿æ°é" align="center" prop="wire"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_sensor_wire" :value="scope.row.wire"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¾åºä¿¡å·" align="center" prop="outputSignal"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lp_output_signal" :value="scope.row.outputSignal"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¾åºç±»å" align="center" prop="outputType"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_output_type" :value="scope.row.outputType"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¾åºææ§" align="center" prop="outputPolarity"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="lb_output_polarity" :value="scope.row.outputPolarity"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æåºè·ç¦»" align="center" prop="distance" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:sensor:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:sensor:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹ä¼ æå¨å¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body> |
| | | <el-form ref="sensorFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="产ååå·" prop="prodModel"> |
| | | <el-input v-model="form.prodModel" placeholder="请è¾å
¥äº§ååå·" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="äº§åæ¡ç " prop="prodBarcode"> |
| | | <el-input v-model="form.prodBarcode" placeholder="请è¾å
¥äº§åæ¡ç " /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :xs="24" :sm="24"> |
| | | <el-form-item label="产å大类" prop="prodClass"> |
| | | <el-radio-group v-model="form.prodClass"> |
| | | <el-radio |
| | | v-for="dict in lb_sensor_class" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="产åå°ç±»" prop="prodSubclass"> |
| | | <el-select v-model="form.prodSubclass" placeholder="è¯·éæ©äº§åå°ç±»"> |
| | | <el-option |
| | | v-for="dict in (form.prodClass == 'å
çµå'?lb_sensor_p_subclass:form.prodClass=='çµå®¹å'?lb_sensor_c_subclass:lb_sensor_l_subclass)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="ä¾çµçµæº" prop="supply"> |
| | | <el-radio-group v-model="form.supply"> |
| | | <el-radio |
| | | v-for="dict in lb_power_supply" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="çµåé«å¼" prop="supplyHigh"> |
| | | <el-input type="number" v-model="form.supplyHigh" placeholder="请è¾å
¥çµåé«å¼"> |
| | | <template #append>V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="çµåä¸å¼" prop="supplyMiddle"> |
| | | <el-input type="number" v-model="form.supplyMiddle" placeholder="请è¾å
¥çµåä¸å¼"> |
| | | <template #append>V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="çµåä½å¼" prop="supplyLow"> |
| | | <el-input type="number" v-model="form.supplyLow" placeholder="请è¾å
¥çµåä½å¼"> |
| | | <template #append>V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="è´è½½çµæµ" prop="loadCurrent"> |
| | | <el-input type="number" v-model="form.loadCurrent" placeholder="请è¾å
¥è´è½½çµæµ"> |
| | | <template #append>A</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="å¼çº¿æ°é" prop="wire"> |
| | | <el-select v-model="form.wire" placeholder="è¯·éæ©å¼çº¿æ°é"> |
| | | <el-option |
| | | v-for="dict in lb_sensor_wire" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="è¾åºä¿¡å·" prop="outputSignal"> |
| | | <el-radio-group v-model="form.outputSignal"> |
| | | <el-radio |
| | | v-for="dict in lp_output_signal" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | |
| | | <el-form-item label="è¾åºç±»å" prop="outputType"> |
| | | <el-radio-group v-model="form.outputType"> |
| | | <el-radio |
| | | v-for="dict in lb_output_type" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | | <el-row> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="è¾åºææ§" prop="outputPolarity"> |
| | | <el-radio-group v-model="form.outputPolarity"> |
| | | <el-radio |
| | | v-for="dict in lb_output_polarity" |
| | | :key="dict.value" |
| | | :value="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="æåºè·ç¦»" prop="distance"> |
| | | <el-input type="number" v-model="form.distance" placeholder="请è¾å
¥æåºè·ç¦»"> |
| | | <template #append>m</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Sensor" lang="ts"> |
| | | import { listSensor, getSensor, delSensor, addSensor, updateSensor } from '@/api/qms/sensor'; |
| | | import { SensorVO, SensorQuery, SensorForm } from '@/api/qms/sensor/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | const { lp_output_signal, lb_output_polarity, lb_sensor_wire, lb_power_supply, lb_output_type, lb_sensor_class, lb_sensor_l_subclass, lb_sensor_c_subclass, lb_sensor_p_subclass } = toRefs<any>(proxy?.useDict('lp_output_signal', 'lb_output_polarity', 'lb_sensor_wire', 'lb_power_supply', 'lb_output_type', 'lb_sensor_class', 'lb_sensor_l_subclass', 'lb_sensor_c_subclass', 'lb_sensor_p_subclass')); |
| | | |
| | | const sensorList = ref<SensorVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const sensorFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: SensorForm = { |
| | | prodId: undefined, |
| | | prodModel: undefined, |
| | | prodBarcode: undefined, |
| | | prodClass: undefined, |
| | | prodSubclass: undefined, |
| | | supply: undefined, |
| | | supplyHigh: undefined, |
| | | supplyMiddle: undefined, |
| | | supplyLow: undefined, |
| | | loadCurrent: undefined, |
| | | wire: undefined, |
| | | outputSignal: undefined, |
| | | outputType: undefined, |
| | | outputPolarity: undefined, |
| | | distance: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<SensorForm, SensorQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | prodModel: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | prodId: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | prodModel: [ |
| | | { required: true, message: "产ååå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | prodBarcode: [ |
| | | { required: true, message: "äº§åæ¡ç ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | prodClass: [ |
| | | { required: true, message: "产å大类ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | prodSubclass: [ |
| | | { required: true, message: "产åå°ç±»ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | supply: [ |
| | | { required: true, message: "ä¾çµçµæºä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | loadCurrent: [ |
| | | { required: true, message: "è´è½½çµæµä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | wire: [ |
| | | { required: true, message: "å¼çº¿æ°éä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | outputSignal: [ |
| | | { required: true, message: "è¾åºä¿¡å·ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | outputType: [ |
| | | { required: true, message: "è¾åºç±»åä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | outputPolarity: [ |
| | | { required: true, message: "è¾åºææ§ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢ä¼ æå¨å表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | const res = await listSensor(queryParams.value); |
| | | sensorList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | sensorFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: SensorVO[]) => { |
| | | ids.value = selection.map(item => item.prodId); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å ä¼ æå¨"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: SensorVO) => { |
| | | reset(); |
| | | const _prodId = row?.prodId || ids.value[0] |
| | | const res = await getSensor(_prodId); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹ä¼ æå¨"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | sensorFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.prodId) { |
| | | await updateSensor(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addSensor(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: SensorVO) => { |
| | | const _prodIds = row?.prodId || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å é¤ä¼ æå¨ç¼å·ä¸º"' + _prodIds + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delSensor(_prodIds); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/sensor/export', { |
| | | ...queryParams.value |
| | | }, `sensor_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:sensorResult:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:sensorResult:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:sensorResult:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:sensorResult:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" :columns="columns" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="sensorResultList" |
| | | :row-key="(row) => `${row.batchCode}-${row.testNum}`" |
| | | |
| | | stripe |
| | | highlight-current-row |
| | | indent="50" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="æ¹æ¬¡å·" align="center" prop="batchCode" v-if="columns[0].visible" /> |
| | | <el-table-column label="æµè¯åºå·" align="center" prop="testNum" v-if="columns[1].visible" /> |
| | | <el-table-column label="å¤å®ç»æ" align="center" prop="judgeResult" v-if="columns[2].visible" /> |
| | | <el-table-column label="æ»æµè¯é¡¹æ°" align="center" prop="totalCount" v-if="columns[3].visible" /> |
| | | <el-table-column label="OK项æ°" align="center" prop="okCount" v-if="columns[4].visible" /> |
| | | <el-table-column label="NG项æ°" align="center" prop="ngCount" v-if="columns[5].visible" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" v-if="columns[6].visible" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="æç»" placement="top"> |
| | | <el-button link type="primary" icon="Document" @click="handleDetail(scope.row)"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:sensorResult:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:sensorResult:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æ¹æ¬¡æç»å¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="sensorResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="å¤å®ç»æ" prop="judgeResult"> |
| | | <el-input v-model="form.judgeResult" placeholder="请è¾å
¥å¤å®ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ»æµè¯é¡¹æ°" prop="totalCount"> |
| | | <el-input v-model="form.totalCount" placeholder="请è¾å
¥æ»æµè¯é¡¹æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="OK项æ°" prop="okCount"> |
| | | <el-input v-model="form.okCount" placeholder="请è¾å
¥OK项æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="NG项æ°" prop="ngCount"> |
| | | <el-input v-model="form.ngCount" placeholder="请è¾å
¥NG项æ°" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="SensorResult" lang="ts"> |
| | | import { listSensorResult, getSensorResult, delSensorResult, addSensorResult, updateSensorResult } from '@/api/qms/sensorResult'; |
| | | import { SensorResultVO, SensorResultQuery, SensorResultForm } from '@/api/qms/sensorResult/types'; |
| | | import { ref, reactive, watch, onMounted } from 'vue'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const sensorResultList = ref<SensorResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const sensorResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: SensorResultForm = { |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | judgeResult: undefined, |
| | | totalCount: undefined, |
| | | okCount: undefined, |
| | | ngCount: undefined, |
| | | createTime: undefined, // æ·»å createTime åæ®µ |
| | | } |
| | | const data = reactive<PageData<SensorResultForm, SensorResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | judgeResult: undefined, |
| | | totalCount: undefined, |
| | | okCount: undefined, |
| | | ngCount: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | judgeResult: [ |
| | | { required: true, message: "å¤å®ç»æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | totalCount: [ |
| | | { required: true, message: "æ»æµè¯é¡¹æ°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | okCount: [ |
| | | { required: true, message: "OK项æ°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | ngCount: [ |
| | | { required: true, message: "NG项æ°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // æ·»å columns æ°ç» |
| | | const columns = ref<FieldOption[]>([ |
| | | { key: 0, label: 'æ¹æ¬¡å·', align: 'center', visible: true }, |
| | | { key: 1, label: 'æµè¯åºå·', align: 'center', visible: true }, |
| | | { key: 2, label: 'å¤å®ç»æ', align: 'center', visible: true }, |
| | | { key: 3, label: 'æ»æµè¯é¡¹æ°', align: 'center', visible: true }, |
| | | { key: 4, label: 'OK项æ°', align: 'center', visible: true }, |
| | | { key: 5, label: 'NG项æ°', align: 'center', visible: true }, |
| | | { key: 6, label: 'å建æ¶é´', align: 'center', visible: true }, |
| | | ]); |
| | | |
| | | /** æ¥è¯¢æ¹æ¬¡æç»å表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.batchCode = proxy.$route.query.batchCode; |
| | | const res = await listSensorResult(queryParams.value); |
| | | sensorResultList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | sensorResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: SensorResultVO[]) => { |
| | | ids.value = selection.map(item => item.batchCode); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æ¹æ¬¡æç»"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: SensorResultVO) => { |
| | | reset(); |
| | | const _batchCode = row?.batchCode || ids.value[0] |
| | | const res = await getSensorResult(_batchCode); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æ¹æ¬¡æç»"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | sensorResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.batchCode) { |
| | | await updateSensorResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addSensorResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: SensorResultVO) => { |
| | | const _batchCodes = row?.batchCode || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿¹æ¬¡æç»ç¼å·ä¸º"' + _batchCodes + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delSensorResult(_batchCodes); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/sensorResult/export', { |
| | | ...queryParams.value |
| | | }, `sensorResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | const handleDetail = (sensor) => { |
| | | console.log("sensor", sensor) |
| | | if (!sensor.retestNum) { |
| | | proxy.$router.push({ path: 'testResult', query: {batchCode: sensor.batchCode, testNum: sensor.testNum} }); |
| | | } else { |
| | | proxy.$router.push({ path: 'retestResult', query: {batchCode: sensor.batchCode.split("-")[0], testNum: sensor.testNum, retestNum: sensor.retestNum} }); |
| | | } |
| | | |
| | | } |
| | | |
| | | watch(()=>proxy.$route.query.batchCode,(batchCode)=>{ |
| | | console.log("batchCode", batchCode) |
| | | if(batchCode) { |
| | | getList(); |
| | | } |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="queryParams.testNum" placeholder="请è¾å
¥æµè¯åºå·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿µæ¬¡æ°" prop="retestNum"> |
| | | <el-input v-model="queryParams.retestNum" placeholder="请è¾å
¥å¤æµæ¬¡æ°" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å·" prop="deviceCode"> |
| | | <el-input v-model="queryParams.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·å¸å·" prop="userName"> |
| | | <el-input v-model="queryParams.userName" placeholder="请è¾å
¥ç¨æ·å¸å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['lb-qms:sensorRetest:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['lb-qms:sensorRetest:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['lb-qms:sensorRetest:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['lb-qms:sensorRetest:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="sensorRetestList" |
| | | @selection-change="handleSelectionChange" |
| | | stripe |
| | | highlight-current-row |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="æ¹æ¬¡å·" align="center" prop="batchCode" v-if="true" /> |
| | | <el-table-column label="æµè¯åºå·" align="center" prop="testNum" v-if="true" /> |
| | | <el-table-column label="夿µæ¬¡æ°" align="center" prop="retestNum" v-if="true" /> |
| | | <el-table-column label="设å¤å·" align="center" prop="deviceCode" /> |
| | | <el-table-column label="ç¨æ·å¸å·" align="center" prop="userName" /> |
| | | <el-table-column label="å¤å®ç»æ" align="center" prop="judgeResult" /> |
| | | <el-table-column label="æ»æµè¯é¡¹æ°" align="center" prop="totalCount" /> |
| | | <el-table-column label="OK项æ°" align="center" prop="okCount" /> |
| | | <el-table-column label="NG项æ°" align="center" prop="ngCount" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['lb-qms:sensorRetest:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['lb-qms:sensorRetest:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹å¤æµè®°å½å¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="sensorRetestFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="设å¤å·" prop="deviceCode"> |
| | | <el-input v-model="form.deviceCode" placeholder="请è¾å
¥è®¾å¤å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·å¸å·" prop="userName"> |
| | | <el-input v-model="form.userName" placeholder="请è¾å
¥ç¨æ·å¸å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤å®ç»æ" prop="judgeResult"> |
| | | <el-input v-model="form.judgeResult" placeholder="请è¾å
¥å¤å®ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ»æµè¯é¡¹æ°" prop="totalCount"> |
| | | <el-input v-model="form.totalCount" placeholder="请è¾å
¥æ»æµè¯é¡¹æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="OK项æ°" prop="okCount"> |
| | | <el-input v-model="form.okCount" placeholder="请è¾å
¥OK项æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="NG项æ°" prop="ngCount"> |
| | | <el-input v-model="form.ngCount" placeholder="请è¾å
¥NG项æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="SensorRetest" lang="ts"> |
| | | import { listSensorRetest, getSensorRetest, delSensorRetest, addSensorRetest, updateSensorRetest } from 'src/api/qms/sensorRetest'; |
| | | import { SensorRetestVO, SensorRetestQuery, SensorRetestForm } from '@/api/qms/sensorRetest/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const sensorRetestList = ref<SensorRetestVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const sensorRetestFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: SensorRetestForm = { |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | retestNum: undefined, |
| | | deviceCode: undefined, |
| | | userName: undefined, |
| | | judgeResult: undefined, |
| | | totalCount: undefined, |
| | | okCount: undefined, |
| | | ngCount: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<SensorRetestForm, SensorRetestQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | retestNum: undefined, |
| | | deviceCode: undefined, |
| | | userName: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | retestNum: [ |
| | | { required: true, message: "夿µæ¬¡æ°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢å¤æµè®°å½å表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | const res = await listSensorRetest(queryParams.value); |
| | | sensorRetestList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | sensorRetestFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: SensorRetestVO[]) => { |
| | | ids.value = selection.map(item => item.batchCode); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å 夿µè®°å½"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: SensorRetestVO) => { |
| | | reset(); |
| | | const _batchCode = row?.batchCode || ids.value[0] |
| | | const res = await getSensorRetest(_batchCode); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹å¤æµè®°å½"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | sensorRetestFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.batchCode) { |
| | | await updateSensorRetest(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addSensorRetest(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: SensorRetestVO) => { |
| | | const _batchCodes = row?.batchCode || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å¤æµè®°å½ç¼å·ä¸º"' + _batchCodes + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delSensorRetest(_batchCodes); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/sensorRetest/export', { |
| | | ...queryParams.value |
| | | }, `sensorRetest_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button v-hasPermi="['qms:testResult:add']" type="primary" plain icon="Plus" @click="handleAdd">æ°å¢</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button v-hasPermi="['qms:testResult:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"--> |
| | | <!-- >ä¿®æ¹</el-button--> |
| | | <!-- >--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button v-hasPermi="['qms:testResult:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"--> |
| | | <!-- >å é¤</el-button--> |
| | | <!-- >--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button v-hasPermi="['qms:testResult:export']" type="warning" plain icon="Download" @click="handleExport">导åº</el-button>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <right-toolbar v-model:showSearch="showSearch" :columns="columns" @query-table="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" stripe highlight-current-row :data="testResultList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column v-if="false" label="" align="center" prop="id" /> |
| | | <el-table-column v-if="columns[0].visible" label="æ¹æ¬¡å·" align="center" prop="batchCode" /> |
| | | <el-table-column v-if="columns[1].visible" label="æµè¯åºå·" align="center" prop="testNum" /> |
| | | <el-table-column v-if="columns[2].visible" label="æµè¯é¡¹ç®" align="center" prop="testItem" /> |
| | | <el-table-column v-if="columns[3].visible" label="å®é
çµå" align="center" prop="voltage" /> |
| | | <el-table-column v-if="columns[4].visible" label="å®é
çµæµ" align="center" prop="loadCurrent" /> |
| | | <el-table-column v-if="columns[5].visible" label="æ åè·ç¦»" align="center" prop="stdDistance" /> |
| | | <el-table-column v-if="columns[6].visible" label="æåºç©" align="center" prop="inductor" /> |
| | | <el-table-column v-if="columns[7].visible" label="è¾åºå¼è" align="center" prop="output" /> |
| | | <el-table-column v-if="columns[8].visible" label="æµè¯æ°æ®" align="center" prop="testValue" /> |
| | | <el-table-column v-if="columns[9].visible" label="夿æ¡ä»¶" align="center" prop="judgeDetail" /> |
| | | <el-table-column v-if="columns[10].visible" label="æµè¯ç»æ" align="center" prop="testResult" /> |
| | | <el-table-column v-if="columns[11].visible" label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column v-if="columns[12].visible" label="å建æ¶é´" align="center" prop="createTime" width="160"> |
| | | <template #default="scope"> |
| | | <span>{{ scope.row.createTime }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button v-hasPermi="['qms:testResult:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button v-hasPermi="['qms:testResult:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ç»æå¯¹è¯æ¡ --> |
| | | <el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body> |
| | | <el-form ref="testResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="form.testNum" placeholder="请è¾å
¥æµè¯åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-input v-model="form.testItem" placeholder="请è¾å
¥æµè¯é¡¹ç®" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="TestResult" lang="ts"> |
| | | import { listTestResult, getTestResult, delTestResult, addTestResult, updateTestResult } from '@/api/qms/testResult'; |
| | | import { TestResultVO, TestResultQuery, TestResultForm } from '@/api/qms/testResult/types'; |
| | | import { ref, reactive, watch, onMounted, computed } from 'vue'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const testResultList = ref<TestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const testResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: TestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | }; |
| | | const data = reactive<PageData<TestResultForm, TestResultQuery>>({ |
| | | form: { ...initFormData }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | params: {} |
| | | }, |
| | | rules: { |
| | | id: [{ required: true, message: 'ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | batchCode: [{ required: true, message: 'æ¹æ¬¡å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | testNum: [{ required: true, message: 'æµè¯åºå·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | testItem: [{ required: true, message: 'æµè¯é¡¹ç®ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | voltage: [{ required: true, message: 'å®é
çµåä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | loadCurrent: [{ required: true, message: 'å®é
çµæµä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | stdDistance: [{ required: true, message: 'æ åè·ç¦»ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | inductor: [{ required: true, message: 'æåºç©ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | output: [{ required: true, message: 'è¾åºå¼èä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | testValue: [{ required: true, message: 'æµè¯æ°æ®ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | judgeDetail: [{ required: true, message: '夿æ¡ä»¶ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | testResult: [{ required: true, message: 'æµè¯ç»æä¸è½ä¸ºç©º', trigger: 'blur' }] |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢æµè¯ç»æå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.batchCode = proxy.$route.query.batchCode; |
| | | queryParams.value.testNum = proxy.$route.query.testNum; |
| | | |
| | | const res = await listTestResult(queryParams.value); |
| | | testResultList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | }; |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | }; |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = { ...initFormData }; |
| | | testResultFormRef.value?.resetFields(); |
| | | }; |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | }; |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: TestResultVO[]) => { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | }; |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = 'æ·»å æµè¯ç»æ'; |
| | | }; |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: TestResultVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0]; |
| | | const res = await getTestResult(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = 'ä¿®æ¹æµè¯ç»æ'; |
| | | }; |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | testResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateTestResult(form.value).finally(() => (buttonLoading.value = false)); |
| | | } else { |
| | | await addTestResult(form.value).finally(() => (buttonLoading.value = false)); |
| | | } |
| | | proxy?.$modal.msgSuccess('æä½æå'); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: TestResultVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç»æç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => (loading.value = false)); |
| | | await delTestResult(_ids); |
| | | proxy?.$modal.msgSuccess('å 餿å'); |
| | | await getList(); |
| | | }; |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download( |
| | | 'qms/testResult/export', |
| | | { |
| | | ...queryParams.value |
| | | }, |
| | | `testResult_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | watch( |
| | | () => proxy.$route.query.testNum, |
| | | (testNum) => { |
| | | console.log('path', proxy.$route.path); |
| | | console.log('testNum', testNum); |
| | | if (proxy.$route.path === '/qms/testResult' && testNum) { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | } |
| | | ); |
| | | const columns = ref<FieldOption[]>([ |
| | | { key: 0, label: 'æ¹æ¬¡å·', align: 'center', visible: true }, |
| | | { key: 1, label: 'æµè¯åºå·', align: 'center', visible: true }, |
| | | { key: 2, label: 'æµè¯é¡¹ç®', align: 'center', visible: true }, |
| | | { key: 3, label: 'å®é
çµå', align: 'center', visible: true }, |
| | | { key: 4, label: 'å®é
çµæµ', align: 'center', visible: true }, |
| | | { key: 5, label: 'æ åè·ç¦»', align: 'center', visible: true }, |
| | | { key: 6, label: 'æåºç©', align: 'center', visible: true }, |
| | | { key: 7, label: 'è¾åºå¼è', align: 'center', visible: true }, |
| | | { key: 8, label: 'æµè¯æ°æ®', align: 'center', visible: true }, |
| | | { key: 9, label: '夿æ¡ä»¶', align: 'center', visible: true }, |
| | | { key: 10, label: 'æµè¯ç»æ', align: 'center', visible: true }, |
| | | { key: 11, label: '夿³¨', align: 'center', visible: true }, |
| | | { key: 12, label: `å建æ¶é´`, visible: true, children: [] } |
| | | ]); |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="queryParams.testNum" placeholder="请è¾å
¥æµè¯åºå·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-input v-model="queryParams.testItem" placeholder="请è¾å
¥æµè¯é¡¹ç®" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="queryParams.voltage" placeholder="请è¾å
¥å®é
çµå" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="queryParams.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="queryParams.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="queryParams.inductor" placeholder="请è¾å
¥æåºç©" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="queryParams.output" placeholder="请è¾å
¥è¾åºå¼è" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="queryParams.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="queryParams.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="queryParams.testResult" placeholder="请è¾å
¥æµè¯ç»æ" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:testResult:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:testResult:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:testResult:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:testResult:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" :data="testResultList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="" align="center" prop="id" v-if="false" /> |
| | | <el-table-column label="æ¹æ¬¡å·" align="center" prop="batchCode" /> |
| | | <el-table-column label="æµè¯åºå·" align="center" prop="testNum" /> |
| | | <el-table-column label="æµè¯é¡¹ç®" align="center" prop="testItem" /> |
| | | <el-table-column label="å®é
çµå" align="center" prop="voltage" /> |
| | | <el-table-column label="å®é
çµæµ" align="center" prop="loadCurrent" /> |
| | | <el-table-column label="æ åè·ç¦»" align="center" prop="stdDistance" /> |
| | | <el-table-column label="æåºç©" align="center" prop="inductor" /> |
| | | <el-table-column label="è¾åºå¼è" align="center" prop="output" /> |
| | | <el-table-column label="æµè¯æ°æ®" align="center" prop="testValue" /> |
| | | <el-table-column label="夿æ¡ä»¶" align="center" prop="judgeDetail" /> |
| | | <el-table-column label="æµè¯ç»æ" align="center" prop="testResult" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:testResult:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:testResult:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ç»æå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="testResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="form.testNum" placeholder="请è¾å
¥æµè¯åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-input v-model="form.testItem" placeholder="请è¾å
¥æµè¯é¡¹ç®" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="TestResult" lang="ts"> |
| | | import { listTestResult, getTestResult, delTestResult, addTestResult, updateTestResult } from '@/api/qms/testResult'; |
| | | import { TestResultVO, TestResultQuery, TestResultForm } from '@/api/qms/testResult/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const testResultList = ref<TestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const testResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: TestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<TestResultForm, TestResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testItem: [ |
| | | { required: true, message: "æµè¯é¡¹ç®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | voltage: [ |
| | | { required: true, message: "å®é
çµåä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | loadCurrent: [ |
| | | { required: true, message: "å®é
çµæµä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | stdDistance: [ |
| | | { required: true, message: "æ åè·ç¦»ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | inductor: [ |
| | | { required: true, message: "æåºç©ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | output: [ |
| | | { required: true, message: "è¾åºå¼èä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testValue: [ |
| | | { required: true, message: "æµè¯æ°æ®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | judgeDetail: [ |
| | | { required: true, message: "夿æ¡ä»¶ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testResult: [ |
| | | { required: true, message: "æµè¯ç»æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢æµè¯ç»æå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | const res = await listTestResult(queryParams.value); |
| | | testResultList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | testResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: TestResultVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: TestResultVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getTestResult(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | testResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: TestResultVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç»æç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delTestResult(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/testResult/export', { |
| | | ...queryParams.value |
| | | }, `testResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:testResult:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:testResult:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:testResult:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:testResult:export']">导åº</el-button> |
| | | </el-col> |
| | | |
| | | <right-toolbar :columns="columns" v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" :data="testResultList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <template v-for="col in visibleColumns" :key="col.prop"> |
| | | <el-table-column |
| | | :label="col.label" |
| | | :align="col.align" |
| | | :prop="col.prop" |
| | | v-if="col.visible" |
| | | > |
| | | <template #header="{ column }"> |
| | | <div @dblclick="handleColumnDoubleClick(column.property)"> |
| | | {{ column.label }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:testResult:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:testResult:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ç»æå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="testResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="form.testNum" placeholder="请è¾å
¥æµè¯åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-input v-model="form.testItem" placeholder="请è¾å
¥æµè¯é¡¹ç®" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- åéæ©å¯¹è¯æ¡ --> |
| | | <el-dialog title="éæ©å" v-model="showColumnSelector" width="300px" append-to-body @close="showColumnSelector = false"> |
| | | <el-checkbox-group v-model="selectedColumns"> |
| | | <el-checkbox v-for="column in columns" :key="column.prop" :label="column.prop">{{ column.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="saveColumnSelection">ç¡® å®</el-button> |
| | | <el-button @click="showColumnSelector = false">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="TestResult" lang="ts"> |
| | | import { listTestResult, getTestResult, delTestResult, addTestResult, updateTestResult } from '@/api/qms/testResult'; |
| | | import { TestResultVO, TestResultQuery, TestResultForm } from '@/api/qms/testResult/types'; |
| | | import { ref, reactive, watch, onMounted, computed } from 'vue'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const testResultList = ref<TestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const testResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: TestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<TestResultForm, TestResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | params: { |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testItem: [ |
| | | { required: true, message: "æµè¯é¡¹ç®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | voltage: [ |
| | | { required: true, message: "å®é
çµåä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | loadCurrent: [ |
| | | { required: true, message: "å®é
çµæµä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | stdDistance: [ |
| | | { required: true, message: "æ åè·ç¦»ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | inductor: [ |
| | | { required: true, message: "æåºç©ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | output: [ |
| | | { required: true, message: "è¾åºå¼èä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testValue: [ |
| | | { required: true, message: "æµè¯æ°æ®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | judgeDetail: [ |
| | | { required: true, message: "夿æ¡ä»¶ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testResult: [ |
| | | { required: true, message: "æµè¯ç»æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢æµè¯ç»æå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.batchCode = proxy.$route.query.batchCode; |
| | | queryParams.value.testNum = proxy.$route.query.testNum; |
| | | |
| | | const res = await listTestResult(queryParams.value); |
| | | testResultList.value = res.rows; |
| | | total.value = res.total; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | testResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: TestResultVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: TestResultVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getTestResult(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | testResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: TestResultVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç»æç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delTestResult(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/testResult/export', { |
| | | ...queryParams.value |
| | | }, `testResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | const columns = [ |
| | | { prop: 'id', label: 'ID', align: 'center', visible: false }, |
| | | { prop: 'batchCode', label: 'æ¹æ¬¡å·', align: 'center', visible: true }, |
| | | { prop: 'testNum', label: 'æµè¯åºå·', align: 'center', visible: true }, |
| | | { prop: 'testItem', label: 'æµè¯é¡¹ç®', align: 'center', visible: true }, |
| | | { prop: 'voltage', label: 'å®é
çµå', align: 'center', visible: true }, |
| | | { prop: 'loadCurrent', label: 'å®é
çµæµ', align: 'center', visible: true }, |
| | | { prop: 'stdDistance', label: 'æ åè·ç¦»', align: 'center', visible: true }, |
| | | { prop: 'inductor', label: 'æåºç©', align: 'center', visible: true }, |
| | | { prop: 'output', label: 'è¾åºå¼è', align: 'center', visible: true }, |
| | | { prop: 'testValue', label: 'æµè¯æ°æ®', align: 'center', visible: true }, |
| | | { prop: 'judgeDetail', label: '夿æ¡ä»¶', align: 'center', visible: true }, |
| | | { prop: 'testResult', label: 'æµè¯ç»æ', align: 'center', visible: true }, |
| | | { prop: 'remark', label: '夿³¨', align: 'center', visible: true } |
| | | ]; |
| | | |
| | | const selectedColumns = ref(columns.map(column => column.prop)); |
| | | |
| | | const visibleColumns = computed(() => { |
| | | // æ·»å ä¾èµé¡¹ï¼ç¡®ä¿å½ selectedColumns ååæ¶ï¼visibleColumns ä¹ä¼éæ°è®¡ç® |
| | | return columns.filter(column => selectedColumns.value.includes(column.prop)); |
| | | }); |
| | | |
| | | // æ°å¢ watch çå¬å¨ï¼çå¬ selectedColumns çåå |
| | | watch(()=> selectedColumns.value, (newSelectedColumns) => { |
| | | console.log("selectedColumns", selectedColumns.value) |
| | | columns.forEach(column => { |
| | | column.visible = newSelectedColumns.includes(column.prop); |
| | | }); |
| | | }); |
| | | |
| | | const handleColumnDoubleClick = (prop: string) => { |
| | | // æ°å¢åå»äºä»¶å¤ç彿° |
| | | console.log('åå»åï¼', prop); |
| | | const column = columns.find(col => col.prop === prop); |
| | | console.log(column) |
| | | if (column) { |
| | | column.visible = !column.visible; |
| | | } |
| | | selectedColumns.value = columns.filter(col => col.visible).map(col => col.prop); |
| | | // // ç¡®ä¿ columns ç visible 屿§åæ¥æ´æ° |
| | | // columns.forEach(col => { |
| | | // col.visible = selectedColumns.value.includes(col.prop); |
| | | // }); |
| | | }; |
| | | |
| | | const saveColumnSelection = () => { |
| | | columns.forEach(column => { |
| | | column.visible = selectedColumns.value.includes(column.prop); |
| | | }); |
| | | }; |
| | | |
| | | watch(() => proxy.$route.query.testNum, (testNum) => { |
| | | console.log("testNum", testNum) |
| | | if(testNum) { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="产ååå·" prop="prodModel"> |
| | | <el-select v-model="queryParams.prodModel" placeholder="è¯·éæ©äº§ååå·" clearable @keyup.enter="handleQuery"> |
| | | <el-option v-for="item in prodModelOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-select v-model="selectedTestItems" :multiple="true" placeholder="è¯·éæ©æµè¯é¡¹ç®" clearable @keyup.enter="handleQuery"> |
| | | <el-option v-for="item in testItemsOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´" style="width: 308px"> |
| | | <el-date-picker |
| | | v-model="dateRangeCreateTime" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | unlink-panels |
| | | :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:testResult:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:testResult:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:testResult:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:testResult:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="handleQuery"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | |
| | | <div ref="chartRef" style="width: 100%; height: 660px;"></div> |
| | | |
| | | <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />--> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ç»æå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="testResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="form.testNum" placeholder="请è¾å
¥æµè¯åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-select v-model="form.testItem" placeholder="è¯·éæ©æµè¯é¡¹ç®"> |
| | | <el-option v-for="item in testItemsOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="TestResult" lang="ts"> |
| | | import { listTestResultAll, getTestResult, delTestResult, addTestResult, updateTestResult, listTestItem } from '@/api/qms/testResult'; |
| | | import { TestResultVO, TestResultQuery, TestResultForm } from '@/api/qms/testResult/types'; |
| | | import * as echarts from 'echarts'; |
| | | import { listProdModels} from '@/api/qms/batch'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const testResultList = ref<TestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | |
| | | // 设置é»è®¤æ¶é´ä¸ºæè¿ä¸ä¸ªæ |
| | | const now = new Date(); |
| | | const dateRangeCreateTime = ref<[DateModelType, DateModelType]>([]); |
| | | const oneMonthAgo = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate()); |
| | | dateRangeCreateTime.value = [oneMonthAgo.toISOString().split('T')[0], now.toISOString().split('T')[0]] as [DateModelType, DateModelType]; |
| | | |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const testResultFormRef = ref<ElFormInstance>(); |
| | | const chartRef = ref<HTMLDivElement | null>(null); // æ°å¢ chartRef å¼ç¨ |
| | | |
| | | const testItemsOptions = ref<{ label: string, value: string }[]>([]); // æ°å¢æµè¯é¡¹ç®é项 |
| | | const selectedTestItems = ref<string | string[]>([]); // ä¿®æ¹ä¸ºå
¼å®¹åéçç±»å |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: TestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | } |
| | | const prodModelOptions = ref<{ label: string, value: string }[]>([]); |
| | | |
| | | const data = reactive<PageData<TestResultForm, TestResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | startTime: undefined, // æ°å¢ startTime åæ®µ |
| | | endTime: undefined, // æ°å¢ endTime åæ®µ |
| | | prodModel: undefined, // æ°å¢äº§ååå·å段 |
| | | params: { |
| | | createTime: undefined, |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testItem: [ |
| | | { required: true, message: "æµè¯é¡¹ç®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | voltage: [ |
| | | { required: true, message: "å®é
çµåä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | loadCurrent: [ |
| | | { required: true, message: "å®é
çµæµä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | stdDistance: [ |
| | | { required: true, message: "æ åè·ç¦»ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | inductor: [ |
| | | { required: true, message: "æåºç©ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | output: [ |
| | | { required: true, message: "è¾åºå¼èä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testValue: [ |
| | | { required: true, message: "æµè¯æ°æ®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | judgeDetail: [ |
| | | { required: true, message: "夿æ¡ä»¶ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testResult: [ |
| | | { required: true, message: "æµè¯ç»æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | prodModel: [ |
| | | { required: true, message: "产ååå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // è·åæææµè¯é¡¹ç® |
| | | const fetchTestItems = async () => { |
| | | const res = await listTestItem(); |
| | | testItemsOptions.value = res.data.map(item => ({ label: item, value: item })); |
| | | } |
| | | // è·åææäº§ååå· |
| | | const fetchProdModels = async () => { |
| | | const res = await listProdModels(); |
| | | prodModelOptions.value = res.data.map(item => ({ label: item, value: item })); |
| | | } |
| | | |
| | | /** æ¥è¯¢æµè¯ç»æå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.params = {}; |
| | | // å¤ç selectedTestItems çå¼ï¼å
¼å®¹åéåå¤é |
| | | if (Array.isArray(selectedTestItems.value)) { |
| | | queryParams.value.testItem = selectedTestItems.value.join(','); // å¤éæ¨¡å¼ |
| | | } else { |
| | | queryParams.value.testItem = selectedTestItems.value; // å鿍¡å¼ |
| | | } |
| | | proxy?.addDateRange(queryParams.value, dateRangeCreateTime.value, 'CreateTime'); |
| | | const res = await listTestResultAll(queryParams.value); |
| | | testResultList.value = res.data; |
| | | loading.value = false; |
| | | updateChart(); // æ´æ°å¾è¡¨ |
| | | } |
| | | |
| | | // çå¬ testResultList çååï¼å¨ææ´æ°å¾è¡¨ |
| | | watch(testResultList, () => { |
| | | updateChart(); |
| | | }); |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | |
| | | testResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | // æ ¡éªæ¶é´èå´æ¯å¦è¶
è¿ä¸ä¸ªæ |
| | | if (dateRangeCreateTime.value[0] && dateRangeCreateTime.value[1]) { |
| | | const startDate = new Date(dateRangeCreateTime.value[0]); |
| | | const endDate = new Date(dateRangeCreateTime.value[1]); |
| | | const timeDiff = endDate.getTime() - startDate.getTime(); |
| | | const maxDuration = 90 * 24 * 60 * 60 * 1000; // ä¸ä¸ªæçæ¯«ç§æ° |
| | | |
| | | if (timeDiff > maxDuration) { |
| | | proxy?.$modal.msgWarning("æ¶é´èå´ä¸è½è¶
è¿ä¸ä¸ªæï¼è¯·éæ°éæ©ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // æ ¡éªäº§ååå·æ¯å¦éæ© |
| | | if (!queryParams.value.prodModel) { |
| | | proxy?.$modal.msgWarning("è¯·éæ©äº§ååå·ï¼"); |
| | | return; |
| | | } |
| | | |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | dateRangeCreateTime.value = ['', '']; |
| | | queryFormRef.value?.resetFields(); |
| | | selectedTestItems.value = []; // éç½®éä¸çæµè¯é¡¹ç® |
| | | reset(); // è°ç¨éç½®æ¹æ³ä»¥æ¸
空æ¶é´æ®µå段 |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: TestResultVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: TestResultVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getTestResult(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | testResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await handleQuery(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: TestResultVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç»æç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delTestResult(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await handleQuery(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/testResult/export', { |
| | | ...queryParams.value |
| | | }, `testResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | // æ´æ°å¾è¡¨ |
| | | const updateChart = () => { |
| | | if (!chartRef.value) return; |
| | | const chart = echarts.init(chartRef.value); |
| | | |
| | | // å®ä¹20个ä¸éå¤çé¢è²æ± |
| | | const colorPool = [ |
| | | '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', |
| | | '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc', '#5e7ce0', |
| | | '#f0c757', '#ff9f7f', '#d48265', '#7fb80e', '#b37feb', |
| | | '#4dc9b0', '#f47920', '#65b581', '#f08585', '#4a90e2', |
| | | // æ°å¢é¢è²ä»¥æé«å¯¹æ¯åº¦ |
| | | '#ff6f61', '#ffd700', '#00ced1', '#da70d6', '#adff2f' |
| | | ]; |
| | | |
| | | // 使ç¨Mapæ¿ä»£Objectæ´é«æ |
| | | const seriesMap = new Map<string, [string, number][]>(); |
| | | testResultList.value.forEach(item => { |
| | | const key = item.testItem; |
| | | if (!seriesMap.has(key)) { |
| | | seriesMap.set(key, []); |
| | | } |
| | | seriesMap.get(key)?.push([item.createTime, item.testValue]); |
| | | }); |
| | | |
| | | const option = { |
| | | grid: { |
| | | top: '15%', |
| | | left: '5%', |
| | | right: '5%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'time', |
| | | name: 'æ¶é´' |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'æµè¯æ°æ®' |
| | | }, |
| | | legend: { |
| | | data: Array.from(seriesMap.keys()) |
| | | }, |
| | | series: Array.from(seriesMap).map(([name, data], index) => ({ |
| | | name: name, |
| | | data: data, |
| | | type: 'line', |
| | | animationDuration: 1000, |
| | | lineStyle: { |
| | | color: colorPool[index % colorPool.length], |
| | | width: 3 // å¢å 线æ¡å®½åº¦ |
| | | }, |
| | | itemStyle: { |
| | | color: colorPool[index % colorPool.length], |
| | | opacity: 0.8 // æ·»å éæåº¦ |
| | | } |
| | | })), |
| | | // æ°å¢ dataZoom é
ç½® |
| | | dataZoom: [ |
| | | { |
| | | type: 'slider', // Xè½´æ»å¨æ¡ |
| | | xAxisIndex: 0, |
| | | start: 0, // åå§èå´èµ·ç¹ç¾åæ¯ |
| | | end: 100 // åå§èå´ç»ç¹ç¾åæ¯ |
| | | }, |
| | | { |
| | | type: 'slider', // Yè½´æ»å¨æ¡ |
| | | yAxisIndex: 0, |
| | | start: 0, // åå§èå´èµ·ç¹ç¾åæ¯ |
| | | end: 100 // åå§èå´ç»ç¹ç¾åæ¯ |
| | | }, |
| | | { |
| | | type: 'inside', // Xè½´å
ç½®æå¨åæ¡é |
| | | xAxisIndex: 0, |
| | | start: 0, |
| | | end: 100 |
| | | }, |
| | | { |
| | | type: 'inside', // Yè½´å
ç½®æå¨åæ¡é |
| | | yAxisIndex: 0, |
| | | start: 0, |
| | | end: 100 |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | chart.setOption(option, true); |
| | | window.addEventListener('resize', () => { |
| | | chart.resize(); |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchTestItems(); // è°ç¨è·åæµè¯é¡¹ç®æ¥å£ |
| | | fetchProdModels(); // è°ç¨è·å产ååå·æ¥å£ |
| | | }); |
| | | </script> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="queryParams.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-select v-model="selectedTestItems" :multiple="true" placeholder="è¯·éæ©æµè¯é¡¹ç®" clearable @keyup.enter="handleQuery"> |
| | | <el-option v-for="item in testItemsOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´" style="width: 308px"> |
| | | <el-date-picker |
| | | v-model="dateRangeCreateTime" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | unlink-panels |
| | | :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | |
| | | <el-card shadow="never"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['qms:testResult:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['qms:testResult:edit']">ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['qms:testResult:remove']">å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['qms:testResult:export']">导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" :data="testResultList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="" align="center" prop="id" v-if="false" /> |
| | | <el-table-column label="æ¹æ¬¡å·" align="center" prop="batchCode" /> |
| | | <el-table-column label="æµè¯åºå·" align="center" prop="testNum" /> |
| | | <el-table-column label="æµè¯é¡¹ç®" align="center" prop="testItem" /> |
| | | <el-table-column label="å®é
çµå" align="center" prop="voltage" /> |
| | | <el-table-column label="å®é
çµæµ" align="center" prop="loadCurrent" /> |
| | | <el-table-column label="æ åè·ç¦»" align="center" prop="stdDistance" /> |
| | | <el-table-column label="æåºç©" align="center" prop="inductor" /> |
| | | <el-table-column label="è¾åºå¼è" align="center" prop="output" /> |
| | | <el-table-column label="æµè¯æ°æ®" align="center" prop="testValue" /> |
| | | <el-table-column label="夿æ¡ä»¶" align="center" prop="judgeDetail" /> |
| | | <el-table-column label="æµè¯ç»æ" align="center" prop="testResult" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remark" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="ä¿®æ¹" placement="top"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:testResult:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="å é¤" placement="top"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:testResult:remove']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />--> |
| | | </el-card> |
| | | <!-- æ·»å æä¿®æ¹æµè¯ç»æå¯¹è¯æ¡ --> |
| | | <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> |
| | | <el-form ref="testResultFormRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="æ¹æ¬¡å·" prop="batchCode"> |
| | | <el-input v-model="form.batchCode" placeholder="请è¾å
¥æ¹æ¬¡å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯åºå·" prop="testNum"> |
| | | <el-input v-model="form.testNum" placeholder="请è¾å
¥æµè¯åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯é¡¹ç®" prop="testItem"> |
| | | <el-select v-model="form.testItem" placeholder="è¯·éæ©æµè¯é¡¹ç®"> |
| | | <el-option v-for="item in testItemsOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµå" prop="voltage"> |
| | | <el-input v-model="form.voltage" placeholder="请è¾å
¥å®é
çµå" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®é
çµæµ" prop="loadCurrent"> |
| | | <el-input v-model="form.loadCurrent" placeholder="请è¾å
¥å®é
çµæµ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åè·ç¦»" prop="stdDistance"> |
| | | <el-input v-model="form.stdDistance" placeholder="请è¾å
¥æ åè·ç¦»" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç©" prop="inductor"> |
| | | <el-input v-model="form.inductor" placeholder="请è¾å
¥æåºç©" /> |
| | | </el-form-item> |
| | | <el-form-item label="è¾åºå¼è" prop="output"> |
| | | <el-input v-model="form.output" placeholder="请è¾å
¥è¾åºå¼è" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯æ°æ®" prop="testValue"> |
| | | <el-input v-model="form.testValue" placeholder="请è¾å
¥æµè¯æ°æ®" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿æ¡ä»¶" prop="judgeDetail"> |
| | | <el-input v-model="form.judgeDetail" placeholder="请è¾å
¥å¤ææ¡ä»¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµè¯ç»æ" prop="testResult"> |
| | | <el-input v-model="form.testResult" placeholder="请è¾å
¥æµè¯ç»æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="TestResult" lang="ts"> |
| | | import { listTestResultAll, getTestResult, delTestResult, addTestResult, updateTestResult, listTestItem } from '@/api/qms/testResult'; |
| | | import { TestResultVO, TestResultQuery, TestResultForm } from '@/api/qms/testResult/types'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const testResultList = ref<TestResultVO[]>([]); |
| | | const buttonLoading = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref<Array<string | number>>([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const dateRangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']); |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const testResultFormRef = ref<ElFormInstance>(); |
| | | |
| | | const testItemsOptions = ref<{ label: string, value: string }[]>([]); // æ°å¢æµè¯é¡¹ç®é项 |
| | | const selectedTestItems = ref<string | string[]>([]); // ä¿®æ¹ä¸ºå
¼å®¹åéçç±»å |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | | title: '' |
| | | }); |
| | | |
| | | const initFormData: TestResultForm = { |
| | | id: undefined, |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | remark: undefined |
| | | } |
| | | const data = reactive<PageData<TestResultForm, TestResultQuery>>({ |
| | | form: {...initFormData}, |
| | | queryParams: { |
| | | batchCode: undefined, |
| | | testNum: undefined, |
| | | testItem: undefined, |
| | | voltage: undefined, |
| | | loadCurrent: undefined, |
| | | stdDistance: undefined, |
| | | inductor: undefined, |
| | | output: undefined, |
| | | testValue: undefined, |
| | | judgeDetail: undefined, |
| | | testResult: undefined, |
| | | startTime: undefined, // æ°å¢ startTime åæ®µ |
| | | endTime: undefined, // æ°å¢ endTime åæ®µ |
| | | params: { |
| | | createTime: undefined, |
| | | } |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | batchCode: [ |
| | | { required: true, message: "æ¹æ¬¡å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testNum: [ |
| | | { required: true, message: "æµè¯åºå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testItem: [ |
| | | { required: true, message: "æµè¯é¡¹ç®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | voltage: [ |
| | | { required: true, message: "å®é
çµåä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | loadCurrent: [ |
| | | { required: true, message: "å®é
çµæµä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | stdDistance: [ |
| | | { required: true, message: "æ åè·ç¦»ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | inductor: [ |
| | | { required: true, message: "æåºç©ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | output: [ |
| | | { required: true, message: "è¾åºå¼èä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testValue: [ |
| | | { required: true, message: "æµè¯æ°æ®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | judgeDetail: [ |
| | | { required: true, message: "夿æ¡ä»¶ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | testResult: [ |
| | | { required: true, message: "æµè¯ç»æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // è·åæææµè¯é¡¹ç® |
| | | const fetchTestItems = async () => { |
| | | const res = await listTestItem(); |
| | | testItemsOptions.value = res.data.map(item => ({ label: item, value: item })); |
| | | } |
| | | |
| | | /** æ¥è¯¢æµè¯ç»æå表 */ |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | queryParams.value.params = {}; |
| | | // å¤ç selectedTestItems çå¼ï¼å
¼å®¹åéåå¤é |
| | | if (Array.isArray(selectedTestItems.value)) { |
| | | queryParams.value.testItem = selectedTestItems.value.join(','); // å¤éæ¨¡å¼ |
| | | } else { |
| | | queryParams.value.testItem = selectedTestItems.value; // å鿍¡å¼ |
| | | } |
| | | proxy?.addDateRange(queryParams.value, dateRangeCreateTime.value, 'CreateTime'); |
| | | const res = await listTestResultAll(queryParams.value); |
| | | testResultList.value = res.data; |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | const cancel = () => { |
| | | reset(); |
| | | dialog.visible = false; |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | |
| | | testResultFormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | console.log("queryParams::",queryParams.value) |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | dateRangeCreateTime.value = ['', '']; |
| | | queryFormRef.value?.resetFields(); |
| | | selectedTestItems.value = []; // éç½®éä¸çæµè¯é¡¹ç® |
| | | reset(); // è°ç¨éç½®æ¹æ³ä»¥æ¸
空æ¶é´æ®µå段 |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | const handleSelectionChange = (selection: TestResultVO[]) => { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | dialog.visible = true; |
| | | dialog.title = "æ·»å æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | const handleUpdate = async (row?: TestResultVO) => { |
| | | reset(); |
| | | const _id = row?.id || ids.value[0] |
| | | const res = await getTestResult(_id); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "ä¿®æ¹æµè¯ç»æ"; |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | const submitForm = () => { |
| | | testResultFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | if (form.value.id) { |
| | | await updateTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } else { |
| | | await addTestResult(form.value).finally(() => buttonLoading.value = false); |
| | | } |
| | | proxy?.$modal.msgSuccess("æä½æå"); |
| | | dialog.visible = false; |
| | | await getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | const handleDelete = async (row?: TestResultVO) => { |
| | | const _ids = row?.id || ids.value; |
| | | await proxy?.$modal.confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç»æç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').finally(() => loading.value = false); |
| | | await delTestResult(_ids); |
| | | proxy?.$modal.msgSuccess("å 餿å"); |
| | | await getList(); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | const handleExport = () => { |
| | | proxy?.download('qms/testResult/export', { |
| | | ...queryParams.value |
| | | }, `testResult_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | fetchTestItems(); // è°ç¨è·åæµè¯é¡¹ç®æ¥å£ |
| | | }); |
| | | </script> |
| | |
| | | <div class="register"> |
| | | <el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form"> |
| | | <div class="title-box"> |
| | | <h3 class="title">RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»</h3> |
| | | <h3 class="title">å
°å®è½¦é´è´¨é管çç³»ç»</h3> |
| | | <lang-select /> |
| | | </div> |
| | | <el-form-item v-if="tenantEnabled" prop="tenantId"> |
| | |
| | | 'echarts', |
| | | 'vue-i18n', |
| | | '@vueup/vue-quill', |
| | | 'bpmn-js/lib/Viewer', |
| | | 'bpmn-js/lib/Modeler.js', |
| | | 'bpmn-js-properties-panel', |
| | | 'min-dash', |
| | | 'diagram-js/lib/navigation/movecanvas', |
| | | 'diagram-js/lib/navigation/zoomscroll', |
| | | 'bpmn-js/lib/features/palette/PaletteProvider', |
| | | 'bpmn-js/lib/features/context-pad/ContextPadProvider', |
| | | 'diagram-js/lib/draw/BaseRenderer', |
| | | 'tiny-svg', |
| | | 'image-conversion', |
| | | 'element-plus/es/components/**/css' |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; |
| | | export default (path: any) => { |
| | | return VueI18nPlugin({ |
| | | include: [path.resolve(__dirname, '../../src/lang/**.json')] |
| | | }); |
| | | }; |