|
@@ -1,6 +1,7 @@
|
|
|
import { defineStore } from 'pinia'
|
|
import { defineStore } from 'pinia'
|
|
|
import { QMS_MODULE_CODES } from '@/config/qmsModules'
|
|
import { QMS_MODULE_CODES } from '@/config/qmsModules'
|
|
|
import { getIqcTaskPage, startIqcTaskProcess } from '@/api/qms/iqc/task'
|
|
import { getIqcTaskPage, startIqcTaskProcess } from '@/api/qms/iqc/task'
|
|
|
|
|
+import { getIpqcTaskPage, startIpqcTaskProcess } from '@/api/qms/ipqc/task'
|
|
|
|
|
|
|
|
const createDefaultFilters = () => ({
|
|
const createDefaultFilters = () => ({
|
|
|
keyword: '', searchMode: 'AND', statusList: [], supplierIds: [], materialCodes: [], batchList: [],
|
|
keyword: '', searchMode: 'AND', statusList: [], supplierIds: [], materialCodes: [], batchList: [],
|
|
@@ -11,23 +12,12 @@ const createDefaultFilters = () => ({
|
|
|
const createDefaultPagination = () => ({ currentPage: 1, pageSize: 20, total: 0 })
|
|
const createDefaultPagination = () => ({ currentPage: 1, pageSize: 20, total: 0 })
|
|
|
|
|
|
|
|
const createTaskSamples = () => ({
|
|
const createTaskSamples = () => ({
|
|
|
- iqc: [
|
|
|
|
|
- { id: 'IQCT001', applicationId: 'IQC001', status: 'pending', materialCode: 'M001', materialName: '电阻', specification: '1KΩ ±5%', supplierName: '供应商A', supplierCode: 'SUP001', batch: 'B001', batchCount: 1, location: 'A01-01', responsibleId: '1', responsibleName: '张三', priority: 'high', startTime: null, completeTime: null, remark: '精密电阻,需要特殊检验', arrivalTime: '2024-01-15 08:30:00', quantity: 100, inspectionSpecVersion: 'V1.2' },
|
|
|
|
|
- { id: 'IQCT002', applicationId: 'IQC002', status: 'processing', materialCode: 'M002', materialName: '电容', specification: '100μF 25V', supplierName: '供应商B', supplierCode: 'SUP002', batch: 'B002', batchCount: 2, location: 'A01-02', responsibleId: '2', responsibleName: '李四', priority: 'medium', startTime: '2024-01-15 10:00:00', completeTime: null, remark: '电解电容,常规检验', arrivalTime: '2024-01-15 09:15:00', quantity: 50, inspectionSpecVersion: 'V1.2' },
|
|
|
|
|
- { id: 'IQCT003', applicationId: 'IQC003', status: 'completed', materialCode: 'M003', materialName: '电感', specification: '10mH ±10%', supplierName: '供应商C', supplierCode: 'SUP003', batch: 'B003', batchCount: 1, location: 'A01-03', responsibleId: '3', responsibleName: '王五', priority: 'low', startTime: '2024-01-14 09:00:00', completeTime: '2024-01-14 16:30:00', remark: '电感器件,已完成检验', arrivalTime: '2024-01-14 08:30:00', quantity: 200, inspectionSpecVersion: 'V1.1' }
|
|
|
|
|
- ],
|
|
|
|
|
- ipqc: [
|
|
|
|
|
- { id: 'IPQCT001', applicationId: 'IPQC001', status: 'pending', workOrder: 'WO-202401-001', process: '焊接', step: '点焊', line: 'L01', station: 'W02', equipment: 'EQ-09', materialCode: 'M1201', materialName: '电池模组', batch: 'P20240116A', batchCount: 2, responsibleId: '3', responsibleName: '王五', priority: 'high', startTime: null, completeTime: null, remark: '首件检验,需工程师确认', shift: '夜班', inspectionSpecVersion: 'V2.0' },
|
|
|
|
|
- { id: 'IPQCT002', applicationId: 'IPQC002', status: 'processing', workOrder: 'WO-202401-009', process: '组装', step: '装配', line: 'L03', station: 'W05', equipment: 'EQ-22', materialCode: 'M1402', materialName: '控制板', batch: 'P20240115B', batchCount: 1, responsibleId: '4', responsibleName: '赵六', priority: 'medium', startTime: '2024-01-16 09:20:00', completeTime: null, remark: '巡检批次', shift: '中班', inspectionSpecVersion: 'V2.0' }
|
|
|
|
|
- ],
|
|
|
|
|
- fqc: [
|
|
|
|
|
- { id: 'FQCT001', applicationId: 'FQC001', status: 'pending', productCode: 'P-900-XL', productName: '蓝牙耳机', productModel: 'Pro X', customer: 'ABC Corp', packageBatch: 'BX001', releaseStatus: '未判定', responsibleId: '5', responsibleName: '钱七', priority: 'high', startTime: null, completeTime: null, remark: '客户特采,仅限样机', inspectionSpecVersion: 'V3.4' },
|
|
|
|
|
- { id: 'FQCT002', applicationId: 'FQC002', status: 'processing', productCode: 'P-700-M', productName: '智能手环', productModel: 'Mini', customer: 'XYZ Ltd', packageBatch: 'BX016', releaseStatus: '检验中', responsibleId: '2', responsibleName: '李四', priority: 'medium', startTime: '2024-01-16 14:20:00', completeTime: null, remark: '抽检批次', inspectionSpecVersion: 'V3.3' },
|
|
|
|
|
- { id: 'FQCT003', applicationId: 'FQC001', status: 'completed', productCode: 'P-900-XL', productName: '蓝牙耳机', productModel: 'Pro X', customer: 'ABC Corp', packageBatch: 'BX000', releaseStatus: '合格', responsibleId: '6', responsibleName: '孙八', priority: 'low', startTime: '2024-01-15 13:00:00', completeTime: '2024-01-15 21:40:00', remark: '批量抽检完成', inspectionSpecVersion: 'V3.3' }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ iqc: [],
|
|
|
|
|
+ ipqc: [],
|
|
|
|
|
+ fqc: []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const REMOTE_MODULES = new Set(['iqc'])
|
|
|
|
|
|
|
+const REMOTE_MODULES = new Set(['iqc', 'ipqc'])
|
|
|
const isRemoteModule = (module: string) => REMOTE_MODULES.has(module)
|
|
const isRemoteModule = (module: string) => REMOTE_MODULES.has(module)
|
|
|
|
|
|
|
|
export const useQmsTaskStore = defineStore('qmsTask', {
|
|
export const useQmsTaskStore = defineStore('qmsTask', {
|
|
@@ -77,7 +67,9 @@ export const useQmsTaskStore = defineStore('qmsTask', {
|
|
|
pageSize: pagination.pageSize,
|
|
pageSize: pagination.pageSize,
|
|
|
status: status && status !== 'all' ? status : undefined
|
|
status: status && status !== 'all' ? status : undefined
|
|
|
}
|
|
}
|
|
|
- const pageResult = await getIqcTaskPage(params)
|
|
|
|
|
|
|
+ const pageResult = module === 'ipqc'
|
|
|
|
|
+ ? await getIpqcTaskPage(params)
|
|
|
|
|
+ : await getIqcTaskPage(params)
|
|
|
const pageData: any = (pageResult as any)?.data ?? pageResult
|
|
const pageData: any = (pageResult as any)?.data ?? pageResult
|
|
|
this.tasks[module] = pageData?.list || []
|
|
this.tasks[module] = pageData?.list || []
|
|
|
this.pagination[module].total = pageData?.total || 0
|
|
this.pagination[module].total = pageData?.total || 0
|
|
@@ -90,7 +82,9 @@ export const useQmsTaskStore = defineStore('qmsTask', {
|
|
|
setActiveTab(module: string, tab: string) { this.activeTabs[module] = tab },
|
|
setActiveTab(module: string, tab: string) { this.activeTabs[module] = tab },
|
|
|
async startInspection(module: string, taskId: string) {
|
|
async startInspection(module: string, taskId: string) {
|
|
|
if (isRemoteModule(module)) {
|
|
if (isRemoteModule(module)) {
|
|
|
- const result: any = await startIqcTaskProcess(taskId)
|
|
|
|
|
|
|
+ const result: any = module === 'ipqc'
|
|
|
|
|
+ ? await startIpqcTaskProcess(taskId)
|
|
|
|
|
+ : await startIqcTaskProcess(taskId)
|
|
|
return result?.data ?? result
|
|
return result?.data ?? result
|
|
|
}
|
|
}
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|