24 changed files with 17705 additions and 11 deletions
-
3src/api/eam/com_eam_object_upload_file.js
-
7src/api/eam/eam.js
-
11src/api/eam/eam_object_list.js
-
262src/api/qc/qc.js
-
25src/api/qc/qcPrint.js
-
26src/api/table.js
-
228src/views/modules/qc/IQCFileTable.vue
-
3607src/views/modules/qc/IQCResultEntry.vue
-
193src/views/modules/qc/com_qc_itemImage_upload_file.vue
-
31src/views/modules/qc/qcBuUtils.js
-
1482src/views/modules/qc/qcFamilyAttribute.vue
-
1652src/views/modules/qc/qcItem.vue
-
778src/views/modules/qc/qcMethod.vue
-
2445src/views/modules/qc/qcPartAttribute.vue
-
682src/views/modules/qc/qcSamplingInspectionLevel.vue
-
971src/views/modules/qc/qcSamplingInspectionPlan.vue
-
1145src/views/modules/qc/qcSamplingInspectionProgramme.vue
-
759src/views/modules/qc/qcSamplingInspectionQty.vue
-
794src/views/modules/qc/qcSamplingInspectionQtyRank.vue
-
1901src/views/modules/qc/qcTemplate.vue
-
142src/views/modules/qc/qc_FAI_upload_file.vue
-
142src/views/modules/qc/qc_SOP_upload_file.vue
-
265src/views/modules/qc/qc_upload.vue
-
165src/views/modules/qc/sub_detail_upload.vue
@ -0,0 +1,3 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
export const uploadEamObjectFile = data => createAPI('/sys/file/upload', 'post', data) |
||||
@ -0,0 +1,7 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
export const getOperatorList = data => createAPI('/qms/qc/getOperatorList', 'post', data) |
||||
|
|
||||
|
export const getUserRoleList = data => createAPI('/qms/qc/getUserRoleList', 'post', data) |
||||
|
|
||||
|
export const deleteObjectFile = data => createAPI('/qms/qc/deleteObjectFile', 'post', data) |
||||
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
export const getFileContentList = data => createAPI('/sys/file/getSysFileByOrderRef2', 'post', data) |
||||
|
|
||||
|
export const getInspectionFile = data => createAPI('/sys/file/getInspectionFile', 'post', data) |
||||
|
|
||||
|
export const downLoadObjectFile = data => createAPI(`/sys/oss/downLoadObjectFile?id=` + data.id, 'post', 777) |
||||
|
|
||||
|
export const downLoadObjectFileMes = data => createAPI(`/sys/oss/downLoadObjectFile?id=` + data.id, 'post', 777) |
||||
|
|
||||
|
export const uploadEamObjectFile = data => createAPI('/sys/file/upload', 'post', data) |
||||
@ -0,0 +1,262 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
// ===================================== 检验方法 =====================================
|
||||
|
export const qcMethodSearch = data => createAPI(`/qms/qc/qcMethodSearch`,'post',data) |
||||
|
export const qcMethodSave = data => createAPI(`/qms/qc/qcMethodSave`,'post',data) |
||||
|
export const qcMethodUpdate = data => createAPI(`/qms/qc/qcMethodUpdate`,'post',data) |
||||
|
export const qcMethodDelete = data => createAPI(`/qms/qc/qcMethodDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 检验项目 =====================================
|
||||
|
export const qcItemSearch = data => createAPI(`/qms/qc/qcItemSearch`,'post',data) |
||||
|
export const qcItemSave = data => createAPI(`/qms/qc/qcItemSave`,'post',data) |
||||
|
export const qcItemUpdate = data => createAPI(`/qms/qc/qcItemUpdate`,'post',data) |
||||
|
export const qcItemDelete = data => createAPI(`/qms/qc/qcItemDelete`,'post',data) |
||||
|
export const uploadExcel = data => createAPI(`/qms/qc/uploadExcel`,'post',data) |
||||
|
export const getItemLists= data => createAPI(`/qms/qc/getItemLists`,'post',data) |
||||
|
export const subDetailUpload= data => createAPI(`/qms/qc/subDetailUpload`,'post',data) |
||||
|
export const queryMethodList= data => createAPI(`/qms/qc/queryMethodList`,'post',data) |
||||
|
|
||||
|
// ===================================== 质检员信息 =====================================
|
||||
|
export const inspectorSearch = data => createAPI(`/qms/qc/inspectorSearch`,'post',data) |
||||
|
export const inspectorSave = data => createAPI(`/qms/qc/inspectorSave`,'post',data) |
||||
|
export const inspectorUpdate = data => createAPI(`/qms/qc/inspectorUpdate`,'post',data) |
||||
|
export const inspectorDelete = data => createAPI(`/qms/qc/inspectorDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 检验模板 =====================================
|
||||
|
export const templateSearch = data => createAPI(`/qms/qc/templateSearch`,'post',data) |
||||
|
export const templateSave = data => createAPI(`/qms/qc/templateSave`,'post',data) |
||||
|
export const templateUpdate = data => createAPI(`/qms/qc/templateUpdate`,'post',data) |
||||
|
export const templateDelete = data => createAPI(`/qms/qc/templateDelete`,'post',data) |
||||
|
export const inspectionTypeSearch = data => createAPI(`/qms/qc/inspectionTypeSearch`,'post',data) |
||||
|
export const objectSearch = data => createAPI(`/qms/qc/objectSearch`,'post',data) |
||||
|
export const templateDetailsSearch = data => createAPI(`/qms/qc/templateDetailsSearch`,'post',data) |
||||
|
export const addItemDetails = data => createAPI(`/qms/qc/addItemDetails`,'post',data) |
||||
|
export const getItemList = data => createAPI(`/qms/qc/getItemList`,'post',data) |
||||
|
export const delItemDetails = data => createAPI(`/qms/qc/delItemDetails`,'post',data) |
||||
|
export const uploadTemplateExcel = data => createAPI(`/qms/qc/uploadTemplateExcel`,'post',data) |
||||
|
export const saveItemDetailed = data => createAPI(`/qms/qc/saveItemDetailed`,'post',data) |
||||
|
export const getItem = data => createAPI(`/qms/qc/getItem`,'post',data) |
||||
|
|
||||
|
// ===================================== 样本量 =====================================
|
||||
|
export const samplingQtySearch = data => createAPI(`/qms/qc/samplingQtySearch`,'post',data) |
||||
|
export const samplingQtySave = data => createAPI(`/qms/qc/samplingQtySave`,'post',data) |
||||
|
export const samplingQtyUpdate = data => createAPI(`/qms/qc/samplingQtyUpdate`,'post',data) |
||||
|
export const samplingQtyDelete = data => createAPI(`/qms/qc/samplingQtyDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 批量级次 =====================================
|
||||
|
export const samplingQtyRankSearch = data => createAPI(`/qms/qc/samplingQtyRankSearch`,'post',data) |
||||
|
export const samplingQtyRankSave = data => createAPI(`/qms/qc/samplingQtyRankSave`,'post',data) |
||||
|
export const samplingQtyRankUpdate = data => createAPI(`/qms/qc/samplingQtyRankUpdate`,'post',data) |
||||
|
export const samplingQtyRankDelete = data => createAPI(`/qms/qc/samplingQtyRankDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 检验等级 =====================================
|
||||
|
export const samplingLevelSearch = data => createAPI(`/qms/qc/samplingLevelSearch`,'post',data) |
||||
|
export const samplingLevelSave = data => createAPI(`/qms/qc/samplingLevelSave`,'post',data) |
||||
|
export const samplingLevelUpdate = data => createAPI(`/qms/qc/samplingLevelUpdate`,'post',data) |
||||
|
export const samplingLevelDelete = data => createAPI(`/qms/qc/samplingLevelDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 样本量字码矩阵 =====================================
|
||||
|
export const samplingInspectionPlanSearch = data => createAPI(`/qms/qc/samplingInspectionPlanSearch`,'post',data) |
||||
|
export const samplingInspectionPlanSave = data => createAPI(`/qms/qc/samplingInspectionPlanSave`,'post',data) |
||||
|
export const samplingInspectionPlanUpdate = data => createAPI(`/qms/qc/samplingInspectionPlanUpdate`,'post',data) |
||||
|
export const samplingInspectionPlanDelete = data => createAPI(`/qms/qc/samplingInspectionPlanDelete`,'post',data) |
||||
|
|
||||
|
// ===================================== 抽样方案 =====================================
|
||||
|
export const samplingProgrammeSearch = data => createAPI(`/qms/qc/samplingProgrammeSearch`,'post',data) |
||||
|
export const samplingProgrammeSave = data => createAPI(`/qms/qc/samplingProgrammeSave`,'post',data) |
||||
|
export const samplingProgrammeDelete = data => createAPI(`/qms/qc/samplingProgrammeDelete`,'post',data) |
||||
|
export const searchSamplingProgrammeDetails = data => createAPI(`/qms/qc/searchSamplingProgrammeDetails`,'post',data) |
||||
|
export const saveSamplingProgrammeDetails = data => createAPI(`/qms/qc/saveSamplingProgrammeDetails`,'post',data) |
||||
|
export const deleteSamplingProgrammeDetails = data => createAPI(`/qms/qc/deleteSamplingProgrammeDetails`,'post',data) |
||||
|
export const getPlanLists = data => createAPI(`/qms/qc/getPlanLists`,'post',data) |
||||
|
|
||||
|
|
||||
|
// ===================================== 物料属性设置 =====================================
|
||||
|
export const qcPartAttributeSearch = data => createAPI(`/qms/qc/qcPartAttributeSearch`,'post',data) |
||||
|
export const qcPartAttributeSave = data => createAPI(`/qms/qc/qcPartAttributeSave`,'post',data) |
||||
|
export const qcPartAttributeDelete = data => createAPI(`/qms/qc/qcPartAttributeDelete`,'post',data) |
||||
|
export const searchPartAttributeDetails = data => createAPI(`/qms/qc/searchPartAttributeDetails`,'post',data) |
||||
|
export const savePartAttributeDetails = data => createAPI(`/qms/qc/savePartAttributeDetails`,'post',data) |
||||
|
export const deletePartAttributeDetails = data => createAPI(`/qms/qc/deletePartAttributeDetails`,'post',data) |
||||
|
export const saveAttributeDetailed = data => createAPI(`/qms/qc/saveAttributeDetailed`,'post',data) |
||||
|
export const uploadPartAttributeExcel = data => createAPI(`/qms/qc/uploadPartAttributeExcel`,'post',data) |
||||
|
export const getOperationDescList = data => createAPI(`/qms/qc/getOperationDescList`,'post',data) |
||||
|
export const getManufacturerList = data => createAPI(`/qms/qc/getManufacturerList`,'post',data) |
||||
|
export const getPartTemplateLists = data => createAPI(`/qms/qc/getPartTemplateLists`,'post',data) |
||||
|
export const qcAttributeTemplateItemDetailsSearch = data => createAPI(`/qms/qc/qcAttributeTemplateItemDetailsSearch`,'post',data) |
||||
|
export const qcAttributeTemplateItemSave = data => createAPI(`/qms/qc/qcAttributeTemplateItemSave`,'post',data) |
||||
|
export const qcPartAttributeEdit = data => createAPI(`/qms/qc/qcPartAttributeEdit`,'post',data) |
||||
|
export const overLoadSearchPartInfo = data => createAPI(`/qms/qc/overLoadSearchPartInfo`,'post',data) |
||||
|
|
||||
|
// ===================================== 类别属性设置 =====================================
|
||||
|
export const qcFamilyAttributeSearch = data => createAPI(`/qms/qc/qcFamilyAttributeSearch`,'post',data) |
||||
|
export const qcFamilyAttributeSave = data => createAPI(`/qms/qc/qcFamilyAttributeSave`,'post',data) |
||||
|
export const qcFamilyAttributeDelete = data => createAPI(`/qms/qc/qcFamilyAttributeDelete`,'post',data) |
||||
|
export const uploadFamilyAttributeExcel = data => createAPI(`/qms/qc/uploadFamilyAttributeExcel`,'post',data) |
||||
|
export const queryFileId = data => createAPI(`/qms/qc/queryFileId`,'post',data) |
||||
|
|
||||
|
// ===================================== FAI检验 =====================================
|
||||
|
export const qcFAIInspectionSearch = data => createAPI(`/qms/qc/qcFAIInspectionSearch`,'post',data) |
||||
|
export const faiDetailSearch = data => createAPI(`/qms/qc/faiDetailSearch`,'post',data) |
||||
|
export const faiRecordDelete = data => createAPI(`/qms/qc/faiRecordDelete`,'post',data) |
||||
|
export const saveFAIDetailedRecord = data => createAPI(`/qms/qc/saveFAIDetailedRecord`,'post',data) |
||||
|
export const saveFAISubmitResult = data => createAPI(`/qms/qc/saveFAISubmitResult`,'post',data) |
||||
|
export const saveFAISubDetailed = data => createAPI(`/qms/qc/saveFAISubDetailed`,'post',data) |
||||
|
export const selectFAISubDetailedRecord = data => createAPI(`/qms/qc/selectFAISubDetailedRecord`,'post',data) |
||||
|
export const checkFAIIsSubmit = data => createAPI(`/qms/qc/checkFAIIsSubmit`,'post',data) |
||||
|
export const checkFAISubDetailValue = data => createAPI(`/qms/qc/checkFAISubDetailValue`,'post',data) |
||||
|
export const saveFAIInspection = data => createAPI(`/qms/qc/saveFAIInspection`,'post',data) |
||||
|
|
||||
|
// ===================================== FQC检验 =====================================
|
||||
|
export const qcFQCInspectionSearch = data => createAPI(`/qms/qc/qcFQCInspectionSearch`,'post',data) |
||||
|
export const fqcDetailSearch = data => createAPI(`/qms/qc/fqcDetailSearch`,'post',data) |
||||
|
export const fqcRecordDelete = data => createAPI(`/qms/qc/fqcRecordDelete`,'post',data) |
||||
|
export const markFQCWorkFileRead = data => createAPI(`/qms/qc/markFQCWorkFileRead`,'post',data) |
||||
|
export const saveFQCDetailedRecord = data => createAPI(`/qms/qc/saveFQCDetailedRecord`,'post',data) |
||||
|
export const saveFQCSubmitResult = data => createAPI(`/qms/qc/saveFQCSubmitResult`,'post',data) |
||||
|
export const saveFQCSubDetailed = data => createAPI(`/qms/qc/saveFQCSubDetailed`,'post',data) |
||||
|
export const selectFQCSubDetailedRecord = data => createAPI(`/qms/qc/selectFQCSubDetailedRecord`,'post',data) |
||||
|
export const checkFQCIsSubmit = data => createAPI(`/qms/qc/checkFQCIsSubmit`,'post',data) |
||||
|
export const checkFQCSubDetailValue = data => createAPI(`/qms/qc/checkFQCSubDetailValue`,'post',data) |
||||
|
export const saveFQCInspection = data => createAPI(`/qms/qc/saveFQCInspection`,'post',data) |
||||
|
|
||||
|
// ===================================== PQC检验 =====================================
|
||||
|
export const qcPQCInspectionSearch = data => createAPI(`/pms/pqc/qcPQCInspectionSearch`,'post',data) |
||||
|
export const pqcDetailSearch = data => createAPI(`/pms/pqc/pqcDetailSearch`,'post',data) |
||||
|
export const pqcRecordDelete = data => createAPI(`/pms/pqc/pqcRecordDelete`,'post',data) |
||||
|
export const savePQCDetailedRecord = data => createAPI(`/pms/pqc/savePQCDetailedRecord`,'post',data) |
||||
|
export const savePQCSubmitResult = data => createAPI(`/pms/pqc/savePQCSubmitResult`,'post',data) |
||||
|
export const savePQCSubDetailed = data => createAPI(`/pms/pqc/savePQCSubDetailed`,'post',data) |
||||
|
export const selectPQCSubDetailedRecord = data => createAPI(`/pms/pqc/selectPQCSubDetailedRecord`,'post',data) |
||||
|
export const checkPQCIsSubmit = data => createAPI(`/pms/pqc/checkPQCIsSubmit`,'post',data) |
||||
|
export const savePQCInspection = data => createAPI(`/pms/pqc/savePQCInspection`,'post',data) |
||||
|
export const actionPQCInspection = data => createAPI(`/pms/pqc/actionPQCInspection`,'post',data) |
||||
|
export const getPQCItemObjectList = data => createAPI(`/pms/pqc/getPQCItemObjectList`,'post',data) |
||||
|
export const rollNoEnter2 = data => createAPI(`/pms/pqc/rollNoEnter2`,'post',data) |
||||
|
export const getOperationList2 = data => createAPI(`/pms/pqc/getOperationList2`,'post',data) |
||||
|
export const queytOperationList = data => createAPI(`/pms/pqc/queytOperationList`,'post',data) |
||||
|
export const queryUserDefaultOperationList = data => createAPI(`/pms/pqc/queryUserDefaultOperationList`,'post',data) |
||||
|
export const queryUserDefaultOperationListByUsername = data => createAPI(`/pms/pqc/queryUserDefaultOperationListByUsername`,'post',data) |
||||
|
export const saveUserDefaultOperation = data => createAPI(`/pms/pqc/saveUserDefaultOperation`,'post',data) |
||||
|
export const queryPartDescByNo = data => createAPI(`/pms/pqc/queryPartDescByNo`,'post',data) |
||||
|
export const queryOperationForResourceList = data => createAPI(`/pms/pqc/queryOperationForResourceList`,'post',data) |
||||
|
export const saveOperationForResource = data => createAPI(`/pms/pqc/saveOperationForResource`,'post',data) |
||||
|
export const queryResourceList = data => createAPI(`/pms/pqc/queryResourceList`,'post',data) |
||||
|
export const queryOperationResourceList = data => createAPI(`/pms/pqc/queryOperationResourceList`,'post',data) |
||||
|
export const queryEamObjectlist = data => createAPI(`/pms/pqc/queryEamObjectlist`,'post',data) |
||||
|
export const deleteOperationForResource = data => createAPI(`/pms/pqc/deleteOperationForResource`,'post',data) |
||||
|
export const deleteOperationForResource2 = data => createAPI(`/pms/pqc/deleteOperationForResource2`,'post',data) |
||||
|
export const getResourceDataOperationForResource = data => createAPI(`/pms/pqc/getResourceDataOperationForResource`,'post',data) |
||||
|
export const deleteUserDefaultOperation = data => createAPI(`/pms/pqc/deleteUserDefaultOperation`,'post',data) |
||||
|
export const getHuanXianSysUserList = data => createAPI(`/pms/pqc/getHuanXianSysUserList`,'post',data) |
||||
|
export const getAllUserList = data => createAPI(`/pms/pqc/getAllUserList`,'post',data) |
||||
|
export const queryResourceList2 = data => createAPI(`/pms/pqc/queryResourceList2`,'post',data) |
||||
|
export const querySopNum = data => createAPI(`/pms/pqc/querySopNum`,'post',data) |
||||
|
export const previewSopFile = data => createAPI(`/pms/pqc/previewSopFile`,'post',data,'download') |
||||
|
export const getColumnDisplayFlagList = data => createAPI(`/pms/pqc/getColumnDisplayFlagList`,'post',data) |
||||
|
|
||||
|
// ===================================== IPQC检验 =====================================
|
||||
|
export const qcIPQCInspectionSearch = data => createAPI(`/qms/qc/qcIPQCInspectionSearch`,'post',data) |
||||
|
export const ipqcDetailSearch = data => createAPI(`/qms/qc/ipqcDetailSearch`,'post',data) |
||||
|
export const ipqcRecordDelete = data => createAPI(`/qms/qc/ipqcRecordDelete`,'post',data) |
||||
|
export const markIPQCWorkFileRead = data => createAPI(`/qms/qc/markIPQCWorkFileRead`,'post',data) |
||||
|
export const saveIPQCDetailedRecord = data => createAPI(`/qms/qc/saveIPQCDetailedRecord`,'post',data) |
||||
|
export const saveIPQCSubmitResult = data => createAPI(`/qms/qc/saveIPQCSubmitResult`,'post',data) |
||||
|
export const saveIPQCSubDetailed = data => createAPI(`/qms/qc/saveIPQCSubDetailed`,'post',data) |
||||
|
export const selectIPQCSubDetailedRecord = data => createAPI(`/qms/qc/selectIPQCSubDetailedRecord`,'post',data) |
||||
|
export const checkIPQCIsSubmit = data => createAPI(`/qms/qc/checkIPQCIsSubmit`,'post',data) |
||||
|
export const checkIPQCSubDetailValue = data => createAPI(`/qms/qc/checkIPQCSubDetailValue`,'post',data) |
||||
|
export const getOperationList = data => createAPI(`/qms/qc/getOperationList`,'post',data) |
||||
|
export const getResourceList = data => createAPI(`/qms/qc/getResourceList`,'post',data) |
||||
|
export const getPartList = data => createAPI(`/qms/qc/getPartList`,'post',data) |
||||
|
export const saveOsInspection = data => createAPI(`/qms/qc/saveOsInspection`,'post',data) |
||||
|
export const getAllResourceList = data => createAPI(`/qms/qc/getAllResourceList`,'post',data) |
||||
|
export const getOrderNoList = data => createAPI(`/qms/qc/getOrderNoList`,'post',data) |
||||
|
export const queryController = data => createAPI(`/qms/qc/queryController`,'post',data) |
||||
|
export const queryTemplateList = data => createAPI(`/qms/qc/queryTemplateList`,'post',data) |
||||
|
export const getPartInformation = data => createAPI(`/qms/qc/getPartInformation`,'post',data) |
||||
|
export const getSpecialOperationList = data => createAPI(`/qms/qc/getSpecialOperationList`,'post',data) |
||||
|
export const getSpecialOperationList2 = data => createAPI(`/qms/qc/getSpecialOperationList2`,'post',data) |
||||
|
export const getRollNo = data => createAPI(`/qms/qc/getRollNo`,'post',data) |
||||
|
export const rollNoEnter = data => createAPI(`/qms/qc/rollNoEnter`,'post',data) |
||||
|
export const queryPartList = data => createAPI(`/qms/qc/queryPartList`,'post',data) |
||||
|
export const umSearch = data => createAPI(`/qms/qc/umSearch`,'post',data) |
||||
|
|
||||
|
// ===================================== IQC检验 =====================================
|
||||
|
export const qcIQCInspectionSearch = data => createAPI(`/qms/qc/qcIQCInspectionSearch`,'post',data) |
||||
|
export const iqcDetailSearch = data => createAPI(`/qms/qc/iqcDetailSearch`,'post',data) |
||||
|
export const selectIQCSubDetailedRecord = data => createAPI(`/qms/qc/selectIQCSubDetailedRecord`,'post',data) |
||||
|
export const checkIQCSubDetailValue = data => createAPI(`/qms/qc/checkIQCSubDetailValue`,'post',data) |
||||
|
export const saveIQCDetailedRecord = data => createAPI(`/qms/qc/saveIQCDetailedRecord`,'post',data) |
||||
|
export const checkIQCIsSubmit = data => createAPI(`/qms/qc/checkIQCIsSubmit`,'post',data) |
||||
|
export const saveIQCSubDetailed = data => createAPI(`/qms/qc/saveIQCSubDetailed`,'post',data) |
||||
|
export const saveIQCSubmitResult = data => createAPI(`/qms/qc/saveIQCSubmitResult`,'post',data) |
||||
|
export const iqcRecordDelete = data => createAPI(`/qms/qc/iqcRecordDelete`,'post',data) |
||||
|
export const disposalMeasuresSearch = data => createAPI(`/qms/qc/disposalMeasuresSearch`,'post',data) |
||||
|
export const searchItemFileUrl = data => createAPI(`/qms/qc/searchItemFileUrl`,'post',data) |
||||
|
export const imageDelete = data => createAPI(`/qms/qc/imageDelete`,'post',data) |
||||
|
export const iqcRecordOverLoad = data => createAPI(`/qms/qc/iqcRecordOverLoad`,'post',data) |
||||
|
export const uploadSopFile = data => createAPI(`/qms/qc/upload`,'post',data) |
||||
|
export const getSiteAndBuByUserName = data => createAPI(`/qms/qc/getSiteAndBuByUserName`,'post',data) |
||||
|
export const searchSeqInfo = data => createAPI(`/qms/qc/searchSeqInfo`,'post',data) |
||||
|
export const searchPartInfo = data => createAPI(`/qms/qc/searchPartInfo`,'post',data) |
||||
|
// 获取采购类型
|
||||
|
export const orderTypeSearch = data => createAPI(`/qms/qc/orderTypeSearch`,'post',data) |
||||
|
export const actionIQCInspection = data => createAPI(`/qms/qc/actionIQCInspection`,'post',data) |
||||
|
export const actionFAIInspection = data => createAPI(`/qms/qc/actionFAIInspection`,'post',data) |
||||
|
export const actionIPQCInspection = data => createAPI(`/qms/qc/actionIPQCInspection`,'post',data) |
||||
|
export const actionFQCInspection = data => createAPI(`/qms/qc/actionFQCInspection`,'post',data) |
||||
|
export const dataAcquisition = data => createAPI(`/qms/qc/dataAcquisition`,'post',data) |
||||
|
export const getEquipmentNoList = data => createAPI(`/qms/qc/getEquipmentNoList`,'post',data) |
||||
|
export const getResponsibleOperatorList = data => createAPI(`/qms/qc/getResponsibleOperatorList`,'post',data) |
||||
|
export const getMhmResponsibleRoleList = data => createAPI(`/qms/qc/getMhmResponsibleRoleList`,'post',data) |
||||
|
export const getMhmRoleByName = data => createAPI(`/qms/qc/getMhmRoleByName`,'post',data) |
||||
|
export const getDataContentList = data => createAPI(`/qms/qc/getDataContentList`,'post',data) |
||||
|
export const getObjectList = data => createAPI(`/qms/qc/getObjectList`,'post',data) |
||||
|
export const getObjectListBy = data => createAPI(`/qms/qc/getObjectListBy`,'post',data) |
||||
|
export const addItemObject = data => createAPI(`/qms/qc/addItemObject`,'post',data) |
||||
|
export const deleteItemObject = data => createAPI(`/qms/qc/deleteItemObject`,'post',data) |
||||
|
export const updateItemObject = data => createAPI(`/qms/qc/updateItemObject`,'post',data) |
||||
|
export const getIQCItemObjectList = data => createAPI(`/qms/qc/getIQCItemObjectList`,'post',data) |
||||
|
export const getFAIItemObjectList = data => createAPI(`/qms/qc/getFAIItemObjectList`,'post',data) |
||||
|
export const getFQCItemObjectList = data => createAPI(`/qms/qc/getFQCItemObjectList`,'post',data) |
||||
|
export const getIPQCItemObjectList = data => createAPI(`/qms/qc/getIPQCItemObjectList`,'post',data) |
||||
|
export const getInspectionStandards = data => createAPI(`/qms/qc/getInspectionStandards`,'post',data) |
||||
|
export const saveInspectionStandard = data => createAPI(`/qms/qc/saveInspectionStandard`,'post',data) |
||||
|
export const dataAcquisitionByItem = data => createAPI(`/qms/qc/dataAcquisitionByItem`,'post',data) |
||||
|
export const getSiteAndBuByUserName2 = data => createAPI(`/qms/qc/getSiteAndBuByUserName2`,'post',data) |
||||
|
export const cancelApproval = data => createAPI(`/qms/qc/cancelApproval`,'post',data) |
||||
|
|
||||
|
export const goUpItemQC = data => createAPI(`/qms/qc/goUpItemQC`,'post',data) |
||||
|
export const goDownItemQC = data => createAPI(`/qms/qc/goDownItemQC`,'post',data) |
||||
|
export const cancelApproval2 = data => createAPI(`/qms/qc/cancelApproval2`,'post',data) |
||||
|
export const queryTemplateSortList = data => createAPI(`/qms/qc/queryTemplateSortList`,'post',data) |
||||
|
|
||||
|
// ===================================== 外采设备维护 =====================================
|
||||
|
export const queryEquipmentFolderLocationList = data => createAPI(`/qms/qc/queryEquipmentFolderLocationList`,'post',data) |
||||
|
export const deleteEquipmentFolderLocationList = data => createAPI(`/qms/qc/deleteEquipmentFolderLocationList`,'post',data) |
||||
|
export const getSuffixList = data => createAPI(`/qms/qc/getSuffixList`,'post',data) |
||||
|
export const saveEquipmentFolderLocationList = data => createAPI(`/qms/qc/saveEquipmentFolderLocationList`,'post',data) |
||||
|
|
||||
|
|
||||
|
// ===================================== 成品物料模块 =====================================
|
||||
|
// 查询
|
||||
|
export const queryProductPartList = data => createAPI(`/qms/qc/queryProductPartList`,'post',data) |
||||
|
// 新增
|
||||
|
export const saveProductPartData = data => createAPI(`/qms/qc/saveProductPartData`,'post',data) |
||||
|
// 修改
|
||||
|
export const updateProductPartData = data => createAPI(`/qms/qc/updateProductPartData`,'post',data) |
||||
|
// 删除
|
||||
|
export const deleteProductPartList = data => createAPI(`/qms/qc/deleteProductPartList`,'post',data) |
||||
|
// 根据site bu partNo查询物料信息
|
||||
|
export const selectPartData = data => createAPI(`/qms/qc/selectPartData`,'post',data) |
||||
|
// 查询用户按钮权限
|
||||
|
export const getButtonsPermission = data => createAPI(`/qms/qc/getButtonsPermission`,'post',data) |
||||
|
|
||||
|
//通过itemNo获取物料属性项
|
||||
|
export const getEamPropertiesItemByItemNo = data => createAPI(`/qms/qc/getEamPropertiesItemByItemNo`,'post',data) |
||||
|
//获取采集器数据
|
||||
|
export const getCollectorDataByItem = data => createAPI(`/qms/qc/getCollectorDataByItem`,'post',data) |
||||
|
//检查采集器异常信号
|
||||
|
export const checkCollectorAbnormalSignal = data => createAPI(`/qms/qc/checkCollectorAbnormalSignal`,'post',data) |
||||
|
|
||||
@ -0,0 +1,25 @@ |
|||||
|
import getLodop from '@/utils/LodopFuncs.js' |
||||
|
|
||||
|
// 打印
|
||||
|
export function qcPrint(dataList) { |
||||
|
const LODOP = getLodop() |
||||
|
if (LODOP) { |
||||
|
for (const row of dataList) { |
||||
|
LODOP.NewPage() |
||||
|
LODOP.SET_PRINT_PAGESIZE(0,500,250,"") |
||||
|
LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); |
||||
|
//LODOP.ADD_PRINT_BARCODE(8,5,80,85,"QRCode",row.inspectionNo)
|
||||
|
LODOP.ADD_PRINT_IMAGE(2,-2,"16.85mm","18.44mm",`<img src="${row.qrCode}" style="width: 70px;height: 70px"/>`); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",8) |
||||
|
LODOP.ADD_PRINT_TEXT(23,67,127,22,row.inspectionNo) |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontName","@微软雅黑"); |
||||
|
} |
||||
|
//LODOP.PRINT_DESIGN();
|
||||
|
//LODOP.PREVIEW();
|
||||
|
LODOP.PRINT(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,26 +1,30 @@ |
|||||
import { createAPI } from "@/utils/httpRequest.js"; |
|
||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
// 获取默认配置
|
// 获取默认配置
|
||||
export const getTableDefault = data => createAPI(`/gridTableDefault/getTableDefaultList`,'Post',data) |
|
||||
|
export const getTableDefault = data => createAPI('/gridTableDefault/getTableDefaultList', 'post', data) |
||||
// 多语言配置
|
// 多语言配置
|
||||
export const getTableDefaultListLanguage = data => createAPI(`/gridTableDefault/getTableDefaultListLanguage`,'Post',data) |
|
||||
|
export const getTableDefaultListLanguage = data => createAPI('/gridTableDefault/getTableDefaultListLanguage', 'post', data) |
||||
|
|
||||
// 添加默认配置
|
// 添加默认配置
|
||||
export const saveTableDefaultList = data => createAPI(`/gridTableDefault/saveTableDefaultList`,'Post',data) |
|
||||
|
export const saveTableDefaultList = data => createAPI('/gridTableDefault/saveTableDefaultList', 'post', data) |
||||
// 删除
|
// 删除
|
||||
export const removerDefault = data => createAPI(`/gridTableDefault/removerDefault`,'post',data) |
|
||||
|
export const removerDefault = data => createAPI('/gridTableDefault/removerDefault', 'post', data) |
||||
|
|
||||
// 获取默认配置
|
|
||||
export const getTableUser = data => createAPI(`/gridTableUser/getTableUserList`,'Post',data) |
|
||||
|
// 获取用户配置
|
||||
|
export const getTableUser = data => createAPI('/gridTableUser/getTableUserList', 'post', data) |
||||
// 多语言配置
|
// 多语言配置
|
||||
export const getTableUserListLanguage = data => createAPI(`/gridTableUser/getTableUserListLanguage`,'Post',data) |
|
||||
|
export const getTableUserListLanguage = data => createAPI('/gridTableUser/getTableUserListLanguage', 'post', data) |
||||
|
|
||||
// 保存用户默认配置
|
// 保存用户默认配置
|
||||
export const saveTableUser = data => createAPI(`/gridTableUser/saveGridTableUserList`,'Post',data) |
|
||||
|
export const saveTableUser = data => createAPI('/gridTableUser/saveGridTableUserList', 'post', data) |
||||
|
// 修改用户默认配置
|
||||
|
export const updateTableUser = data => createAPI('/gridTableUser/updateTableUser', 'post', data) |
||||
|
|
||||
// 删除
|
// 删除
|
||||
export const removerUser = data => createAPI(`/gridTableUser/removerUser`,'post',data) |
|
||||
|
export const removerUser = data => createAPI('/gridTableUser/removerUser', 'post', data) |
||||
|
|
||||
// 获取功能对应下的所有表格
|
// 获取功能对应下的所有表格
|
||||
export const getMenuTableList = data => createAPI(`/gridTableDefault/getMenuTableList`,'post',data) |
|
||||
|
export const getMenuTableList = data => createAPI('/gridTableDefault/getMenuTableList', 'post', data) |
||||
|
|
||||
|
// 更新列宽
|
||||
|
export const updateColumnSize = data => createAPI('/gridTableUser/updateColumnSize', 'post', data) |
||||
@ -0,0 +1,228 @@ |
|||||
|
<script> |
||||
|
import {downLoadObjectFile, downLoadObjectFileMes} from '@/api/eam/eam_object_list.js' |
||||
|
import {deleteObjectFile} from '@/api/eam/eam.js' |
||||
|
export default { |
||||
|
name: "iqcFileTable", |
||||
|
props:{ |
||||
|
dataList:{ |
||||
|
type:Array, |
||||
|
required:true |
||||
|
}, |
||||
|
queryLoading:{ |
||||
|
type:Boolean, |
||||
|
default:false, |
||||
|
}, |
||||
|
columns:{ |
||||
|
type:Array, |
||||
|
required: true, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
emitFilePreviewed (row) { |
||||
|
this.$emit('file-previewed', row) |
||||
|
}, |
||||
|
|
||||
|
// 预览 |
||||
|
previewFile (row) { |
||||
|
// 预览文件 |
||||
|
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] |
||||
|
let type = '' |
||||
|
if (image.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'image/' + row.fileType |
||||
|
} |
||||
|
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv'] |
||||
|
if (video.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'video/' + row.fileType |
||||
|
} |
||||
|
let txt = ['txt'] |
||||
|
if (txt.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'text/plain' |
||||
|
} |
||||
|
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] |
||||
|
if (office.includes(row.fileType.toLowerCase())) { |
||||
|
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`) |
||||
|
return |
||||
|
} |
||||
|
let pdf = ['pdf'] |
||||
|
if (pdf.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'application/pdf' |
||||
|
} |
||||
|
if (type === ''){ |
||||
|
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`) |
||||
|
return; |
||||
|
} |
||||
|
downLoadObjectFile(row).then(({data}) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
// 创建URL来生成预览 |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
// 在新标签页中打开文件预览 |
||||
|
window.open(fileURL, '_blank') |
||||
|
this.emitFilePreviewed(row) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 预览 |
||||
|
previewFileMes (row) { |
||||
|
// 预览文件 |
||||
|
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] |
||||
|
let type = '' |
||||
|
if (image.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'image/' + row.fileType |
||||
|
} |
||||
|
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv'] |
||||
|
if (video.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'video/' + row.fileType |
||||
|
} |
||||
|
let txt = ['txt'] |
||||
|
if (txt.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'text/plain' |
||||
|
} |
||||
|
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] |
||||
|
if (office.includes(row.fileType.toLowerCase())) { |
||||
|
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`) |
||||
|
return |
||||
|
} |
||||
|
let pdf = ['pdf'] |
||||
|
if (pdf.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'application/pdf' |
||||
|
} |
||||
|
if (type === ''){ |
||||
|
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`) |
||||
|
return; |
||||
|
} |
||||
|
downLoadObjectFileMes(row).then(({data}) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
// 创建URL来生成预览 |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
// 在新标签页中打开文件预览 |
||||
|
window.open(fileURL, '_blank') |
||||
|
this.emitFilePreviewed(row) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 文件下载 |
||||
|
downloadFile (row) { |
||||
|
downLoadObjectFile(row) |
||||
|
.then(({data}) => { |
||||
|
// 不限制文件下载类型 |
||||
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
||||
|
// 下载文件名称 |
||||
|
const fileName = row.fileName |
||||
|
// a标签下载 |
||||
|
const linkNode = document.createElement('a') |
||||
|
// a标签的download属性规定下载文件的名称 |
||||
|
linkNode.download = fileName |
||||
|
linkNode.style.display = 'none' |
||||
|
// 生成一个Blob URL |
||||
|
linkNode.href = URL.createObjectURL(blob) |
||||
|
document.body.appendChild(linkNode) |
||||
|
// 模拟在按钮上的一次鼠标单击 |
||||
|
linkNode.click() |
||||
|
// 释放URL 对象 |
||||
|
URL.revokeObjectURL(linkNode.href) |
||||
|
document.body.removeChild(linkNode) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 文件下载 |
||||
|
downloadFileMes (row) { |
||||
|
downLoadObjectFileMes(row) |
||||
|
.then(({data}) => { |
||||
|
// 不限制文件下载类型 |
||||
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
||||
|
// 下载文件名称 |
||||
|
const fileName = row.fileName |
||||
|
// a标签下载 |
||||
|
const linkNode = document.createElement('a') |
||||
|
// a标签的download属性规定下载文件的名称 |
||||
|
linkNode.download = fileName |
||||
|
linkNode.style.display = 'none' |
||||
|
// 生成一个Blob URL |
||||
|
linkNode.href = URL.createObjectURL(blob) |
||||
|
document.body.appendChild(linkNode) |
||||
|
// 模拟在按钮上的一次鼠标单击 |
||||
|
linkNode.click() |
||||
|
// 释放URL 对象 |
||||
|
URL.revokeObjectURL(linkNode.href) |
||||
|
document.body.removeChild(linkNode) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 删除文件 |
||||
|
deleteFile (row) { |
||||
|
let tempData = { |
||||
|
site: row.orderRef1, |
||||
|
inspectionNo: row.orderRef2, |
||||
|
buNo: row.orderRef4 |
||||
|
} |
||||
|
this.$confirm('确定要删除此文件?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
deleteObjectFile(row).then(({data}) => { |
||||
|
if (data && data.code == 0) { |
||||
|
this.getFileContentData(tempData) |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<el-table |
||||
|
:height="350" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
v-loading="queryLoading" |
||||
|
element-loading-text="拼命加载中" |
||||
|
style="width: 100%; "> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columns" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="100" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link> |
||||
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> |
||||
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link> |
||||
|
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="previewFileMes(scope.row)">预览</el-link> |
||||
|
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="downloadFileMes(scope.row)">下载</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
3607
src/views/modules/qc/IQCResultEntry.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,193 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" :before-close="closeDialog" :showClose="false" width="390px" style="height: 530px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12" style="width:36%"> |
||||
|
<el-form-item class="customer-item" label="检验单号"> |
||||
|
<el-input v-model="pageData.inspectionNo" style="width: 120px;" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label="项目编码"> |
||||
|
<el-input v-model="pageData.itemNo" style="width: 120px;" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<!-- 图像区域 --> |
||||
|
<ul class="content-image" v-viewer> |
||||
|
<li v-for="(item, index) in descImgs" :key="index" style="float: left;display: inline"> |
||||
|
<img :src="item.url" style="width:70px;height: 70px"/> |
||||
|
<!-- 删除图标 --> |
||||
|
<div class="delete-img"> |
||||
|
<i class="el-icon-delete" @click="deleteImage(index,item.id)"></i> |
||||
|
</div> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-upload class="customer-upload" drag multiple :file-list="fileList" |
||||
|
action="javascript:void(0);" ref="uploadFile" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
||||
|
accept=".jpg,.jpeg,.png,.gif" :auto-upload="false" |
||||
|
style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUploadFile">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import {uploadEamObjectFile} from '@/api/eam/com_eam_object_upload_file.js'; |
||||
|
import { |
||||
|
searchItemFileUrl, // 查询文件路径 |
||||
|
imageDelete, // 删除图片 |
||||
|
} from "@/api/qc/qc.js" |
||||
|
/* 引入组件 */ |
||||
|
var functionId = 'C10000002'; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '项目图片上传', |
||||
|
visible: false, |
||||
|
userId: this.$store.state.user.name, |
||||
|
fileList: [], |
||||
|
pageData: { |
||||
|
site: '', |
||||
|
buNo: '', |
||||
|
username: this.$store.state.user.name, |
||||
|
inspectionNo: '', |
||||
|
itemNo: '', |
||||
|
fileRemark: '', |
||||
|
folder: '' |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
descImgs: [], |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 初始化组件的参数 |
||||
|
init (currentRow) { |
||||
|
// 初始化参数 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
||||
|
// 打开页面 |
||||
|
this.visible = true |
||||
|
this.descImgs = [] |
||||
|
this.searchItemFileUrl() |
||||
|
}, |
||||
|
// 查询图片列表 |
||||
|
searchItemFileUrl () { |
||||
|
this.descImgs = [] |
||||
|
searchItemFileUrl(this.pageData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
for (let i = 0; i < data.rows.length; i++) { |
||||
|
this.descImgs.push(data.rows[i]) |
||||
|
} |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 上传之前 |
||||
|
beforeUploadHandle (file) { |
||||
|
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { |
||||
|
this.$message.error('只支持图片!') |
||||
|
return false |
||||
|
} |
||||
|
}, |
||||
|
// 选择上传文件时 |
||||
|
onChange (file, fileList) { |
||||
|
this.fileList = fileList |
||||
|
}, |
||||
|
// 关闭modal |
||||
|
closeDialog () { |
||||
|
this.fileList = [] |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
// 刷新报工的页面 |
||||
|
//this.$emit('refreshPageTables2') |
||||
|
// 关闭当前的页面 |
||||
|
this.visible = false |
||||
|
}, |
||||
|
|
||||
|
// 保修当前的数据 |
||||
|
saveUploadFile () { |
||||
|
// 判断文件是否上传 |
||||
|
if (null == this.fileList || 0 === this.fileList.length) { |
||||
|
this.$message.error("请先上传图片!") |
||||
|
return false |
||||
|
} |
||||
|
const formData = new FormData() |
||||
|
// 片接文件 |
||||
|
for (let i = 0; i < this.fileList.length; i++) { |
||||
|
formData.append("file",this.fileList[i].raw) |
||||
|
} |
||||
|
//formData.append("file", this.fileList[0].raw) |
||||
|
formData.append("site", this.pageData.site) |
||||
|
formData.append("folder", this.pageData.folder) |
||||
|
formData.append("objectID", this.pageData.inspectionNo) |
||||
|
formData.append("orderRef1", this.pageData.itemNo) |
||||
|
formData.append("orderRef4", this.pageData.buNo) |
||||
|
uploadEamObjectFile(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
this.searchItemFileUrl() |
||||
|
this.fileList = [] |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 删除图片 |
||||
|
deleteImage (index, id) { |
||||
|
let param = { |
||||
|
id: id |
||||
|
} |
||||
|
this.$confirm(`是否删除该图片?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
imageDelete(param).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.searchItemFileUrl() |
||||
|
this.$message.success(data.msg) |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 点击 X 关闭对话框的回调 |
||||
|
**/ |
||||
|
handleDialogClose () { |
||||
|
this.fileList = [] |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
// 刷新报工的页面 |
||||
|
//this.$emit('refreshPageTables2') |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,31 @@ |
|||||
|
export const QC_DEFAULT_BU_NO = '*' |
||||
|
|
||||
|
export function buildQcBu (site) { |
||||
|
if (!site) { |
||||
|
return '' |
||||
|
} |
||||
|
const siteOnly = String(site).includes('_') ? String(site).split('_')[0] : site |
||||
|
return `${siteOnly}_${QC_DEFAULT_BU_NO}` |
||||
|
} |
||||
|
|
||||
|
export function parseQcBu (bu) { |
||||
|
if (!bu) { |
||||
|
return { site: '', buNo: QC_DEFAULT_BU_NO } |
||||
|
} |
||||
|
const site = String(bu).includes('_') ? String(bu).split('_')[0] : bu |
||||
|
return { site, buNo: QC_DEFAULT_BU_NO } |
||||
|
} |
||||
|
|
||||
|
export function normalizeBuList (list) { |
||||
|
if (!list || !list.length) { |
||||
|
return list || [] |
||||
|
} |
||||
|
return list.map(item => { |
||||
|
const bu = buildQcBu(item.site) |
||||
|
return { |
||||
|
...item, |
||||
|
buNo: bu, |
||||
|
bu |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
1482
src/views/modules/qc/qcFamilyAttribute.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1652
src/views/modules/qc/qcItem.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,778 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 条件查询 --> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData"> |
||||
|
<!-- <el-form-item label="BU"> |
||||
|
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buDesc"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="方法编码"> |
||||
|
<el-input v-model="searchData.methodNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="方法名称"> |
||||
|
<el-input v-model="searchData.methodName" clearable style="width: 200px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="检验类型"> |
||||
|
<el-select v-model="searchData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 100px"> |
||||
|
<el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option> |
||||
|
<el-option |
||||
|
v-for = "i in options" |
||||
|
:key = "i.inspectionTypeNo" |
||||
|
:label = "i.inspectionTypeName" |
||||
|
:value = "i.inspectionTypeNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ "导出" }} |
||||
|
</download-excel> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 展示列表 --> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
@header-dragend="handleColumnResize" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<!-- <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> |
||||
|
<span v-else> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> --> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="130" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a> |
||||
|
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 新增和修改 --> |
||||
|
<el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu"> |
||||
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 456px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="方法名称:" prop="methodName" :rules="rules.methodNameType"> |
||||
|
<el-input v-model="modalData.methodName" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="检验类型:" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType"> |
||||
|
<el-select v-model="modalData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 221px"> |
||||
|
<el-option |
||||
|
v-for = "i in options" |
||||
|
:key = "i.inspectionTypeNo" |
||||
|
:label = "i.inspectionTypeName" |
||||
|
:value = "i.inspectionTypeNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item :label="'检验方法说明:'"> |
||||
|
<el-input v-model="modalData.methodRemark" style="width: 456px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData()">保存</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
qcMethodSearch, // 检验方法查询 |
||||
|
qcMethodSave, // 检验方法新增 |
||||
|
qcMethodUpdate, // 检验方法修改 |
||||
|
qcMethodDelete, // 检验方法删除 |
||||
|
inspectionTypeSearch, // 搜索所有检验类型 |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu } from './qcBuUtils' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage,updateColumnSize} from "@/api/table.js" |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
columnsProp:['createBy', 'updateBy'], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["检验方法"], |
||||
|
exportFooter: [], |
||||
|
exportList: [], |
||||
|
// 导出 end |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
methodNo: '', |
||||
|
methodName: '', |
||||
|
inspectionTypeNo: '', |
||||
|
buDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataList: [], |
||||
|
dataListLoading: false, |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
modalData: { |
||||
|
site: '', |
||||
|
bu: '', |
||||
|
flag: '', |
||||
|
methodNo: '', |
||||
|
methodName: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
methodRemark: '', |
||||
|
inspectionTypeNo: '' |
||||
|
}, |
||||
|
// 标头展示 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableBuDesc', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableMethodNo', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'methodNo', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '方法编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableMethodName', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'methodName', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '方法名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableMethodRemark', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'methodRemark', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '方法说明', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableInspectionTypeName', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'inspectionTypeName', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '检验类型', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableCreateDate', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableCreateBy', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableUpdateDate', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301001, |
||||
|
serialNumber: '301001TableUpdateBy', |
||||
|
tableId: "301001Table", |
||||
|
tableName: "检验方法维护表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
methodNameType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
inspectionTypeNoType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
bu:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
options: [], |
||||
|
userBuList: [], |
||||
|
lineInspectionRoleFlag: false, |
||||
|
pqcInspectionTypeNo: '108', |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 180 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 当前用户是否包含换线点检角色 |
||||
|
this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag() |
||||
|
// 获取用户的 site 和 bu |
||||
|
this.getSiteAndBuByUserName() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 获取检验类型 |
||||
|
this.inspectionTypeSearch() |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table',1) |
||||
|
if (!this.authSearch) { |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleColumnResize(newWidth, oldWidth, column, event){ |
||||
|
let inData= this.columnList.filter(item => item.columnProp === column.property)[0] |
||||
|
inData.columnWidth=newWidth |
||||
|
updateColumnSize(inData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
console.log("栏位宽度保存成功!") |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取用户的bu |
||||
|
getSiteAndBuByUserName () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 是否包含换线点检角色 |
||||
|
resolveLineInspectionRoleFlag () { |
||||
|
return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y' |
||||
|
}, |
||||
|
|
||||
|
// 获取PQC对应的检验类型编码 |
||||
|
getPqcInspectionTypeNo () { |
||||
|
const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC') |
||||
|
if (pqcData) { |
||||
|
this.pqcInspectionTypeNo = pqcData.inspectionTypeNo |
||||
|
} |
||||
|
return this.pqcInspectionTypeNo |
||||
|
}, |
||||
|
|
||||
|
// 换线点检角色仅允许PQC |
||||
|
applyPqcInspectionTypeLimit () { |
||||
|
if (!this.lineInspectionRoleFlag) { |
||||
|
return |
||||
|
} |
||||
|
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo() |
||||
|
this.searchData.inspectionTypeNo = pqcInspectionTypeNo |
||||
|
this.modalData.inspectionTypeNo = pqcInspectionTypeNo |
||||
|
}, |
||||
|
|
||||
|
// 查询获取数据列表 |
||||
|
getDataList () { |
||||
|
this.applyPqcInspectionTypeLimit() |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
qcMethodSearch(this.searchData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 新增按钮 |
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
site: '', |
||||
|
bu: this.userBuList[0].buNo, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
methodNo: '', |
||||
|
methodName: '', |
||||
|
methodRemark: '', |
||||
|
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : '' |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改按钮 |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
bu: buildQcBu(row.site), |
||||
|
site: row.site, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
methodNo: row.methodNo, |
||||
|
methodName: row.methodName, |
||||
|
methodRemark: row.methodRemark, |
||||
|
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : row.inspectionTypeNo |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除方法 |
||||
|
deleteModal (row) { |
||||
|
this.$confirm(`是否删除这个检验方法?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
qcMethodDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增/修改方法 |
||||
|
saveData () { |
||||
|
this.applyPqcInspectionTypeLimit() |
||||
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
||||
|
this.$message.warning('请选择BU!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.methodName === '' || this.modalData.methodName == null) { |
||||
|
this.$message.warning('请输入检验方法名称!') |
||||
|
return |
||||
|
} |
||||
|
if(this.modalData.inspectionTypeNo === ''|| this.modalData.inspectionTypeNo == null) { |
||||
|
this.$message.warning('请选择检验类型!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { // 新增 |
||||
|
qcMethodSave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { // 修改 |
||||
|
qcMethodUpdate(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 查询检验类型 |
||||
|
inspectionTypeSearch () { |
||||
|
let tempData = { |
||||
|
site: this.$store.state.user.site |
||||
|
} |
||||
|
inspectionTypeSearch(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.options = data.rows |
||||
|
if (this.lineInspectionRoleFlag) { |
||||
|
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo() |
||||
|
this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo) |
||||
|
this.searchData.inspectionTypeNo = pqcInspectionTypeNo |
||||
|
this.modalData.inspectionTypeNo = pqcInspectionTypeNo |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if(this.$route.meta.menuId === data.list[i].menuId){ |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//导出excel |
||||
|
async createExportData() { |
||||
|
this.applyPqcInspectionTypeLimit() |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await qcMethodSearch(this.searchData).then(({data}) => { |
||||
|
this.exportList= data.page.list |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload() {}, |
||||
|
|
||||
|
finishDownload() {}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList1 = [] |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable = { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
// this.showDefault = true. |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
2445
src/views/modules/qc/qcPartAttribute.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,682 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 条件查询 --> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData"> |
||||
|
<!-- <el-form-item :label="'BU'"> |
||||
|
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buDesc"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item :label="'检验等级编码'"> |
||||
|
<el-input v-model="searchData.samplingLevelNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'检验等级描述'"> |
||||
|
<el-input v-model="searchData.samplingLevelDesc" clearable style="width: 200px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'"> |
||||
|
<el-select v-model="searchData.samplingLevelActive" style="width: 80px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<!-- <el-button @click="doEmpty()">清空</el-button>--> |
||||
|
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ "导出" }} |
||||
|
</download-excel> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 展示列表 --> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> |
||||
|
<span v-else> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a> |
||||
|
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 新增和修改 --> |
||||
|
<el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu"> |
||||
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 456px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="检验等级描述:" prop="samplingLevelDesc" :rules="rules.samplingLevelDescType"> |
||||
|
<el-input v-model="modalData.samplingLevelDesc" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'" prop="samplingLevelActive" :rules="rules.samplingLevelActiveType"> |
||||
|
<el-select filterable v-model="modalData.samplingLevelActive" style="width: 221px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="备注说明:"> |
||||
|
<el-input v-model="modalData.samplingLevelRemark" style="width: 456px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData()">保存</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
samplingLevelSearch, // 查询检验等级 |
||||
|
samplingLevelSave, // 新增检验等级 |
||||
|
samplingLevelUpdate, // 修改检验等级 |
||||
|
samplingLevelDelete, // 删除检验等级 |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu } from './qcBuUtils' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
columnsProp:['createBy','samplingLevelActive','updateBy'], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "样本量" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["样本量"], |
||||
|
exportFooter: [], |
||||
|
exportList: [], |
||||
|
// 导出 end |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingLevelActive: '', |
||||
|
buDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataList: [], |
||||
|
dataListLoading: false, |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
modalData: { |
||||
|
flag: '', |
||||
|
site: '', |
||||
|
bu: '', |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingLevelActive: '', |
||||
|
samplingLevelRemark: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
}, |
||||
|
// 标头展示 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableBuDesc', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableSamplingLevelNo', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'samplingLevelNo', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '检验等级编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableSamplingLevelDesc', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'samplingLevelDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '检验等级描述', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableSamplingLevelRemark', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'samplingLevelRemark', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '备注说明', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableSamplingLevelActive', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'samplingLevelActive', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '是否可用', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableCreateDate', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableCreateBy', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableUpdateDate', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301011, |
||||
|
serialNumber: '301011TableUpdateBy', |
||||
|
tableId: "301011Table", |
||||
|
tableName: "检验水平表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
samplingLevelDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingLevelActiveType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
bu:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
userBuList: [], |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 150 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 获取用户的 site 和 bu |
||||
|
this.getSiteAndBuByUserName() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table',1) |
||||
|
if (!this.authSearch) { |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 获取用户的bu |
||||
|
getSiteAndBuByUserName () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 查询获取数据列表 |
||||
|
getDataList () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
samplingLevelSearch(this.searchData).then(({data}) => { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增按钮 |
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
bu: this.userBuList[0].buNo, |
||||
|
site: '', |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingLevelActive: 'Y', |
||||
|
samplingLevelRemark: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改按钮 |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
bu: buildQcBu(row.site), |
||||
|
site: row.site, |
||||
|
samplingLevelNo: row.samplingLevelNo, |
||||
|
samplingLevelDesc: row.samplingLevelDesc, |
||||
|
samplingLevelActive: row.samplingLevelActive, |
||||
|
samplingLevelRemark: row.samplingLevelRemark, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除方法 |
||||
|
deleteModal (row) { |
||||
|
this.$confirm(`是否删除这个检验等级?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
samplingLevelDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增/修改方法 |
||||
|
saveData () { |
||||
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
||||
|
this.$message.warning('请选择BU!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingLevelDesc === '' || this.modalData.samplingLevelDesc == null) { |
||||
|
this.$message.warning('请输入检验等级描述!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingLevelActive === '' || this.modalData.samplingLevelActive == null) { |
||||
|
this.$message.warning('请选择是否在用!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { // 新增 |
||||
|
samplingLevelSave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { // 修改 |
||||
|
samplingLevelUpdate(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if (this.$route.meta.menuId === data.list[i].menuId) { |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 导出excel |
||||
|
async createExportData () { |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await samplingLevelSearch(this.searchData).then(({data}) => { |
||||
|
this.exportList = data.rows |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload() {}, |
||||
|
|
||||
|
finishDownload() {}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList1 = [] |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable= { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
// this.showDefault = true. |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,971 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 条件查询 --> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData"> |
||||
|
<!-- <el-form-item :label="'BU'"> |
||||
|
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buDesc"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item :label="'检验水平'"> |
||||
|
<el-input v-model="searchData.samplingLevelDesc" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'样本量字码'"> |
||||
|
<el-input v-model="searchData.samplingQtyDesc" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'"> |
||||
|
<el-select v-model="searchData.samplingPlanActive" style="width: 80px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<!-- <el-button @click="doEmpty()">清空</el-button>--> |
||||
|
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ "导出" }} |
||||
|
</download-excel> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 展示列表 --> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed === ''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> |
||||
|
<span v-else> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a> |
||||
|
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 分页--> |
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 新增和修改 --> |
||||
|
<el-dialog title="样本量字码矩阵" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu"> |
||||
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 456px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="矩阵名称:" prop="samplingPlanDesc" :rules="rules.samplingPlanDescType"> |
||||
|
<el-input v-model="modalData.samplingPlanDesc" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否在用:" prop="samplingPlanActive" :rules="rules.samplingPlanActiveType"> |
||||
|
<el-select filterable v-model="modalData.samplingPlanActive" style="width: 221px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item prop="samplingQtyNo" :rules="rules.samplingQtyNoType"> |
||||
|
<span slot="label" style="" @click="getBaseList(210)"><a herf="#">样本量编码</a></span> |
||||
|
<el-input v-model="modalData.samplingQtyNo" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="样本量字码:" prop="samplingQtyDesc" :rules="rules.samplingQtyDescType"> |
||||
|
<el-input v-model="modalData.samplingQtyDesc" disabled style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item prop="samplingQtyRankNo" :rules="rules.samplingQtyRankNoType"> |
||||
|
<span slot="label" style="" @click="getBaseList(209)"><a herf="#">抽样量级别编码</a></span> |
||||
|
<el-input v-model="modalData.samplingQtyRankNo" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="抽样量级别名称:" prop="samplingQtyRankDesc" :rules="rules.samplingQtyRankDescType"> |
||||
|
<el-input v-model="modalData.samplingQtyRankDesc" disabled style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item prop="samplingLevelNo" :rules="rules.samplingLevelNoType"> |
||||
|
<span slot="label" style="" @click="getBaseList(208)"><a herf="#">抽样等级编码</a></span> |
||||
|
<el-input v-model="modalData.samplingLevelNo" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="抽样等级名称:" prop="samplingLevelDesc" :rules="rules.samplingLevelDescType"> |
||||
|
<el-input v-model="modalData.samplingLevelDesc" disabled style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData()">保存</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
samplingInspectionPlanSearch, // 查询矩阵 |
||||
|
samplingInspectionPlanSave, // 新增矩阵 |
||||
|
samplingInspectionPlanUpdate, // 修改矩阵 |
||||
|
samplingInspectionPlanDelete, // 删除矩阵 |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu } from './qcBuUtils' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
watch: { |
||||
|
modalData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.modalData.samplingPlanNo = this.modalData.samplingPlanNo.toUpperCase() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
columnsProp:['createBy','samplingPlanActive','updateBy'], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "检验项目" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["检验项目"], |
||||
|
exportFooter: [], |
||||
|
exportList: [], |
||||
|
// 导出 end |
||||
|
// 条件查询对象 |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
samplingLevelDesc: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingPlanActive: '', |
||||
|
buDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
}, |
||||
|
// 分页对象 |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataList: [], |
||||
|
dataListLoading: false, |
||||
|
dataListSelections: [], |
||||
|
// 其它对象 |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
modalData: { |
||||
|
flag: '', |
||||
|
site: '', |
||||
|
bu: '', |
||||
|
samplingPlanNo: '', |
||||
|
samplingPlanDesc: '', |
||||
|
samplingQtyNo: '', |
||||
|
samplingQty: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
samplingQtyRankNo: '', |
||||
|
minQty: '', |
||||
|
maxQty: '', |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingPlanActive: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
}, |
||||
|
detailData: { |
||||
|
id: '', |
||||
|
site: '', |
||||
|
buNo: '', |
||||
|
samplingQtyRankNo: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingQtyNo: '', |
||||
|
samplingQty: '', |
||||
|
samplingPlanActive: '' |
||||
|
}, |
||||
|
// 展示标头 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableBuDesc', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingPlanNo', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingPlanNo', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '矩阵编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingPlanDesc', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingPlanDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '矩阵名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingQtyDesc', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingQtyDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '样本量字码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingQty', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '样本量', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingQtyRankDesc', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingQtyRankDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '批量级次', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableMinQty', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'minQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '最小抽样数', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 110, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableMaxQty', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'maxQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '最大抽样数', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 110, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingLevelDesc', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingLevelDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '抽样等级', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableSamplingPlanActive', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'samplingPlanActive', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '是否可用', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableCreateDate', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableCreateBy', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableUpdateDate', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301012, |
||||
|
serialNumber: '301012TableUpdateBy', |
||||
|
tableId: "301012Table", |
||||
|
tableName: "样本量字码矩阵表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
samplingPlanDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingPlanActiveType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyNoType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyRankNoType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyRankDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingLevelNoType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingLevelDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
bu:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
userBuList: [], |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 180 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 获取用户的 site 和 bu |
||||
|
this.getSiteAndBuByUserName() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table',1) |
||||
|
if (!this.authSearch) { |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 获取用户的bu |
||||
|
getSiteAndBuByUserName () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取数据列表 |
||||
|
getDataList () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
samplingInspectionPlanSearch(this.searchData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 多选 |
||||
|
selectionChangeHandle (val) { |
||||
|
this.dataListSelections = val |
||||
|
}, |
||||
|
|
||||
|
// 获取方法数据列表 |
||||
|
getBaseList (val,type) { |
||||
|
this.tagNo = val |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
let conSql = '' |
||||
|
if (this.modalData.bu === null || this.modalData.bu === '') { |
||||
|
this.$message.warning("请选择BU!") |
||||
|
return |
||||
|
} else { |
||||
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '*'" |
||||
|
} |
||||
|
if (val === 210) { |
||||
|
strVal = this.detailData.samplingQtyNo |
||||
|
} else if (val === 209) { |
||||
|
strVal = this.detailData.samplingQtyRankNo |
||||
|
} else if (val === 208) { |
||||
|
strVal = this.detailData.samplingLevelNo |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal, conSql) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 列表方法的回调 |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 210) { |
||||
|
this.modalData.samplingQtyNo = val.sampling_qty_no |
||||
|
this.modalData.samplingQtyDesc = val.sampling_qty_desc |
||||
|
} |
||||
|
if (this.tagNo === 209) { |
||||
|
this.modalData.samplingQtyRankNo = val.sampling_qty_rank_no |
||||
|
this.modalData.samplingQtyRankDesc = val.sampling_qty_rank_desc |
||||
|
} |
||||
|
if (this.tagNo === 208) { |
||||
|
this.modalData.samplingLevelNo = val.sampling_level_no |
||||
|
this.modalData.samplingLevelDesc = val.sampling_level_desc |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 新增 |
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
site: '', |
||||
|
bu: this.userBuList[0].buNo, |
||||
|
samplingPlanNo: '', |
||||
|
samplingQtyNo: '', |
||||
|
samplingQty: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
samplingQtyRankNo: '', |
||||
|
minQty: '', |
||||
|
maxQty: '', |
||||
|
samplingLevelNo: '', |
||||
|
samplingLevelDesc: '', |
||||
|
samplingPlanActive: 'Y', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改 |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
bu: buildQcBu(row.site), |
||||
|
site: row.site, |
||||
|
samplingPlanNo: row.samplingPlanNo, |
||||
|
samplingPlanDesc: row.samplingPlanDesc, |
||||
|
samplingQtyNo: row.samplingQtyNo, |
||||
|
samplingQty: row.samplingQty, |
||||
|
samplingQtyDesc: row.samplingQtyDesc, |
||||
|
samplingQtyRankDesc: row.samplingQtyRankDesc, |
||||
|
samplingQtyRankNo: row.samplingQtyRankNo, |
||||
|
minQty: row.minQty, |
||||
|
maxQty: row.maxQty, |
||||
|
samplingLevelNo: row.samplingLevelNo, |
||||
|
samplingLevelDesc: row.samplingLevelDesc, |
||||
|
samplingPlanActive: row.samplingPlanActive, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除 |
||||
|
deleteModal (row) { |
||||
|
this.$confirm(`是否删除这个矩阵?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
samplingInspectionPlanDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
saveData () { |
||||
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
||||
|
this.$message.warning('请选择BU!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingPlanDesc === '' || this.modalData.samplingPlanDesc == null) { |
||||
|
this.$message.warning('请输入矩阵名称!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyNo === '' || this.modalData.samplingQtyNo == null) { |
||||
|
this.$message.warning('请选择样本量编码!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyRankNo === '' || this.modalData.samplingQtyRankNo == null) { |
||||
|
this.$message.warning('请选择批量级次编码!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingLevelNo === '' || this.modalData.samplingLevelNo == null) { |
||||
|
this.$message.warning('请选择检验水平编码!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingPlanActive === '' || this.modalData.samplingPlanActive == null) { |
||||
|
this.$message.warning('请选择是否在用!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { |
||||
|
samplingInspectionPlanSave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
samplingInspectionPlanUpdate(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if (this.$route.meta.menuId === data.list[i].menuId) { |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//导出excel |
||||
|
async createExportData () { |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await samplingInspectionPlanSearch(this.searchData).then(({data}) => { |
||||
|
this.exportList = data.page.list |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload() {}, |
||||
|
|
||||
|
finishDownload() {}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList1 = [] |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList(tableId, columnId) { |
||||
|
let queryTable = { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
// this.showDefault = true. |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
1145
src/views/modules/qc/qcSamplingInspectionProgramme.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,759 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 条件查询 --> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData"> |
||||
|
<!-- <el-form-item :label="'BU'"> |
||||
|
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buDesc"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item :label="'样本量编码'"> |
||||
|
<el-input v-model="searchData.samplingQtyNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'样本量字码'"> |
||||
|
<el-input v-model="searchData.samplingQtyDesc" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'样本量'"> |
||||
|
<el-input v-model="searchData.samplingQty" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'"> |
||||
|
<el-select v-model="searchData.samplingQtyActive" style="width: 80px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ "导出" }} |
||||
|
</download-excel> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 展示列表 --> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> |
||||
|
<span v-else> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a> |
||||
|
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 新增和修改 --> |
||||
|
<el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px"> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu"> |
||||
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 390px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="样本量字码:" prop="samplingQtyDesc" :rules="rules.samplingQtyDescType"> |
||||
|
<el-input v-model="modalData.samplingQtyDesc" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="样本量:" prop="samplingQty" :rules="rules.samplingQtyType"> |
||||
|
<el-input v-model="modalData.samplingQty" type="number" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'" prop="samplingQtyActive" :rules="rules.samplingQtyActiveType"> |
||||
|
<el-select filterable v-model="modalData.samplingQtyActive" style="width: 120px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="样本量说明:"> |
||||
|
<el-input v-model="modalData.samplingQtyRemark" style="width: 390px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData()">保存</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
samplingQtySearch, // 查询样本量 |
||||
|
samplingQtySave, // 新增样本量 |
||||
|
samplingQtyUpdate, // 修改样本量 |
||||
|
samplingQtyDelete, // 删除样本量 |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu } from './qcBuUtils' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
export default { |
||||
|
watch: { |
||||
|
searchData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.searchData.samplingQtyDesc = this.searchData.samplingQtyDesc.toUpperCase() |
||||
|
} |
||||
|
}, |
||||
|
modalData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.modalData.samplingQtyDesc = this.modalData.samplingQtyDesc.toUpperCase() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
columnsProp:['createBy', 'samplingQtyActive', 'updateBy'], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "样本量" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["样本量"], |
||||
|
exportFooter: [], |
||||
|
exportList: [], |
||||
|
// 导出 end |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
samplingQtyNo: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingQty: '', |
||||
|
samplingQtyActive: '', |
||||
|
buDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataList: [], |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
modalData: { |
||||
|
flag: '', |
||||
|
site: '', |
||||
|
bu: '', |
||||
|
samplingQtyNo: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingQty: '', |
||||
|
samplingQtyRemark: '', |
||||
|
samplingQtyActive: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
}, |
||||
|
// 标头展示 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableBuDesc', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableSamplingQtyNo', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'samplingQtyNo', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '样本量编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableSamplingQtyDesc', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'samplingQtyDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '样本量字码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableSamplingQty', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'samplingQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '样本量', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableSamplingQtyRemark', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'samplingQtyRemark', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '样本量说明', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableSamplingQtyActive', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'samplingQtyActive', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '是否可用', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableCreateDate', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableCreateBy', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableUpdateDate', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301009, |
||||
|
serialNumber: '301009TableUpdateBy', |
||||
|
tableId: "301009Table", |
||||
|
tableName: "样本大小表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
samplingQtyDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyActiveType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
bu:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
userBuList: [], |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 180 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 获取用户的 site 和 bu |
||||
|
this.getSiteAndBuByUserName() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table',1) |
||||
|
if (!this.authSearch) { |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
// 获取用户的bu |
||||
|
getSiteAndBuByUserName () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 查询获取数据列表 |
||||
|
getDataList () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
samplingQtySearch(this.searchData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增按钮 |
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
site: '', |
||||
|
bu: this.userBuList[0].buNo, |
||||
|
samplingQtyNo: '', |
||||
|
samplingQtyDesc: '', |
||||
|
samplingQty: '', |
||||
|
samplingQtyRemark: '', |
||||
|
samplingQtyActive: 'Y', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改按钮 |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
bu: buildQcBu(row.site), |
||||
|
site: row.site, |
||||
|
samplingQtyNo: row.samplingQtyNo, |
||||
|
samplingQtyDesc: row.samplingQtyDesc, |
||||
|
samplingQty: row.samplingQty, |
||||
|
samplingQtyRemark: row.samplingQtyRemark, |
||||
|
samplingQtyActive: row.samplingQtyActive, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除方法 |
||||
|
deleteModal (row) { |
||||
|
this.$confirm(`是否删除这个样本量?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
samplingQtyDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增/修改方法 |
||||
|
saveData () { |
||||
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
||||
|
this.$message.warning('请选择BU!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyDesc === '' || this.modalData.samplingQtyDesc == null) { |
||||
|
this.$message.warning('请输入样本量字码!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQty === '' || this.modalData.samplingQty == null) { |
||||
|
this.$message.warning('请输入样本量!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyActive === '' || this.modalData.samplingQtyActive == null) { |
||||
|
this.$message.warning('请选择是否在用!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { // 新增 |
||||
|
samplingQtySave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { // 修改 |
||||
|
samplingQtyUpdate(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if (this.$route.meta.menuId === data.list[i].menuId) { |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 导出excel |
||||
|
async createExportData () { |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await samplingQtySearch(this.searchData).then(({data}) => { |
||||
|
this.exportList = data.rows |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload () {}, |
||||
|
|
||||
|
finishDownload () {}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList1 = [] |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable = { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
// this.showDefault = true. |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -0,0 +1,794 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<!-- 条件查询 --> |
||||
|
<el-form :inline="true" label-position="top" :model="searchData"> |
||||
|
<!-- <el-form-item :label="'BU'"> |
||||
|
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.buDesc" |
||||
|
:value = "i.buDesc"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item :label="'批量级次编码'"> |
||||
|
<el-input v-model="searchData.samplingQtyRankNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'批量级次名称'"> |
||||
|
<el-input v-model="searchData.samplingQtyRankDesc" clearable style="width: 200px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'"> |
||||
|
<el-select v-model="searchData.samplingQtyRankActive" style="width: 80px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button> |
||||
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ "导出" }} |
||||
|
</download-excel> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- 展示列表 --> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed==''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> |
||||
|
<span v-else> |
||||
|
{{ scope.row[item.columnProp] }} |
||||
|
</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="160" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a> |
||||
|
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 新增和修改 --> |
||||
|
<el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu"> |
||||
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 456px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="批量级次名称:" prop="samplingQtyRankDesc" :rules="rules.samplingQtyRankDescType"> |
||||
|
<el-input v-model="modalData.samplingQtyRankDesc" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否可用'" prop="samplingQtyRankActive" :rules="rules.samplingQtyRankActiveType"> |
||||
|
<el-select filterable v-model="modalData.samplingQtyRankActive" style="width: 221px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="最小抽样量:" prop="minQty" :rules="rules.minQtyType"> |
||||
|
<el-input class="numInput" v-model="modalData.minQty" @input="handleInput(modalData.minQty,1)" type="number" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="最大抽样量:" prop="maxQty" :rules="rules.maxQtyType"> |
||||
|
<el-input class="numInput" v-model="modalData.maxQty" @input="handleInput(modalData.maxQty,2)" type="number" style="width: 221px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="备注说明:"> |
||||
|
<el-input v-model="modalData.samplingQtyRankRemark" style="width: 456px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveData()">保存</el-button> |
||||
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
samplingQtyRankSearch, // 查询批量级次 |
||||
|
samplingQtyRankSave, // 新增批量级次 |
||||
|
samplingQtyRankUpdate, // 修改批量级次 |
||||
|
samplingQtyRankDelete, // 删除批量级次 |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu } from './qcBuUtils' |
||||
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
columnsProp:['createBy', 'samplingQtyRankActive', 'updateBy'], |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: "批量级次" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["批量级次"], |
||||
|
exportFooter: [], |
||||
|
exportList: [], |
||||
|
// 导出 end |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
userName: this.$store.state.user.name, |
||||
|
samplingQtyRankNo: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
samplingQtyRankActive: '', |
||||
|
buDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
height: 200, |
||||
|
dataList: [], |
||||
|
dataListLoading: false, |
||||
|
modalFlag: false, |
||||
|
modalDisableFlag: false, |
||||
|
modalData: { |
||||
|
flag: '', |
||||
|
site: '', |
||||
|
bu: '', |
||||
|
samplingQtyRankNo: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
minQty: '', |
||||
|
maxQty: '', |
||||
|
samplingQtyRankRemark: '', |
||||
|
samplingQtyRankActive: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
}, |
||||
|
// 标头展示 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableBuDesc', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableSamplingQtyRankNo', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'samplingQtyRankNo', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '批量级次编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableSamplingQtyRankDesc', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'samplingQtyRankDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '批量级次名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableMinQty', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'minQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '最小抽样量', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableMaxQty', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'maxQty', |
||||
|
headerAlign: 'center', |
||||
|
align: "right", |
||||
|
columnLabel: '最大抽样量', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableSamplingQtyRankRemark', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'samplingQtyRankRemark', |
||||
|
headerAlign: 'center', |
||||
|
align: "left", |
||||
|
columnLabel: '备注说明', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableSamplingQtyRankActive', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'samplingQtyRankActive', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '是否可用', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableCreateDate', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableCreateBy', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableUpdateDate', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 170, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 301010, |
||||
|
serialNumber: '301010TableUpdateBy', |
||||
|
tableId: "301010Table", |
||||
|
tableName: "批量级次表", |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: "center", |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
samplingQtyRankDescType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
samplingQtyRankActiveType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
minQtyType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
maxQtyType:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
bu:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
userBuList: [], |
||||
|
authSearch: false, |
||||
|
authSave: false, |
||||
|
authUpdate: false, |
||||
|
authDelete: false, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 180 |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 获取用户的 site 和 bu |
||||
|
this.getSiteAndBuByUserName() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 动态列 |
||||
|
this.getTableUserColumn(this.$route.meta.menuId+'table',1) |
||||
|
if (!this.authSearch) { |
||||
|
// 获取数据列表 |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 获取用户的bu |
||||
|
getSiteAndBuByUserName () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// ======= 正则校验 ======= |
||||
|
handleInput (value, type) { |
||||
|
// 大于等于0,且只能输入4位小数 |
||||
|
let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') |
||||
|
// if (val === null || val === undefined || val === '') { |
||||
|
// val = 0 |
||||
|
// } |
||||
|
if (type === 1) { |
||||
|
this.modalData.minQty = val |
||||
|
} else if (type === 2) { |
||||
|
this.modalData.maxQty = val |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
|
||||
|
// 查询获取数据列表 |
||||
|
getDataList () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
samplingQtyRankSearch(this.searchData).then(({data}) => { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增按钮 |
||||
|
addModal () { |
||||
|
this.modalData = { |
||||
|
flag: '1', |
||||
|
bu: this.userBuList[0].buNo, |
||||
|
site: '', |
||||
|
samplingQtyRankNo: '', |
||||
|
samplingQtyRankDesc: '', |
||||
|
minQty: '', |
||||
|
maxQty: '', |
||||
|
samplingQtyRankRemark: '', |
||||
|
samplingQtyRankActive: 'Y', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = false |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改按钮 |
||||
|
updateModal (row) { |
||||
|
this.modalData = { |
||||
|
flag: '2', |
||||
|
bu: buildQcBu(row.site), |
||||
|
site: row.site, |
||||
|
samplingQtyRankNo: row.samplingQtyRankNo, |
||||
|
samplingQtyRankDesc: row.samplingQtyRankDesc, |
||||
|
minQty: row.minQty, |
||||
|
maxQty: row.maxQty, |
||||
|
samplingQtyRankRemark: row.samplingQtyRankRemark, |
||||
|
samplingQtyRankActive: row.samplingQtyRankActive, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name |
||||
|
} |
||||
|
this.modalDisableFlag = true |
||||
|
this.modalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除方法 |
||||
|
deleteModal (row) { |
||||
|
this.$confirm(`是否删除这个批量级次?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
samplingQtyRankDelete(row).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增/修改方法 |
||||
|
saveData () { |
||||
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
||||
|
this.$message.warning('请选择BU!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyRankDesc === '' || this.modalData.samplingQtyRankDesc == null) { |
||||
|
this.$message.warning('请输入批量级次名称!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.minQty === '' || this.modalData.minQty == null) { |
||||
|
this.$message.warning('请输入最小抽样量!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.maxQty === '' || this.modalData.maxQty == null) { |
||||
|
this.$message.warning('请输入最大抽样量!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.samplingQtyRankActive === '' || this.modalData.samplingQtyRankActive == null) { |
||||
|
this.$message.warning('请选择是否在用!') |
||||
|
return |
||||
|
} |
||||
|
if (this.modalData.flag === '1') { // 新增 |
||||
|
samplingQtyRankSave(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { // 修改 |
||||
|
samplingQtyRankUpdate(this.modalData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getDataList() |
||||
|
this.modalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if (this.$route.meta.menuId === data.list[i].menuId) { |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//导出excel |
||||
|
async createExportData () { |
||||
|
this.searchData.limit = -1 |
||||
|
this.searchData.page = 1 |
||||
|
await samplingQtyRankSearch(this.searchData).then(({data}) => { |
||||
|
this.exportList= data.page.list |
||||
|
}) |
||||
|
return this.exportList |
||||
|
}, |
||||
|
|
||||
|
startDownload() {}, |
||||
|
|
||||
|
finishDownload() {}, |
||||
|
|
||||
|
fields () { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
|
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn (tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList1 = [] |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList (tableId, columnId) { |
||||
|
let queryTable= { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columnList = data.rows |
||||
|
break; |
||||
|
// case 2: |
||||
|
// this.columnDetailList = data.rows |
||||
|
// break; |
||||
|
// case 3: |
||||
|
// this.columnList2 = data.rows |
||||
|
// break; |
||||
|
// case 4: |
||||
|
// this.columnList3 = data.rows |
||||
|
// break; |
||||
|
} |
||||
|
} else { |
||||
|
// this.showDefault = true. |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.numInput /deep/ .el-input__inner{ |
||||
|
text-align: right; |
||||
|
} |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
1901
src/views/modules/qc/qcTemplate.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,142 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="pageData.titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label="检验单号:" > |
||||
|
<el-input v-model="pageData.inspectionNo" style="width: 120px;" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-upload class="customer-upload" drag multiple :file-list="fileList" |
||||
|
action="javascript:void(0);" ref="uploadFile" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
||||
|
accept="*" :auto-upload="false" |
||||
|
style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24" style="margin-bottom: 30px;"> |
||||
|
<el-form-item class="customer-item" label="备注:"> |
||||
|
<el-input type="textarea" style="width: 360px;" placeholder="请输入内容" v-model="pageData.fileRemark"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUploadFile">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
uploadEamObjectFile, |
||||
|
} from '@/api/eam/com_eam_object_upload_file.js'; |
||||
|
|
||||
|
/* 引入组件 */ |
||||
|
var functionId = 'C10000002' |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
folder: '', |
||||
|
visible: false, |
||||
|
userId: this.$store.state.user.name, |
||||
|
fileList: [], |
||||
|
pageData: { |
||||
|
titleCon: '', |
||||
|
site: '', |
||||
|
buNo: '', |
||||
|
username: this.$store.state.user.name, |
||||
|
inspectionNo: '', |
||||
|
fileRemark: '', |
||||
|
folder: '', |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
//初始化组件的参数 |
||||
|
init (currentRow) { |
||||
|
//初始化参数 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
||||
|
this.folder = this.pageData.folder |
||||
|
//打开页面 |
||||
|
this.visible = true |
||||
|
//重置人员信息 |
||||
|
this.pageData.username = this.userId |
||||
|
}, |
||||
|
// 上传之前 |
||||
|
beforeUploadHandle (file) { |
||||
|
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
||||
|
// this.$message.error('只支持图片和PDF文档!') |
||||
|
// return false |
||||
|
// } |
||||
|
// this.num++ |
||||
|
}, |
||||
|
// 选择上传文件时 |
||||
|
onChange (file, fileList) { |
||||
|
this.fileList = fileList |
||||
|
}, |
||||
|
// 关闭modal |
||||
|
closeDialog () { |
||||
|
this.fileList = [] |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
// 刷新报工的页面 |
||||
|
this.$emit('refreshPageTables') |
||||
|
//关闭当前的页面 |
||||
|
this.visible = false |
||||
|
}, |
||||
|
// 保修当前的数据 |
||||
|
saveUploadFile () { |
||||
|
let remark = this.pageData.fileRemark |
||||
|
if (null === remark || remark === undefined) { |
||||
|
remark = '' |
||||
|
} |
||||
|
// 判断文件是否上传 |
||||
|
if (null == this.fileList || 0 === this.fileList.length) { |
||||
|
this.$message.error("请先上传文件!") |
||||
|
return false |
||||
|
} |
||||
|
const formData = new FormData() |
||||
|
// 片接文件 |
||||
|
for (let i = 0; i < this.fileList.length; i++) { |
||||
|
formData.append("file",this.fileList[i].raw) |
||||
|
} |
||||
|
formData.append("folder", this.folder) |
||||
|
formData.append("site", this.pageData.site) |
||||
|
formData.append("objectID", this.pageData.inspectionNo) |
||||
|
formData.append("remark", remark) |
||||
|
formData.append("orderRef4", this.pageData.buNo) |
||||
|
uploadEamObjectFile(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
//清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
this.pageData.fileRemark = '' |
||||
|
this.fileList = [] |
||||
|
// 刷新报工的页面 |
||||
|
this.$emit('refreshPageTables') |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,142 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="pageData.titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label="物料编码" > |
||||
|
<el-input v-model="pageData.partNo" style="width: 120px;" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="检验类型"> |
||||
|
<el-select v-model="pageData.inspectionTypeNo" placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for = "i in pageData.options" |
||||
|
:key = "i.inspectionTypeNo" |
||||
|
:label = "i.inspectionTypeName" |
||||
|
:value = "i.inspectionTypeNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-upload class="customer-upload" drag multiple :file-list="fileList" |
||||
|
action="javascript:void(0);" ref="uploadFile" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
||||
|
accept="*" :auto-upload="false" |
||||
|
style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUploadFile">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
uploadSopFile, |
||||
|
} from '@/api/qc/qc.js' |
||||
|
|
||||
|
/* 引入组件 */ |
||||
|
var functionId = 'C10000002' |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
folder: '', |
||||
|
visible: false, |
||||
|
userId: this.$store.state.user.name, |
||||
|
fileList: [], |
||||
|
pageData: { |
||||
|
titleCon: '', |
||||
|
site: '', |
||||
|
buNo: '', |
||||
|
createBy: '', |
||||
|
partNo: '', |
||||
|
inspectionTypeNo: '', |
||||
|
options: [] |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 初始化组件的参数 |
||||
|
init (currentRow) { |
||||
|
// 初始化参数 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
||||
|
// 打开页面 |
||||
|
this.visible = true |
||||
|
}, |
||||
|
// 上传之前 |
||||
|
beforeUploadHandle (file) { |
||||
|
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
||||
|
// this.$message.error('只支持图片和PDF文档!') |
||||
|
// return false |
||||
|
// } |
||||
|
// this.num++ |
||||
|
}, |
||||
|
/* 选择上传文件时 */ |
||||
|
onChange (file, fileList) { |
||||
|
this.fileList = fileList |
||||
|
}, |
||||
|
/* 关闭modal */ |
||||
|
closeDialog () { |
||||
|
this.fileList = [] |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
// 刷新报工的页面 |
||||
|
this.$emit('refreshPageTables') |
||||
|
// 关闭当前的页面 |
||||
|
this.visible = false |
||||
|
}, |
||||
|
/* 保修当前的数据 */ |
||||
|
saveUploadFile () { |
||||
|
/* 判断文件是否上传 */ |
||||
|
if (null == this.fileList || 0 === this.fileList.length) { |
||||
|
this.$message.error("请先上传文件!") |
||||
|
return false |
||||
|
} |
||||
|
/* 判断检验类型是否选择 */ |
||||
|
if (this.pageData.inspectionTypeNo === null || this.pageData.inspectionTypeNo === '') { |
||||
|
this.$message.error("请选择检验类型!") |
||||
|
return false |
||||
|
} |
||||
|
const formData = new FormData() |
||||
|
// 片接文件 |
||||
|
for (let i = 0; i < this.fileList.length; i++) { |
||||
|
formData.append("file",this.fileList[i].raw) |
||||
|
} |
||||
|
formData.append("orderRef1", this.pageData.site) |
||||
|
formData.append("orderRef2", this.pageData.partNo) |
||||
|
formData.append("orderRef3", this.pageData.inspectionTypeNo) |
||||
|
formData.append("createBy", this.pageData.createBy) |
||||
|
formData.append("orderRef4", this.pageData.buNo) |
||||
|
uploadSopFile(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
this.fileList = [] |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button> |
||||
|
<!-- <el-form-item label="BU"> |
||||
|
<el-select v-model="bu" placeholder="请选择" style="width: 295px"> |
||||
|
<el-option |
||||
|
v-for = "i in userBuList" |
||||
|
:key = "i.buNo" |
||||
|
:label = "i.sitename" |
||||
|
:value = "i.buNo"> |
||||
|
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
||||
|
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;"> |
||||
|
{{ i.buDesc }} |
||||
|
</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUploadFile()">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
uploadExcel, // 导入项目文件 |
||||
|
uploadTemplateExcel, // 导入模板文件 |
||||
|
uploadPartAttributeExcel, // 导入物料属性文件 |
||||
|
uploadFamilyAttributeExcel, // 导入类别属性文件 |
||||
|
queryFileId, // 查询文件ID |
||||
|
getSiteAndBuByUserName |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { buildQcBu, parseQcBu } from './qcBuUtils' |
||||
|
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js' |
||||
|
import axios from 'axios' |
||||
|
import Vue from 'vue' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '文件导入', |
||||
|
visible: false, |
||||
|
fileList: [], |
||||
|
bu: '', |
||||
|
userBuList:[], |
||||
|
pageData: { |
||||
|
flag: '', |
||||
|
createBy: '', |
||||
|
site: '' |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getSiteAndBu(); |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取用户的bu |
||||
|
getSiteAndBu () { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
//初始化组件的参数 |
||||
|
init(currentRow) { |
||||
|
// 获得类别 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
||||
|
this.bu = buildQcBu(this.pageData.site || this.$store.state.user.site) |
||||
|
//打开页面 |
||||
|
this.visible = true; |
||||
|
}, |
||||
|
// 上传之前 |
||||
|
beforeUploadHandle(file) { |
||||
|
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase() |
||||
|
if (!(extName === '.xlsx' || extName === '.xls')) { |
||||
|
this.$message.error('数据导入失败,请选择正确的xlsx模板文件') |
||||
|
return false |
||||
|
} |
||||
|
}, |
||||
|
/*选择上传文件时*/ |
||||
|
onChange(file){ |
||||
|
this.fileList.push(file); |
||||
|
}, |
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.fileList = []; |
||||
|
// 刷新报工的页面 |
||||
|
this.$emit('refreshPageTables'); |
||||
|
// 关闭当前的页面 |
||||
|
this.visible = false; |
||||
|
}, |
||||
|
/*保修当前的数据*/ |
||||
|
saveUploadFile(){ |
||||
|
if (this.bu==''||this.bu == null){ |
||||
|
this.$message.warning("请选择BU!"); |
||||
|
return false; |
||||
|
} |
||||
|
/*判断文件是否上传*/ |
||||
|
if(null == this.fileList || 0 == this.fileList.length){ |
||||
|
this.$message.error("请先上传文件!"); |
||||
|
return false; |
||||
|
} |
||||
|
const formData = new FormData(); |
||||
|
formData.append("file", this.fileList[0].raw); |
||||
|
formData.append("createBy", this.pageData.createBy); |
||||
|
formData.append("site", buildQcBu(parseQcBu(this.bu).site)); |
||||
|
if (this.pageData.flag === 'item'){ |
||||
|
uploadExcel(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg); |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles(); |
||||
|
// 关闭窗口并刷新页面 |
||||
|
this.closeDialog(); |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
} else if (this.pageData.flag === 'template'){ |
||||
|
formData.set('site',this.bu) |
||||
|
uploadTemplateExcel(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg); |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles(); |
||||
|
// 关闭窗口并刷新页面 |
||||
|
this.closeDialog(); |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}else if (this.pageData.flag === 'partAttribute'){ |
||||
|
formData.set('site',this.bu) |
||||
|
uploadPartAttributeExcel(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg); |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles(); |
||||
|
// 关闭窗口并刷新页面 |
||||
|
this.closeDialog(); |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
}else if (this.pageData.flag === 'familyAttribute'){ |
||||
|
uploadFamilyAttributeExcel(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg); |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles(); |
||||
|
// 关闭窗口并刷新页面 |
||||
|
this.closeDialog(); |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
this.bu = ''; |
||||
|
}, |
||||
|
// 下载 |
||||
|
async downloadFile(){ |
||||
|
let file = { |
||||
|
id: 0, |
||||
|
fileName: '' |
||||
|
} |
||||
|
let tempData = { |
||||
|
orderRef1: '', |
||||
|
orderRef2: '' |
||||
|
} |
||||
|
if(this.pageData.flag === 'item'){ // 检验项目 |
||||
|
tempData.orderRef1 = 'qc'; |
||||
|
tempData.orderRef2 = 'itemFormat'; |
||||
|
await queryFileId(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
file.id = data.data.id |
||||
|
file.fileName = data.data.fileName |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}else if (this.pageData.flag === 'template'){ // 检验模板 |
||||
|
tempData.orderRef1 = 'qc'; |
||||
|
tempData.orderRef2 = 'templateFormat'; |
||||
|
await queryFileId(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
file.id = data.data.id |
||||
|
file.fileName = data.data.fileName |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}else if (this.pageData.flag === 'partAttribute'){ // 物料属性设置 |
||||
|
tempData.orderRef1 = 'qc'; |
||||
|
tempData.orderRef2 = 'partAttributeFormat'; |
||||
|
await queryFileId(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
file.id = data.data.id |
||||
|
file.fileName = data.data.fileName |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}else if (this.pageData.flag === 'familyAttribute'){ // 类别属性设置 |
||||
|
tempData.orderRef1 = 'qc'; |
||||
|
tempData.orderRef2 = 'familyAttributeFormat'; |
||||
|
await queryFileId(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
file.id = data.data.id |
||||
|
file.fileName = data.data.fileName |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
await downLoadObjectFile(file).then(({data}) => { |
||||
|
// 不限制文件下载类型 |
||||
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
||||
|
// 下载文件名称 |
||||
|
const fileName = file.fileName |
||||
|
// a标签下载 |
||||
|
const linkNode = document.createElement('a') |
||||
|
// a标签的download属性规定下载文件的名称 |
||||
|
linkNode.download = fileName |
||||
|
linkNode.style.display = 'none' |
||||
|
// 生成一个Blob URL |
||||
|
linkNode.href = URL.createObjectURL(blob) |
||||
|
document.body.appendChild(linkNode) |
||||
|
// 模拟在按钮上的一次鼠标单击 |
||||
|
linkNode.click() |
||||
|
// 释放URL 对象 |
||||
|
URL.revokeObjectURL(linkNode.href) |
||||
|
document.body.removeChild(linkNode) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
||||
@ -0,0 +1,165 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="saveUploadFile()">保存</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
subDetailUpload, // 子明细批量导入 |
||||
|
queryFileId, // 查询文件ID |
||||
|
} from "@/api/qc/qc.js" |
||||
|
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js' |
||||
|
import axios from 'axios' |
||||
|
import Vue from 'vue' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '文件导入', |
||||
|
visible: false, |
||||
|
fileList: [], |
||||
|
pageData: { |
||||
|
flag: '', |
||||
|
site: '', |
||||
|
buNo: '', |
||||
|
inspectionNo: '' |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
//初始化组件的参数 |
||||
|
init (currentRow) { |
||||
|
// 获得类别 |
||||
|
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
||||
|
//打开页面 |
||||
|
this.visible = true |
||||
|
}, |
||||
|
|
||||
|
// 上传之前 |
||||
|
beforeUploadHandle (file) { |
||||
|
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase() |
||||
|
if (!(extName === '.xlsx' || extName === '.xls')) { |
||||
|
this.$message.error('数据导入失败,请选择正确的xlsx模板文件') |
||||
|
return false |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 选择上传文件时 |
||||
|
onChange (file) { |
||||
|
this.fileList.push(file) |
||||
|
}, |
||||
|
|
||||
|
// 关闭modal |
||||
|
closeDialog () { |
||||
|
this.fileList = [] |
||||
|
// 刷新报工的页面 |
||||
|
//this.$emit('refreshPageTables') |
||||
|
// 关闭当前的页面 |
||||
|
this.visible = false |
||||
|
}, |
||||
|
|
||||
|
// 保修当前的数据 |
||||
|
saveUploadFile () { |
||||
|
// 判断文件是否上 |
||||
|
if (null == this.fileList || 0 === this.fileList.length) { |
||||
|
this.$message.error("请先上传文件!") |
||||
|
return false |
||||
|
} |
||||
|
const formData = new FormData() |
||||
|
formData.append("file", this.fileList[0].raw) |
||||
|
formData.append("flag", this.pageData.flag) |
||||
|
formData.append("site", this.pageData.site) |
||||
|
formData.append("buNo", this.pageData.buNo) |
||||
|
formData.append("inspectionNo", this.pageData.inspectionNo) |
||||
|
subDetailUpload(formData).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
// 返回超出上下限的数量 |
||||
|
this.$emit("changeEvent", data.countMap) |
||||
|
this.$message.success(data.msg) |
||||
|
// 清空文件上传记录 |
||||
|
this.$refs.uploadFile.clearFiles() |
||||
|
// 关闭窗口并刷新页面 |
||||
|
//this.closeDialog() |
||||
|
this.fileList = [] |
||||
|
this.visible = false |
||||
|
} else { |
||||
|
let message = data.msg.split(';') |
||||
|
this.$alert(message[0] + '<br/>' + message[1], '导入失败', { |
||||
|
confirmButtonText: '确定', |
||||
|
dangerouslyUseHTMLString: true |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 下载 |
||||
|
async downloadFile () { |
||||
|
let file = { |
||||
|
id: 0, |
||||
|
fileName: '' |
||||
|
} |
||||
|
let tempData = { |
||||
|
orderRef1: 'qc', |
||||
|
orderRef2: 'subDetailUpload' |
||||
|
} |
||||
|
await queryFileId(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
file.id = data.data.id |
||||
|
file.fileName = data.data.fileName |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
await downLoadObjectFile(file).then(({data}) => { |
||||
|
// 不限制文件下载类型 |
||||
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
||||
|
// 下载文件名称 |
||||
|
const fileName = file.fileName |
||||
|
// a标签下载 |
||||
|
const linkNode = document.createElement('a') |
||||
|
// a标签的download属性规定下载文件的名称 |
||||
|
linkNode.download = fileName |
||||
|
linkNode.style.display = 'none' |
||||
|
// 生成一个Blob URL |
||||
|
linkNode.href = URL.createObjectURL(blob) |
||||
|
document.body.appendChild(linkNode) |
||||
|
// 模拟在按钮上的一次鼠标单击 |
||||
|
linkNode.click() |
||||
|
// 释放URL 对象 |
||||
|
URL.revokeObjectURL(linkNode.href) |
||||
|
document.body.removeChild(linkNode) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 点击 X 关闭对话框的回调 |
||||
|
**/ |
||||
|
handleDialogClose () { |
||||
|
this.fileList = [] |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue