Browse Source

QMS质量代码 分批提交2

master
赵宏斌 3 months ago
parent
commit
55bf948254
  1. 231
      src/api/qc/qc.js
  2. 25
      src/api/qc/qcPrint.js
  3. 27
      src/api/qc/qc_report.js
  4. 51
      src/views/modules/common/QrCode.vue
  5. 124
      src/views/modules/qc/QCReportFileTable.vue
  6. 452
      src/views/modules/qc/UserDefaultOperation.vue
  7. 657
      src/views/modules/qc/qcDeviceMaintenance.vue
  8. 1492
      src/views/modules/qc/qcFamilyAttribute.vue
  9. 482
      src/views/modules/qc/qcInspector.vue
  10. 1616
      src/views/modules/qc/qcItem.vue
  11. 754
      src/views/modules/qc/qcMethod.vue
  12. 2268
      src/views/modules/qc/qcPartAttribute.vue
  13. 707
      src/views/modules/qc/qcSamplingInspectionLevel.vue
  14. 975
      src/views/modules/qc/qcSamplingInspectionPlan.vue
  15. 1155
      src/views/modules/qc/qcSamplingInspectionProgramme.vue
  16. 784
      src/views/modules/qc/qcSamplingInspectionQty.vue
  17. 803
      src/views/modules/qc/qcSamplingInspectionQtyRank.vue
  18. 1866
      src/views/modules/qc/qcTemplate.vue
  19. 142
      src/views/modules/qc/qc_FAI_upload_file.vue
  20. 142
      src/views/modules/qc/qc_SOP_upload_file.vue
  21. 263
      src/views/modules/qc/qc_upload.vue
  22. 165
      src/views/modules/qc/sub_detail_upload.vue

231
src/api/qc/qc.js

@ -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)

25
src/api/qc/qcPrint.js

@ -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();
}
}

27
src/api/qc/qc_report.js

@ -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')

51
src/views/modules/common/QrCode.vue

@ -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>

124
src/views/modules/qc/QCReportFileTable.vue

@ -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')
// adownload
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>

452
src/views/modules/qc/UserDefaultOperation.vue

@ -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>

657
src/views/modules/qc/qcDeviceMaintenance.vue

@ -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

482
src/views/modules/qc/qcInspector.vue

@ -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

754
src/views/modules/qc/qcMethod.vue

@ -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

707
src/views/modules/qc/qcSamplingInspectionLevel.vue

@ -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&#45;&#45;primary el-button&#45;&#45;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>

975
src/views/modules/qc/qcSamplingInspectionPlan.vue

@ -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

784
src/views/modules/qc/qcSamplingInspectionQty.vue

@ -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&#45;&#45;primary el-button&#45;&#45;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>

803
src/views/modules/qc/qcSamplingInspectionQtyRank.vue

@ -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) {
// 04
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

142
src/views/modules/qc/qc_FAI_upload_file.vue

@ -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>

142
src/views/modules/qc/qc_SOP_upload_file.vue

@ -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>

263
src/views/modules/qc/qc_upload.vue

@ -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')
// adownload
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>

165
src/views/modules/qc/sub_detail_upload.vue

@ -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')
// adownload
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>
Loading…
Cancel
Save