22 changed files with 15181 additions and 0 deletions
-
231src/api/qc/qc.js
-
25src/api/qc/qcPrint.js
-
27src/api/qc/qc_report.js
-
51src/views/modules/common/QrCode.vue
-
124src/views/modules/qc/QCReportFileTable.vue
-
452src/views/modules/qc/UserDefaultOperation.vue
-
657src/views/modules/qc/qcDeviceMaintenance.vue
-
1492src/views/modules/qc/qcFamilyAttribute.vue
-
482src/views/modules/qc/qcInspector.vue
-
1616src/views/modules/qc/qcItem.vue
-
754src/views/modules/qc/qcMethod.vue
-
2268src/views/modules/qc/qcPartAttribute.vue
-
707src/views/modules/qc/qcSamplingInspectionLevel.vue
-
975src/views/modules/qc/qcSamplingInspectionPlan.vue
-
1155src/views/modules/qc/qcSamplingInspectionProgramme.vue
-
784src/views/modules/qc/qcSamplingInspectionQty.vue
-
803src/views/modules/qc/qcSamplingInspectionQtyRank.vue
-
1866src/views/modules/qc/qcTemplate.vue
-
142src/views/modules/qc/qc_FAI_upload_file.vue
-
142src/views/modules/qc/qc_SOP_upload_file.vue
-
263src/views/modules/qc/qc_upload.vue
-
165src/views/modules/qc/sub_detail_upload.vue
@ -0,0 +1,231 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
// ===================================== 检验方法 =====================================
|
|||
export const qcMethodSearch = data => createAPI(`/pms/qc/qcMethodSearch`,'post',data) |
|||
export const qcMethodSave = data => createAPI(`/pms/qc/qcMethodSave`,'post',data) |
|||
export const qcMethodUpdate = data => createAPI(`/pms/qc/qcMethodUpdate`,'post',data) |
|||
export const qcMethodDelete = data => createAPI(`/pms/qc/qcMethodDelete`,'post',data) |
|||
|
|||
// ===================================== 检验项目 =====================================
|
|||
export const qcItemSearch = data => createAPI(`/pms/qc/qcItemSearch`,'post',data) |
|||
export const qcItemSave = data => createAPI(`/pms/qc/qcItemSave`,'post',data) |
|||
export const qcItemUpdate = data => createAPI(`/pms/qc/qcItemUpdate`,'post',data) |
|||
export const qcItemDelete = data => createAPI(`/pms/qc/qcItemDelete`,'post',data) |
|||
export const uploadExcel = data => createAPI(`/pms/qc/uploadExcel`,'post',data) |
|||
export const getItemLists= data => createAPI(`/pms/qc/getItemLists`,'post',data) |
|||
export const subDetailUpload= data => createAPI(`/pms/qc/subDetailUpload`,'post',data) |
|||
export const queryMethodList= data => createAPI(`/pms/qc/queryMethodList`,'post',data) |
|||
|
|||
// ===================================== 质检员信息 =====================================
|
|||
export const inspectorSearch = data => createAPI(`/pms/qc/inspectorSearch`,'post',data) |
|||
export const inspectorSave = data => createAPI(`/pms/qc/inspectorSave`,'post',data) |
|||
export const inspectorUpdate = data => createAPI(`/pms/qc/inspectorUpdate`,'post',data) |
|||
export const inspectorDelete = data => createAPI(`/pms/qc/inspectorDelete`,'post',data) |
|||
|
|||
// ===================================== 检验模板 =====================================
|
|||
export const templateSearch = data => createAPI(`/pms/qc/templateSearch`,'post',data) |
|||
export const templateSave = data => createAPI(`/pms/qc/templateSave`,'post',data) |
|||
export const templateUpdate = data => createAPI(`/pms/qc/templateUpdate`,'post',data) |
|||
export const templateDelete = data => createAPI(`/pms/qc/templateDelete`,'post',data) |
|||
export const inspectionTypeSearch = data => createAPI(`/pms/qc/inspectionTypeSearch`,'post',data) |
|||
export const objectSearch = data => createAPI(`/pms/qc/objectSearch`,'post',data) |
|||
export const templateDetailsSearch = data => createAPI(`/pms/qc/templateDetailsSearch`,'post',data) |
|||
export const addItemDetails = data => createAPI(`/pms/qc/addItemDetails`,'post',data) |
|||
export const getItemList = data => createAPI(`/pms/qc/getItemList`,'post',data) |
|||
export const delItemDetails = data => createAPI(`/pms/qc/delItemDetails`,'post',data) |
|||
export const uploadTemplateExcel = data => createAPI(`/pms/qc/uploadTemplateExcel`,'post',data) |
|||
export const saveItemDetailed = data => createAPI(`/pms/qc/saveItemDetailed`,'post',data) |
|||
export const getItem = data => createAPI(`/pms/qc/getItem`,'post',data) |
|||
|
|||
// ===================================== 样本量 =====================================
|
|||
export const samplingQtySearch = data => createAPI(`/pms/qc/samplingQtySearch`,'post',data) |
|||
export const samplingQtySave = data => createAPI(`/pms/qc/samplingQtySave`,'post',data) |
|||
export const samplingQtyUpdate = data => createAPI(`/pms/qc/samplingQtyUpdate`,'post',data) |
|||
export const samplingQtyDelete = data => createAPI(`/pms/qc/samplingQtyDelete`,'post',data) |
|||
|
|||
// ===================================== 批量级次 =====================================
|
|||
export const samplingQtyRankSearch = data => createAPI(`/pms/qc/samplingQtyRankSearch`,'post',data) |
|||
export const samplingQtyRankSave = data => createAPI(`/pms/qc/samplingQtyRankSave`,'post',data) |
|||
export const samplingQtyRankUpdate = data => createAPI(`/pms/qc/samplingQtyRankUpdate`,'post',data) |
|||
export const samplingQtyRankDelete = data => createAPI(`/pms/qc/samplingQtyRankDelete`,'post',data) |
|||
|
|||
// ===================================== 检验等级 =====================================
|
|||
export const samplingLevelSearch = data => createAPI(`/pms/qc/samplingLevelSearch`,'post',data) |
|||
export const samplingLevelSave = data => createAPI(`/pms/qc/samplingLevelSave`,'post',data) |
|||
export const samplingLevelUpdate = data => createAPI(`/pms/qc/samplingLevelUpdate`,'post',data) |
|||
export const samplingLevelDelete = data => createAPI(`/pms/qc/samplingLevelDelete`,'post',data) |
|||
|
|||
// ===================================== 样本量字码矩阵 =====================================
|
|||
export const samplingInspectionPlanSearch = data => createAPI(`/pms/qc/samplingInspectionPlanSearch`,'post',data) |
|||
export const samplingInspectionPlanSave = data => createAPI(`/pms/qc/samplingInspectionPlanSave`,'post',data) |
|||
export const samplingInspectionPlanUpdate = data => createAPI(`/pms/qc/samplingInspectionPlanUpdate`,'post',data) |
|||
export const samplingInspectionPlanDelete = data => createAPI(`/pms/qc/samplingInspectionPlanDelete`,'post',data) |
|||
|
|||
// ===================================== 抽样方案 =====================================
|
|||
export const samplingProgrammeSearch = data => createAPI(`/pms/qc/samplingProgrammeSearch`,'post',data) |
|||
export const samplingProgrammeSave = data => createAPI(`/pms/qc/samplingProgrammeSave`,'post',data) |
|||
export const samplingProgrammeDelete = data => createAPI(`/pms/qc/samplingProgrammeDelete`,'post',data) |
|||
export const searchSamplingProgrammeDetails = data => createAPI(`/pms/qc/searchSamplingProgrammeDetails`,'post',data) |
|||
export const saveSamplingProgrammeDetails = data => createAPI(`/pms/qc/saveSamplingProgrammeDetails`,'post',data) |
|||
export const deleteSamplingProgrammeDetails = data => createAPI(`/pms/qc/deleteSamplingProgrammeDetails`,'post',data) |
|||
export const getPlanLists = data => createAPI(`/pms/qc/getPlanLists`,'post',data) |
|||
|
|||
|
|||
// ===================================== 物料属性设置 =====================================
|
|||
export const qcPartAttributeSearch = data => createAPI(`/pms/qc/qcPartAttributeSearch`,'post',data) |
|||
export const qcPartAttributeSave = data => createAPI(`/pms/qc/qcPartAttributeSave`,'post',data) |
|||
export const qcPartAttributeDelete = data => createAPI(`/pms/qc/qcPartAttributeDelete`,'post',data) |
|||
export const searchPartAttributeDetails = data => createAPI(`/pms/qc/searchPartAttributeDetails`,'post',data) |
|||
export const savePartAttributeDetails = data => createAPI(`/pms/qc/savePartAttributeDetails`,'post',data) |
|||
export const deletePartAttributeDetails = data => createAPI(`/pms/qc/deletePartAttributeDetails`,'post',data) |
|||
export const saveAttributeDetailed = data => createAPI(`/pms/qc/saveAttributeDetailed`,'post',data) |
|||
export const uploadPartAttributeExcel = data => createAPI(`/pms/qc/uploadPartAttributeExcel`,'post',data) |
|||
export const getOperationDescList = data => createAPI(`/pms/qc/getOperationDescList`,'post',data) |
|||
export const getManufacturerList = data => createAPI(`/pms/qc/getManufacturerList`,'post',data) |
|||
export const getPartTemplateLists = data => createAPI(`/pms/qc/getPartTemplateLists`,'post',data) |
|||
export const qcPartAttributeEdit = data => createAPI(`/pms/qc/qcPartAttributeEdit`,'post',data) |
|||
export const overLoadSearchPartInfo = data => createAPI(`/pms/qc/overLoadSearchPartInfo`,'post',data) |
|||
|
|||
// ===================================== 类别属性设置 =====================================
|
|||
export const qcFamilyAttributeSearch = data => createAPI(`/pms/qc/qcFamilyAttributeSearch`,'post',data) |
|||
export const qcFamilyAttributeSave = data => createAPI(`/pms/qc/qcFamilyAttributeSave`,'post',data) |
|||
export const qcFamilyAttributeDelete = data => createAPI(`/pms/qc/qcFamilyAttributeDelete`,'post',data) |
|||
export const uploadFamilyAttributeExcel = data => createAPI(`/pms/qc/uploadFamilyAttributeExcel`,'post',data) |
|||
export const queryFileId = data => createAPI(`/pms/qc/queryFileId`,'post',data) |
|||
|
|||
// ===================================== FAI检验 =====================================
|
|||
export const qcFAIInspectionSearch = data => createAPI(`/pms/qc/qcFAIInspectionSearch`,'post',data) |
|||
export const faiDetailSearch = data => createAPI(`/pms/qc/faiDetailSearch`,'post',data) |
|||
export const faiRecordDelete = data => createAPI(`/pms/qc/faiRecordDelete`,'post',data) |
|||
export const saveFAIDetailedRecord = data => createAPI(`/pms/qc/saveFAIDetailedRecord`,'post',data) |
|||
export const saveFAISubmitResult = data => createAPI(`/pms/qc/saveFAISubmitResult`,'post',data) |
|||
export const saveFAISubDetailed = data => createAPI(`/pms/qc/saveFAISubDetailed`,'post',data) |
|||
export const selectFAISubDetailedRecord = data => createAPI(`/pms/qc/selectFAISubDetailedRecord`,'post',data) |
|||
export const checkFAIIsSubmit = data => createAPI(`/pms/qc/checkFAIIsSubmit`,'post',data) |
|||
export const checkFAISubDetailValue = data => createAPI(`/pms/qc/checkFAISubDetailValue`,'post',data) |
|||
export const saveFAIInspection = data => createAPI(`/pms/qc/saveFAIInspection`,'post',data) |
|||
|
|||
// ===================================== FQC检验 =====================================
|
|||
export const qcFQCInspectionSearch = data => createAPI(`/pms/qc/qcFQCInspectionSearch`,'post',data) |
|||
export const fqcDetailSearch = data => createAPI(`/pms/qc/fqcDetailSearch`,'post',data) |
|||
export const fqcRecordDelete = data => createAPI(`/pms/qc/fqcRecordDelete`,'post',data) |
|||
export const saveFQCDetailedRecord = data => createAPI(`/pms/qc/saveFQCDetailedRecord`,'post',data) |
|||
export const saveFQCSubmitResult = data => createAPI(`/pms/qc/saveFQCSubmitResult`,'post',data) |
|||
export const saveFQCSubDetailed = data => createAPI(`/pms/qc/saveFQCSubDetailed`,'post',data) |
|||
export const selectFQCSubDetailedRecord = data => createAPI(`/pms/qc/selectFQCSubDetailedRecord`,'post',data) |
|||
export const checkFQCIsSubmit = data => createAPI(`/pms/qc/checkFQCIsSubmit`,'post',data) |
|||
export const checkFQCSubDetailValue = data => createAPI(`/pms/qc/checkFQCSubDetailValue`,'post',data) |
|||
export const saveFQCInspection = data => createAPI(`/pms/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(`/pms/qc/qcIPQCInspectionSearch`,'post',data) |
|||
export const ipqcDetailSearch = data => createAPI(`/pms/qc/ipqcDetailSearch`,'post',data) |
|||
export const ipqcRecordDelete = data => createAPI(`/pms/qc/ipqcRecordDelete`,'post',data) |
|||
export const saveIPQCDetailedRecord = data => createAPI(`/pms/qc/saveIPQCDetailedRecord`,'post',data) |
|||
export const saveIPQCSubmitResult = data => createAPI(`/pms/qc/saveIPQCSubmitResult`,'post',data) |
|||
export const saveIPQCSubDetailed = data => createAPI(`/pms/qc/saveIPQCSubDetailed`,'post',data) |
|||
export const selectIPQCSubDetailedRecord = data => createAPI(`/pms/qc/selectIPQCSubDetailedRecord`,'post',data) |
|||
export const checkIPQCIsSubmit = data => createAPI(`/pms/qc/checkIPQCIsSubmit`,'post',data) |
|||
export const checkIPQCSubDetailValue = data => createAPI(`/pms/qc/checkIPQCSubDetailValue`,'post',data) |
|||
export const getOperationList = data => createAPI(`/pms/qc/getOperationList`,'post',data) |
|||
export const getResourceList = data => createAPI(`/pms/qc/getResourceList`,'post',data) |
|||
export const getPartList = data => createAPI(`/pms/qc/getPartList`,'post',data) |
|||
export const saveOsInspection = data => createAPI(`/pms/qc/saveOsInspection`,'post',data) |
|||
export const getAllResourceList = data => createAPI(`/pms/qc/getAllResourceList`,'post',data) |
|||
export const getOrderNoList = data => createAPI(`/pms/qc/getOrderNoList`,'post',data) |
|||
export const queryController = data => createAPI(`/pms/qc/queryController`,'post',data) |
|||
export const queryTemplateList = data => createAPI(`/pms/qc/queryTemplateList`,'post',data) |
|||
export const getPartInformation = data => createAPI(`/pms/qc/getPartInformation`,'post',data) |
|||
export const getSpecialOperationList = data => createAPI(`/pms/qc/getSpecialOperationList`,'post',data) |
|||
export const getRollNo = data => createAPI(`/pms/qc/getRollNo`,'post',data) |
|||
export const rollNoEnter = data => createAPI(`/pms/qc/rollNoEnter`,'post',data) |
|||
export const queryPartList = data => createAPI(`/pms/qc/queryPartList`,'post',data) |
|||
export const umSearch = data => createAPI(`/pms/qc/umSearch`,'post',data) |
|||
|
|||
// ===================================== IQC检验 =====================================
|
|||
export const qcIQCInspectionSearch = data => createAPI(`/pms/qc/qcIQCInspectionSearch`,'post',data) |
|||
export const iqcDetailSearch = data => createAPI(`/pms/qc/iqcDetailSearch`,'post',data) |
|||
export const selectIQCSubDetailedRecord = data => createAPI(`/pms/qc/selectIQCSubDetailedRecord`,'post',data) |
|||
export const checkIQCSubDetailValue = data => createAPI(`/pms/qc/checkIQCSubDetailValue`,'post',data) |
|||
export const saveIQCDetailedRecord = data => createAPI(`/pms/qc/saveIQCDetailedRecord`,'post',data) |
|||
export const checkIQCIsSubmit = data => createAPI(`/pms/qc/checkIQCIsSubmit`,'post',data) |
|||
export const saveIQCSubDetailed = data => createAPI(`/pms/qc/saveIQCSubDetailed`,'post',data) |
|||
export const saveIQCSubmitResult = data => createAPI(`/pms/qc/saveIQCSubmitResult`,'post',data) |
|||
export const iqcRecordDelete = data => createAPI(`/pms/qc/iqcRecordDelete`,'post',data) |
|||
export const disposalMeasuresSearch = data => createAPI(`/pms/qc/disposalMeasuresSearch`,'post',data) |
|||
export const searchItemFileUrl = data => createAPI(`/pms/qc/searchItemFileUrl`,'post',data) |
|||
export const imageDelete = data => createAPI(`/pms/qc/imageDelete`,'post',data) |
|||
export const iqcRecordOverLoad = data => createAPI(`/pms/qc/iqcRecordOverLoad`,'post',data) |
|||
export const uploadSopFile = data => createAPI(`/pms/qc/upload`,'post',data) |
|||
export const getSiteAndBuByUserName = data => createAPI(`/pms/qc/getSiteAndBuByUserName`,'post',data) |
|||
export const searchSeqInfo = data => createAPI(`/pms/qc/searchSeqInfo`,'post',data) |
|||
export const searchPartInfo = data => createAPI(`/pms/qc/searchPartInfo`,'post',data) |
|||
// 获取采购类型
|
|||
export const orderTypeSearch = data => createAPI(`/pms/qc/orderTypeSearch`,'post',data) |
|||
export const actionIQCInspection = data => createAPI(`/pms/qc/actionIQCInspection`,'post',data) |
|||
export const actionFAIInspection = data => createAPI(`/pms/qc/actionFAIInspection`,'post',data) |
|||
export const actionIPQCInspection = data => createAPI(`/pms/qc/actionIPQCInspection`,'post',data) |
|||
export const actionFQCInspection = data => createAPI(`/pms/qc/actionFQCInspection`,'post',data) |
|||
export const dataAcquisition = data => createAPI(`/pms/qc/dataAcquisition`,'post',data) |
|||
export const getEquipmentNoList = data => createAPI(`/pms/qc/getEquipmentNoList`,'post',data) |
|||
export const getResponsibleOperatorList = data => createAPI(`/pms/qc/getResponsibleOperatorList`,'post',data) |
|||
export const getDataContentList = data => createAPI(`/pms/qc/getDataContentList`,'post',data) |
|||
export const getObjectList = data => createAPI(`/pms/qc/getObjectList`,'post',data) |
|||
export const getObjectListBy = data => createAPI(`/pms/qc/getObjectListBy`,'post',data) |
|||
export const addItemObject = data => createAPI(`/pms/qc/addItemObject`,'post',data) |
|||
export const deleteItemObject = data => createAPI(`/pms/qc/deleteItemObject`,'post',data) |
|||
export const updateItemObject = data => createAPI(`/pms/qc/updateItemObject`,'post',data) |
|||
export const getIQCItemObjectList = data => createAPI(`/pms/qc/getIQCItemObjectList`,'post',data) |
|||
export const getFAIItemObjectList = data => createAPI(`/pms/qc/getFAIItemObjectList`,'post',data) |
|||
export const getFQCItemObjectList = data => createAPI(`/pms/qc/getFQCItemObjectList`,'post',data) |
|||
export const getIPQCItemObjectList = data => createAPI(`/pms/qc/getIPQCItemObjectList`,'post',data) |
|||
export const getInspectionStandards = data => createAPI(`/pms/qc/getInspectionStandards`,'post',data) |
|||
export const saveInspectionStandard = data => createAPI(`/pms/qc/saveInspectionStandard`,'post',data) |
|||
export const dataAcquisitionByItem = data => createAPI(`/pms/qc/dataAcquisitionByItem`,'post',data) |
|||
export const getSiteAndBuByUserName2 = data => createAPI(`/pms/qc/getSiteAndBuByUserName2`,'post',data) |
|||
export const cancelApproval = data => createAPI(`/pms/qc/cancelApproval`,'post',data) |
|||
|
|||
export const goUpItemQC = data => createAPI(`/pms/qc/goUpItemQC`,'post',data) |
|||
export const goDownItemQC = data => createAPI(`/pms/qc/goDownItemQC`,'post',data) |
|||
export const cancelApproval2 = data => createAPI(`/pms/qc/cancelApproval2`,'post',data) |
|||
|
|||
// ===================================== 外采设备维护 =====================================
|
|||
export const queryEquipmentFolderLocationList = data => createAPI(`/pms/qc/queryEquipmentFolderLocationList`,'post',data) |
|||
export const deleteEquipmentFolderLocationList = data => createAPI(`/pms/qc/deleteEquipmentFolderLocationList`,'post',data) |
|||
export const getSuffixList = data => createAPI(`/pms/qc/getSuffixList`,'post',data) |
|||
export const saveEquipmentFolderLocationList = data => createAPI(`/pms/qc/saveEquipmentFolderLocationList`,'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(); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
@ -0,0 +1,27 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
// IQC报表查询
|
|||
export const getIQCReport = data => createAPI('/pms/qcReport/getIQCReport','post',data) |
|||
// IPQC报表查询
|
|||
export const getIPQCReport = data => createAPI('/pms/qcReport/getIPQCReport','post',data) |
|||
// FAI报表查询
|
|||
export const getFAIReport = data => createAPI('/pms/qcReport/getFAIReport','post',data) |
|||
// FQC报表查询
|
|||
export const getFQCReport = data => createAPI('/pms/qcReport/getFQCReport','post',data) |
|||
// PQC报表查询
|
|||
export const getPQCReport = data => createAPI('/pms/qcReport/getPQCReport','post',data) |
|||
|
|||
|
|||
// IQC报表明细查询
|
|||
export const getIQCDetailReport = data => createAPI('/pms/qcReport/getIQCDetailReport','post',data) |
|||
// IPQC报表明细查询
|
|||
export const getIPQCDetailReport = data => createAPI('/pms/qcReport/getIPQCDetailReport','post',data) |
|||
// FAI报表明细查询
|
|||
export const getFAIDetailReport = data => createAPI('/pms/qcReport/getFAIDetailReport','post',data) |
|||
// FQC报表明细查询
|
|||
export const getFQCDetailReport = data => createAPI('/pms/qcReport/getFQCDetailReport','post',data) |
|||
// PQC报表明细查询
|
|||
export const getPQCDetailReport = data => createAPI('/pms/qcReport/getPQCDetailReport','post',data) |
|||
|
|||
// 导出
|
|||
export const downloadQcDetailRecord = data => createAPI('/pms/qcReport/downloadQcDetailRecord','post',data, 'download') |
|||
@ -0,0 +1,51 @@ |
|||
<template> |
|||
<div v-if="false"> |
|||
<!-- 你可以选择是否需要展示 base64 编码字符串 --> |
|||
<div v-for="(code, index) in qrCodesBase64" :key="index"> |
|||
<!-- <p>{{ code }}</p>--> |
|||
<img :src="code"/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import QRCode from 'qrcode' |
|||
|
|||
export default { |
|||
name: 'QrCode', |
|||
data() { |
|||
return { |
|||
texts: ['text1', 'text2', 'text3'], // 你要生成二维码的文本数组 |
|||
qrCodesBase64: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
init(contextList){ |
|||
this.texts = contextList |
|||
this.generateQRCodesSync(this.texts) |
|||
return this.qrCodesBase64 |
|||
}, |
|||
generateQRCodeSync(text) { |
|||
let base64 = '' |
|||
QRCode.toDataURL(text, { errorCorrectionLevel: 'H' }, (err, url) => { |
|||
if (err) { |
|||
console.error(err) |
|||
return |
|||
} |
|||
base64 = url |
|||
}) |
|||
return base64 |
|||
}, |
|||
generateQRCodesSync(texts) { |
|||
this.qrCodesBase64 = texts.map(text => this.generateQRCodeSync(text)) |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.generateQRCodesSync(this.texts) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
/* 你的样式 */ |
|||
</style> |
|||
@ -0,0 +1,124 @@ |
|||
<script> |
|||
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js' |
|||
export default { |
|||
name: "qcReportFileTable", |
|||
props:{ |
|||
dataList:{ |
|||
type:Array, |
|||
required:true |
|||
}, |
|||
queryLoading:{ |
|||
type:Boolean, |
|||
default:false, |
|||
}, |
|||
columns:{ |
|||
type:Array, |
|||
required: true, |
|||
} |
|||
}, |
|||
methods: { |
|||
// 预览 |
|||
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); |
|||
// 在新标签页中打开文件预览 |
|||
const newTab = window.open(fileURL, '_blank') |
|||
}) |
|||
}, |
|||
|
|||
// 文件下载 |
|||
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) |
|||
}) |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</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 style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link> |
|||
<el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,452 @@ |
|||
<script> |
|||
import {queryUserDefaultOperationList, |
|||
saveUserDefaultOperation, |
|||
queryUserDefaultOperationListByUsername, |
|||
queytOperationList, |
|||
deleteUserDefaultOperation, |
|||
getSiteAndBuByUserName, |
|||
getAllUserList |
|||
} from "@/api/qc/qc.js" |
|||
export default { |
|||
name: 'userDefaultOpetation', |
|||
data () { |
|||
return { |
|||
queryParams: { |
|||
page: 1, |
|||
pageCount: 50, |
|||
username: '', |
|||
operation: '', |
|||
bu: '' |
|||
}, |
|||
operationList:[], |
|||
dataList: [], |
|||
userBuList: [], |
|||
total: 0, |
|||
modalFlag: false, |
|||
modalData: { |
|||
username: '', |
|||
operation:'', |
|||
bu: '', |
|||
}, |
|||
userFlag:false, |
|||
userData:{ |
|||
username:'', |
|||
userDisplay:'' |
|||
}, |
|||
userDataList:[], |
|||
ifUsernameExist: 0, |
|||
columns: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Bu', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'buDesc', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: 'BU', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Username', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'username', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '用户名', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Username', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'userDisplay', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Operation', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'operation', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工序编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Operation', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'operationDesc', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工序名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
} |
|||
], |
|||
userColomn: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Bu', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'username', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '用户名', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Username', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'userDisplay', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '描述', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
} |
|||
] |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
handleQuery () { |
|||
queryUserDefaultOperationList(this.queryParams).then(({data}) => { |
|||
if (data.code == 0) { |
|||
this.dataList = data.rows |
|||
this.total = data.total |
|||
} |
|||
}).catch((errer) => { |
|||
this.$message.error(errer) |
|||
}) |
|||
}, |
|||
async handleQueryByUsername () { |
|||
let json = { |
|||
username: this.modalData.username |
|||
} |
|||
await queryUserDefaultOperationListByUsername(json).then(({data})=>{ |
|||
this.ifUsernameExist = data.code |
|||
}) |
|||
}, |
|||
// 获取用户的bu |
|||
getSiteAndBuByUserName () { |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getSiteAndBuByUserName(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.userBuList = data.rows |
|||
} |
|||
}) |
|||
}, |
|||
async saveModalData(){ |
|||
let data = this.modalData |
|||
if (data.username==null||data.username==''){ |
|||
this.$message.warning("用户名不能为空!") |
|||
return |
|||
}else { |
|||
await this.handleQueryByUsername() |
|||
if (this.ifUsernameExist==2){ |
|||
this.$message.warning("此用户名已经存在记录") |
|||
return |
|||
} |
|||
} |
|||
if (data.operation==null||data.operation==''){ |
|||
this.$message.warning("工序类型不能为空!") |
|||
return |
|||
} |
|||
if (data.bu==null||data.bu==''){ |
|||
this.$message.warning("BU不能为空!") |
|||
return |
|||
} |
|||
saveUserDefaultOperation(data).then(({data})=>{ |
|||
if (data.code == 0){ |
|||
this.$message.success("保存成功") |
|||
this.handleQuery() |
|||
} |
|||
this.modalFlag = false |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
queryOperationList(){ |
|||
queytOperationList().then(({data})=>{ |
|||
if (data && data.code === 0) { |
|||
this.operationList = data.rows |
|||
} |
|||
}).catch((error)=>{ |
|||
console.log("失败") |
|||
console.log(error) |
|||
}) |
|||
}, |
|||
deleteData(row){ |
|||
this.$confirm(`确认删除?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(()=>{ |
|||
deleteUserDefaultOperation(row).then(({data})=>{ |
|||
if (data.code==0){ |
|||
this.$message.success("删除成功") |
|||
this.handleQuery() |
|||
} |
|||
}).catch() |
|||
}) |
|||
|
|||
}, |
|||
// 获取用户选择列表 |
|||
queryUserList () { |
|||
getAllUserList(this.userData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.userDataList = data.rows |
|||
this.userFlag = true |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
addmoadl(){ |
|||
this.modalData = { |
|||
username: '', |
|||
operation:'', |
|||
bu: '', |
|||
} |
|||
this.ifUsernameExist = 0 |
|||
this.modalFlag = true |
|||
}, |
|||
getRowData (row) { |
|||
this.modalData.username = row.username |
|||
this.modalData.userDisplay = row.userDisplay |
|||
this.userFlag = false |
|||
}, |
|||
}, |
|||
created () { |
|||
// 查询主列表 |
|||
this.handleQuery() |
|||
// 获取bu列表 |
|||
this.getSiteAndBuByUserName() |
|||
this.queryOperationList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="box-container"> |
|||
<!-- 查询条件--> |
|||
<el-form :inline="true" label-position="top" :model="queryParams"> |
|||
<el-form-item :label="'BU'"> |
|||
<el-select v-model="queryParams.bu" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for = "i in userBuList" |
|||
:key = "i.buNo" |
|||
:label = "i.buDesc" |
|||
:value = "i.buNo"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="'用户名'"> |
|||
<el-input v-model="queryParams.username" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'工序类型'"> |
|||
<!-- <el-input v-model="queryParams.operation" clearable style="width: 120px"></el-input>--> |
|||
<el-select v-model="queryParams.operation" clearable style="width: 120px"> |
|||
<el-option |
|||
v-for = "i in operationList" |
|||
:key = "i.code" |
|||
:label = "i.description" |
|||
:value = "i.code"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="handleQuery">查询</el-button> |
|||
<el-button type="primary" @click="addmoadl()">新增</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<!-- 主表信息--> |
|||
<div style="height: 90%"> |
|||
<el-table :data="dataList" border |
|||
highlight-current-row |
|||
height="100%" ref="table"> |
|||
<el-table-column label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<a @click="deleteData(scope.row)" type="primary" style="margin-left: 2px">{{'删除'}}</a> |
|||
</template> |
|||
</el-table-column> |
|||
<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"> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<!-- 分页信息--> |
|||
<el-pagination |
|||
style="margin-top: 5px" |
|||
:current-page="queryParams.page" |
|||
:page-sizes="[50, 100, 500, 1000]" |
|||
:page-size="queryParams.pageCount" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<!-- 新增数据dialog--> |
|||
<el-dialog title="新增记录" :visible.sync="modalFlag" width="495px"> |
|||
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="BU" prop="bu"> |
|||
<el-select v-model="modalData.bu" placeholder="请选择" style="width: 221px"> |
|||
<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-item :label="'工序类型'"> |
|||
<el-select v-model="modalData.operation" style="width: 221px"> |
|||
<el-option |
|||
v-for = "i in operationList" |
|||
:key = "i.code" |
|||
:label = "i.description" |
|||
:value = "i.code"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="'用户名'"> |
|||
<span style="cursor: pointer" slot="label" @click="queryUserList"><a>用户名</a></span> |
|||
<el-input v-model="modalData.username" readonly style="width: 221px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'名称'"> |
|||
<el-input v-model="modalData.userDisplay" disabled style="width: 221px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="saveModalData()">保 存</el-button> |
|||
<el-button @click="modalFlag = false">取 消</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
|
|||
<!-- 用户选择dialog--> |
|||
<el-dialog title="用户" :close-on-click-modal="false" v-drag :visible.sync="userFlag" width="520px"> |
|||
<div class="rq"> |
|||
<el-form :inline="true" label-position="top" :model="userData"> |
|||
<el-form-item :label="'用户名'"> |
|||
<el-input v-model="userData.username" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'描述'"> |
|||
<el-input v-model="userData.userDisplay" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button type="primary" @click="queryUserList">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="300" |
|||
:data="userDataList" |
|||
@row-dblclick="getRowData" |
|||
border |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
v-for="(item,index) in userColomn" :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> |
|||
</div> |
|||
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|||
<el-button type="primary" @click="userFlag=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
|
|||
|
|||
|
|||
</template> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,657 @@ |
|||
<script> |
|||
import {queryOperationForResourceList, |
|||
saveOperationForResource, |
|||
queytOperationList, |
|||
getSiteAndBuByUserName, |
|||
queryEquipmentFolderLocationList, |
|||
deleteEquipmentFolderLocationList, |
|||
getSuffixList, |
|||
saveEquipmentFolderLocationList |
|||
} from "@/api/qc/qc.js" |
|||
import excel from "@/utils/excel-util.js"; |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
export default { |
|||
name: 'OperationForResource', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
queryParams: { |
|||
page: 1, |
|||
pageCount: 50, |
|||
bu:'', |
|||
operation: '', |
|||
resource: '' |
|||
}, |
|||
exportName: "外采设备维护" + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
dataList: [], |
|||
dataListSelections: [], |
|||
total: 0, |
|||
modalFlag: false, |
|||
resourceFlag:false, |
|||
ifexist:0, |
|||
resourData:{ |
|||
resourceId:'', |
|||
resourceDesc:'' |
|||
}, |
|||
operationList:[], |
|||
suffixList:[], |
|||
userBuList: [], |
|||
editFlag: false, |
|||
viewFlag: false, |
|||
modalData: { |
|||
page: 1, |
|||
pageCount: 50, |
|||
equipmentNo: '', |
|||
equipmentDesc: '', |
|||
}, |
|||
columns: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Site', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'site', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工厂编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Operation', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'equipmentNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '设备编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101106, |
|||
serialNumber: '200101106Table1Operation', |
|||
tableId: '200101106Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'equipmentDesc', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '设备名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'fileNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '采集ID', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'ip', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: 'IP', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'suffix', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '采集方式', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'batchDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '每批次时间(s)', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'createBy', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '创建人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'createTime', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '创建时间', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'updateBy', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '变更人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 200101107, |
|||
serialNumber: '200101107Table1Resource', |
|||
tableId: '200101107Table1', |
|||
tableName: '用户默认工序设置表', |
|||
columnProp: 'updateTime', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '变更时间', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
methods: { |
|||
handleQuery () { |
|||
queryEquipmentFolderLocationList(this.queryParams).then(({data}) => { |
|||
if (data.code==0) { |
|||
this.dataList = data.rows |
|||
this.total = data.total |
|||
} |
|||
}).catch((errer) => { |
|||
this.$message.error(errer) |
|||
}) |
|||
}, |
|||
// 获取用户的bu |
|||
getSiteAndBuByUserName () { |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getSiteAndBuByUserName(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.userBuList = data.rows |
|||
this.$set(this.queryParams, 'bu', this.userBuList[0].buNo) |
|||
//查询数据 |
|||
this.handleQuery() |
|||
} |
|||
}) |
|||
}, |
|||
// 多选 |
|||
selectionChangeHandle (val) { |
|||
this.dataListSelections = val |
|||
}, |
|||
addDialog () { |
|||
this.editFlag = false |
|||
this.viewFlag = false |
|||
this.modalData = { |
|||
page: 1, |
|||
pageCount: 50, |
|||
site: this.$store.state.user.site, |
|||
buNo: '*', |
|||
editFlag: 0, |
|||
equipmentNo: '', |
|||
equipmentDesc: '', |
|||
createBy: this.$store.state.user.name |
|||
} |
|||
this.modalFlag = true |
|||
}, |
|||
editData(row){ |
|||
this.editFlag = true |
|||
this.viewFlag = false |
|||
this.modalData = row |
|||
this.modalData.bu = row.site + '_' + row.buNo |
|||
this.modalData.editFlag = 1 |
|||
this.modalData.updateBy = this.$store.state.user.name |
|||
this.modalFlag = true |
|||
}, |
|||
viewData(row){ |
|||
this.viewFlag = true |
|||
this.modalData = row |
|||
this.modalData.bu = row.site + '_' + row.buNo |
|||
this.modalFlag = true |
|||
}, |
|||
// 获取基础数据列表S |
|||
getBaseList (val,type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
let conSql = '' |
|||
if (val === 200) { |
|||
strVal = this.modalData.equipmentNo |
|||
conSql = " and site = '" + this.$store.state.user.site + "'" |
|||
this.$refs.baseList.init(val, strVal, conSql) |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
// 列表方法的回调 |
|||
getBaseData (val) { |
|||
if (this.tagNo === 200) { |
|||
this.modalData.equipmentNo = val.ObjectID |
|||
this.modalData.equipmentDesc = val.ObjectDesc |
|||
} |
|||
}, |
|||
async saveModalData(){ |
|||
if (this.modalData.equipmentNo==null ||this.modalData.equipmentNo==''){ |
|||
this.$message.warning("请输入设备编码!") |
|||
return |
|||
} |
|||
saveEquipmentFolderLocationList(this.modalData).then(({data})=>{ |
|||
if (data.code==0){ |
|||
this.modalFlag = false |
|||
this.$message.success(data.msg) |
|||
this.handleQuery() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}).catch() |
|||
|
|||
}, |
|||
getSuffixList(){ |
|||
getSuffixList().then(({data})=>{ |
|||
if (data && data.code === 0) { |
|||
this.suffixList = data.rows |
|||
} |
|||
}).catch((error)=>{ |
|||
console.log(error) |
|||
}) |
|||
}, |
|||
queryOperationList(){ |
|||
queytOperationList().then(({data})=>{ |
|||
if (data && data.code === 0) { |
|||
this.operationList = data.rows |
|||
} |
|||
}).catch((error)=>{ |
|||
console.log("失败") |
|||
console.log(error) |
|||
}) |
|||
}, |
|||
deleteData(){ |
|||
if (!this.dataListSelections || this.dataListSelections.length === 0) { |
|||
this.$message.warning("请选择要删除的记录") |
|||
return |
|||
} |
|||
this.$confirm(`确认删除选中的` + this.dataListSelections.length +'条记录吗?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(()=>{ |
|||
deleteEquipmentFolderLocationList(this.dataListSelections).then(({data})=>{ |
|||
if (data.code==0){ |
|||
this.$message.success("删除成功") |
|||
this.handleQuery() |
|||
} |
|||
}).catch() |
|||
}) |
|||
}, |
|||
async exportExcel() { |
|||
this.queryParams.page = 1 |
|||
this.queryParams.pageCount = -1 |
|||
excel.exportTable({ |
|||
url: "/pms/qc/queryEquipmentFolderLocationList", |
|||
columnMapping: this.columns,//可以直接用table,不需要的列就剔除 |
|||
mergeSetting: [],//需要合并的列 |
|||
params: this.queryParams, |
|||
fileName: this.exportName+".xlsx", |
|||
rowFetcher: res => res.data, |
|||
columnFormatter: [], |
|||
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|||
}) |
|||
} |
|||
}, |
|||
created () { |
|||
// 获取用户的 site 和 bu |
|||
// this.getSiteAndBuByUserName() |
|||
//查询工序类别信息 |
|||
this.queryOperationList() |
|||
this.getSuffixList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="box-container"> |
|||
<!-- 查询条件--> |
|||
<el-form :inline="true" label-position="top" :model="queryParams"> |
|||
<!-- <el-form-item :label="'BU'">--> |
|||
<!-- <el-select v-model="queryParams.bu" placeholder="请选择" style="width: 80px">--> |
|||
<!-- <el-option--> |
|||
<!-- v-for = "i in userBuList"--> |
|||
<!-- :key = "i.buNo"--> |
|||
<!-- :label = "i.buDesc"--> |
|||
<!-- :value = "i.buNo">--> |
|||
<!-- </el-option>--> |
|||
<!-- </el-select>--> |
|||
<!-- </el-form-item>--> |
|||
<el-form-item :label="'工厂编号'"> |
|||
<el-input v-model="queryParams.site" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'设备编码'"> |
|||
<el-input v-model="queryParams.equipmentNo" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'设备名称'"> |
|||
<el-input v-model="queryParams.equipmentDesc" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'IP'"> |
|||
<el-input v-model="queryParams.ip" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'采集方式'"> |
|||
<el-input v-model="queryParams.suffix" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="handleQuery">查询</el-button> |
|||
<el-button type="primary" @click="addDialog()">新增</el-button> |
|||
<el-button type="primary" @click="deleteData()">删除</el-button> |
|||
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<!-- 主表信息--> |
|||
<div style="height: 90%"> |
|||
<el-table :data="dataList" border |
|||
highlight-current-row |
|||
@selection-change="selectionChangeHandle" |
|||
height="100%" ref="table"> |
|||
<el-table-column |
|||
type="selection" |
|||
header-align="center" |
|||
align="center" |
|||
width="50"> |
|||
</el-table-column> |
|||
<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"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<a @click="editData(scope.row)" type="primary" style="margin-left: 2px">{{'编辑'}}</a> |
|||
<a @click="viewData(scope.row)" type="primary" style="margin-left: 2px">{{'详情'}}</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<!-- 分页信息--> |
|||
<el-pagination |
|||
style="margin-top: 5px" |
|||
:current-page="queryParams.page" |
|||
:page-sizes="[50, 100, 500, 1000]" |
|||
:page-size="queryParams.pageCount" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<!-- 新增数据dialog--> |
|||
<el-dialog :title="!editFlag?'新增':'编辑'" :visible.sync="modalFlag" width="620px" |
|||
:close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;"> |
|||
<!-- <el-form-item label="BU" prop="bu">--> |
|||
<!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="editFlag" style="width: 221px">--> |
|||
<!-- <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-item label="工厂编码"> |
|||
<el-input v-model="modalData.site" disabled style="width: 221px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="设备编码"> |
|||
<span style="cursor: pointer" slot="label" @click="getBaseList(200)" v-if="!editFlag"><a>设备编码</a></span> |
|||
<el-input v-model="modalData.equipmentNo" disabled style="width: 100px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="设备名称"> |
|||
<el-input v-model="modalData.equipmentDesc" disabled style="width: 221px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="IP"> |
|||
<el-input v-model="modalData.ip" style="width: 221px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="端口"> |
|||
<el-input v-model="modalData.port" style="width: 100px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="采集方式"> |
|||
<!-- <el-input v-model="modalData.suffix" disabled style="width: 104px"></el-input>--> |
|||
<!-- suffixList--> |
|||
<el-select v-model="modalData.suffix" placeholder="请选择" style="width: 104px"> |
|||
<el-option |
|||
v-for = "i in suffixList" |
|||
:key = "i" |
|||
:label = "i" |
|||
:value = "i"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="采集批次时间"> |
|||
<el-input v-model="modalData.batchDate" style="width: 104px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="采集ID"> |
|||
<el-input v-model="modalData.fileNo" style="width: 104px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="文件解析路径"> |
|||
<!-- <span style="cursor: pointer" slot="label" @click="selectServerFolder()"><a>文件解析路径</a></span>--> |
|||
<el-input v-model="modalData.folderPath" style="width: 570px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="文件备份路径"> |
|||
<el-input v-model="modalData.backupFolderPath" style="width: 570px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="图片备份路径"> |
|||
<el-input v-model="modalData.backupPhotoPath" style="width: 570px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="寄存器地址"> |
|||
<el-input v-model="modalData.registerAddress" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="寄存器位数"> |
|||
<el-input v-model="modalData.registerNum" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="设备报警声音标识"> |
|||
<el-select v-model="modalData.buzzer" style="width: 133px"> |
|||
<el-option value="1" label="Y"></el-option> |
|||
<el-option value="0" label="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="设备类型"> |
|||
<el-select v-model="modalData.repairType" style="width: 133px"> |
|||
<el-option value="短信" label="短信"></el-option> |
|||
<el-option value="邮件" label="邮件"></el-option> |
|||
<el-option value="随身机" label="随身机"></el-option> |
|||
<el-option value="三色灯" label="三色灯"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="寄存器数量类型"> |
|||
<el-input v-model="modalData.registerNumColumntype" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="寄存器地址类型"> |
|||
<el-input v-model="modalData.registerAddressInspection" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="寄存器读取开始位"> |
|||
<el-input v-model="modalData.registerNumInspection" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="寄存器检验单号类型"> |
|||
<el-input v-model="modalData.registerNumInspectionColumntype" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="单位数量"> |
|||
<el-input v-model="modalData.unitId" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="文件类型读取行特殊标识"> |
|||
<el-input v-model="modalData.excelCompareFieldsX" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="文件读取列位数"> |
|||
<el-input v-model="modalData.excelCompareFieldsY" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="文件从多少行开始读取"> |
|||
<el-input v-model="modalData.initialLine" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="文件读取行数"> |
|||
<el-input v-model="modalData.dataRow" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="文件读取跳过行数"> |
|||
<el-input v-model="modalData.skipLine" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="数据分割标识"> |
|||
<el-input v-model="modalData.cuttingSymbol" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="设备直连标识"> |
|||
<el-select v-model="modalData.transparentFlag" style="width: 133px"> |
|||
<el-option value="Y" label="Y"></el-option> |
|||
<el-option value="N" label="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :disabled="viewFlag" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="采集是否参与公式计算"> |
|||
<el-select v-model="modalData.formulaCalculation" style="width: 133px"> |
|||
<el-option value="Y" label="Y"></el-option> |
|||
<el-option value="N" label="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="公式计算函数"> |
|||
<el-input v-model="modalData.formula" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="采集数据是否需要分组"> |
|||
<el-select v-model="modalData.groupCalculation" style="width: 133px"> |
|||
<el-option value="Y" label="Y"></el-option> |
|||
<el-option value="N" label="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="正则表达式"> |
|||
<el-input v-model="modalData.regexp" style="width: 133px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="saveModalData()" v-if="!viewFlag">保 存</el-button> |
|||
<el-button @click="modalFlag = false">取 消</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
<!-- chooseList --> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
|
|||
|
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
1492
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
@ -0,0 +1,482 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 收藏 --> |
|||
<!-- <div>--> |
|||
<!-- <span @click="favoriteFunction()">--> |
|||
<!-- <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>--> |
|||
<!-- </span>--> |
|||
<!-- </div>--> |
|||
<!-- 条件查询 --> |
|||
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()"> |
|||
<el-form-item :label="'质检员工号'"> |
|||
<el-input v-model="searchData.inspectorNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'质检员姓名'"> |
|||
<el-input v-model="searchData.inspectorName" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'所处检验工序'"> |
|||
<el-input v-model="searchData.inspectorType" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'是否在岗'"> |
|||
<el-select filterable v-model="searchData.inspectorActive" style="width: 120px"> |
|||
<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 type="primary" @click="getDataList()">查询</el-button> |
|||
<el-button 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"> {{ 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="160" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="updateModal(scope.row)">修改</a> |
|||
<a 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="430px"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="质检员工号:"> |
|||
<el-input v-model="modalData.inspectorNo" :disabled="modalDisableFlag" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="质检员姓名:"> |
|||
<el-input v-model="modalData.inspectorName" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="质检员电话:"> |
|||
<el-input v-model="modalData.inspectorPhone" type="number" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'所处检验工序'"> |
|||
<el-input v-model="modalData.inspectorType" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'是否在岗'"> |
|||
<el-select filterable v-model="modalData.inspectorActive" 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-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 { |
|||
inspectorSearch, // 搜索质检员信息 |
|||
inspectorSave, // 新增质检员信息 |
|||
inspectorUpdate, // 修改质检员信息 |
|||
inspectorDelete, // 删除质检员信息 |
|||
} from "@/api/qc/qc.js" |
|||
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|||
export default { |
|||
watch: { |
|||
searchData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.searchData.inspectorNo = this.searchData.inspectorNo.toUpperCase() |
|||
} |
|||
}, |
|||
modalData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.modalData.inspectorNo = this.modalData.inspectorNo.toUpperCase() |
|||
this.modalData.inspectorType = this.modalData.inspectorType.toUpperCase() |
|||
} |
|||
} |
|||
}, |
|||
data () { |
|||
return { |
|||
// 是否收藏 |
|||
favorite: false, |
|||
|
|||
// 导出 start |
|||
exportData: [], |
|||
exportName: "质检员" + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ["质检员"], |
|||
exportFooter: [], |
|||
exportList:[], |
|||
// 导出 end |
|||
|
|||
searchData: { |
|||
inspectorNo: '', |
|||
inspectorName: '', |
|||
inspectorPhone: '', |
|||
inspectorType: '', |
|||
inspectorActive: '' |
|||
}, |
|||
height: 200, |
|||
dataList: [], |
|||
dataListLoading: false, |
|||
modalFlag: false, |
|||
modalDisableFlag: false, |
|||
modalData: { |
|||
flag: '', |
|||
inspectorNo: '', |
|||
inspectorName: '', |
|||
inspectorPhone: '', |
|||
inspectorType: '', |
|||
inspectorActive: '' |
|||
}, |
|||
// 标头展示 |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101008, |
|||
serialNumber: '101008TableEamPropertiesItemID', |
|||
tableId: '101008Table', |
|||
tableName: 'common', |
|||
columnProp: 'inspectorNo', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '质检员工号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101008, |
|||
serialNumber: '101008TableEamPropertiesItemDesc', |
|||
tableId: '101008Table', |
|||
tableName: 'common', |
|||
columnProp: 'inspectorName', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '质检员姓名', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101008, |
|||
serialNumber: '101008TableEamPropertiesItemDesc', |
|||
tableId: '101008Table', |
|||
tableName: 'common', |
|||
columnProp: 'inspectorPhone', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '质检员电话', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101008, |
|||
serialNumber: '101008TableEamPropertiesItemDesc', |
|||
tableId: '101008Table', |
|||
tableName: 'common', |
|||
columnProp: 'inspectorType', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '所处检验工序', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101008, |
|||
serialNumber: '101008TableEamPropertiesItemDesc', |
|||
tableId: '101008Table', |
|||
tableName: 'common', |
|||
columnProp: 'inspectorActive', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '是否在岗', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 180 |
|||
}) |
|||
}, |
|||
created () { |
|||
this.getDataList() |
|||
this.favoriteIsOk() |
|||
}, |
|||
methods: { |
|||
// 查询获取数据列表 |
|||
getDataList () { |
|||
inspectorSearch(this.searchData).then(({data}) => { |
|||
this.dataList = data.rows |
|||
}) |
|||
}, |
|||
// 新增按钮 |
|||
addModal () { |
|||
this.modalData = { |
|||
flag: '1', |
|||
inspectorNo: '', |
|||
inspectorName: '', |
|||
inspectorPhone: '', |
|||
inspectorType: '', |
|||
inspectorActive: '' |
|||
} |
|||
this.modalDisableFlag = false |
|||
this.modalFlag = true |
|||
}, |
|||
// 修改按钮 |
|||
updateModal (row) { |
|||
this.modalData = { |
|||
flag: '2', |
|||
inspectorNo: row.inspectorNo, |
|||
inspectorName: row.inspectorName, |
|||
inspectorPhone: row.inspectorPhone, |
|||
inspectorType: row.inspectorType, |
|||
inspectorActive: row.inspectorActive |
|||
} |
|||
this.modalDisableFlag = true |
|||
this.modalFlag = true |
|||
}, |
|||
// 删除方法 |
|||
deleteModal (row) { |
|||
this.$confirm(`是否删除这个质检员信息?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
inspectorDelete(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.inspectorNo == '' || this.modalData.inspectorNo == null) { |
|||
this.$alert('请输入质检员工号!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if (this.modalData.inspectorName == '' || this.modalData.inspectorName == null) { |
|||
this.$alert('请输入质检员姓名!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if (this.modalData.inspectorPhone == '' || this.modalData.inspectorPhone == null) { |
|||
this.$alert('请输入质检员电话!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if (this.modalData.inspectorType == '' || this.modalData.inspectorType == null) { |
|||
this.$alert('请输入质检员职责!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if (this.modalData.inspectorActive == '' || this.modalData.inspectorActive == null) { |
|||
this.$alert('请选择质检员是否在岗!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if (this.modalData.flag == '1') { // 新增 |
|||
inspectorSave(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 { // 修改 |
|||
inspectorUpdate(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 |
|||
} |
|||
console.log(this.$route.meta.menuId) |
|||
userFavoriteList(userFavorite).then(({data}) => { |
|||
for (let i = 0; i < data.list.length; i++) { |
|||
// let flag=false; |
|||
if(this.$route.meta.menuId==data.list[i].menuId){ |
|||
this.favorite = true |
|||
// flag=true; |
|||
} |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
// 收藏 OR 取消收藏 |
|||
favoriteFunction() { |
|||
let userFavorite = { |
|||
userId: this.$store.state.user.id, |
|||
functionId: this.$route.meta.menuId, |
|||
} |
|||
if (this.favorite) { |
|||
// 取消收藏 |
|||
// this.$confirm(`确定取消收藏`, '提示', { |
|||
// confirmButtonText: '确定', |
|||
// cancelButtonText: '取消', |
|||
// type: 'warning' |
|||
// }).then(() => { |
|||
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 inspectorSearch(this.searchData).then(({data}) => { |
|||
this.exportList= data.rows; |
|||
}) |
|||
|
|||
return this.exportList; |
|||
}, |
|||
startDownload() { |
|||
// this.exportData = this.dataList |
|||
|
|||
}, |
|||
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 |
|||
}, |
|||
// 导出 end |
|||
} |
|||
} |
|||
</script> |
|||
1616
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,754 @@ |
|||
<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.site" clearable style="width: 120px"></el-input> |
|||
</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" placeholder="请选择" style="width: 100px"> |
|||
<el-option 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> |
|||
</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-item label="工厂编码:" prop="site" :rules="rules.site"> |
|||
<el-input v-model="modalData.site" 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 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" 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 {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: '301001TableSite', |
|||
tableId: "301001Table", |
|||
tableName: "检验方法维护表", |
|||
columnProp: 'site', |
|||
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: 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: { |
|||
site:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
methodNameType:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
inspectionTypeNoType:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
bu:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
] |
|||
}, |
|||
options: [], |
|||
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.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 |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 查询获取数据列表 |
|||
getDataList () { |
|||
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: this.$store.state.user.site, |
|||
buNo: '*', |
|||
// bu: this.userBuList[0].buNo, |
|||
createBy: this.$store.state.user.name, |
|||
updateBy: this.$store.state.user.name, |
|||
methodNo: '', |
|||
methodName: '', |
|||
methodRemark: '', |
|||
inspectionTypeNo: '' |
|||
} |
|||
this.modalDisableFlag = false |
|||
this.modalFlag = true |
|||
}, |
|||
|
|||
// 修改按钮 |
|||
updateModal (row) { |
|||
this.modalData = { |
|||
flag: '2', |
|||
// bu: row.site + '_' + row.buNo, |
|||
site: row.site, |
|||
buNo: row.buNo, |
|||
createBy: this.$store.state.user.name, |
|||
updateBy: this.$store.state.user.name, |
|||
methodNo: row.methodNo, |
|||
methodName: row.methodName, |
|||
methodRemark: row.methodRemark, |
|||
inspectionTypeNo: 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 () { |
|||
if (this.modalData.site === '' || this.modalData.site == null) { |
|||
this.$message.warning('请填写工厂编码!') |
|||
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 |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 校验用户是否收藏 |
|||
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 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> |
|||
2268
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,707 @@ |
|||
<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.site" style="width: 120px"></el-input> |
|||
</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> |
|||
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</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-item label="工厂编码:" prop="site" :rules="rules.site"> |
|||
<el-input v-model="modalData.site" 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 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 excel from "@/utils/excel-util.js"; |
|||
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: '301011TableSite', |
|||
tableId: "301011Table", |
|||
tableName: "检验水平表", |
|||
columnProp: 'site', |
|||
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: '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: { |
|||
site:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
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, |
|||
buNo: '*', |
|||
site: this.$store.state.user.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: row.site + '_' + row.buNo, |
|||
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.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 |
|||
}, |
|||
async exportExcel() { |
|||
this.searchData.limit = -1 |
|||
this.searchData.page = 1 |
|||
excel.exportTable({ |
|||
url: "/pms/qc/samplingLevelSearch", |
|||
columnMapping: this.columnList,//可以直接用table,不需要的列就剔除 |
|||
mergeSetting: [],//需要合并的列 |
|||
params: this.searchData, |
|||
fileName: this.exportName+".xlsx", |
|||
rowFetcher: res => res.data, |
|||
columnFormatter: [], |
|||
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|||
}) |
|||
}, |
|||
|
|||
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,975 @@ |
|||
<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.site" style="width: 120px"></el-input> |
|||
</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-item label="工厂编码:" prop="site" :rules="rules.site"> |
|||
<el-input v-model="modalData.site" 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 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 {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: '301012TableSite', |
|||
tableId: "301012Table", |
|||
tableName: "样本量字码矩阵表", |
|||
columnProp: 'site', |
|||
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: '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: { |
|||
site:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
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 = '' |
|||
conSql = " and site = '" + this.$store.state.user.site + "'" |
|||
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: this.$store.state.user.site, |
|||
// bu: this.userBuList[0].buNo, |
|||
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: row.site + '_' + row.buNo, |
|||
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.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> |
|||
1155
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,784 @@ |
|||
<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.site" clearable style="width: 120px"></el-input> |
|||
</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> |
|||
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</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-item label="工厂编码:" prop="site" :rules="rules.site"> |
|||
<el-input v-model="modalData.site" disabled style="width: 120px"></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 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 excel from "@/utils/excel-util.js"; |
|||
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: '301009TableSite', |
|||
tableId: "301009Table", |
|||
tableName: "样本大小表", |
|||
columnProp: 'site', |
|||
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: '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: { |
|||
site:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
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: this.$store.state.user.site, |
|||
buNo: '*', |
|||
// 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: row.site + '_' + row.buNo, |
|||
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.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 |
|||
}, |
|||
async exportExcel() { |
|||
this.searchData.limit = -1 |
|||
this.searchData.page = 1 |
|||
excel.exportTable({ |
|||
url: "/pms/qc/samplingQtySearch", |
|||
columnMapping: this.columnList,//可以直接用table,不需要的列就剔除 |
|||
mergeSetting: [],//需要合并的列 |
|||
params: this.searchData, |
|||
fileName: this.exportName+".xlsx", |
|||
rowFetcher: res => res.data, |
|||
columnFormatter: [], |
|||
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|||
}) |
|||
}, |
|||
|
|||
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,803 @@ |
|||
<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.site" clearable style="width: 120px"></el-input> |
|||
</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-item label="工厂编码:" prop="site" :rules="rules.site"> |
|||
<el-input v-model="modalData.site" 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 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 {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: '301010TableSite', |
|||
tableId: "301010Table", |
|||
tableName: "批量级次表", |
|||
columnProp: 'site', |
|||
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: '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: { |
|||
site:[ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
} |
|||
], |
|||
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, |
|||
buNo: '*', |
|||
site: this.$store.state.user.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: row.site + '_' + row.buNo, |
|||
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.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> |
|||
1866
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,263 @@ |
|||
<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 { 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.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", this.bu.split('_')[0]); |
|||
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