Browse Source

刀模创建

master
shenzhouyu 2 months ago
parent
commit
02dd0ebd89
  1. 19
      src/api/qc/dm.js
  2. 108
      src/api/qc/dmBasic.js
  3. 15
      src/api/qc/dmFai.js
  4. 3
      src/api/qc/qc.js
  5. 4225
      src/views/modules/dm/DMFAIResultEntry.vue
  6. 668
      src/views/modules/dm/DMQcFamilyAttribute.vue
  7. 1162
      src/views/modules/dm/DMQcItem.vue
  8. 615
      src/views/modules/dm/DMQcMethod.vue
  9. 1630
      src/views/modules/dm/DMQcPartAttribute.vue
  10. 1172
      src/views/modules/dm/DMQcTemplate.vue
  11. 4162
      src/views/modules/dm/DMResultEntry.vue
  12. 121
      src/views/modules/dm/dm_SOP_upload_file.vue
  13. 215
      src/views/modules/dm/dm_upload.vue

19
src/api/qc/dm.js

@ -0,0 +1,19 @@
import { createAPI } from "@/utils/httpRequest.js";
// DM 结果录入(上机检验)独立接口
export const qcDMInspectionSearch = data => createAPI(`/pms/dm/qcDMInspectionSearch`, "post", data);
export const dmDetailSearch = data => createAPI(`/pms/dm/dmDetailSearch`, "post", data);
export const dmRecordDelete = data => createAPI(`/pms/dm/dmRecordDelete`, "post", data);
export const saveDMDetailedRecord = data => createAPI(`/pms/dm/saveDMDetailedRecord`, "post", data);
export const saveDMSubmitResult = data => createAPI(`/pms/dm/saveDMSubmitResult`, "post", data);
export const saveDMSubDetailed = data => createAPI(`/pms/dm/saveDMSubDetailed`, "post", data);
export const selectDMSubDetailedRecord = data => createAPI(`/pms/dm/selectDMSubDetailedRecord`, "post", data);
export const checkDMIsSubmit = data => createAPI(`/pms/dm/checkDMIsSubmit`, "post", data);
export const saveDmOsInspection = data => createAPI(`/pms/dm/saveDmOsInspection`, "post", data);
export const actionDMInspection = data => createAPI(`/pms/dm/actionDMInspection`, "post", data);
export const cancelDmApproval = data => createAPI(`/pms/dm/cancelDmApproval`, "post", data);
export const searchDmPartAttributeDetails = data => createAPI(`/pms/dm/searchDmPartAttributeDetails`, "post", data);
export const queryDmTemplateList = data => createAPI(`/pms/dm/queryDmTemplateList`, "post", data);
export const getDmIpqcItemObjectList = data => createAPI(`/pms/dm/getDmIpqcItemObjectList`, "post", data);
export const checkDMSubDetailValue = data => createAPI(`/pms/dm/checkDMSubDetailValue`, "post", data);
export const inspectionTypeSearch = data => createAPI(`/pms/dm/basic/inspectionTypeSearch`,'post',data)

108
src/api/qc/dmBasic.js

@ -0,0 +1,108 @@
import { createAPI } from "@/utils/httpRequest.js";
// 说明:为了让 DM 页面“整页搬运 QC 完整版源码”时只改 import 路径,
// 这里同时提供 qc.js 同名导出(qcMethodSearch 等)以及 dm 前缀导出(dmQcMethodSearch 等)。
// ------------------------------------- 基础通用 -------------------------------------
export const inspectionTypeSearch = data => createAPI(`/pms/dm/basic/inspectionTypeSearch`, "post", data);
export const getSiteAndBuByUserName = data => createAPI(`/pms/dm/basic/getSiteAndBuByUserName`, "post", data);
export const queryFileId = data => createAPI(`/pms/dm/basic/queryFileId`, "post", data);
export const uploadSopFile = data => createAPI(`/pms/dm/basic/upload`, "post", data);
// ------------------------------------- 检验方法(后端表 dm_method / dm_method_item,URL 仍为 qcMethod*) -------------------------------------
export const qcMethodSearch = data => createAPI(`/pms/dm/basic/qcMethodSearch`, "post", data);
export const dmMethodSave = data => createAPI(`/pms/dm/basic/dmMethodSave`, "post", data);
export const dmMethodUpdate = data => createAPI(`/pms/dm/basic/dmMethodUpdate`, "post", data);
export const dmMethodDelete = data => createAPI(`/pms/dm/basic/dmMethodDelete`, "post", data);
export const queryMethodList = data => createAPI(`/pms/dm/basic/queryMethodList`, "post", data);
// ------------------------------------- 检验项目 -------------------------------------
export const qcItemSearch = data => createAPI(`/pms/dm/basic/qcItemSearch`, "post", data);
export const qcItemSave = data => createAPI(`/pms/dm/basic/qcItemSave`, "post", data);
export const qcItemUpdate = data => createAPI(`/pms/dm/basic/qcItemUpdate`, "post", data);
export const qcItemDelete = data => createAPI(`/pms/dm/basic/qcItemDelete`, "post", data);
export const uploadExcel = data => createAPI(`/pms/dm/basic/uploadExcel`, "post", data);
export const getEquipmentNoList = data => createAPI(`/pms/dm/basic/getEquipmentNoList`, "post", data);
export const getDataContentList = data => createAPI(`/pms/dm/basic/getDataContentList`, "post", data);
export const getObjectList = data => createAPI(`/pms/dm/basic/getObjectList`, "post", data);
export const getObjectListBy = data => createAPI(`/pms/dm/basic/getObjectListBy`, "post", data);
export const addItemObject = data => createAPI(`/pms/dm/basic/addItemObject`, "post", data);
export const deleteItemObject = data => createAPI(`/pms/dm/basic/deleteItemObject`, "post", data);
export const updateItemObject = data => createAPI(`/pms/dm/basic/updateItemObject`, "post", data);
// ------------------------------------- 检验模板 -------------------------------------
export const templateSearch = data => createAPI(`/pms/dm/basic/templateSearch`, "post", data);
export const templateSave = data => createAPI(`/pms/dm/basic/templateSave`, "post", data);
export const templateUpdate = data => createAPI(`/pms/dm/basic/templateUpdate`, "post", data);
export const templateDelete = data => createAPI(`/pms/dm/basic/templateDelete`, "post", data);
export const templateDetailsSearch = data => createAPI(`/pms/dm/basic/templateDetailsSearch`, "post", data);
export const addItemDetails = data => createAPI(`/pms/dm/basic/addItemDetails`, "post", data);
export const getItemList = data => createAPI(`/pms/dm/basic/getItemList`, "post", data);
export const delItemDetails = data => createAPI(`/pms/dm/basic/delItemDetails`, "post", data);
export const saveItemDetailed = data => createAPI(`/pms/dm/basic/saveItemDetailed`, "post", data);
export const getItem = data => createAPI(`/pms/dm/basic/getItem`, "post", data);
export const getInspectionStandards = data => createAPI(`/pms/dm/basic/getInspectionStandards`, "post", data);
export const saveInspectionStandard = data => createAPI(`/pms/dm/basic/saveInspectionStandard`, "post", data);
export const goUpItemQC = data => createAPI(`/pms/dm/basic/goUpItemQC`, "post", data);
export const goDownItemQC = data => createAPI(`/pms/dm/basic/goDownItemQC`, "post", data);
export const uploadTemplateExcel = data => createAPI(`/pms/dm/basic/uploadTemplateExcel`, "post", data);
// ------------------------------------- 刀模属性 / 类别属性 -------------------------------------
export const dmPartAttributeSearch = data => createAPI(`/pms/dm/basic/dmPartAttributeSearch`, "post", data);
export const dmPartAttributeSave = data => createAPI(`/pms/dm/basic/dmPartAttributeSave`, "post", data);
export const dmPartAttributeEdit = data => createAPI(`/pms/dm/basic/dmPartAttributeEdit`, "post", data);
export const dmPartAttributeDelete = data => createAPI(`/pms/dm/basic/dmPartAttributeDelete`, "post", data);
export const qcFamilyAttributeSearch = data => createAPI(`/pms/dm/basic/qcFamilyAttributeSearch`, "post", data);
export const qcFamilyAttributeSave = data => createAPI(`/pms/dm/basic/qcFamilyAttributeSave`, "post", data);
export const qcFamilyAttributeDelete = data => createAPI(`/pms/dm/basic/qcFamilyAttributeDelete`, "post", data);
export const dmAttributeTemplateDetailsSearch = data => createAPI(`/pms/dm/basic/dmAttributeTemplateDetailsSearch`, "post", data);
export const dmAttributeTemplateSave = data => createAPI(`/pms/dm/basic/dmAttributeTemplateSave`, "post", data);
export const dmAttributeTemplateDelete = data => createAPI(`/pms/dm/basic/dmAttributeTemplateDelete`, "post", data);
export const dmAttributeTemplateDetailedSave = data => createAPI(`/pms/dm/basic/dmAttributeTemplateDetailedSave`, "post", data);
export const dmAttributeTemplateList = data => createAPI(`/pms/dm/basic/dmAttributeTemplateList`, "post", data);
export const dmAttributeTemplateFirstByTool = data => createAPI(`/pms/dm/basic/dmAttributeTemplateFirstByTool`, "post", data);
// 物料(刀模)+模板:覆盖检验项目/标准值(检验标准清单)
export const dmAttributeTemplateItemDetailsSearch = data => createAPI(`/pms/dm/basic/dmAttributeTemplateItemDetailsSearch`, "post", data);
export const dmAttributeTemplateItemGetItemList = data => createAPI(`/pms/dm/basic/dmAttributeTemplateItemGetItemList`, "post", data);
export const dmAttributeTemplateItemAdd = data => createAPI(`/pms/dm/basic/dmAttributeTemplateItemAdd`, "post", data);
export const dmAttributeTemplateItemDelete = data => createAPI(`/pms/dm/basic/dmAttributeTemplateItemDelete`, "post", data);
export const dmAttributeTemplateItemSave = data => createAPI(`/pms/dm/basic/dmAttributeTemplateItemSave`, "post", data);
export const getOperationDescList = data => createAPI(`/pms/dm/basic/getOperationDescList`, "post", data);
export const getManufacturerList = data => createAPI(`/pms/dm/basic/getManufacturerList`, "post", data);
export const getAllResourceList = data => createAPI(`/pms/dm/basic/getAllResourceList`, "post", data);
export const dmToolInfoSearch = data => createAPI(`/pms/dm/basic/dmToolInfoSearch`, "post", data);
export const dmsearchToolHeader = data => createAPI(`/pms/dm/basic/dmsearchToolHeader`, "post", data);
export const dmPartAttributeUploadExcel = data => createAPI(`/pms/dm/basic/dmPartAttributeUploadExcel`, "post", data);
export const uploadFamilyAttributeExcel = data => createAPI(`/pms/dm/basic/uploadFamilyAttributeExcel`, "post", data);
// 兼容导出(旧 DM 页面仍可能引用旧命名)
export const searchPartInfo = dmToolInfoSearch;
export const uploadPartAttributeExcel = dmPartAttributeUploadExcel;
export const searchPartAttributeDetails = dmAttributeTemplateDetailsSearch;
export const savePartAttributeDetails = dmAttributeTemplateSave;
export const deletePartAttributeDetails = dmAttributeTemplateDelete;
export const saveAttributeDetailed = dmAttributeTemplateDetailedSave;
export const getPartTemplateLists = dmAttributeTemplateList;
export const qcPartAttributeSearch = dmPartAttributeSearch;
export const qcPartAttributeSave = dmPartAttributeSave;
export const qcPartAttributeEdit = dmPartAttributeEdit;
export const qcPartAttributeDelete = dmPartAttributeDelete;
// ------------------------------------- dm 前缀(兼容旧命名) -------------------------------------
export const dmInspectionTypeSearch = inspectionTypeSearch;
export const dmQcMethodSearch = qcMethodSearch;
export const dmQcItemSearch = qcItemSearch;
export const dmQcItemSave = qcItemSave;
export const dmQcItemUpdate = qcItemUpdate;
export const dmQcItemDelete = qcItemDelete;
export const dmTemplateSearch = templateSearch;
export const dmTemplateSave = templateSave;
export const dmTemplateUpdate = templateUpdate;
export const dmTemplateDelete = templateDelete;
export const dmQcPartAttributeSearch = dmPartAttributeSearch;
export const dmQcPartAttributeSave = dmPartAttributeSave;
export const dmQcPartAttributeEdit = dmPartAttributeEdit;
export const dmQcPartAttributeDelete = dmPartAttributeDelete;
export const dmQcFamilyAttributeSearch = qcFamilyAttributeSearch;
export const dmQcFamilyAttributeSave = qcFamilyAttributeSave;
export const dmQcFamilyAttributeDelete = qcFamilyAttributeDelete;

15
src/api/qc/dmFai.js

@ -0,0 +1,15 @@
import { createAPI } from "@/utils/httpRequest.js";
export const qcDMFAIInspectionSearch = data => createAPI(`/pms/dm/fai/qcDMFAIInspectionSearch`, "post", data);
export const dmFaiDetailSearch = data => createAPI(`/pms/dm/fai/dmFaiDetailSearch`, "post", data);
export const dmFaiRecordDelete = data => createAPI(`/pms/dm/fai/dmFaiRecordDelete`, "post", data);
export const saveDMFAIDetailedRecord = data => createAPI(`/pms/dm/fai/saveDMFAIDetailedRecord`, "post", data);
export const saveDMFAISubmitResult = data => createAPI(`/pms/dm/fai/saveDMFAISubmitResult`, "post", data);
export const saveDMFAISubDetailed = data => createAPI(`/pms/dm/fai/saveDMFAISubDetailed`, "post", data);
export const selectDMFAISubDetailedRecord = data => createAPI(`/pms/dm/fai/selectDMFAISubDetailedRecord`, "post", data);
export const checkDMFAIIsSubmit = data => createAPI(`/pms/dm/fai/checkDMFAIIsSubmit`, "post", data);
export const saveDMFAIInspection = data => createAPI(`/pms/dm/fai/saveDMFAIInspection`, "post", data);
export const actionDMFAIInspection = data => createAPI(`/pms/dm/fai/actionDMFAIInspection`, "post", data);
export const cancelDMFAIApproval = data => createAPI(`/pms/dm/fai/cancelDMFAIApproval`, "post", data);
export const getDMFAIItemObjectList = data => createAPI(`/pms/dm/fai/getDMFAIItemObjectList`, "post", data);
export const queryDmTemplateList = data => createAPI(`/pms/dm/queryDmTemplateList`, "post", data);

3
src/api/qc/qc.js

@ -251,3 +251,6 @@ export const getButtonsPermission = data => createAPI(`/pms/qc/getButtonsPermiss
export const getEamPropertiesItemByItemNo = data => createAPI(`/pms/eam/getEamPropertiesItemByItemNo`,'post',data)
//获取采集器数据
export const getCollectorDataByItem = data => createAPI(`/pms/qc/getCollectorDataByItem`,'post',data)
//检查采集器异常信号
export const checkCollectorAbnormalSignal = data => createAPI(`/pms/qc/checkCollectorAbnormalSignal`,'post',data)

4225
src/views/modules/dm/DMFAIResultEntry.vue
File diff suppressed because it is too large
View File

668
src/views/modules/dm/DMQcFamilyAttribute.vue

@ -0,0 +1,668 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'BU'">
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
<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.familyID" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="'类别名称'"><el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input></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-form-item>
<el-form-item :label="' '">
<el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>
</el-form-item>
</el-form>
<el-table :height="height" :data="dataList" border style="width: 100%;">
<el-table-column prop="buDesc" header-align="center" align="center" label="BU"></el-table-column>
<el-table-column prop="familyID" header-align="center" align="center" label="物料类别编码"></el-table-column>
<el-table-column prop="familyName" header-align="center" align="center" label="物料类别名称"></el-table-column>
<el-table-column prop="attributeRemark" header-align="center" align="center" label="备注"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="160" label="操作">
<template slot-scope="scope">
<a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
<a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(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" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="BU">
<el-select v-model="modalData.bu" placeholder="请选择" style="width: 375px">
<el-option v-for="i in userBuList" :key="i.buNo" :label="i.sitename" :value="i.buNo"></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>
<span slot="label" @click="getBaseList(1042)"><a herf="#">类别编码</a></span>
<el-input v-model="modalData.familyID" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="类别名称:"><el-input v-model="modalData.familyName" disabled style="width: 240px"></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.attributeRemark" style="width: 375px"></el-input></el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
<el-form :inline="true" label-position="top">
<el-form-item :label="'类别编码'"><el-input v-model="detailData.familyID" readonly style="width: 120px"></el-input></el-form-item>
<el-form-item :label="'类别名称'"><el-input v-model="detailData.familyName" readonly style="width: 300px"></el-input></el-form-item>
<el-form-item :label="' '"><el-button type="primary" @click="addFastModal()">新增</el-button></el-form-item>
</el-form>
<el-table :height="300" :data="detailList" border style="width: 100%;">
<el-table-column prop="templateId" header-align="center" align="center" label="模板编码"></el-table-column>
<el-table-column prop="templateName" header-align="center" align="left" label="模板名称"></el-table-column>
<el-table-column prop="inspectionTypeName" header-align="center" align="center" label="检验类型"></el-table-column>
<el-table-column prop="operation" header-align="center" align="center" label="工序"></el-table-column>
<el-table-column prop="resourceID" header-align="center" align="center" label="机台"></el-table-column>
<el-table-column prop="manufacturerName" header-align="center" align="center" label="供应商"></el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="150" label="检验水平">
<template slot-scope="scope">
<el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
<el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
</template>
</el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="90" label="检验周期(h)">
<template slot-scope="scope"><el-input v-model="scope.row.inspectionCycle" type="number"></el-input></template>
</el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="150" label="抽样方案">
<template slot-scope="scope">
<el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
<el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
</template>
</el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="70" label="AQL">
<template slot-scope="scope"><el-input v-model="scope.row.aql" type="number"></el-input></template>
</el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="70" label="AC">
<template slot-scope="scope"><el-input v-model="scope.row.ac" type="number"></el-input></template>
</el-table-column>
<el-table-column prop="" header-align="center" align="center" min-width="70" label="RE">
<template slot-scope="scope"><el-input v-model="scope.row.re" type="number"></el-input></template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="90" label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveDetail()">保存</el-button>
<el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="detailData">
<el-form-item :label="'模板编码'"><el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="'模板名称'"><el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item label="检验类型">
<el-select v-model="detailData.inspectionTypeNo" placeholder="请选择" style="width: 100px">
<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 type="primary" @click="checkInspectionType()">查询</el-button></el-form-item>
<el-form-item style="margin-left: 117px" :label="' '">
<el-button
v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'"
type="primary" @click="getOperationList()" style="width: 63px">工序</el-button>
<el-button v-if="detailData.inspectionTypeNo === '105'" type="primary" @click="getManufacturerListFn()" style="width: 63px">供应商</el-button>
</el-form-item>
<el-form-item :label="' '">
<el-button
v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'"
type="primary" @click="getAllResourceListFn()" style="width: 63px">机台</el-button>
</el-form-item>
</el-form>
</div>
<el-container style="margin-top: 0px;">
<el-main style="width: 470px;padding: 1px">
<span style="font-size: 12px">可选模板</span>
<el-table height="360" :data="itemList1" border ref="itemTable1" @row-click="itemClickRow1" @selection-change="selectionItem1" highlight-current-row style="width: 100%">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
<el-table-column prop="templateName" header-align="center" align="center" min-width="170" label="模板名称"></el-table-column>
<el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="80" label="检验类型"></el-table-column>
</el-table>
</el-main>
<el-main style="width: 100px;padding: 1px">
<div style="margin-top: 160px;margin-left: 18px"><el-button type="primary" @click="addItem()">添加>></el-button></div>
<div style="margin-top: 15px;margin-left: 18px"><el-button type="primary" @click="deleteItem()">删除<<</el-button></div>
</el-main>
<el-main style="width: 470px;padding: 1px">
<span style="font-size: 12px">已有模板</span>
<el-table height="360" :data="itemList2" border ref="itemTable2" @row-click="itemClickRow2" @selection-change="selectionItem2" highlight-current-row style="width: 100%">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
<el-table-column prop="templateName" header-align="center" align="center" min-width="170" label="模板名称"></el-table-column>
<el-table-column prop="manufacturerName" header-align="center" align="center" min-width="100" label="供应商"></el-table-column>
<el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="80" label="检验类型"></el-table-column>
</el-table>
</el-main>
</el-container>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="operationData">
<el-form-item :label="'工序:'"><el-input v-model="operationData.operationDesc" style="width: 120px"></el-input></el-form-item>
<el-form-item :label="' '"><el-button type="primary" @click="getOperationList2()">查询</el-button></el-form-item>
</el-form>
<el-table :height="300" :data="operationList" ref="operationTable" @row-click="operationClickRow" @selection-change="selectionOperationChangeHandle" border :row-class-name="operationRowClassName" style="width: 100%;">
<el-table-column type="index" width="50" align="center">
<template slot-scope="scope"><el-radio v-model="operationCurrent" :label="scope.row.index">{{""}}</el-radio></template>
</el-table-column>
<el-table-column prop="operationDesc" header-align="center" align="center" label="工序"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center"><el-button type="primary" @click="confirmOperation()">确认</el-button></el-footer>
</el-dialog>
<el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="resourceData">
<el-form-item :label="'机台编码'"><el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="'机台名称'"><el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="' '"><el-button type="primary" @click="getAllResourceList2()">查询</el-button></el-form-item>
</el-form>
<el-table :height="300" :data="resourceList" ref="resourceTable" @row-click="resourceClickRow" @selection-change="selectionResourceChangeHandle" border :row-class-name="resourceRowClassName" style="width: 100%;">
<el-table-column type="index" width="50" align="center">
<template slot-scope="scope"><el-radio v-model="resourceCurrent" :label="scope.row.index">{{""}}</el-radio></template>
</el-table-column>
<el-table-column prop="resourceId" header-align="center" align="center" label="机台编码"></el-table-column>
<el-table-column prop="resourceDesc" header-align="center" align="center" label="机台名称"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center"><el-button type="primary" @click="confirmResource()">确认</el-button></el-footer>
</el-dialog>
<el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="420px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="manufacturerData">
<el-form-item :label="'供应商编码:'"><el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="'供应商名称:'"><el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input></el-form-item>
<el-form-item :label="' '"><el-button type="primary" @click="getManufacturerListFn()">查询</el-button></el-form-item>
</el-form>
<el-table :height="300" :data="manufacturerList" ref="manufacturerTable" @row-click="manufacturerClickRow" @selection-change="selectionManufacturerChangeHandle" border style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="manufacturerID" header-align="center" align="center" label="供应商编码"></el-table-column>
<el-table-column prop="manufacturerName" header-align="center" align="center" label="供应商名称"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="confirmManufacturer()">确认</el-button>
<el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<dmUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></dmUpload>
</div>
</template>
<script>
import {
qcFamilyAttributeSearch,
qcFamilyAttributeSave,
qcFamilyAttributeDelete,
getPartTemplateLists,
searchPartAttributeDetails,
saveAttributeDetailed,
savePartAttributeDetails,
deletePartAttributeDetails,
getOperationDescList,
getManufacturerList,
getAllResourceList,
inspectionTypeSearch,
getSiteAndBuByUserName
} from "@/api/qc/dmBasic.js";
import Chooselist from "@/views/modules/common/Chooselist_eam";
import { userFavoriteList, saveUserFavorite, removeUserFavorite } from "@/api/userFavorite.js";
import dmUpload from "./dm_upload.vue";
export default {
name: "DMQcFamilyAttribute",
components: { Chooselist, dmUpload },
data() {
return {
favorite: false,
searchData: { site: "", userName: this.$store.state.user.name, familyID: "", familyName: "", buDesc: "RFID", attributeType: "B", inspectionTypeNo: "105", page: 1, limit: 10 },
height: 200,
pageIndex: 1,
pageSize: 100,
totalPage: 0,
modalFlag: false,
modalData: { site: "", bu: "2_03-RFID", flag: "", familyID: "", familyName: "", supplierNo: "", supplierDesc: "", attributeRemark: "", createBy: this.$store.state.user.name, attributeType: "B" },
detailData: { site: "", buNo: "", familyID: "", familyName: "", attributeNo: "", attributeType: "B", inspectionTypeNo: "105", templateId: "", templateName: "", createBy: this.$store.state.user.name },
detailModelFlag: false,
detailList: [],
fastAddFlag: false,
itemList1: [],
itemList2: [],
itemSelections1: [],
itemSelections2: [],
tempLevelRow: null,
tempProgrammeRow: null,
operationList: [],
operationModelFlag: false,
operationData: { operationDesc: "", inspectionTypeNo: "" },
operation: "",
operationCurrent: -1,
resourceModelFlag: false,
resourceData: { site: "", resourceId: "", resourceDesc: "" },
resourceList: [],
resourceId: "",
resourceCurrent: -1,
manufacturerModelFlag: false,
manufacturerList: [],
manufacturerData: { site: "", manufacturerID: "", manufacturerName: "" },
dataListManufacturerSelections: [],
selectionManufacturer: [],
dataList: [],
userBuList: [],
options: [],
authSearch: false,
authSave: false,
authDelete: false,
authDetail: false,
menuId: this.$route.meta.menuId
};
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 210;
});
},
created() {
this.getButtonAuthData();
this.getSiteAndBuByUserName();
this.inspectionTypeSearch();
this.favoriteIsOk();
if (!this.authSearch) this.getDataList();
},
methods: {
chooseLevel(row) {
this.tempLevelRow = row;
this.getBaseList(208);
},
chooseProgrammeRow(row) {
this.tempProgrammeRow = row;
this.getBaseList(207);
},
getSiteAndBuByUserName() {
getSiteAndBuByUserName({ username: this.$store.state.user.name }).then(({ data }) => {
if (data.code === 0) this.userBuList = data.rows;
});
},
inspectionTypeSearch() {
inspectionTypeSearch({ site: this.$store.state.user.site }).then(({ data }) => {
if (data.code === 0) this.options = data.rows;
});
},
getDataList() {
this.searchData.limit = this.pageSize;
this.searchData.page = this.pageIndex;
this.searchData.inspectionTypeNo = "105";
qcFamilyAttributeSearch(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 = { site: "", bu: '2_03-RFID', flag: "1", familyID: "", familyName: "", supplierNo: "", supplierDesc: "", attributeRemark: "", createBy: this.$store.state.user.name, attributeType: "B" };
this.modalFlag = true;
},
saveData() {
if (!this.modalData.bu) return this.$message.warning("请选择BU!");
if (!this.modalData.familyID) return this.$message.warning("请选择物料分类编码!");
if (!this.modalData.familyName) return this.$message.warning("请选择物料分类名称!");
qcFamilyAttributeSave(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: "确定" });
}
});
},
deletePropertiesModel(row) {
this.$confirm("是否删除这个分类属性?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" })
.then(() => qcFamilyAttributeDelete(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(() => {});
},
detailModal(row) {
this.detailData.site = row.site;
this.detailData.buNo = row.buNo;
this.detailData.familyID = row.familyID;
this.detailData.familyName = row.familyName;
this.detailData.attributeNo = row.familyID;
this.detailData.inspectionTypeNo = "105";
searchPartAttributeDetails(this.detailData).then(({ data }) => {
this.detailList = data.rows || [];
});
this.detailModelFlag = true;
},
saveDetail() {
const reqList = this.detailList.map((item) => {
const inData = { ...item, updateBy: this.$store.state.user.name };
return saveAttributeDetailed(inData);
});
Promise.all(reqList).then(() => {
this.getDataList();
this.detailModelFlag = false;
this.$message({ message: "操作成功", type: "success", duration: 1500, onClose: () => {} });
});
},
addFastModal() {
this.itemSelections1 = null;
this.itemSelections2 = null;
this.selectionManufacturer = [];
this.dataListManufacturerSelections = [];
this.operation = "";
this.resourceId = "";
this.operationCurrent = -1;
this.resourceCurrent = -1;
this.detailData.inspectionTypeNo = "105";
this.checkInspectionType();
this.fastAddFlag = true;
},
checkInspectionType() {
this.detailData.inspectionTypeNo = "105";
getPartTemplateLists(this.detailData).then(({ data }) => {
this.operation = "";
this.resourceId = "";
this.operationCurrent = -1;
this.resourceCurrent = -1;
this.itemList1 = data.row1 || [];
this.itemList2 = data.row2 || [];
});
},
itemClickRow1(row) {
this.$refs.itemTable1.toggleRowSelection(row);
},
itemClickRow2(row) {
this.$refs.itemTable2.toggleRowSelection(row);
},
selectionItem1(val) {
this.itemSelections1 = val;
},
selectionItem2(val) {
this.itemSelections2 = val;
},
selectFlag() {
return true;
},
addItem() {
if (!this.itemSelections1 || this.itemSelections1.length === 0) {
this.$message.warning("请选择可选模板!");
return;
}
if (this.detailData.inspectionTypeNo === "105" && (!this.selectionManufacturer || this.selectionManufacturer.length === 0)) {
this.$message.warning("请选择供应商!");
return;
}
if ((this.detailData.inspectionTypeNo === "101" || this.detailData.inspectionTypeNo === "102" || this.detailData.inspectionTypeNo === "103" || this.detailData.inspectionTypeNo === "104" || this.detailData.inspectionTypeNo === "106" || this.detailData.inspectionTypeNo === "107") && !this.operation) {
this.$message.warning("请选择工序!");
return;
}
if ((this.detailData.inspectionTypeNo === "101" || this.detailData.inspectionTypeNo === "102" || this.detailData.inspectionTypeNo === "103" || this.detailData.inspectionTypeNo === "104" || this.detailData.inspectionTypeNo === "106" || this.detailData.inspectionTypeNo === "107") && !this.resourceId) {
this.$message.warning("请选择机台!");
return;
}
const inData = {
site: this.detailData.site,
buNo: this.detailData.buNo,
attributeNo: this.detailData.familyID,
itemList: this.itemSelections1,
operation: this.operation,
resourceID: this.resourceId,
manufacturerList: this.selectionManufacturer,
attributeType: this.detailData.attributeType,
inspectionTypeNo: this.detailData.inspectionTypeNo
};
savePartAttributeDetails(inData).then(({ data }) => {
if (data && data.code === 0) {
this.checkInspectionType();
this.itemSelections1 = [];
this.operation = "";
this.resourceId = "";
this.selectionManufacturer = [];
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
deleteItem() {
if (!this.itemSelections2 || this.itemSelections2.length === 0) {
this.$message.warning("请选择已有模板!");
return;
}
const inData = {
attributeNo: this.detailData.familyID,
itemList: this.itemSelections2,
attributeType: this.detailData.attributeType,
site: this.detailData.site,
buNo: this.detailData.buNo
};
deletePartAttributeDetails(inData).then(({ data }) => {
if (data && data.code === 0) {
this.checkInspectionType();
this.itemSelections2 = [];
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
deletePartAttributeDetails(row) {
this.$confirm("是否删除这个检验模板?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" })
.then(() => {
deletePartAttributeDetails(row).then(({ data }) => {
if (data && data.code === 0) {
searchPartAttributeDetails(this.detailData).then(({ data }) => {
this.detailList = data.rows || [];
});
this.$message({ message: "操作成功", type: "success", duration: 1500, onClose: () => {} });
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
})
.catch(() => {});
},
refreshDetailList() {
searchPartAttributeDetails(this.detailData).then(({ data }) => {
this.detailList = data.rows || [];
});
},
getBaseList(val) {
this.tagNo = val;
this.$nextTick(() => {
if (val === 1042) this.$refs.baseList.init(val, this.modalData.familyID);
if (val === 208 && this.tempLevelRow) this.$refs.baseList.init(val, this.tempLevelRow.samplingLevelNo);
if (val === 207 && this.tempProgrammeRow) this.$refs.baseList.init(val, this.tempProgrammeRow.samplingProgrammeNo);
});
},
getBaseData(val) {
if (this.tagNo === 1042) {
this.modalData.familyID = val.FamilyID;
this.modalData.familyName = val.FamilyName;
}
if (this.tagNo === 208 && this.tempLevelRow) {
this.tempLevelRow.samplingLevelNo = val.sampling_level_no;
this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc;
}
if (this.tagNo === 207 && this.tempProgrammeRow) {
this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no;
this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc;
}
},
getManufacturerListFn() {
this.manufacturerData.site = this.$store.state.user.site;
getManufacturerList(this.manufacturerData).then(({ data }) => {
if (data && data.code === 0) {
this.manufacturerList = data.rows || [];
this.$nextTick(() => {
if (this.$refs.manufacturerTable) this.$refs.manufacturerTable.clearSelection();
this.manufacturerList.forEach((row) => {
if (this.selectionManufacturer.includes(row.manufacturerID) && this.$refs.manufacturerTable) {
this.$refs.manufacturerTable.toggleRowSelection(row, true);
}
});
});
this.manufacturerModelFlag = true;
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
manufacturerClickRow(row) {
this.$refs.manufacturerTable.toggleRowSelection(row);
},
selectionManufacturerChangeHandle(val) {
this.dataListManufacturerSelections = val;
},
confirmManufacturer() {
this.selectionManufacturer = this.dataListManufacturerSelections.map((i) => i.manufacturerID);
this.manufacturerModelFlag = false;
},
getOperationList() {
this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo;
getOperationDescList(this.operationData).then(({ data }) => {
if (data && data.code === 0) {
this.operationList = data.rows || [];
this.operationModelFlag = true;
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
getOperationList2() {
getOperationDescList(this.operationData).then(({ data }) => {
if (data && data.code === 0) {
this.operationList = data.rows || [];
this.operationCurrent = -1;
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
operationClickRow(row) {
this.$refs.operationTable.toggleRowSelection(row);
},
selectionOperationChangeHandle(val) {
if (val && val.length > 0) {
this.operation = val[0].operationDesc;
this.operationCurrent = val[0].index;
}
},
operationRowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
confirmOperation() {
this.operationModelFlag = false;
},
getAllResourceListFn() {
this.resourceData.site = this.$store.state.user.site;
getAllResourceList(this.resourceData).then(({ data }) => {
if (data && data.code === 0) {
this.resourceList = data.rows || [];
this.resourceModelFlag = true;
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
getAllResourceList2() {
getAllResourceList(this.resourceData).then(({ data }) => {
if (data && data.code === 0) {
this.resourceList = data.rows || [];
this.resourceCurrent = -1;
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
},
resourceClickRow(row) {
this.$refs.resourceTable.toggleRowSelection(row);
},
selectionResourceChangeHandle(val) {
if (val && val.length > 0) {
this.resourceId = val[0].resourceId;
this.resourceCurrent = val[0].index;
}
},
resourceRowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
confirmResource() {
this.resourceModelFlag = false;
},
qcUpload() {
const currentData = { flag: "familyAttribute", createBy: this.$store.state.user.name, site: this.$store.state.user.site };
this.$nextTick(() => this.$refs.qcUpload.init(currentData));
},
favoriteIsOk() {
userFavoriteList({ userId: this.$store.state.user.id, languageCode: this.$i18n.locale }).then(({ data }) => {
for (let i = 0; i < data.list.length; i++) if (this.$route.meta.menuId === data.list[i].menuId) this.favorite = true;
});
},
favoriteFunction() {
const 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; });
}
},
getButtonAuthData() {
const searchFlag = this.isAuth(this.menuId + ":search");
const saveFlag = this.isAuth(this.menuId + ":save");
const deleteFlag = this.isAuth(this.menuId + ":delete");
const detailFlag = this.isAuth(this.menuId + ":detail");
this.authSearch = !searchFlag;
this.authSave = !saveFlag;
this.authDelete = !deleteFlag;
this.authDetail = !detailFlag;
}
}
};
</script>

1162
src/views/modules/dm/DMQcItem.vue
File diff suppressed because it is too large
View File

615
src/views/modules/dm/DMQcMethod.vue

@ -0,0 +1,615 @@
<template>
<div class="mod-config">
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item label="BU">
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
<el-option
v-for="i in userBuList"
:key="i.buNo"
:label="i.buDesc"
:value="i.buDesc">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="方法编码">
<el-input v-model="searchData.methodNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="方法名称">
<el-input v-model="searchData.methodName" clearable style="width: 200px"></el-input>
</el-form-item>
<el-form-item label="检验类型">
<el-select v-model="searchData.inspectionTypeNo" 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>
<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>
// / DmMethodData dm_method_itemDmMethodItemData
import {
qcMethodSearch,
dmMethodSave,
dmMethodUpdate,
dmMethodDelete,
inspectionTypeSearch,
getSiteAndBuByUserName
} from "@/api/qc/dmBasic.js";
import { getTableDefaultListLanguage, getTableUserListLanguage, updateColumnSize } from "@/api/table.js";
import { userFavoriteList, saveUserFavorite, removeUserFavorite } from "@/api/userFavorite.js";
export default {
name: "DMQcMethod",
data() {
return {
columnsProp: ["createBy", "updateBy"],
favorite: false,
exportData: [],
exportName: "刀模检验方法" + this.dayjs().format("YYYYMMDDHHmmss"),
exportHeader: ["刀模检验方法"],
exportFooter: [],
exportList: [],
searchData: {
site: "",
userName: this.$store.state.user.name,
methodNo: "",
methodName: "",
inspectionTypeNo: "",
buDesc: "RFID",
page: 1,
limit: 10
},
pageIndex: 1,
pageSize: 20,
totalPage: 0,
height: 200,
dataList: [],
dataListLoading: false,
modalFlag: false,
modalDisableFlag: false,
modalData: {
site: "",
bu: "2_03-RFID",
flag: "",
methodNo: "",
methodName: "",
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodRemark: "",
inspectionTypeNo: "822"
},
columnList: [
{
userId: this.$store.state.user.name,
functionId: 822001,
serialNumber: "822001TableBuDesc",
tableId: "822001Table",
tableName: "检验方法维护表",
columnProp: "buDesc",
headerAlign: "center",
align: "center",
columnLabel: "BU",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: "",
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 822001,
serialNumber: "822001TableMethodNo",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableMethodName",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableMethodRemark",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableInspectionTypeName",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableCreateDate",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableCreateBy",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableUpdateDate",
tableId: "822001Table",
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: 822001,
serialNumber: "822001TableUpdateBy",
tableId: "822001Table",
tableName: "检验方法维护表",
columnProp: "updateBy",
headerAlign: "center",
align: "center",
columnLabel: "更新人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: "",
columnWidth: 120
}
],
rules: {
methodNameType: [{ required: true, message: " ", trigger: ["blur", "change"] }],
inspectionTypeNoType: [{ required: true, message: " ", trigger: ["blur", "change"] }],
bu: [{ required: true, message: " ", trigger: ["blur", "change"] }]
},
options: [],
userBuList: [],
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
menuId: this.$route.meta.menuId
};
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 180;
});
},
created() {
this.getButtonAuthData();
this.getSiteAndBuByUserName();
this.favoriteIsOk();
this.inspectionTypeSearch();
this.getTableUserColumn(this.$route.meta.menuId + "table", 1);
if (!this.authSearch) {
this.getDataList();
}
},
methods: {
handleColumnResize(newWidth, oldWidth, column) {
const inData = this.columnList.filter(item => item.columnProp === column.property)[0];
inData.columnWidth = newWidth;
updateColumnSize(inData).then(({ data }) => {
if (data.code === 0) {
console.log("栏位宽度保存成功!");
}
});
},
getSiteAndBuByUserName() {
const 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: "",
bu: '2_03-RFID',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodNo: "",
methodName: "",
methodRemark: "",
inspectionTypeNo: "822"
};
this.modalDisableFlag = false;
this.modalFlag = true;
},
updateModal(row) {
this.modalData = {
flag: "2",
bu: row.site + "_" + row.buNo,
site: row.site,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodNo: row.methodNo,
methodName: row.methodName,
methodRemark: row.methodRemark,
inspectionTypeNo: "822"
};
this.modalDisableFlag = true;
this.modalFlag = true;
},
deleteModal(row) {
this.$confirm(`是否删除这个检验方法?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
dmMethodDelete(row).then(({ data }) => {
if (data && data.code === 0) {
this.getDataList();
this.$message({ message: "操作成功", type: "success", duration: 1500, onClose: () => {} });
} else {
this.$alert(data.msg, "错误", { confirmButtonText: "确定" });
}
});
})
.catch(() => {});
},
saveData() {
if (this.modalData.bu === "" || this.modalData.bu == null) {
this.$message.warning("请选择BU!");
return;
}
if (this.modalData.methodName === "" || this.modalData.methodName == null) {
this.$message.warning("请输入检验方法名称!");
return;
}
if (this.modalData.flag === "1") {
dmMethodSave(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 {
dmMethodUpdate(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() {
const tempData = { site: this.$store.state.user.site };
inspectionTypeSearch(tempData).then(({ data }) => {
if (data.code === 0) {
this.options = data.rows;
this.modalData.inspectionTypeNo = "822";
}
});
},
favoriteIsOk() {
const 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;
}
}
});
},
favoriteFunction() {
const 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;
});
}
},
async createExportData() {
this.searchData.limit = -1;
this.searchData.page = 1;
this.searchData.inspectionTypeNo = "822";
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 += "}";
// eslint-disable-next-line no-eval
return eval("(" + json + ")");
},
async getTableUserColumn(tableId, columnId) {
const queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId,
status: true,
languageCode: this.$i18n.locale
};
await getTableUserListLanguage(queryTableUser).then(({ data }) => {
if (data.rows.length > 0) {
if (columnId === 1) this.columnList = data.rows;
} else {
this.getColumnList(tableId, columnId);
}
});
},
async getColumnList(tableId, columnId) {
const queryTable = { functionId: this.$route.meta.menuId, tableId, languageCode: this.$i18n.locale };
await getTableDefaultListLanguage(queryTable).then(({ data }) => {
if (!data.rows.length === 0) {
if (columnId === 1) this.columnList = data.rows;
}
});
},
getButtonAuthData() {
const searchFlag = this.isAuth(this.menuId + ":search");
const saveFlag = this.isAuth(this.menuId + ":save");
const updateFlag = this.isAuth(this.menuId + ":update");
const 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>

1630
src/views/modules/dm/DMQcPartAttribute.vue
File diff suppressed because it is too large
View File

1172
src/views/modules/dm/DMQcTemplate.vue
File diff suppressed because it is too large
View File

4162
src/views/modules/dm/DMResultEntry.vue
File diff suppressed because it is too large
View File

121
src/views/modules/dm/dm_SOP_upload_file.vue

@ -0,0 +1,121 @@
<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-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/dmBasic.js";
export default {
name: "DmSopUploadFile",
data() {
return {
visible: false,
fileList: [],
pageData: {
titleCon: "",
site: "",
buNo: "",
createBy: "",
partNo: "",
inspectionTypeNo: "",
options: []
},
};
},
methods: {
init(currentRow) {
this.pageData = JSON.parse(JSON.stringify(currentRow));
this.visible = true;
},
beforeUploadHandle() {},
onChange(file, fileList) {
this.fileList = fileList;
},
closeDialog() {
this.fileList = [];
this.$refs.uploadFile.clearFiles();
this.$emit("refreshPageTables");
this.visible = false;
},
saveUploadFile() {
if (this.fileList == null || this.fileList.length === 0) {
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>

215
src/views/modules/dm/dm_upload.vue

@ -0,0 +1,215 @@
<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.site || '') + '_' + (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,
getSiteAndBuByUserName
} from "@/api/qc/dmBasic.js";
import { downLoadObjectFile } from "@/api/eam/eam_object_list.js";
export default {
name: "DmUpload",
data() {
return {
titleCon: "文件导入",
visible: false,
fileList: [],
bu: "2_03-RFID",
userBuList: [],
pageData: {
flag: "",
createBy: "",
site: ""
}
};
},
created() {
this.getSiteAndBu();
},
methods: {
getSiteAndBu() {
const 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) {
const 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);
},
closeDialog() {
this.fileList = [];
this.$emit("refreshPageTables");
this.visible = false;
},
saveUploadFile() {
if (this.bu === "" || this.bu == null) {
this.$message.warning("请选择BU!");
return false;
}
if (this.fileList == null || this.fileList.length === 0) {
this.$message.error("请先上传文件!");
return false;
}
const formData = new FormData();
formData.append("file", this.fileList[0].raw);
formData.append("createBy", this.pageData.createBy);
const buParts = this.bu.split("_");
formData.append("site", buParts[0] || "");
if (this.pageData.flag === "item" && buParts.length > 1) {
formData.append("buNo", buParts.slice(1).join("_"));
}
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() {
const file = { id: 0, fileName: "" };
const tempData = { orderRef1: "", orderRef2: "" };
// 沿 QC /OSS qc
if (this.pageData.flag === "item") {
tempData.orderRef1 = "qc";
tempData.orderRef2 = "itemFormat";
} else if (this.pageData.flag === "template") {
tempData.orderRef1 = "qc";
tempData.orderRef2 = "templateFormat";
} else if (this.pageData.flag === "partAttribute") {
tempData.orderRef1 = "qc";
tempData.orderRef2 = "partAttributeFormat";
} 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;
const linkNode = document.createElement("a");
linkNode.download = fileName;
linkNode.style.display = "none";
linkNode.href = URL.createObjectURL(blob);
document.body.appendChild(linkNode);
linkNode.click();
URL.revokeObjectURL(linkNode.href);
document.body.removeChild(linkNode);
});
}
}
};
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save