yfy 3 years ago
parent
commit
cc20636988
  1. 27
      src/api/qc/qc.js
  2. 44
      src/views/modules/qc/FAIResultEntry.vue
  3. 771
      src/views/modules/qc/qcFamilyAttribute.vue
  4. 10
      src/views/modules/qc/qcItemMaintenance.vue
  5. 246
      src/views/modules/qc/qcPartAttribute.vue
  6. 80
      src/views/modules/qc/qcSamplingInspectionPlan.vue
  7. 940
      src/views/modules/qc/qcSamplingInspectionProgramme.vue
  8. 203
      src/views/modules/qc/qcTemplate.vue

27
src/api/qc/qc.js

@ -12,6 +12,7 @@ export const qcCheckOutItemSearch = data => createAPI(`/pms/qc/qcCheckOutItemSea
export const qcCheckOutItemSave = data => createAPI(`/pms/qc/qcCheckOutItemSave`,'post',data)
export const qcCheckOutItemUpdate = data => createAPI(`/pms/qc/qcCheckOutItemUpdate`,'post',data)
export const qcCheckOutItemDelete = data => createAPI(`/pms/qc/qcCheckOutItemDelete`,'post',data)
export const uploadExcel = data => createAPI(`/pms/qc/uploadExcel`,'post',data)
// ===================================== 根据物料设置检验模板 =====================================
export const qcPartModelSearch = data => createAPI(`/pms/qc/qcPartModelSearch`,'post',data)
@ -19,7 +20,6 @@ export const qcPartModelSave = data => createAPI(`/pms/qc/qcPartModelSave`,'post
export const qcPartModelUpdate = data => createAPI(`/pms/qc/qcPartModelUpdate`,'post',data)
export const qcPartModelDelete = data => createAPI(`/pms/qc/qcPartModelDelete`,'post',data)
// ===================================== 根据分类设置检验模板 =====================================
export const qcCheckOutModelSearch = data => createAPI(`/pms/qc/qcCheckOutModelSearch`,'post',data)
export const qcCheckOutModelSave = data => createAPI(`/pms/qc/qcCheckOutModelSave`,'post',data)
@ -30,7 +30,6 @@ export const saveModalDetails = data => createAPI(`/pms/qc/saveModalDetails`,'po
export const deleteModalDetails = data => createAPI(`/pms/qc/deleteModalDetails`,'post',data)
export const getItemLists= data => createAPI(`/pms/qc/getItemLists`,'post',data)
// ===================================== 检验录入 =====================================
export const qcInspectionInformationSearch = data => createAPI(`/pms/qc/qcInspectionInformationSearch`,'post',data)
export const modalCodeBlur = data => createAPI(`/pms/qc/modalCodeBlur`,'post',data)
@ -51,7 +50,6 @@ export const workOrderSearch = data => createAPI(`/pms/qc/workOrderSearch`,'post
export const selectInformationByWorkOrderNo = data => createAPI(`/pms/qc/selectInformationByWorkOrderNo`,'post',data)
export const checkSubDetailValue = data => createAPI(`/pms/qc/checkSubDetailValue`,'post',data)
// ===================================== 质检员信息 =====================================
export const inspectorSearch = data => createAPI(`/pms/qc/inspectorSearch`,'post',data)
export const inspectorSave = data => createAPI(`/pms/qc/inspectorSave`,'post',data)
@ -69,7 +67,7 @@ export const ItemDetailsSearch = data => createAPI(`/pms/qc/ItemDetailsSearch`,'
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 uploadExcel = data => createAPI(`/pms/qc/uploadExcel`,'post',data)
export const uploadTemplateExcel = data => createAPI(`/pms/qc/uploadTemplateExcel`,'post',data)
export const saveItemDetailed = data => createAPI(`/pms/qc/saveItemDetailed`,'post',data)
// ===================================== 样本量 =====================================
@ -90,12 +88,22 @@ export const samplingLevelSave = data => createAPI(`/pms/qc/samplingLevelSave`,'
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)
@ -104,6 +112,13 @@ export const searchPartAttributeDetails = data => createAPI(`/pms/qc/searchPartA
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 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)
// ===================================== FAI检验 =====================================
export const qcFAIInspectionSearch = data => createAPI(`/pms/qc/qcFAIInspectionSearch`,'post',data)

44
src/views/modules/qc/FAIResultEntry.vue

@ -14,12 +14,6 @@
<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.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="searchData.partDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="检验时间">
<el-col :span="11">
<el-input v-model="searchData.startDate" type="date"></el-input>
@ -29,18 +23,10 @@
<el-input v-model="searchData.endDate" type="date"></el-input>
</el-col>
</el-form-item>
<el-form-item :label="'是否合格'">
<el-select filterable v-model="searchData.isQualified" style="width: 130px">
<el-option label="全部" value=""></el-option>
<el-option label="合格" value="Y"></el-option>
<el-option label="不合格" value="N"></el-option>
<el-option label="待提交" value="D"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="doEmpty()">清空</el-button>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addInspectionRecords()">新增检验记录</el-button>
<el-button type="primary" @click="addInspectionRecords()">新增</el-button>
<download-excel
:fields="fields()"
:data="exportData"
@ -302,20 +288,20 @@
<script>
import {
qcFAIInspectionSearch, // FAI
qcInspectionInformationSearch, //
qcInspectionInformationSave, //
qcInspectionInformationDelete, //
detailInformationSearch, //
modalCodeBlur, //
saveDetailInformation, //
// searchModelTree, //
saveSubmitResult, //
checkCompleted, //
selectModelByPartNo, //
subDetailInformationSave, //
selectSubDetailInformation,
checkOutIsSubmit, //
// workOrderSearch, //
selectInformationByWorkOrderNo, //
checkSubDetailValue //
} from "@/api/qc/qc.js"
@ -326,28 +312,6 @@
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.isQualified = this.searchData.isQualified.toUpperCase()
//
this.searchData.inspectionNo = this.searchData.inspectionNo.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.isQualified = this.modalData.isQualified.toUpperCase()
this.modalData.inspectionNo = this.modalData.inspectionNo.toUpperCase()
}
},
detailData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.isQualified = this.modalData.isQualified.toUpperCase()
this.modalData.inspectionNo = this.modalData.inspectionNo.toUpperCase()
}
},
},
data () {
@ -935,7 +899,7 @@
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
qcInspectionInformationSearch(this.searchData).then(({data}) => {
qcFAIInspectionSearch(this.searchData).then(({data}) => {
if (data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage

771
src/views/modules/qc/qcFamilyAttribute.vue
File diff suppressed because it is too large
View File

10
src/views/modules/qc/qcItemMaintenance.vue

@ -8,17 +8,16 @@
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'检验项目编码'">
<el-form-item :label="'项目编码'">
<el-input v-model="searchData.itemNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检验项目名称'">
<el-form-item :label="'项目名称'">
<el-input v-model="searchData.itemDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
<el-form-item :label="' '">
<input ref="file" type="file" accept=".xlsx,.xls" style="display: none;" @change="uploadFile">
<el-button type="primary" icon="el-icon-upload" @click="clickFile">导入</el-button>
@ -37,7 +36,6 @@
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<!-- 展示列表 -->
@ -77,7 +75,6 @@
<!-- 新增和修改 -->
<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.itemDesc" style="width: 120px"></el-input>
@ -89,7 +86,6 @@
</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-if="modalData.valueTypeDb == 'T'" v-model="modalData.defaultValue" style="width: 120px"></el-input>
@ -104,13 +100,11 @@
<el-input v-if="modalData.valueTypeDb == 'N'" v-model="modalData.minValue" type="number" style="width: 120px"></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.itemRemark" 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>

246
src/views/modules/qc/qcPartAttribute.vue

@ -14,13 +14,17 @@
<el-form-item :label="'物料名称'">
<el-input v-model="searchData.partDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料类别'">
<el-form-item :label="'类别名称'">
<el-input v-model="searchData.familyName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="doEmpty()">清空</el-button>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
<el-form-item :label="' '">
<input ref="file" type="file" accept=".xlsx,.xls" style="display: none;" @change="uploadFile">
<el-button type="primary" icon="el-icon-upload" @click="clickFile">导入</el-button>
<download-excel
:fields="fields()"
:data="exportData"
@ -67,7 +71,6 @@
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
<a type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
</template>
@ -85,9 +88,8 @@
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" style="margin-left: 7px;margin-top: -5px;">
<el-form-item >
<span slot="label" style="" @click="getBaseList(1043)"><a herf="#">物料编码</a></span>
@ -130,8 +132,8 @@
<el-input v-model="detailData.partDesc" readonly style="width: 220px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="addDetailModal()">新增</el-button>
<el-button type="primary" @click="addFastModal()">快速新增</el-button>
<!-- <el-button type="primary" @click="addDetailModal()">新增</el-button>-->
<el-button type="primary" @click="addFastModal()">新增</el-button>
</el-form-item>
</el-form>
<!-- 检验项目展示列表 -->
@ -241,35 +243,36 @@
</el-footer>
</el-dialog>
<!-- 检验模板->新增 -->
<el-dialog title="添加模板" :close-on-click-modal="false" v-drag :visible.sync="addDetailModalFlag" width="300px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item >
<span slot="label" style="" @click="getBaseList(1050)"><a herf="#">检验模板编码</a></span>
<el-input v-model="detailData.templateId" @blur="itemNoBlur" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="检验项目名称:">
<el-input v-model="detailData.templateName" disabled style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="savePartAttributeDetails()">保存</el-button>
<el-button type="primary" @click="addDetailModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- &lt;!&ndash; 检验模板->新增 &ndash;&gt;-->
<!-- <el-dialog title="添加模板" :close-on-click-modal="false" v-drag :visible.sync="addDetailModalFlag" width="300px">-->
<!-- <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">-->
<!-- <el-form-item >-->
<!-- <span slot="label" style="" @click="getBaseList(1050)"><a herf="#">检验模板编码</a></span>-->
<!-- <el-input v-model="detailData.templateId" @blur="itemNoBlur" style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="检验项目名称:">-->
<!-- <el-input v-model="detailData.templateName" disabled style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <el-footer style="height:40px;margin-top: 10px;text-align:center">-->
<!-- <el-button type="primary" @click="savePartAttributeDetails()">保存</el-button>-->
<!-- <el-button type="primary" @click="addDetailModalFlag = false">关闭</el-button>-->
<!-- </el-footer>-->
<!-- </el-dialog>-->
<!-- 检验项目->快速新增 -->
<el-dialog title="快速添加" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="800px">
<!-- 检验模板->快速新增 -->
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="800px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="detailData">
<el-form-item :label="'物料编码'">
<el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
<el-form-item :label="'模板编码'">
<el-input v-model="detailData.templateId" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="detailData.partDesc" readonly style="width: 120px"></el-input>
<el-form-item :label="'模板名称'">
<el-input v-model="detailData.templateName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="检验类型">
<el-select v-model="detailData.inspectionTypeNo" placeholder="请选择">
<el-option label="全部" value=""></el-option>
<el-option
v-for = "i in options"
:key = "i.inspectionTypeNo"
@ -358,19 +361,17 @@
import {
qcPartAttributeSearch, //
qcPartAttributeSave, //
qcPartModelUpdate,
qcPartAttributeDelete, //
searchPartAttributeDetails, //
savePartAttributeDetails, //
deletePartAttributeDetails, //
saveAttributeDetailed, //
qcCheckOutItemSearch, //
getItemLists, //
InspectionTypeSearch //
InspectionTypeSearch, //
uploadPartAttributeExcel //
} from "@/api/qc/qc.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import qcPartAttribute from './qcPartAttribute.vue'
export default {
components: {
Chooselist
@ -396,6 +397,7 @@
partNo: '',
partDesc: '',
familyID: '',
familyName: '',
attributeType: 'A',
page: 1,
limit: 10,
@ -404,7 +406,7 @@
pageIndex: 1,
pageSize: 100,
totalPage: 0,
addDetailModalFlag:false,
// addDetailModalFlag:false,
modalFlag:false,
modalDisableFlag:false,
modalData:{
@ -568,7 +570,7 @@
columnProp: 'createBy',
headerAlign: "center",
align: "left",
columnLabel: '操作',
columnLabel: '操作',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -581,13 +583,6 @@
detailModelFlag:false,
detailList: [],
dataListLoading: false,
itemData:{
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'D',
createdBy: this.$store.state.user.name
},
dataList:[],
//
columnDetailList: [
@ -717,6 +712,7 @@
partNo: '',
partDesc: '',
familyID: '',
familyName: '',
attributeType: 'A',
page: 1,
limit: 10,
@ -814,23 +810,6 @@
this.modalDisableFlag = false;
this.modalFlag = true;
},
updateModal(row){
this.modalData={
flag: '2',
partNo: row.partNo,
partDesc: row.partDesc,
familyID: row.familyID,
familyName: row.familyName,
umid: row.umid,
supplierNo: row.supplierNo,
supplierDesc: row.supplierDesc,
attributeRemark: row.attributeRemark,
attributeType: 'A',
createdBy: this.$store.state.user.name
};
this.modalDisableFlag = true;
this.modalFlag = true;
},
//
deletePropertiesModel (row) {
this.$confirm(`是否删除这个检验模板?`, '提示', {
@ -864,6 +843,12 @@
})
return false
}
if (this.modalData.partDesc == '' || this.modalData.partDesc == null) {
this.$alert('请选择物料名称!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.modalData.flag == '1'){
qcPartAttributeSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
@ -882,24 +867,6 @@
})
}
})
}else {
qcPartModelUpdate(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: '确定'
})
}
})
}
},
//
@ -936,14 +903,6 @@
})
this.detailModelFlag = true;
},
//
addDetailModal(){
this.detailData.templateId = '';
this.detailData.templateName = '';
this.addDetailModalFlag = true;
},
checkInspectionType(){
getItemLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1;
@ -961,7 +920,6 @@
})
this.fastAddFlag = true;
},
clickItem1(row){
this.itemListRow1 = JSON.parse(JSON.stringify(row));
},
@ -985,8 +943,8 @@
savePartAttributeDetails(inData).then(({data}) => {
if (data && data.code == 0) {
getItemLists(this.detailData).then(({data}) => {
this.itemList1=data.row1;
this.itemList2=data.row2;
this.itemList1 = data.row1;
this.itemList2 = data.row2;
})
this.itemListRow1 = null
} else {
@ -1029,48 +987,47 @@
this.detailList = data.rows
})
},
//
savePartAttributeDetails(){
if(this.detailData.templateId == "" || this.detailData.templateId == null){
this.$alert('请选择检验模板!', '错误', {
confirmButtonText: '确定'
})
return false
}
savePartAttributeDetails(this.detailData).then(({data}) => {
if (data && data.code == 0) {
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
})
this.addDetailModalFlag = false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
itemNoBlur(){
let inData = {
itemType: 'D',
itemNo: this.detailData.itemNo
}
qcCheckOutItemSearch(inData).then(({data}) => {
if(data.rows.length > 0){
this.detailData.itemDesc = data.rows[0].itemDesc
}else {
this.detailData.itemDesc = ''
}
})
},
// //
// savePartAttributeDetails(){
// if(this.detailData.templateId == "" || this.detailData.templateId == null){
// this.$alert('', '', {
// confirmButtonText: ''
// })
// return false
// }
// savePartAttributeDetails(this.detailData).then(({data}) => {
// if (data && data.code == 0) {
// searchPartAttributeDetails(this.detailData).then(({data}) => {
// this.detailList = data.rows
// })
// this.addDetailModalFlag = false;
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// }
// })
// } else {
// this.$alert(data.msg, '', {
// confirmButtonText: ''
// })
// }
// })
// },
// itemNoBlur(){
// let inData = {
// itemType: 'D',
// itemNo: this.detailData.itemNo
// }
// qcCheckOutItemSearch(inData).then(({data}) => {
// if(data.rows.length > 0){
// this.detailData.itemDesc = data.rows[0].itemDesc
// }else {
// this.detailData.itemDesc = ''
// }
// })
// },
//
deletePartAttributeDetails(row){
this.$confirm(`是否删除这个检验模板?`, '提示', {
@ -1178,6 +1135,37 @@
},
// end
//
clickFile() {
this.$refs.file.dispatchEvent(new MouseEvent('click'))
},
async uploadFile() {
const file = this.$refs.file.files
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase()
if (extName === '.xlsx' || extName === '.xls') {
let formData = new FormData()
formData.append('file', file[0])
uploadPartAttributeExcel(formData).then(({data}) => {
if(data.code === 0) {
this.getDataList()
this.$message({
type: 'success',
message: '数据导入成功!'
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
else {
this.$message.error('数据导入失败,请选择正确的xlsx模板文件')
}
this.load();
},
}
}
</script>

80
src/views/modules/qc/qcSamplingInspection.vue → src/views/modules/qc/qcSamplingInspectionPlan.vue

@ -8,21 +8,15 @@
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'抽样方案编码'">
<el-input v-model="searchData.samplingPlanNo" style="width: 120px"></el-input>
<el-form-item :label="'检验水平'">
<el-input v-model="searchData.samplingLevelDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'样本量字码'">
<el-input v-model="searchData.samplingQtyDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'批量级次'">
<el-input v-model="searchData.samplingQtyRankDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检验等级'">
<el-input v-model="searchData.samplingLevelDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否可用'">
<el-select filterable v-model="searchData.samplingPlanActive" style="width: 130px">
<el-option label="请选择" value=""></el-option>
<el-select v-model="searchData.samplingPlanActive" style="width: 130px">
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
@ -76,7 +70,7 @@
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="updateModal(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteModal(scope.row)">删除</a>
</template>
</el-table-column>
@ -94,7 +88,18 @@
</el-pagination>
<!-- 新增和修改 -->
<el-dialog title="检验项目" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
<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.samplingPlanDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="是否在用:">
<el-select filterable v-model="modalData.samplingPlanActive" 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>
@ -126,15 +131,6 @@
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="是否在用:">
<el-select filterable v-model="modalData.samplingPlanActive" 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>
@ -147,10 +143,10 @@
<script>
import {
samplingInspectionPlanSearch, //
samplingInspectionPlanSave, //
samplingInspectionPlanUpdate, //
samplingInspectionPlanDelete, //
samplingInspectionPlanSearch, //
samplingInspectionPlanSave, //
samplingInspectionPlanUpdate, //
samplingInspectionPlanDelete, //
} from "@/api/qc/qc.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@ -188,10 +184,10 @@
//
searchData: {
site: this.$store.state.user.site,
samplingQtyRankNo: '',
samplingLevelNo: '',
samplingLevelDesc: '',
samplingQtyNo: '',
samplingQtyDesc: '',
samplingPlanActive: '',
page: 1,
limit: 10,
@ -211,6 +207,7 @@
flag: '',
site: this.$store.state.user.site,
samplingPlanNo: '',
samplingPlanDesc: '',
samplingQtyNo: '',
samplingQty: '',
samplingQtyDesc: '',
@ -262,7 +259,25 @@
columnProp: 'samplingPlanNo',
headerAlign: 'center',
align: 'left',
columnLabel: '抽样方案编码',
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: 'samplingPlanDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '矩阵名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -503,6 +518,7 @@
flag: '2',
site: this.$store.state.user.site,
samplingPlanNo: row.samplingPlanNo,
samplingPlanDesc: row.samplingPlanDesc,
samplingQtyNo: row.samplingQtyNo,
samplingQty: row.samplingQty,
samplingQtyDesc: row.samplingQtyDesc,
@ -519,7 +535,7 @@
},
//
deleteModal (row) {
this.$confirm(`是否删除这个抽样方案?`, '提示', {
this.$confirm(`是否删除这个矩阵?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -545,6 +561,12 @@
},
saveData () {
if (this.modalData.samplingPlanDesc == '' || this.modalData.samplingPlanDesc == null) {
this.$alert('请输入矩阵名称!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.modalData.samplingQtyNo == '' || this.modalData.samplingQtyNo == null) {
this.$alert('请选择样本量编码!', '错误', {
confirmButtonText: '确定'
@ -558,7 +580,7 @@
return false
}
if (this.modalData.samplingLevelNo == '' || this.modalData.samplingLevelNo == null) {
this.$alert('请选择检验等级编码!', '错误', {
this.$alert('请选择检验水平编码!', '错误', {
confirmButtonText: '确定'
})
return false

940
src/views/modules/qc/qcSamplingInspectionProgramme.vue

@ -0,0 +1,940 @@
<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.samplingProgrammeDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'抽样方案代码'">
<el-input v-model="searchData.samplingProgrammeCode" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="doEmpty()">清空</el-button>
<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="detailModal(scope.row)">矩阵详情</a>
<a type="text" size="small" @click="deleteData(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, 1000]"
: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" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="抽样方案名称:">
<el-input v-model="modalData.samplingProgrammeDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="抽样方案代码:">
<el-input v-model="modalData.samplingProgrammeCode" style="width: 120px"></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="1500px">
<el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
<el-form-item :label="'抽样方案编码'">
<el-input v-model="detailData.samplingProgrammeNo" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'抽样方案名称'">
<el-input v-model="detailData.samplingProgrammeDesc" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'抽样方案代码'">
<el-input v-model="detailData.samplingProgrammeCode" readonly style="width: 100px"></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
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnDetailList" :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="80"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="deleteSamplingProgrammeDetails(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="detailModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 矩阵详情->快速新增 -->
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="800px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="detailData">
<el-form-item :label="'方案编码'">
<el-input v-model="detailData.samplingProgrammeNo" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'方案名称'">
<el-input v-model="detailData.samplingProgrammeDesc" readonly style="width: 120px"></el-input>
</el-form-item>
</el-form>
</div>
<el-container style="margin-top: -12px;">
<el-main style="width: 300px">
<span style="font-size: 12px" >可选矩阵</span>
<el-table
height="300px"
:data="itemList1"
border
@row-click="clickItem1"
highlight-current-row
v-loading="dataListLoading"
style="width: 100%">
<el-table-column
prop="samplingPlanNo"
header-align="center"
align="left"
min-width="110"
label="矩阵编码">
</el-table-column>
<el-table-column
prop="samplingPlanDesc"
header-align="center"
align="left"
min-width="170"
label="矩阵名称">
</el-table-column>
</el-table>
</el-main>
<el-main style="width: 100px">
<div style="margin-top: 100px">
<el-button type="primary" @click="addItem()">添加>></el-button>
</div>
<div style="margin-top: 20px">
<el-button type="primary" @click="deleteItem()">删除<<</el-button>
</div>
</el-main>
<el-main style="width: 300px">
<span style="font-size: 12px" >已有矩阵</span>
<el-table
height="300px"
:data="itemList2"
border
@row-click="clickItem2"
highlight-current-row
v-loading="dataListLoading"
style="width: 100%">
<el-table-column
prop="samplingPlanNo"
header-align="center"
align="left"
min-width="110"
label="矩阵编码">
</el-table-column>
<el-table-column
prop="samplingPlanDesc"
header-align="center"
align="left"
min-width="170"
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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
samplingProgrammeSearch, //
samplingProgrammeSave, //
samplingProgrammeDelete, //
searchSamplingProgrammeDetails, //
getPlanLists, //
saveSamplingProgrammeDetails, //
deleteSamplingProgrammeDetails, //
} from "@/api/qc/qc.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
components: {
Chooselist
},
watch: {
},
data () {
return {
//
favorite: false,
// start
exportData: [],
exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["根据物料设置检验模板"],
exportFooter: [],
exportList:[],
// end
tagNo: '',
searchData: {
site: this.$store.state.user.site,
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
samplingProgrammeCode: '',
page: 1,
limit: 10,
},
height: 200,
pageIndex: 1,
pageSize: 100,
totalPage: 0,
modalFlag:false,
modalDisableFlag:false,
modalData:{
flag: '',
site: this.$store.state.user.site,
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
samplingProgrammeCode: '',
createBy: this.$store.state.user.name,
},
detailData:{
site: this.$store.state.user.site,
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
samplingProgrammeCode: '',
createBy: this.$store.state.user.name
},
columnList: [
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableCodeNo',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'site',
headerAlign: "center",
align: "left",
columnLabel: '工厂号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableCodeNo',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'samplingProgrammeNo',
headerAlign: "center",
align: "left",
columnLabel: '抽样方案编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableCodeDesc',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'samplingProgrammeDesc',
headerAlign: "center",
align: "left",
columnLabel: '抽样方案名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableCodeDesc',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'samplingProgrammeCode',
headerAlign: "center",
align: "left",
columnLabel: '抽样方案代码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableActive',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'createTime',
headerAlign: "center",
align: "left",
columnLabel: '操作时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003TableActive',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'createBy',
headerAlign: "center",
align: "left",
columnLabel: '操作人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60,
},
],
detailModelFlag:false,
detailList: [],
dataListLoading: false,
itemData:{
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'D',
createdBy: this.$store.state.user.name
},
dataList:[],
//
columnDetailList: [
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2EamPropertiesItemID',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingPlanNo',
headerAlign: "center",
align: "left",
columnLabel: '矩阵编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2EamPropertiesItemDesc',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingPlanDesc',
headerAlign: "center",
align: "left",
columnLabel: '矩阵名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingQtyDesc',
headerAlign: "center",
align: "left",
columnLabel: '样本量字码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingQty',
headerAlign: "center",
align: "left",
columnLabel: '样本量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingQtyRankDesc',
headerAlign: "center",
align: "left",
columnLabel: '批量级次',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'minQty',
headerAlign: "center",
align: "left",
columnLabel: '最小抽样数',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'maxQty',
headerAlign: "center",
align: "left",
columnLabel: '最大抽样数',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2MinValue',
tableId: "301003Table2",
tableName: "检验项目表",
columnProp: 'samplingLevelDesc',
headerAlign: "center",
align: "left",
columnLabel: '抽样等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
],
//
fastAddFlag:false,
itemList1:[],
itemList2:[],
itemListRow1:{},
itemListRow2:{},
tempLevelRow:'',
tempPlanRow:'',
options: [],
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 210
})
},
created () {
this.getDataList();
this.favoriteIsOk()
},
methods: {
//
doEmpty(){
this.searchData = {
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
samplingProgrammeCode: '',
page: 1,
limit: 10,
}
},
chooseLevel(row){
this.tempLevelRow = row;
this.getBaseList(1048);
},
choosePlanRow(row){
this.tempPlanRow = row;
this.getBaseList(1049);
},
// S
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1043) {
strVal = this.modalData.partNo
this.$refs.baseList.init(val, strVal)
}
if (val === 1050) {
strVal = this.detailData.templateId
this.$refs.baseList.init(val, strVal)
}
if (val === 1048) {
strVal = this.tempLevelRow.samplingLevelNo
this.$refs.baseList.init(val, strVal)
}
if (val === 1049) {
strVal = this.tempPlanRow.samplingPlanNo
this.$refs.baseList.init(val, strVal)
}
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1043) {
this.modalData.partNo = val.part_no
this.modalData.partDesc = val.part_desc
}
if (this.tagNo === 1050) {
this.detailData.templateId = val.template_id
this.detailData.templateName = val.template_name
}
if (this.tagNo === 1048) {
this.tempLevelRow.samplingLevelNo = val.sampling_level_no
this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
}
if (this.tagNo === 1049) {
this.tempPlanRow.samplingPlanNo = val.sampling_plan_no
}
},
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
samplingProgrammeSearch(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()
},
addModal(){
this.modalData={
flag: '1',
site: this.$store.state.user.site,
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
samplingProgrammeCode: '',
createBy: this.$store.state.user.name,
};
this.modalDisableFlag = false;
this.modalFlag = true;
},
//
deleteData (row) {
this.$confirm(`是否删除这个抽样方案?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
samplingProgrammeDelete(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.samplingProgrammeDesc == '' || this.modalData.samplingProgrammeDesc == null) {
this.$alert('请输入抽样方案名称!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.modalData.samplingProgrammeCode == '' || this.modalData.samplingProgrammeCode == null) {
this.$alert('请输入抽样方案代码!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.modalData.flag == '1'){
samplingProgrammeSave(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: '确定'
})
}
})
}
},
//
detailModal(row){
this.detailData.samplingProgrammeNo = row.samplingProgrammeNo
this.detailData.samplingProgrammeDesc = row.samplingProgrammeDesc
this.detailData.samplingProgrammeCode = row.samplingProgrammeCode
searchSamplingProgrammeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
})
this.detailModelFlag = true;
},
//
addFastModal(){
this.itemListRow2 = null
this.itemListRow1 = null
getPlanLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1;
this.itemList2 = data.row2;
})
this.fastAddFlag = true;
},
clickItem1(row){
this.itemListRow1 = JSON.parse(JSON.stringify(row));
},
clickItem2(row){
this.itemListRow2 = JSON.parse(JSON.stringify(row));
},
//
addItem(){
if(this.itemListRow1 == null){
this.$alert("请选择可选矩阵!", '错误', {
confirmButtonText: '确定'
})
return false;
}
let inData = {
samplingProgrammeNo: this.detailData.samplingProgrammeNo,
samplingPlanNo: this.itemListRow1.samplingPlanNo,
site: this.$store.state.user.site
}
saveSamplingProgrammeDetails(inData).then(({data}) => {
if (data && data.code == 0) {
getPlanLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1;
this.itemList2 = data.row2;
})
this.itemListRow1 = null
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
deleteItem(){
if(this.itemListRow2 == null){
this.$alert("请选择已选矩阵!", '错误', {
confirmButtonText: '确定'
})
return false;
}
let inData = {
samplingProgrammeNo: this.detailData.samplingProgrammeNo,
samplingPlanNo: this.itemListRow2.samplingPlanNo,
site: this.$store.state.user.site
}
deleteSamplingProgrammeDetails(inData).then(({data}) => {
if (data && data.code === 0) {
getPlanLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1;
this.itemList2 = data.row2;
})
this.itemListRow2 = null
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
refreshDetailList(){
searchSamplingProgrammeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
})
},
//
deleteSamplingProgrammeDetails(row){
this.$confirm(`是否删除这个矩阵?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSamplingProgrammeDetails(row).then(({data}) => {
if (data && data.code === 0) {
searchSamplingProgrammeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
//
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 samplingProgrammeSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
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>

203
src/views/modules/qc/qcTemplate.vue

@ -8,14 +8,15 @@
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'检验模板编号'">
<el-form-item :label="'模板编码'">
<el-input v-model="searchData.templateId" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检验模板名称'">
<el-form-item :label="'模板名称'">
<el-input v-model="searchData.templateName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="检验类型">
<el-select v-model="searchData.inspectionTypeNo" placeholder="请选择">
<el-option label="全部" value=""></el-option>
<el-option
v-for = "i in options"
:key = "i.inspectionTypeNo"
@ -28,6 +29,10 @@
<el-button @click="doEmpty()">清空</el-button>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
<el-form-item :label="' '">
<input ref="file" type="file" accept=".xlsx,.xls" style="display: none;" @change="uploadFile">
<el-button type="primary" icon="el-icon-upload" @click="clickFile">导入</el-button>
<download-excel
:fields="fields()"
:data="exportData"
@ -94,7 +99,6 @@
<!-- 检验模板新增/修改 -->
<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.templateName" style="width: 120px"></el-input>
@ -113,11 +117,13 @@
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item >
<span slot="label" style="" @click="getBaseList(1049)"><a herf="#">抽样方案</a></span>
<el-input v-model="modalData.samplingPlanNo" style="width: 120px"></el-input>
<span slot="label" style="" @click="getBaseList(1051)"><a herf="#">抽样方案编码</a></span>
<el-input v-model="modalData.samplingProgrammeNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="抽样方案名称:">
<el-input v-model="modalData.samplingProgrammeDesc" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1048)"><a herf="#">检验水平编码</a></span>
@ -127,7 +133,6 @@
<el-input v-model="modalData.samplingLevelDesc" disabled style="width: 120px"></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="AQL:">
<el-input v-model="modalData.aql" style="width: 120px"></el-input>
@ -139,7 +144,6 @@
<el-input v-model="modalData.re" type="number" style="width: 120px"></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.templateVersion" :disabled="modalDisableFlag" style="width: 120px"></el-input>
@ -148,7 +152,6 @@
<el-input v-model="modalData.templateRemark" style="width: 255px"></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>
@ -191,7 +194,6 @@
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
@ -251,7 +253,6 @@
<a type="text" size="small" @click="delItemDetails(scope.row)">删除项目</a>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
@ -263,8 +264,14 @@
<!-- 检验项目->快速新增 -->
<el-dialog title="快速添加" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="800px">
<div style="font-size: 12px">
检验模板编码<el-input v-model="detailData.templateId" readonly style="width: 120px"></el-input>
检验模板名称<el-input v-model="detailData.templateName" readonly style="width: 120px"></el-input>
<el-form :inline="true" label-position="top" :model="detailData">
<el-form-item :label="'模板编码'">
<el-input v-model="detailData.templateId" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'模板名称'">
<el-input v-model="detailData.templateName" readonly style="width: 120px"></el-input>
</el-form-item>
</el-form>
</div>
<el-container style="margin-top: -12px;">
<el-main style="width: 300px">
@ -333,37 +340,6 @@
</el-footer>
</el-dialog>
<!-- 检验项目->可选值 -->
<el-dialog title="可选值" :close-on-click-modal="false" v-drag :visible.sync="chooseModalFlag" width="350px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="检验项目名称:">
<el-input v-model="chooseModalData.itemDesc" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检测值类型'">
<el-select filterable v-model="chooseModalData.valueTypeDb" disabled style="width: 120px">
<el-option label="文本" value="T"></el-option>
<el-option label="数字" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="chooseTableData"
border
style="width: 100%">
<el-table-column
prop="availableValue"
header-align="center"
align="left"
min-width="200"
label="属性值">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="chooseModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -381,6 +357,7 @@
getItemList, //
delItemDetails, //
saveItemDetailed, //
uploadTemplateExcel, //
qcCheckOutItemSearch, //
} from "@/api/qc/qc.js"
@ -397,7 +374,6 @@
return {
//
favorite: false,
// start
exportData: [],
exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
@ -405,7 +381,6 @@
exportFooter: [],
exportList:[],
// end
tagNo:'',
searchData: {
site: this.$store.state.user.site,
@ -421,7 +396,6 @@
pageIndex: 1,
pageSize: 100,
totalPage: 0,
addDetailModalFlag:false,
modalFlag:false,
modalDisableFlag:false,
modalData:{
@ -432,7 +406,8 @@
templateRemark: '',
templateType: '',
templateVersion: '',
samplingPlanNo: '',
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
inspectionTypeNo: '',
inspectionCycle: '',
createTime: '',
@ -450,7 +425,8 @@
templateRemark: '',
templateType: '',
templateVersion: '',
samplingPlanNo: '',
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
inspectionTypeNo: '',
inspectionCycle: '',
createTime: '',
@ -507,7 +483,7 @@
serialNumber: '301003TableCodeDesc',
tableId: "301003Table",
tableName: "检验模板表",
columnProp: 'samplingPlanNo',
columnProp: 'samplingProgrammeNo',
headerAlign: "center",
align: "left",
columnLabel: '抽样方案',
@ -738,22 +714,8 @@
],
detailModelFlag:false,
detailList: [],
chooseTableData:[],
dataListLoading: false,
dataListSelections: [],
// modalDisableFlag:false,
chooseModalFlag:false,
itemFlag:'text',
itemData:{
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'D',
createdBy: this.$store.state.user.name
},
dataList:[],
departmentList:[],
//
columnDetailList: [
{
@ -811,13 +773,6 @@
columnWidth: 70,
},
],
levelList:[],
chooseModalData:{
itemNo: '',
itemDesc: '',
itemType:'D',
valueTypeDb:'',
},
//
fastAddFlag:false,
itemList1:[],
@ -845,7 +800,6 @@
}
})
},
//
objectSearch(){
objectSearch().then(({data}) => {
@ -854,7 +808,6 @@
}
})
},
//
doEmpty(){
this.searchData = {
@ -866,14 +819,13 @@
limit: 10,
}
},
// S
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1049) {
strVal = this.modalData.samplingPlanNo
if (val === 1051) {
strVal = this.modalData.samplingProgrammeNo
this.$refs.baseList.init(val, strVal)
}
if (val === 1048) {
@ -884,8 +836,9 @@
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1049) {
this.modalData.samplingPlanNo = val.sampling_plan_no
if (this.tagNo === 1051) {
this.modalData.samplingProgrammeNo = val.sampling_programme_no
this.modalData.samplingProgrammeDesc = val.sampling_programme_desc
}
if (this.tagNo === 1048) {
this.modalData.samplingLevelNo = val.sampling_level_no
@ -926,7 +879,8 @@
templateRemark: '',
templateType: '',
templateVersion: '',
samplingPlanNo: '',
samplingProgrammeNo: '',
samplingProgrammeDesc: '',
inspectionTypeNo: '',
inspectionCycle: '',
createBy: this.$store.state.user.name,
@ -948,7 +902,8 @@
templateRemark: row.templateRemark,
templateType: row.templateType,
templateVersion: row.templateVersion,
samplingPlanNo: row.samplingPlanNo,
samplingProgrammeNo: row.samplingProgrammeNo,
samplingProgrammeDesc: row.samplingProgrammeDesc,
inspectionTypeNo: row.inspectionTypeNo,
createBy: this.$store.state.user.name,
samplingLevelNo: row.samplingLevelNo,
@ -994,7 +949,7 @@
})
return false
}
if (this.modalData.samplingPlanNo == '' || this.modalData.samplingPlanNo == null) {
if (this.modalData.samplingProgrammeNo == '' || this.modalData.samplingProgrammeNo == null) {
this.$alert('请选择抽检方案!', '错误', {
confirmButtonText: '确定'
})
@ -1068,7 +1023,7 @@
})
}
},
//
//
detailModal(row){
this.detailData.templateId = row.templateId
this.detailData.templateName = row.templateName
@ -1102,14 +1057,6 @@
})
}
},
//
// addDetailModal(){
// this.detailData.itemNo = '';
// this.detailData.itemDesc = '';
// this.addDetailModalFlag = true;
// },
//
addFastModal(){
this.itemListRow2 = null
@ -1120,7 +1067,6 @@
})
this.fastAddFlag = true;
},
clickItem1(row){
this.itemListRow1 = JSON.parse(JSON.stringify(row));
},
@ -1191,48 +1137,6 @@
this.detailList = data.rows
})
},
//
addItemDetails(){
if(this.detailData.itemNo == "" || this.detailData.itemNo == null){
this.$alert('请选择检验明细编码!', '错误', {
confirmButtonText: '确定'
})
return false
}
addItemDetails(this.detailData).then(({data}) => {
if (data && data.code == 0) {
ItemDetailsSearch(this.detailData).then(({data}) => {
this.detailList = data.rows
})
this.addDetailModalFlag = false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
itemNoBlur(){
let inData = {
itemType: 'D',
itemNo: this.detailData.itemNo
}
qcCheckOutItemSearch(inData).then(({data}) => {
if(data.rows.length>0){
this.detailData.itemDesc = data.rows[0].itemDesc
}else {
this.detailData.itemDesc = ''
}
})
},
//
delItemDetails(row){
console.log(row)
@ -1278,7 +1182,6 @@
// flag=true;
}
}
})
},
// OR
@ -1315,7 +1218,6 @@
await templateSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
@ -1336,11 +1238,40 @@
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
clickFile() {
this.$refs.file.dispatchEvent(new MouseEvent('click'))
},
async uploadFile() {
const file = this.$refs.file.files
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase()
if (extName === '.xlsx' || extName === '.xls') {
let formData = new FormData()
formData.append('file', file[0])
uploadTemplateExcel(formData).then(({data}) => {
if(data.code === 0) {
this.getDataList()
this.$message({
type: 'success',
message: '数据导入成功!'
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
else {
this.$message.error('数据导入失败,请选择正确的xlsx模板文件')
}
this.load();
},
}
}
</script>
Loading…
Cancel
Save