Browse Source

QMS修改功能添加

master
shenzhouyu 2 months ago
parent
commit
e5fdf809ca
  1. 22
      src/views/modules/qc/FAIResultEntry.vue
  2. 21
      src/views/modules/qc/FQCResultEntry.vue
  3. 23
      src/views/modules/qc/IPQCResultEntry.vue
  4. 83
      src/views/modules/qc/IQCFileTable.vue
  5. 1631
      src/views/modules/qc/SQCResultEntry.vue
  6. 51
      src/views/modules/qc/com_qc_itemImage_upload_file.vue
  7. 103
      src/views/modules/qc/qcPartAttribute.vue

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

@ -291,9 +291,9 @@
</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-form-item label="老卷号">
<el-input v-model="modalData.batchRollNo" style="width: 221px"></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item label="送检总数">
<el-input v-model="modalData.sjzs" disabled style="width: 120px"></el-input>
</el-form-item>
@ -1146,24 +1146,6 @@ export default {
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 301007,
serialNumber: '301007Table1BatchRollNo',
tableId: "301007Table1",
tableName: "FQC检验记录表",
columnProp: 'batchRollNo',
headerAlign: "center",
align: "center",
columnLabel: '老卷号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301007,

21
src/views/modules/qc/FQCResultEntry.vue

@ -274,9 +274,6 @@
</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.batchRollNo" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="送检总数">
<el-input v-model="modalData.sjzs" disabled style="width: 120px"></el-input>
</el-form-item>
@ -1119,24 +1116,6 @@
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 301015,
serialNumber: '301015Table1BatchRollNo',
tableId: "301015Table1",
tableName: "FQC检验记录表",
columnProp: 'batchRollNo',
headerAlign: "center",
align: "center",
columnLabel: '老卷号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301015,

23
src/views/modules/qc/IPQCResultEntry.vue

@ -293,11 +293,6 @@
<input type="checkbox" id="specialTask" name="specialTask" v-model="checked" @click="changeSpecialTask"/> <label for="specialTask">无工单检验</label>
</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.batchRollNo" style="width: 456px"></el-input>
</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 type="textarea" v-model="modalData.specialRequirements" :rows="3" resize='none' show-word-limit style="width: 456px;height: 30px"></el-input>
@ -1147,24 +1142,6 @@
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 301014,
serialNumber: '301014Table1BatchRollNo',
tableId: "301014Table1",
tableName: "IPQC检验记录表",
columnProp: 'batchRollNo',
headerAlign: "center",
align: "center",
columnLabel: '老卷号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301014,

83
src/views/modules/qc/IQCFileTable.vue

@ -18,52 +18,59 @@ export default {
}
},
methods: {
//
// sys_ossdownLoadObjectFile //PDF blob URL
previewFile (row) {
//
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
let type = ''
if (image.includes(row.fileType.toLowerCase())) {
type = 'image/' + row.fileType
const ft = (row.fileType || '').toLowerCase()
const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']
const imageMime = { jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', gif: 'image/gif', bmp: 'image/bmp', webp: 'image/webp' }
let mime = ''
if (imageExts.includes(ft)) {
mime = imageMime[ft] || ('image/' + ft)
}
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
if (video.includes(row.fileType.toLowerCase())) {
type = 'video/' + row.fileType
const video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
if (video.includes(ft)) {
mime = 'video/' + ft
}
let txt = ['txt']
if (txt.includes(row.fileType.toLowerCase())) {
type = 'text/plain'
const txt = ['txt']
if (txt.includes(ft)) {
mime = 'text/plain'
}
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
if (office.includes(row.fileType.toLowerCase())) {
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
const office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
if (office.includes(ft)) {
this.$message.warning(`暂不支持预览${ft}文件`)
return
}
let pdf = ['pdf']
if (pdf.includes(row.fileType.toLowerCase())) {
type = 'application/pdf'
const pdf = ['pdf']
if (pdf.includes(ft)) {
mime = 'application/pdf'
}
if (type === ''){
this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
return;
if (mime === '') {
this.$message.warning(ft ? `暂不支持预览${ft}文件` : '缺少文件类型,无法预览')
return
}
downLoadObjectFile(row).then(({data}) => {
// const blob = new Blob([data], { type: type });
// // URL
// const fileURL = URL.createObjectURL(blob);
// //
// const newTab = window.open(fileURL, '_blank')
const type = 'text/plain;charset=utf-8'; //
const blob = new Blob([data], { type });
const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
//
const newTab = window.open();
newTab.document.write('<pre>' + content + '</pre>');
};
reader.readAsText(blob, 'utf-8');
downLoadObjectFile(row).then(({ data }) => {
if (mime === 'text/plain') {
const blob = new Blob([data], { type: 'text/plain;charset=utf-8' })
const reader = new FileReader()
reader.onload = function (e) {
const content = e.target.result
const newTab = window.open()
if (newTab) {
newTab.document.write('<pre>' + content + '</pre>')
}
}
reader.readAsText(blob, 'utf-8')
return
}
const blob = new Blob([data], { type: mime })
const fileURL = URL.createObjectURL(blob)
const newTab = window.open(fileURL, '_blank')
if (!newTab) {
URL.revokeObjectURL(fileURL)
this.$message.warning('请允许弹出窗口后再预览')
return
}
newTab.addEventListener('beforeunload', () => URL.revokeObjectURL(fileURL))
})
},

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

51
src/views/modules/qc/com_qc_itemImage_upload_file.vue

@ -17,8 +17,9 @@
<el-row>
<!-- 图像区域 -->
<ul class="content-image" v-viewer>
<li v-for="(item, index) in descImgs" :key="index" style="float: left;display: inline">
<img :src="item.url" style="width:70px;height: 70px"/>
<li v-for="(item, index) in descImgs" :key="item.id || index" style="float: left;display: inline">
<div v-if="!item.previewSrc" class="img-thumb-placeholder" style="width:70px;height:70px;background:#f2f2f2;display:inline-block;vertical-align:top;"></div>
<img v-else :src="item.previewSrc" style="width:70px;height: 70px"/>
<!-- 删除图标 -->
<div class="delete-img">
<i class="el-icon-delete" @click="deleteImage(index,item.id)"></i>
@ -49,6 +50,7 @@
<script>
import {uploadEamObjectFile} from '@/api/eam/com_eam_object_upload_file.js';
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js'
import {
searchItemFileUrl, //
imageDelete, //
@ -57,6 +59,9 @@ import {
var functionId = 'C10000002';
export default {
beforeDestroy () {
this.revokePreviewBlobs()
},
data() {
return {
titleCon: '项目图片上传',
@ -77,6 +82,35 @@ export default {
}
},
methods: {
revokePreviewBlobs () {
(this.descImgs || []).forEach(item => {
if (item.previewSrc && String(item.previewSrc).indexOf('blob:') === 0) {
URL.revokeObjectURL(item.previewSrc)
}
})
},
guessImageMime (fileName) {
const ext = (fileName || '').split('.').pop().toLowerCase()
const map = { jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', gif: 'image/gif', bmp: 'image/bmp', webp: 'image/webp' }
return map[ext] || 'image/jpeg'
},
loadImagePreviews (rows) {
rows.forEach(row => {
const id = row.id
downLoadObjectFile({ id }).then(({ data }) => {
const name = row.fileName || row.file_name
const mime = this.guessImageMime(name)
const blob = data instanceof Blob ? data : new Blob([data], { type: mime })
const url = URL.createObjectURL(blob)
const item = this.descImgs.find(d => d.id === id)
if (item) {
this.$set(item, 'previewSrc', url)
} else {
URL.revokeObjectURL(url)
}
}).catch(() => {})
})
},
//
init (currentRow) {
//
@ -86,14 +120,17 @@ export default {
this.descImgs = []
this.searchItemFileUrl()
},
//
// file:// downLoadObjectFile
searchItemFileUrl () {
this.revokePreviewBlobs()
this.descImgs = []
searchItemFileUrl(this.pageData).then(({data}) => {
if (data.code === 0) {
for (let i = 0; i < data.rows.length; i++) {
this.descImgs.push(data.rows[i])
}
const rows = data.rows || []
rows.forEach(r => {
this.descImgs.push(Object.assign({}, r, { previewSrc: '' }))
})
this.loadImagePreviews(this.descImgs)
} else {
this.$message.warning(data.msg)
}
@ -113,6 +150,7 @@ export default {
},
// modal
closeDialog () {
this.revokePreviewBlobs()
this.fileList = []
//
this.$refs.uploadFile.clearFiles()
@ -179,6 +217,7 @@ export default {
* 点击 X 关闭对话框的回调
**/
handleDialogClose () {
this.revokePreviewBlobs()
this.fileList = []
//
this.$refs.uploadFile.clearFiles()

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

@ -88,7 +88,7 @@
<template slot-scope="scope">
<a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
<a v-if="!authUpdate" type="text" size="small" @click="standardDetailModal(scope.row)">检验标准</a>
<a v-if="!authCheckout" type="text" size="small" @click="standardDetailModal(scope.row)">检验标准</a>
<a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
<a v-if="!authFile" type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a>
</template>
@ -181,9 +181,6 @@
<el-col :span="6">
<el-checkbox v-model="modalData.fqcExempt" true-label="Y" false-label="N">FQC检验</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="modalData.rqcExempt" true-label="Y" false-label="N">RQC检验</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="modalData.sqcExempt" true-label="Y" false-label="N">SQC检验</el-checkbox>
</el-col>
@ -224,7 +221,45 @@
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnDetailList" :key="index"
v-for="(item,index) in detailColumnsBeforeIpqc" :key="'before-' + 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
prop="ipqcInspectionMethod"
header-align="center"
align="center"
min-width="140"
label="IPQC检验方式">
<template slot-scope="scope">
<el-select
v-model="scope.row.ipqcInspectionMethod"
placeholder="请选择"
size="mini"
style="width: 120px"
:disabled="!isIPQCInspectionType(scope.row)">
<el-option
v-for="opt in ipqcInspectionMethodOptions"
:key="opt"
:label="opt"
:value="opt">
</el-option>
</el-select>
<span v-if="isIPQCInspectionType(scope.row) && !scope.row.ipqcInspectionMethod" style="color:#F56C6C;margin-left:6px">*</span>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in detailColumnsAfterIpqc" :key="'after-' + index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
@ -1458,6 +1493,7 @@
detailList: [],
dataList: [],
dataListLoading: false,
ipqcInspectionMethodOptions: ['首件检', '自检', '巡检', '末件检'],
//
columnDetailList: [
{
@ -1767,11 +1803,27 @@
authUpdate: false,
authDelete: false,
authDetail: false,
authCheckout: false,
authFile: false,
menuId: this.$route.meta.menuId,
}
},
computed: {
detailColumnsBeforeIpqc () {
const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
if (idx === -1) return list
return list.slice(0, idx + 1)
},
detailColumnsAfterIpqc () {
const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
if (idx === -1) return []
return list.slice(idx + 1)
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
@ -1841,6 +1893,30 @@
})
},
isIPQCInspectionType (row) {
const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
return name.toUpperCase().includes('IPQC') || no.toUpperCase().includes('IPQC')
},
normalizeIpqcInspectionMethod (row) {
if (!row) return
if (this.isIPQCInspectionType(row)) {
if (!row.ipqcInspectionMethod) {
this.$set(row, 'ipqcInspectionMethod', '首件检')
}
} else {
if (row.ipqcInspectionMethod) {
this.$set(row, 'ipqcInspectionMethod', '')
}
}
},
normalizeDetailListIpqcInspectionMethod () {
if (!Array.isArray(this.detailList)) return
this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r))
},
chooseLevel (row) {
this.tempLevelRow = row
this.getBaseList(208)
@ -2091,6 +2167,13 @@
//
saveDetail () {
// IPQC IPQC
this.normalizeDetailListIpqcInspectionMethod()
const missingIpqc = (this.detailList || []).find(r => this.isIPQCInspectionType(r) && !r.ipqcInspectionMethod)
if (missingIpqc) {
this.$message.warning('检验类型为IPQC时,“IPQC检验方式”为必填!')
return
}
for (let i = 0; i < this.detailList.length; i++) {
this.detailList[i].updateBy = this.$store.state.user.name
saveAttributeDetailed(this.detailList[i]).then(({data}) => {
@ -2121,8 +2204,10 @@
this.detailData.partNo = row.partNo
this.detailData.attributeNo = row.partNo
this.detailData.partDesc = row.partDesc
this.$set(this.detailData, 'inspectionTypeNo', '')
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
this.detailModelFlag = true
},
@ -2188,14 +2273,14 @@
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.detailData.inspectionTypeNo === '108') && (this.operation == null || this.operation === '')) {
/* 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.detailData.inspectionTypeNo === '108') && (this.operation == null || 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 == null || this.resourceId === '')) {
this.$message.warning('请选择机台!')
return
}
} */
if ((this.detailData.inspectionTypeNo === '105') && (this.selectionManufacturer == null || this.selectionManufacturer.length === 0)) {
this.$message.warning('请选择供应商!')
return
@ -2261,6 +2346,7 @@
refreshDetailList () {
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
},
@ -2530,6 +2616,7 @@
if (data && data.code === 0) {
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
this.$message({
message: '操作成功',
@ -2962,6 +3049,7 @@
let deleteFlag = this.isAuth(this.menuId+":delete")
let detailFlag = this.isAuth(this.menuId+":detail")
let fileFlag = this.isAuth(this.menuId+":file")
let checkoutFlag = this.isAuth(this.menuId+":checkout")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
@ -2969,6 +3057,7 @@
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authFile = !fileFlag
this.authCheckout = !checkoutFlag
},
}
}

Loading…
Cancel
Save