MVP
This commit is contained in:
426
src/views/ProcessManagement/4MTextManagement/index.vue
Normal file
426
src/views/ProcessManagement/4MTextManagement/index.vue
Normal file
@@ -0,0 +1,426 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 250px" clearable @change="searchData">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchData()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-circle-plus" @click="createData('form')">创建</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="640px"
|
||||
style="width: 100%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="排序" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.序号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="内容" min-width="200px">
|
||||
<template slot-scope="scope">
|
||||
<span @click="showContentPreview(scope.row.内容)">{{ scope.row.内容 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color:#ff0000;"
|
||||
@click="deleteData(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<!-- 创建对话框 -->
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="创建4M信息" center style="min-height: 200px;" width="900px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号" style="width: 400px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="排序" prop="orderNum" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="form.orderNum"
|
||||
:min="1"
|
||||
:step="1"
|
||||
size="small"
|
||||
style="width: 400px"
|
||||
placeholder="请输入排序号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容" prop="content" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.content"
|
||||
type="textarea"
|
||||
:rows="12"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 700px; font-family: Consolas, monospace;"
|
||||
placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑对话框 -->
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="编辑4M信息" center style="min-height: 200px;" width="900px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.stationNumberValue"
|
||||
readonly
|
||||
size="small"
|
||||
style="width: 400px"
|
||||
placeholder="工位号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="排序" prop="orderNum" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="form1.orderNum"
|
||||
:min="1"
|
||||
:step="1"
|
||||
size="small"
|
||||
style="width: 400px"
|
||||
placeholder="请输入排序号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容" prop="content" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.content"
|
||||
type="textarea"
|
||||
:rows="12"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 700px; font-family: Consolas, monospace;"
|
||||
placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitEdit('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 内容预览弹窗 -->
|
||||
<el-dialog :visible.sync="previewDialogVisible" title="内容预览" fullscreen>
|
||||
<div class="preview-container">
|
||||
<pre class="preview-content">{{ previewContent }}</pre>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" size="small" @click="previewDialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'FourMTextManagement',
|
||||
data() {
|
||||
return {
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
tableData: [],
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
previewDialogVisible: false,
|
||||
previewContent: '',
|
||||
loading: false,
|
||||
form: {
|
||||
stationNumberValue: '',
|
||||
orderNum: 1,
|
||||
content: ''
|
||||
},
|
||||
rules: {
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
orderNum: [{ required: true, message: '请输入排序号', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
ID: '',
|
||||
stationNumberValue: '',
|
||||
orderNum: 1,
|
||||
content: ''
|
||||
},
|
||||
rules1: {
|
||||
orderNum: [{ required: true, message: '请输入排序号', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
setTimeout(() => {
|
||||
this.searchData()
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
// 获取工位号列表
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '工位与名称_视图_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: `【${response.data[i].工位号}】${response.data[i].工位名称}`,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询数据
|
||||
searchData() {
|
||||
this.loading = true
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', 'MES_4M管理_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData = []
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 创建数据
|
||||
createData(formName) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.stationNumberValue = ''
|
||||
this.form.orderNum = 1
|
||||
this.form.content = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 提交新增
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['序号', this.form.orderNum]
|
||||
param[1] = ['工位号', this.form.stationNumberValue]
|
||||
param[2] = ['内容', this.form.content]
|
||||
var Data = this.CreateData('12', 'MES_4M管理_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0]['result'] === '1') {
|
||||
this.$message({
|
||||
message: '4M信息增加成功!',
|
||||
type: 'success'
|
||||
})
|
||||
// 弹窗不关闭,序号+1,内容清空,工位号保留
|
||||
this.form.orderNum = this.form.orderNum + 1
|
||||
this.form.content = ''
|
||||
// 自动切换查询工位号到提交的工位并查询
|
||||
this.stationNumberValue = this.form.stationNumberValue
|
||||
this.searchData()
|
||||
} else {
|
||||
this.$message.error('4M信息增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消新增
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 修改数据
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.form1.ID = row.ID
|
||||
this.form1.stationNumberValue = row.工位号
|
||||
this.form1.orderNum = row.序号
|
||||
this.form1.content = row.内容
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 提交修改
|
||||
submitEdit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.form1.ID]
|
||||
param[1] = ['序号', this.form1.orderNum]
|
||||
param[2] = ['工位号', this.form1.stationNumberValue]
|
||||
param[3] = ['内容', this.form1.content]
|
||||
var Data = this.CreateData('12', 'MES_4M管理_修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0]['result'] === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.searchData()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消修改
|
||||
callOff1(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
// 删除数据
|
||||
deleteData(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'MES_4M管理_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0]['result'] === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchData()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 显示内容预览
|
||||
showContentPreview(content) {
|
||||
this.previewContent = content
|
||||
this.previewDialogVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
background-color: white!important;
|
||||
}
|
||||
|
||||
/* 预览弹窗样式 */
|
||||
.preview-container {
|
||||
height: calc(100vh - 160px);
|
||||
overflow: auto;
|
||||
background-color: #1e1e1e;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
}
|
||||
.preview-content {
|
||||
font-family: Consolas, 'Courier New', monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #d4d4d4;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
103
src/views/ProcessManagement/AndonMaintenance/UploadExcel.vue
Normal file
103
src/views/ProcessManagement/AndonMaintenance/UploadExcel.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div style="display: inline-block;width: 100%;height: 100%;margin-top: 5px">
|
||||
<input id="excel-upload-input" ref="excel-upload-input" type="file" multiple="multiple" accept=".xlsx, .xls" class="c-hide" @change="handkeFileChange">
|
||||
<div id="drop" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover">
|
||||
将Excel文件拖到这或
|
||||
<el-button style="margin-left:16px;" size="small" icon="el-icon-search" type="primary" plain @click="handleUpload">浏览</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
excelData: {
|
||||
itemFile: [],
|
||||
worksheet: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateDate({ itemFile, worksheet }) {
|
||||
this.excelData.itemFile.push(itemFile)
|
||||
this.excelData.worksheet.push(worksheet)
|
||||
},
|
||||
handleDrop(e) {
|
||||
this.excelData.itemFile = []
|
||||
this.excelData.worksheet = [] // 每次拖拽都清空一次
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
const files = e.dataTransfer.files
|
||||
for (let i = 0; i < files.length; i++) { // 支持多个文件
|
||||
const itemFile = files[i]
|
||||
this.readerData(itemFile)
|
||||
}
|
||||
this.$emit('on-selected-file', this.excelData)
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
},
|
||||
handleDragover(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
handleUpload() {
|
||||
this.excelData.itemFile = []
|
||||
this.excelData.worksheet = [] // 每次点击“浏览”都清空一次
|
||||
document.getElementById('excel-upload-input').click()
|
||||
},
|
||||
handkeFileChange(e) {
|
||||
const files = e.target.files
|
||||
for (let i = 0; i < files.length; i++) { // 支持多个文件
|
||||
const itemFile = files[i]
|
||||
if (!itemFile) return
|
||||
this.readerData(itemFile)
|
||||
}
|
||||
this.$emit('on-selected-file', this.excelData)
|
||||
this.$refs['excel-upload-input'].value = null // fix can't select the same excel
|
||||
},
|
||||
readerData(itemFile) {
|
||||
const reader = new FileReader()
|
||||
reader.onload = e => {
|
||||
const data = e.target.result
|
||||
const fixedData = this.fixdata(data)
|
||||
const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
|
||||
const firstSheetName = workbook.SheetNames[0] // cjnsheetname
|
||||
const worksheet = workbook.Sheets[firstSheetName] // 默认firstsheet
|
||||
this.generateDate({ itemFile, worksheet })
|
||||
}
|
||||
reader.readAsArrayBuffer(itemFile)
|
||||
},
|
||||
fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#excel-upload-input{
|
||||
display: none;
|
||||
z-index: -9999;
|
||||
}
|
||||
#drop{
|
||||
border: 2px dashed #bbb;
|
||||
width: 600px;
|
||||
line-height: 160px;
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
958
src/views/ProcessManagement/AndonMaintenance/index.vue
Normal file
958
src/views/ProcessManagement/AndonMaintenance/index.vue
Normal file
@@ -0,0 +1,958 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 250px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="`【${item.value}】${item.label}`"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">Andon类型:</span>
|
||||
<el-select v-model="andonValue" placeholder="请选择Andon类型" size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in andonArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageSize=15;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">添加</el-button>
|
||||
<el-button type="success" size="small" icon="el-icon-setting" @click="openAndonTypeManage">Andon类型管理</el-button>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-document-copy" @click="openStationCopy">工位拷贝</el-button>
|
||||
<!-- <el-button type="info" plain size="small" icon="el-icon-upload2" @click="importOrder('form')">导入</el-button>-->
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%;max-height: 700px"
|
||||
border
|
||||
size="mini"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="Andon类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安东类型描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="编号">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ scope.row.编号 }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" label="问题描述">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.编号描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: #ff0000"
|
||||
@click="deleteInformation(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="`【${item.value}】${item.label}`"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Andon类型" prop="andonValue" style="display: inline-block">
|
||||
<el-select v-model="form.andonValue" size="small" placeholder="请选择Andon类型">
|
||||
<el-option
|
||||
v-for="item in andonArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题描述" prop="numberDescription" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.numberDescription"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入问题描述"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '添加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
<el-button v-if="title === '修改'" type="primary" size="small" @click="submitAdd1()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="编辑生产订单" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="物料号" prop="orderNumber" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.orderNumber"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入物料号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件名称" prop="partName" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.partName"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="零件名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件图号" prop="partDrawing" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.partDrawing"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入零件图号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="number" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.number"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产厂家" prop="manufactor" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.manufactor"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入生产厂家"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd1()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="订单导入" center style="min-height: 200px" width="900px">
|
||||
<div class="app-container">
|
||||
<upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/>
|
||||
<div style="margin-left: 395px">
|
||||
<span v-show="worksheet.length > 1" style="cursor: pointer;width: 50px;" @click="removeAll"><i class="el-icon-close"/></span>
|
||||
<el-upload :on-remove="handleRemove" :file-list="itemFile" style="width: 220px" action=""/>
|
||||
</div>
|
||||
<div v-if="worksheet.length !== 0" style="margin: 3px 0 0 395px">
|
||||
<el-button icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- Andon类型管理对话框 -->
|
||||
<el-dialog :visible.sync="dialogAndonTypeManage" title="Andon类型管理" center width="900px">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" @click="addAndonType">新增类型</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="andonTypeLoading"
|
||||
:data="andonTypeTableData"
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="类型代码" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安东类型代码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="类型简称" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安东类型简称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="类型描述">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安东类型描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="呼叫描述">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安东呼叫描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否禁用" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.是否禁用 == 0 ? 'success' : 'danger'" size="mini">
|
||||
{{ scope.row.是否禁用 == 0 ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="editAndonType(scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: #ff0000"
|
||||
@click="deleteAndonType(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!-- Andon类型新增/修改对话框 -->
|
||||
<el-dialog :visible.sync="dialogAndonTypeForm" :title="andonTypeFormTitle" center width="500px">
|
||||
<el-form ref="formAndonType" :model="formAndonType" :rules="rulesAndonType" label-position="right" label-width="120px">
|
||||
<el-form-item label="类型代码" prop="安东类型代码">
|
||||
<el-input-number
|
||||
v-model="formAndonType.安东类型代码"
|
||||
:disabled="andonTypeFormTitle === '修改类型'"
|
||||
:min="1"
|
||||
size="small"
|
||||
placeholder="请输入类型代码"
|
||||
style="width: 100%"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型简称" prop="安东类型简称">
|
||||
<el-input
|
||||
v-model="formAndonType.安东类型简称"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入类型简称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型描述" prop="安东类型描述">
|
||||
<el-input
|
||||
v-model="formAndonType.安东类型描述"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入类型描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫描述" prop="安东呼叫描述">
|
||||
<el-input
|
||||
v-model="formAndonType.安东呼叫描述"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入呼叫描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否禁用" prop="是否禁用">
|
||||
<el-radio-group v-model="formAndonType.是否禁用">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogAndonTypeForm = false">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAndonType">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 工位拷贝对话框 -->
|
||||
<el-dialog :visible.sync="dialogStationCopy" title="工位拷贝" center width="500px">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
title="提示:目标工位的所有 Andon 配置将被清空并替换为来源工位的配置!"
|
||||
type="warning"
|
||||
style="margin-bottom: 20px;"/>
|
||||
<el-form ref="formStationCopy" :model="formStationCopy" :rules="rulesStationCopy" label-position="right" label-width="100px">
|
||||
<el-form-item label="来源工位" prop="来源工位">
|
||||
<el-select v-model="formStationCopy.来源工位" size="small" placeholder="请选择来源工位" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="`【${item.value}】${item.label}`"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标工位" prop="目标工位">
|
||||
<el-select v-model="formStationCopy.目标工位" size="small" placeholder="请选择目标工位" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="`【${item.value}】${item.label}`"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogStationCopy = false">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitStationCopy">确定拷贝</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UploadExcelComponent from './UploadExcel.vue'
|
||||
import { sleep } from '../../../utils/tool'
|
||||
import { validateChineseLength } from '../../../utils/validate'
|
||||
// import request from '@/utils/request'
|
||||
export default {
|
||||
name: 'UploadExcel',
|
||||
components: { UploadExcelComponent },
|
||||
data() {
|
||||
return {
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
andonArr: [],
|
||||
andonValue: '',
|
||||
andonLabel: '',
|
||||
worksheet: [],
|
||||
itemFile: [],
|
||||
unSpecification: [],
|
||||
title: '',
|
||||
andonID: '',
|
||||
form: { // 创建订单
|
||||
stationNumberValue: '',
|
||||
andonValue: '',
|
||||
numberDescription: ''
|
||||
},
|
||||
rules: { // 创建订单验证
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
andonValue: [{ required: true, message: '请选择Andon类型', trigger: 'change' }],
|
||||
numberDescription: [{ required: true, validator: validateChineseLength }]
|
||||
},
|
||||
form1: { // 修改订单
|
||||
partName: '',
|
||||
orderNumber: '',
|
||||
partDrawing: '',
|
||||
number: '',
|
||||
manufactor: '',
|
||||
verificationValue: 0,
|
||||
mainMaterialValue: 0,
|
||||
ID: ''
|
||||
},
|
||||
rules1: { // 修改订单验证
|
||||
partName: [{ required: true, message: '请输入零件名称', trigger: 'blur' }],
|
||||
orderNumber: [{ required: true, message: '请输入物料号', trigger: 'blur' }],
|
||||
partDrawing: [{ required: true, message: '请输入零件图号', trigger: 'blur' }],
|
||||
number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
|
||||
manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
|
||||
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }],
|
||||
mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
|
||||
},
|
||||
form2: { // 订单下发
|
||||
planQuantity: '',
|
||||
orderNumber: '',
|
||||
engineTypeValue: '',
|
||||
MID: '',
|
||||
IssuedQuantity: 1
|
||||
},
|
||||
rules2: { // 订单下发验证
|
||||
planQuantity: [{ required: true, message: '请输入计划数量', trigger: 'blur' }],
|
||||
orderNumber: [{ required: true, message: '请输入订单号', trigger: 'blur' }],
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
|
||||
IssuedQuantity: [{ required: true, message: '请输入订单下发数量', trigger: 'blur' }]
|
||||
},
|
||||
// planTime: [new Date(new Date().getTime() - 3600 * 1000 * 24 * 3000), new Date(new Date().getTime())],
|
||||
planTime: [],
|
||||
tableData: [],
|
||||
importData: [],
|
||||
dialogFormVisible: false, // 创建订单
|
||||
dialogFormVisible1: false, // 修改订单
|
||||
dialogFormVisible3: false, // 订单导入
|
||||
states: '', // 当前库存状态
|
||||
MIDGroup: [],
|
||||
total: 0, // 总条数
|
||||
pageList: 15, // 每页显示条数
|
||||
pageSize: 15, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
loading: false,
|
||||
// Andon类型管理
|
||||
dialogAndonTypeManage: false,
|
||||
dialogAndonTypeForm: false,
|
||||
andonTypeFormTitle: '',
|
||||
andonTypeLoading: false,
|
||||
andonTypeTableData: [],
|
||||
formAndonType: {
|
||||
安东类型代码: null,
|
||||
安东类型简称: '',
|
||||
安东类型描述: '',
|
||||
是否禁用: 0,
|
||||
安东呼叫描述: ''
|
||||
},
|
||||
rulesAndonType: {
|
||||
安东类型代码: [{ required: true, message: '请输入类型代码', trigger: 'blur' }],
|
||||
安东类型简称: [{ required: true, message: '请输入类型简称', trigger: 'blur' }],
|
||||
安东类型描述: [{ required: true, message: '请输入类型描述', trigger: 'blur' }],
|
||||
安东呼叫描述: [{ required: true, message: '请输入呼叫描述', trigger: 'blur' }],
|
||||
是否禁用: [{ required: true, message: '请选择是否禁用', trigger: 'change' }]
|
||||
},
|
||||
// 工位拷贝
|
||||
dialogStationCopy: false,
|
||||
formStationCopy: {
|
||||
来源工位: '',
|
||||
目标工位: ''
|
||||
},
|
||||
rulesStationCopy: {
|
||||
来源工位: [{ required: true, message: '请选择来源工位', trigger: 'change' }],
|
||||
目标工位: [{ required: true, message: '请选择目标工位', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
andonValue() {
|
||||
for (let i = 0; i < this.andonArr.length; i++) {
|
||||
if (this.andonArr[i].value === this.andonValue) {
|
||||
this.andonLabel = this.andonArr[i].label
|
||||
}
|
||||
}
|
||||
if (!this.andonValue) {
|
||||
this.andonLabel = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
this.getEndStation()
|
||||
this.searchOrder()
|
||||
},
|
||||
methods: {
|
||||
removeAll() {
|
||||
this.worksheet = []
|
||||
this.itemFile = []
|
||||
},
|
||||
async selected(data) { // 选择需要导入的文件
|
||||
console.log(data, 1111)
|
||||
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
|
||||
this.itemFile = data.itemFile
|
||||
},
|
||||
handleRemove(file) { // 移除文件
|
||||
for (let i = 0; i < this.itemFile.length; i++) {
|
||||
if (this.itemFile[i].name === file.name) {
|
||||
this.worksheet.splice(i, 1)
|
||||
this.itemFile.splice(i, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.andonArr = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'ANDON_类型_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.andonArr.push({
|
||||
label: response.data[i].安东类型描述,
|
||||
value: response.data[i].安东类型代码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位名称,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
let stationNumberValue_check
|
||||
let andonTypeValue_check
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.andonValue ? andonTypeValue_check = 1 : (andonTypeValue_check = 0, this.andonValue = '')
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[2] = ['安东类型代码', this.andonValue]
|
||||
param[3] = ['安东类型代码_ischeck', andonTypeValue_check]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', 'ANDON_类型_编号_工艺页查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
})
|
||||
},
|
||||
// 创建订单
|
||||
creatOrder(formName) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.stationNumberValue = ''
|
||||
this.form.andonValue = ''
|
||||
this.form.numberDescription = ''
|
||||
this.dialogFormVisible = true
|
||||
this.title = '添加'
|
||||
},
|
||||
// 提交新增订单
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumberValue]
|
||||
param[1] = ['安东类型代码', this.form.andonValue]
|
||||
param[2] = ['编号描述', this.form.numberDescription]
|
||||
var Data = this.CreateData('12', 'ANDON_类型_编号_工艺页增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消新增订单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 导入订单
|
||||
importOrder() {
|
||||
this.dialogFormVisible3 = true
|
||||
},
|
||||
// 删除订单
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'ANDON_类型_编号_工艺页删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '订单删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('订单删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改订单
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.andonID = row.ID
|
||||
this.form.stationNumberValue = row.工位号
|
||||
this.form.andonValue = row.安东类型代码
|
||||
this.form.numberDescription = row.编号描述
|
||||
this.dialogFormVisible = true
|
||||
this.title = '修改'
|
||||
},
|
||||
// 提交修改订单
|
||||
submitAdd1() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.andonID]
|
||||
param[1] = ['工位号', this.form.stationNumberValue]
|
||||
param[2] = ['安东类型代码', this.form.andonValue]
|
||||
param[3] = ['编号描述', this.form.numberDescription]
|
||||
var Data = this.CreateData('12', 'ANDON_类型_编号_工艺页编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消修改订单
|
||||
callOff1() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
},
|
||||
// 多选
|
||||
handleSelectionChange(val) {
|
||||
this.MIDGroup = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.MIDGroup.push(val[i].MID)
|
||||
}
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
async basicPartsToSQL() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.err = 0
|
||||
for (let j = this.worksheet.length - 1; j >= 0; j--) {
|
||||
let
|
||||
stationNumberValue,
|
||||
andonTypeNumber,
|
||||
number,
|
||||
numberDescription,
|
||||
numberDescription2
|
||||
var param = []
|
||||
param[0] = ['编号', this.worksheet[j].C2.v]
|
||||
console.log('编号', this.worksheet[j].C2.v)
|
||||
var Data = this.CreateData('11', 'ANDON_类型_编号_导入校验', param)
|
||||
const response = await this.ExecDatabase(Data)
|
||||
const res = response.data
|
||||
if (res[0].Column1 !== 0) {
|
||||
this.$notify.error(`${this.worksheet[j].C2.v}已经存在,请确认文件是否正确`)
|
||||
this.loading = false
|
||||
this.disabled = false
|
||||
return
|
||||
} else {
|
||||
for (let i = 0; i < 999; i++) {
|
||||
const attr = i + 2
|
||||
stationNumberValue = this.worksheet[j][`A${attr}`] ? this.worksheet[j][`A${attr}`].v : ''
|
||||
andonTypeNumber = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : ''
|
||||
number = this.worksheet[j][`C${attr}`] ? this.worksheet[j][`C${attr}`].v : ''
|
||||
numberDescription = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : ''
|
||||
numberDescription2 = this.worksheet[j][`E${attr}`] ? this.worksheet[j][`E${attr}`].v : ''
|
||||
if (!stationNumberValue && !andonTypeNumber &&
|
||||
!number && !numberDescription && !numberDescription2) {
|
||||
break
|
||||
} else if (!number) { // 名称不能为空
|
||||
this.$notify.error(`编号不能为空`)
|
||||
break
|
||||
} else {
|
||||
if (number) {
|
||||
await sleep(50)
|
||||
await this.insertToSQL(stationNumberValue,
|
||||
andonTypeNumber,
|
||||
number,
|
||||
numberDescription,
|
||||
numberDescription2)
|
||||
} else {
|
||||
this.loading = false
|
||||
this.disabled = false
|
||||
this.$notify.error(`请确认导入文件是否正确`)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.itemFile.splice(j, 1)
|
||||
this.worksheet.splice(j, 1)
|
||||
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败物料个数为${this.err},请检查文件是否正确`)
|
||||
}
|
||||
this.loading = false
|
||||
this.searchOrder()
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.loading = false
|
||||
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
},
|
||||
async insertToSQL(stationNumberValue,
|
||||
andonTypeNumber,
|
||||
number,
|
||||
numberDescription,
|
||||
numberDescription2) {
|
||||
try {
|
||||
var param = []
|
||||
param[0] = ['工位号', stationNumberValue]
|
||||
param[1] = ['安东类型代码', andonTypeNumber]
|
||||
param[2] = ['编号', number]
|
||||
param[3] = ['编号描述', numberDescription]
|
||||
param[4] = ['编号描述2', numberDescription2]
|
||||
param[5] = ['导入类型', '1', 'int', '1']
|
||||
var Data = this.CreateData('12', 'ANDON_类型_编号_导入Excel', param)
|
||||
const response = await this.ExecDatabase(Data)
|
||||
const res = response.data
|
||||
if (res.hasOwnProperty('output') === false) {
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${number}导入失败`)
|
||||
}
|
||||
} else {
|
||||
if (res.result[0].result === '0') {
|
||||
this.$notify.error(`${number}导入失败`)
|
||||
}
|
||||
if (res.output[0].导入类型 === '2') {
|
||||
this.$notify.warning(`${number}存在重复数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.$message.error(`导入数据错误`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
},
|
||||
// ========== Andon类型管理相关方法 ==========
|
||||
// 打开Andon类型管理对话框
|
||||
openAndonTypeManage() {
|
||||
this.dialogAndonTypeManage = true
|
||||
this.getAndonTypeList()
|
||||
},
|
||||
// 查询Andon类型列表
|
||||
getAndonTypeList() {
|
||||
this.andonTypeLoading = true
|
||||
this.andonTypeTableData = []
|
||||
const param = []
|
||||
const Data = this.CreateData('11', 'ANDON_类型_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.andonTypeTableData = response.data
|
||||
this.andonTypeLoading = false
|
||||
}).catch(() => {
|
||||
this.andonTypeLoading = false
|
||||
this.$message.error('查询失败!')
|
||||
})
|
||||
},
|
||||
// 新增Andon类型
|
||||
addAndonType() {
|
||||
this.andonTypeFormTitle = '新增类型'
|
||||
this.formAndonType = {
|
||||
安东类型代码: null,
|
||||
安东类型简称: '',
|
||||
安东类型描述: '',
|
||||
是否禁用: 0,
|
||||
安东呼叫描述: ''
|
||||
}
|
||||
this.dialogAndonTypeForm = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs['formAndonType']) {
|
||||
this.$refs['formAndonType'].clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改Andon类型
|
||||
editAndonType(row) {
|
||||
this.andonTypeFormTitle = '修改类型'
|
||||
this.formAndonType = {
|
||||
安东类型代码: row.安东类型代码,
|
||||
安东类型简称: row.安东类型简称,
|
||||
安东类型描述: row.安东类型描述,
|
||||
是否禁用: row.是否禁用 || 0,
|
||||
安东呼叫描述: row.安东呼叫描述
|
||||
}
|
||||
this.dialogAndonTypeForm = true
|
||||
},
|
||||
// 提交Andon类型(新增或修改)
|
||||
submitAndonType() {
|
||||
this.$refs['formAndonType'].validate((valid) => {
|
||||
if (valid) {
|
||||
const param = []
|
||||
param[0] = ['安东类型代码', this.formAndonType.安东类型代码]
|
||||
param[1] = ['安东类型简称', this.formAndonType.安东类型简称]
|
||||
param[2] = ['安东类型描述', this.formAndonType.安东类型描述]
|
||||
param[3] = ['是否禁用', this.formAndonType.是否禁用]
|
||||
param[4] = ['安东呼叫描述', this.formAndonType.安东呼叫描述]
|
||||
const procedureName = this.andonTypeFormTitle === '新增类型' ? 'ANDON_类型_增加' : 'ANDON_类型_修改'
|
||||
const Data = this.CreateData('12', procedureName, param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success(response.data[0].msg || (this.andonTypeFormTitle === '新增类型' ? '新增成功!' : '修改成功!'))
|
||||
this.dialogAndonTypeForm = false
|
||||
this.getAndonTypeList()
|
||||
this.getEndStation() // 刷新下拉列表
|
||||
} else if (response.data[0].result === '2') {
|
||||
this.$message.error(response.data[0].msg || '操作失败!')
|
||||
} else {
|
||||
this.$message.error('操作失败!')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('操作失败!')
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除Andon类型
|
||||
deleteAndonType(row) {
|
||||
this.$confirm('删除此类型可能影响现有数据,是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const param = []
|
||||
param[0] = ['安东类型代码', row.安东类型代码]
|
||||
const Data = this.CreateData('12', 'ANDON_类型_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.$message.success('删除成功!')
|
||||
this.getAndonTypeList()
|
||||
this.getEndStation() // 刷新下拉列表
|
||||
}).catch(() => {
|
||||
this.$message.error('删除失败!')
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message.info('已取消删除')
|
||||
})
|
||||
},
|
||||
// ========== 工位拷贝相关方法 ==========
|
||||
// 打开工位拷贝对话框
|
||||
openStationCopy() {
|
||||
this.formStationCopy = {
|
||||
来源工位: '',
|
||||
目标工位: ''
|
||||
}
|
||||
this.dialogStationCopy = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs['formStationCopy']) {
|
||||
this.$refs['formStationCopy'].clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交工位拷贝
|
||||
submitStationCopy() {
|
||||
this.$refs['formStationCopy'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 二次确认
|
||||
this.$confirm(`确定要将【${this.formStationCopy.来源工位}】的配置拷贝到【${this.formStationCopy.目标工位}】吗?目标工位的现有配置将被清空!`, '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const param = []
|
||||
param[0] = ['来源工位', this.formStationCopy.来源工位]
|
||||
param[1] = ['目标工位', this.formStationCopy.目标工位]
|
||||
const Data = this.CreateData('11', 'ANDON_类型_编号_工位拷贝', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === 1) {
|
||||
this.$message.success(response.data[0].msg)
|
||||
this.dialogStationCopy = false
|
||||
// 如果当前查询的是目标工位,则刷新列表
|
||||
if (this.stationNumberValue === this.formStationCopy.目标工位) {
|
||||
this.searchOrder()
|
||||
}
|
||||
} else if (response.data[0].result === 2) {
|
||||
this.$message.error(response.data[0].msg)
|
||||
} else {
|
||||
this.$message.error('拷贝失败!')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('拷贝失败!')
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message.info('已取消拷贝')
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
background-color: white!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
680
src/views/ProcessManagement/BomEngineManagement/BomList.vue
Normal file
680
src/views/ProcessManagement/BomEngineManagement/BomList.vue
Normal file
@@ -0,0 +1,680 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">基本机型:</span>
|
||||
<el-select
|
||||
v-model="bigEngine"
|
||||
placeholder="请选择基本机型"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px"
|
||||
@change="selectBigEngine">
|
||||
<el-option
|
||||
v-for="item in bigEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">总成号:</span>
|
||||
<el-select
|
||||
v-model="smallEngine"
|
||||
placeholder="请选择总成号"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in smallEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
|
||||
<span style="margin-left: 10px">零件号:</span>
|
||||
<el-input
|
||||
v-model="partId"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入零件号"/>
|
||||
|
||||
<span style="margin-left: 10px">零件名称:</span>
|
||||
<el-input
|
||||
v-model="partName"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入零件名称"/>
|
||||
<br>
|
||||
<br>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 5px"
|
||||
@click="pageSize = 30; pageCurrent = 1; searchOrder()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 5px"
|
||||
@click="addInformation()">新增</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-document-copy"
|
||||
@click="copyBOM('form1')">总成号拷贝</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="640px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center" />
|
||||
<el-table-column align="center" label="总成号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="基本型号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.基本型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="拷贝来源">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.拷贝来源 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" @click="deleteInformation(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 拷贝图号弹出框 -->
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="总成号拷贝" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="来源总成号" prop="EngineSource" style="display: inline-block">
|
||||
<el-select v-model="form1.EngineSource" placeholder="请选择来源总成号" filterable size="small" @change="selectCopyEngineSourceChange">
|
||||
<el-option
|
||||
v-for="item in smallEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源福田号" style="display: inline-block">
|
||||
<el-input v-model="form1.FoTonPartsCodeSource" size="small" placeholder="" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标总成号" prop="EngineTarget" style="display: inline-block">
|
||||
<el-input v-model="form1.EngineTarget" size="small" placeholder="请输入目标总成号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标福田号" prop="FoTonPartsCodeTarget" style="display: inline-block">
|
||||
<el-input v-model="form1.FoTonPartsCodeTarget" size="small" placeholder="请输入目标福田零件号" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd1()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 新增修改弹出框 -->
|
||||
<el-dialog :visible.sync="dialogFormVisible2" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form1" :model="addForm" :rules="addUpdateRules" label-position="right" label-width="110px">
|
||||
<el-form-item label="基本机型:" prop="bigEngine" style="display: inline-block">
|
||||
<el-select
|
||||
v-model="bigEngine"
|
||||
placeholder="请选择基本机型"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px"
|
||||
@change="selectBigEngine">
|
||||
<el-option
|
||||
v-for="item in bigEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总成号:" prop="smallEngine" style="display: inline-block">
|
||||
<el-select
|
||||
v-model="addForm.smallEngine"
|
||||
placeholder="请选择总成号"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in smallEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工位号:" prop="opName" style="display: inline-block">
|
||||
<el-select
|
||||
v-model="addForm.opName"
|
||||
placeholder="请选择工位号"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件名称" prop="partName" style="display: inline-block">
|
||||
<el-input v-model="addForm.partName" size="small" placeholder="请输入零件名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="零件号" prop="partId" style="display: inline-block">
|
||||
<el-input v-model="addForm.partId" size="small" placeholder="请输入零件号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="size" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="addForm.size"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
style="width: 200px;"
|
||||
placeholder="请输入使用数量" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff2('addForm')">取消</el-button>
|
||||
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('addForm')">确定</el-button>
|
||||
<el-button v-if="title === '新增'" type="primary" size="small" @click="submitAdd('addForm')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
bigEngine: '', // 大机型
|
||||
smallEngine: '', // 小机型
|
||||
partName: '', // 零件名称
|
||||
partId: '', // 零件号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: [],
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
title: '',
|
||||
form1: {
|
||||
FoTonPartsCodeTarget: '', // 目标福田号
|
||||
FoTonPartsCodeSource: '', // 来源福田号
|
||||
EngineSource: '', // 图号来源
|
||||
EngineTarget: '' // 目标图号
|
||||
},
|
||||
addForm: {
|
||||
id: '',
|
||||
smallEngine: '',
|
||||
partId: '',
|
||||
opName: '',
|
||||
size: 0,
|
||||
partName: ''
|
||||
},
|
||||
rules1: {
|
||||
FoTonPartsCodeTarget: [{ required: true, message: '请选择图号来源', trigger: ['blur', 'change'] }],
|
||||
EngineSource: [{ required: true, message: '请选择图号来源', trigger: ['blur', 'change'] }],
|
||||
EngineTarget: [{ required: true, message: '请输入目标图号', trigger: ['blur', 'change'] }]
|
||||
},
|
||||
addUpdateRules: {
|
||||
smallEngine: [{ required: true, message: '请选择总成号', trigger: ['blur', 'change'] }],
|
||||
partName: [{ required: true, message: '请输入零件名称', trigger: ['blur', 'change'] }],
|
||||
partId: [{ required: true, message: '请输入零件号', trigger: ['blur', 'change'] }],
|
||||
opName: [{ required: true, message: '请选择工位号', trigger: ['blur', 'change'] }],
|
||||
size: [{ required: true, message: '请输入使用数量', trigger: ['blur', 'change'] }]
|
||||
},
|
||||
smallEngineList: [], // 小机型列表
|
||||
bigEngineList: [] // 大机型列表
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getSmallEngine()
|
||||
this.getEndStation()
|
||||
this.searchOrder()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择大机型触发事件
|
||||
selectBigEngine() {
|
||||
this.addForm.smallEngine = ''
|
||||
this.smallEngine = ''
|
||||
this.getSmallEngine()
|
||||
},
|
||||
// 拷贝总成号 机型选中事件 获取福田号
|
||||
selectCopyEngineSourceChange() {
|
||||
this.form1.FoTonPartsCodeSource = ''
|
||||
var param = []
|
||||
param[0] = ['零件号', this.form1.EngineSource]
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_福田零件号_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
this.form1.FoTonPartsCodeSource = response.data[0].福田零件号
|
||||
this.form1.FoTonPartsCodeTarget = response.data[0].福田零件号
|
||||
} else {
|
||||
this.$message.error('此总成号无对应福田零件号')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑零件
|
||||
editInformation(row) {
|
||||
this.addForm.id = row.ID
|
||||
this.addForm.smallEngine = row.零件号
|
||||
this.addForm.opName = row.工位号
|
||||
this.addForm.size = row.数量
|
||||
this.addForm.partId = row.零件编号
|
||||
this.addForm.partName = row.零件名称
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
// 新增零件
|
||||
addInformation() {
|
||||
this.title = '新增'
|
||||
// 清空表单
|
||||
this.addForm.smallEngine = ''
|
||||
this.addForm.partId = ''
|
||||
this.addForm.opName = ''
|
||||
this.addForm.size = 0
|
||||
this.addForm.partName = ''
|
||||
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
// 删除订单
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将在所有总成号中删除该零件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['零件编号', row.零件编号]
|
||||
var Data = this.CreateData('12', '北汽福田_BOM_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '零件删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('零件删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 复制图号取消
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
// 修改框取消
|
||||
callOff2() {
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
// 复制图号提交
|
||||
submitAdd1() {
|
||||
var param = []
|
||||
param[0] = ['零件号', this.form1.EngineSource]
|
||||
param[1] = ['新零件号', this.form1.EngineTarget]
|
||||
param[2] = ['新福田号', this.form1.FoTonPartsCodeTarget]
|
||||
var Data = this.CreateData('11', '北汽福田BOM_复制', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response)
|
||||
if (response.data[0].result === 1) {
|
||||
this.$message({
|
||||
message: response.data[0].msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.smallEngine = this.form1.EngineTarget
|
||||
this.getSmallEngine()
|
||||
this.getEndStation()
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error(response.data[0].msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改提交
|
||||
submitUpdate() {
|
||||
var param = []
|
||||
param[0] = ['零件号', this.addForm.smallEngine]
|
||||
param[1] = ['工位号', this.addForm.opName]
|
||||
param[2] = ['零件名称', this.addForm.partName]
|
||||
param[3] = ['零件编号', this.addForm.partId]
|
||||
param[4] = ['数量', this.addForm.size]
|
||||
param[5] = ['id', this.addForm.id]
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response)
|
||||
if (response.data[0].result === 1) {
|
||||
this.$message({
|
||||
message: response.data[0].msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible2 = false
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error(response.data[0].msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增提交
|
||||
submitAdd() {
|
||||
var param = []
|
||||
param[0] = ['零件号', this.addForm.smallEngine]
|
||||
param[1] = ['工位号', this.addForm.opName]
|
||||
param[2] = ['零件名称', this.addForm.partName]
|
||||
param[3] = ['零件编号', this.addForm.partId]
|
||||
param[4] = ['数量', this.addForm.size]
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response)
|
||||
if (response.data[0].result === 1) {
|
||||
this.$message({
|
||||
message: response.data[0].msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible2 = false
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error(response.data[0].msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取小机型
|
||||
getSmallEngine() {
|
||||
this.smallEngineList = []
|
||||
var param = []
|
||||
this.bigEngine ? param[0] = ['基本型号', this.bigEngine] : ''
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_零件号查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.smallEngineList.push({
|
||||
label: response.data[i].零件号,
|
||||
value: response.data[i].零件号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取大机型
|
||||
getEndStation() {
|
||||
this.bigEngine = ''
|
||||
this.bigEngineList = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.bigEngineList.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号,
|
||||
labelName: response.data[i].发动机机型标志
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拷贝BOM数据 按钮
|
||||
copyBOM(formName) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
let bigEngine_check
|
||||
let smallEngine_check
|
||||
let partName_check
|
||||
let partId_check
|
||||
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.bigEngine ? bigEngine_check = 1 : (bigEngine_check = 0, this.bigEngine = '')
|
||||
this.smallEngine ? smallEngine_check = 1 : (smallEngine_check = 0, this.smallEngine = '')
|
||||
this.partName ? partName_check = 1 : (partName_check = 0, this.partName = '')
|
||||
this.partId ? partId_check = 1 : (partId_check = 0, this.partId = '')
|
||||
|
||||
var param = []
|
||||
param[0] = ['基本型号_ischeck', bigEngine_check]
|
||||
param[1] = ['基本型号', this.bigEngine]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
param[8] = ['零件号_ischeck', smallEngine_check]
|
||||
param[9] = ['零件号', this.smallEngine]
|
||||
param[10] = ['零件编号_ischeck', partId_check]
|
||||
param[11] = ['零件编号', this.partId]
|
||||
param[12] = ['零件名称_ischeck', partName_check]
|
||||
param[13] = ['零件名称', this.partName]
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let stationNumberValue_check
|
||||
let bigEngine_check
|
||||
let smallEngine_check
|
||||
let partName_check
|
||||
let partId_check
|
||||
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.bigEngine ? bigEngine_check = 1 : (bigEngine_check = 0, this.bigEngine = '')
|
||||
this.smallEngine ? smallEngine_check = 1 : (smallEngine_check = 0, this.smallEngine = '')
|
||||
this.partName ? partName_check = 1 : (partName_check = 0, this.partName = '')
|
||||
this.partId ? partId_check = 1 : (partId_check = 0, this.partId = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['基本型号_ischeck', bigEngine_check]
|
||||
param[1] = ['基本型号', this.bigEngine]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
param[8] = ['零件号_ischeck', smallEngine_check]
|
||||
param[9] = ['零件号', this.smallEngine]
|
||||
param[10] = ['零件编号_ischeck', partId_check]
|
||||
param[11] = ['零件编号', this.partId]
|
||||
param[12] = ['零件名称_ischeck', partName_check]
|
||||
param[13] = ['零件名称', this.partName]
|
||||
var Data = this.CreateData('2001', '北汽福田_BOM_查询', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.topDiv {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 200px
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 200px
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-card style="margin-bottom: 10px;width: 100%;">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">基本机型:</span>
|
||||
<el-select
|
||||
v-model="bigEngine"
|
||||
placeholder="请选择基本机型"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px"
|
||||
@change="selectBigEngine">
|
||||
<el-option
|
||||
v-for="item in bigEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="EngineName1" placeholder="请选择比对零件号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in smallEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
<el-button size="small" type="primary" style="margin: 0 2vw;" @click="searchBomList()">比对零件号差异</el-button>
|
||||
<el-select v-model="EngineName2" placeholder="请选择比对零件号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in smallEngineList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini" />
|
||||
</el-select>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-card style="margin-bottom: 10px">
|
||||
<el-button size="small" type="primary">创建一级菜单</el-button>
|
||||
</el-card> -->
|
||||
<el-card>
|
||||
<el-table
|
||||
ref="multipleTableLeft"
|
||||
:data="tableData"
|
||||
:cell-class-name="cellClassName"
|
||||
stripe
|
||||
size="mini"
|
||||
height="700"
|
||||
style="height:calc(100vh - 330px);">
|
||||
<el-table-column type="index" width="60" label="序号" align="center" />
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
ref="multipleTableRight"
|
||||
:data="tableData"
|
||||
:cell-class-name="cellClassName"
|
||||
stripe
|
||||
size="mini"
|
||||
height="700"
|
||||
style="height:calc(100vh - 330px);">
|
||||
<el-table-column type="index" width="60" label="序号" align="center" />
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号2 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件号2 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件编号2 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称2 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量2 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'MenuManagement',
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
EngineName1: '',
|
||||
EngineName2: '',
|
||||
rules1: {
|
||||
moduleName: [{ required: true, message: '请输入', trigger: ['blur', 'change'] }]
|
||||
},
|
||||
rules2: {
|
||||
moduleName: [{ required: true, message: '请输入', trigger: ['blur', 'change'] }]
|
||||
},
|
||||
smallEngineList: [],
|
||||
dom1: null,
|
||||
dom2: null,
|
||||
stationNumber: [], // 工位号
|
||||
stationNumberValue: '',
|
||||
bigEngine: '',
|
||||
bigEngineList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSmallEngine()
|
||||
this.getStationNumber()
|
||||
this.getEndStation()
|
||||
setTimeout(() => {
|
||||
this.dom1 = this.$refs.multipleTableLeft.bodyWrapper
|
||||
this.dom2 = this.$refs.multipleTableRight.bodyWrapper
|
||||
this.listenerScroll()
|
||||
}, 500)
|
||||
},
|
||||
methods: {
|
||||
listenerScroll() {
|
||||
this.dom2.addEventListener('scroll', () => {
|
||||
// 横滚
|
||||
this.dom1.scrollLeft = this.dom2.scrollLeft
|
||||
// 竖滚
|
||||
this.dom1.scrollTop = this.dom2.scrollTop
|
||||
})
|
||||
|
||||
this.dom1.addEventListener('scroll', () => {
|
||||
// 横滚
|
||||
this.dom2.scrollLeft = this.dom1.scrollLeft
|
||||
// 竖滚
|
||||
this.dom2.scrollTop = this.dom1.scrollTop
|
||||
})
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询零件号数据
|
||||
searchBomList() {
|
||||
this.tableData = []
|
||||
|
||||
let stationNumberValue_check
|
||||
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
|
||||
var param = []
|
||||
param[0] = ['零件号1', this.EngineName1]
|
||||
param[1] = ['零件号2', this.EngineName2]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_零件差异查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
// this.loading = false
|
||||
})
|
||||
},
|
||||
// 选择大机型触发事件
|
||||
selectBigEngine() {
|
||||
this.EngineName1 = ''
|
||||
this.EngineName2 = ''
|
||||
this.getSmallEngine()
|
||||
},
|
||||
// 获取大机型
|
||||
getEndStation() {
|
||||
this.bigEngine = ''
|
||||
this.bigEngineList = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.bigEngineList.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号,
|
||||
labelName: response.data[i].发动机机型标志
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取小机型
|
||||
getSmallEngine() {
|
||||
this.smallEngineList = []
|
||||
var param = []
|
||||
this.bigEngine ? param[0] = ['基本型号', this.bigEngine] : ''
|
||||
var Data = this.CreateData('11', '北汽福田_BOM_零件号查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.smallEngineList.push({
|
||||
label: response.data[i].零件号,
|
||||
value: response.data[i].零件号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据差异来决定该行颜色
|
||||
cellClassName({ row, column }) {
|
||||
let isNoEqual = false
|
||||
row.工位号 !== row.工位号2 ? isNoEqual = true : ''
|
||||
// row.零件号 !== row.零件号2 ? isNoEqual = true : ''
|
||||
row.零件编号 !== row.零件编号2 ? isNoEqual = true : ''
|
||||
row.零件名称 !== row.零件名称2 ? isNoEqual = true : ''
|
||||
row.数量 !== row.数量2 ? isNoEqual = true : ''
|
||||
|
||||
if (isNoEqual) {
|
||||
return 'NoEqual-row'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
::v-deep.el-table .el-table__body .NoEqual-row {
|
||||
background: rgba(255, 255, 0, 0.5) !important;
|
||||
/* color: #fff !important; */
|
||||
}
|
||||
</style>
|
||||
31
src/views/ProcessManagement/BomEngineManagement/index.vue
Normal file
31
src/views/ProcessManagement/BomEngineManagement/index.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="Bom数据" name="1">
|
||||
<BomList ref="fresh1" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="总成号比对" name="2">
|
||||
<BomListCompare ref="fresh1" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BomList from '@/views/ProcessManagement/BomEngineManagement/BomList.vue'
|
||||
import BomListCompare from '@/views/ProcessManagement/BomEngineManagement/BomListCompare.vue'
|
||||
export default {
|
||||
components: {
|
||||
'BomList': BomList,
|
||||
'BomListCompare': BomListCompare
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: '1'
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
359
src/views/ProcessManagement/CertificateConformity/index.vue
Normal file
359
src/views/ProcessManagement/CertificateConformity/index.vue
Normal file
@@ -0,0 +1,359 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" clearable style="width: 150px" @change="searchTable">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">工位名称:</span>
|
||||
<el-input v-model="stationName" readonly style="width:170px;" placeholder="" size="small"/>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="add()">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测试方法" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测试方法 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="检测要求">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.检测要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工具/设备" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.检测设备 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)"/>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteOrder(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="合格证项目新增" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" placeholder="请选择工位号" size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测试方法" prop="testMethod" style="display: inline-block">
|
||||
<el-input v-model="form.testMethod" size="small" placeholder="请输入测试方法"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测要求" prop="testContent" style="display: inline-block">
|
||||
<el-input v-model="form.testContent" size="small" placeholder="请输入检测要求"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具/设备" prop="testTool" style="display: inline-block">
|
||||
<el-input v-model="form.testTool" size="small" placeholder="请输入工具/设备"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="addRhythm('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="合格证项目编辑" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="editForm" :model="editForm" :rules="editRules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-input v-model="editForm.stationNumberValue" readonly size="small" placeholder=""/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测试方法" prop="testMethod" style="display: inline-block">
|
||||
<el-input v-model="editForm.testMethod" size="small" placeholder="请输入测试方法"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测要求" prop="testContent" style="display: inline-block">
|
||||
<el-input v-model="editForm.testContent" size="small" placeholder="请输入检测要求"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具/设备" prop="testTool" style="display: inline-block">
|
||||
<el-input v-model="editForm.testTool" size="small" placeholder="请输入工具/设备"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('editForm')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitEdit('editForm')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rhythm: '',
|
||||
engineTypeValue: '',
|
||||
engineType: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
testMethod: '',
|
||||
stationNumberValue: '',
|
||||
opCodeName: '',
|
||||
testTool: '',
|
||||
testContent: ''
|
||||
},
|
||||
editForm: {
|
||||
id: '',
|
||||
stationNumberValue: '',
|
||||
opCodeName: '',
|
||||
testMethod: '',
|
||||
testTool: '',
|
||||
testContent: ''
|
||||
},
|
||||
rules: {
|
||||
stationNumberValue: [{ required: true, message: '请选择工位', trigger: 'change' }],
|
||||
testMethod: [{ required: true, message: '请输入测试方法', trigger: 'blur' }],
|
||||
testTool: [{ required: true, message: '请输入工具/设备', trigger: 'blur' }],
|
||||
testContent: [{ required: true, message: '请输入检测要求', trigger: 'blur' }]
|
||||
},
|
||||
editRules: {
|
||||
testMethod: [{ required: true, message: '请输入测试方法', trigger: 'blur' }],
|
||||
testTool: [{ required: true, message: '请输入工具/设备', trigger: 'blur' }],
|
||||
testContent: [{ required: true, message: '请输入检测要求', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
stationNumberValue() {
|
||||
for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
this.stationName = this.stationNumber[i].labelName
|
||||
}
|
||||
}
|
||||
if (!this.stationNumberValue) {
|
||||
this.stationName = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
// 初始化获取订单号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getProductType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础信息_机型信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].机型ID
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].机型号,
|
||||
value: response.data[i].机型ID,
|
||||
labelName: response.data[i].机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询信息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', 'CATL_基础_合格证项目_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.$refs['editForm'].resetFields()
|
||||
},
|
||||
// 新增节拍
|
||||
addRhythm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumberValue]
|
||||
param[1] = ['测试方法', this.form.testMethod]
|
||||
param[2] = ['检测要求', this.form.testContent]
|
||||
param[3] = ['检测设备', this.form.testTool]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('新增失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
edit(row) {
|
||||
this.dialogFormVisible1 = true
|
||||
this.editForm.id = row.ID
|
||||
this.editForm.stationNumberValue = row.工位号
|
||||
this.editForm.testMethod = row.测试方法
|
||||
this.editForm.testTool = row.检测设备
|
||||
this.editForm.testContent = row.检测要求
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.editForm.id]
|
||||
param[1] = ['测试方法', this.editForm.testMethod]
|
||||
param[2] = ['检测要求', this.editForm.testContent]
|
||||
param[3] = ['检测设备', this.editForm.testTool]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '编辑成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('编辑失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除订单
|
||||
deleteOrder(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
368
src/views/ProcessManagement/InterfaceModuleMaintenance/index.vue
Normal file
368
src/views/ProcessManagement/InterfaceModuleMaintenance/index.vue
Normal file
@@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">模块描述:</span>
|
||||
<el-select v-model="moduleDescriptionValue" placeholder="请选择模块描述" clearable size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in moduleDescription"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="770px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 60%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="模块描述">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.模块描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否禁用" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否禁用 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)"/>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteInformation(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumber" placeholder="请选择工位号" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签ID:" prop="moduleDescription" style="display: inline-block">
|
||||
<el-select v-model="form.moduleDescription" placeholder="请选择模块描述" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in moduleDescription"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否禁用:" prop="isDisable" style="display: inline-block">
|
||||
<el-select v-model="form.isDisable" placeholder="请选择是否禁用" size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in isDisable"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('form')">确定</el-button>
|
||||
<el-button v-if="title === '添加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
moduleDescription: [],
|
||||
moduleDescriptionValue: '',
|
||||
tagIDArr: [
|
||||
{
|
||||
label: 'lbl_datagrid_quality_name',
|
||||
value: 'lbl_datagrid_quality_name'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item1',
|
||||
value: 'lbl_datagrid_quality_item1'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item2',
|
||||
value: 'lbl_datagrid_quality_item2'
|
||||
}
|
||||
],
|
||||
isDisable: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
}, {
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
isDisableValue: 0,
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
dialogFormVisible: false,
|
||||
title: '',
|
||||
form: {
|
||||
stationNumber: '',
|
||||
moduleDescription: '',
|
||||
isDisable: 0
|
||||
},
|
||||
rules: {
|
||||
stationNumber: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
moduleDescription: [{ required: true, message: '请选择模块', trigger: 'change' }],
|
||||
isDisable: [{ required: true, message: '请选择是否禁用', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable1()
|
||||
this.getStationNumber()
|
||||
this.getModuleDescription()
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '物料批次扫描切换_工位号_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getModuleDescription() {
|
||||
this.moduleDescription = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES界面显示_模块列表_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.moduleDescription.push({
|
||||
label: response.data[i].模块描述,
|
||||
value: response.data[i].模块编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询MES消息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
// let stationNumberValue_check
|
||||
// this.stationNumberValue ? stationNumberValue_check = true : (stationNumberValue_check = false, this.stationNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['模块编号', this.moduleDescriptionValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
// param[2] = ['工位号', this.stationNumberValue]
|
||||
// param[3] = ['check工位号', stationNumberValue_check]
|
||||
var Data = this.CreateData('11', '工艺管理_界面模块维护_信息查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询MES消息
|
||||
searchTable1() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '工艺管理_界面模块维护_初始化查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
addTo() {
|
||||
this.title = '添加'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumber]
|
||||
param[1] = ['模块编号', this.form.moduleDescription]
|
||||
param[2] = ['是否禁用', this.form.isDisable]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '工艺管理_界面模块维护_信息增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.tagID = ''
|
||||
this.form.tagText = ''
|
||||
this.form.isDisable = 0
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.标签编号
|
||||
this.form.stationNumber = row.工位号
|
||||
this.form.moduleDescription = row.模块编号
|
||||
if (row.是否禁用 === '是') {
|
||||
this.form.isDisable = 1
|
||||
} else {
|
||||
this.form.isDisable = 0
|
||||
}
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumber]
|
||||
param[1] = ['模块编号', this.form.moduleDescription]
|
||||
param[2] = ['是否禁用', this.form.isDisable]
|
||||
param[3] = ['标签编号', this.labelNumber]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '工艺管理_界面模块维护_信息编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['标签编号', row.标签编号]
|
||||
var Data = this.CreateData('12', '工艺管理_界面模块维护_信息删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '订单删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('订单删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
374
src/views/ProcessManagement/LabelLanguageMaintenance/index.vue
Normal file
374
src/views/ProcessManagement/LabelLanguageMaintenance/index.vue
Normal file
@@ -0,0 +1,374 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">标签文字:</span>
|
||||
<el-input v-model="labelText" style="width:150px;" placeholder="标签文字" size="small" clearable/>
|
||||
<span style="margin-left: 10px">是否禁用:</span>
|
||||
<el-select v-model="isDisableValue" placeholder="请选择" size="small" style="width: 80px">
|
||||
<el-option
|
||||
v-for="item in isDisable"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchLabelText()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="770px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="语言编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.语言编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="标签ID">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标签ID }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="标签描述">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标签描述 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否禁用">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="Number(scope.row.是否禁用) === 1">是</span>
|
||||
<span v-if="Number(scope.row.是否禁用) === 0">否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" @click="deleteInformation(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumber" placeholder="请选择工位号" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签ID:" prop="tagID" style="display: inline-block">
|
||||
<el-select v-model="form.tagID" placeholder="请选择标签ID" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in tagIDArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签文字:" prop="tagText" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.tagText"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入标签文字"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否禁用:" prop="isDisable" style="display: inline-block">
|
||||
<el-select v-model="form.isDisable" placeholder="请选择是否禁用" size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in isDisable"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '编辑标签'" type="primary" size="small" @click="submitUpdate('form')">确定</el-button>
|
||||
<el-button v-if="title === '添加标签'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
isDisable: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
}, {
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
isDisableValue: 0,
|
||||
tagIDArr: [
|
||||
{
|
||||
label: 'lbl_datagrid_quality_name',
|
||||
value: 'lbl_datagrid_quality_name'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item1',
|
||||
value: 'lbl_datagrid_quality_item1'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item2',
|
||||
value: 'lbl_datagrid_quality_item2'
|
||||
}
|
||||
],
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
dialogFormVisible: false,
|
||||
title: '',
|
||||
form: {
|
||||
stationNumber: '',
|
||||
tagID: '',
|
||||
tagText: '',
|
||||
isDisable: 0
|
||||
},
|
||||
rules: {
|
||||
stationNumber: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
tagID: [{ required: true, message: '请选择标签ID', trigger: 'change' }],
|
||||
tagText: [{ required: true, message: '请输入标签文字', trigger: 'blur' }],
|
||||
isDisable: [{ required: true, message: '请选择是否禁用', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchLabelText()
|
||||
this.getStationNumber()
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '物料批次扫描切换_工位号_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询MES消息
|
||||
searchLabelText() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
this.stationNumberValue ? stationNumberValue_check = true : (stationNumberValue_check = false, this.stationNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['标签文字', this.labelText]
|
||||
param[1] = ['是否禁用', this.isDisableValue]
|
||||
param[2] = ['工位号', this.stationNumberValue]
|
||||
param[3] = ['check工位号', stationNumberValue_check]
|
||||
var Data = this.CreateData('11', '工艺管理_界面标签语言维护_信息查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
addTo() {
|
||||
this.title = '添加标签'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
topOrder() {
|
||||
if (this.mid) {
|
||||
this.dialogFormVisible = true
|
||||
} else {
|
||||
this.$message.error('请选择订单!')
|
||||
}
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumber]
|
||||
param[1] = ['标签ID', this.form.tagID]
|
||||
param[2] = ['标签文字', this.form.tagText]
|
||||
param[3] = ['是否禁用', this.form.isDisable]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '工艺管理_界面标签语言维护_信息增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchLabelText()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.tagID = ''
|
||||
this.form.tagText = ''
|
||||
this.form.isDisable = 0
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.标签编号
|
||||
this.form.stationNumber = row.工位号
|
||||
this.form.tagID = row.标签ID
|
||||
this.form.tagText = row.标签描述
|
||||
this.form.isDisable = Number(row.是否禁用)
|
||||
this.title = '编辑标签'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumber]
|
||||
param[1] = ['标签ID', this.form.tagID]
|
||||
param[2] = ['标签文字', this.form.tagText]
|
||||
param[3] = ['是否禁用', this.form.isDisable]
|
||||
param[4] = ['语言标签编号', this.labelNumber]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '工艺管理_界面标签语言维护_信息修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchLabelText()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['标签编号', row.标签编号]
|
||||
var Data = this.CreateData('12', '工艺管理_界面标签语言维护_信息删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '订单删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchLabelText()
|
||||
} else {
|
||||
this.$message.error('订单删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
294
src/views/ProcessManagement/LabelLanguageMaintenance/index2.vue
Normal file
294
src/views/ProcessManagement/LabelLanguageMaintenance/index2.vue
Normal file
@@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="height: 867px">
|
||||
<el-col :span="6">
|
||||
<div style="width: 145px;display: inline-block">
|
||||
<el-input v-model="processFileName" placeholder="请输入文件名称" clearable/>
|
||||
</div>
|
||||
<el-button :disabled="loading" type="success" plain icon="el-icon-search" style="margin-left: 10px" @click="searchTable()">查询文件</el-button>
|
||||
<br>
|
||||
<el-upload
|
||||
ref="uploadStandFile"
|
||||
:on-remove="handleRemove"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:file-list="fileList"
|
||||
:auto-upload="false"
|
||||
:action="action"
|
||||
:data="Data"
|
||||
:limit="1"
|
||||
:on-success="stnFileSuccess"
|
||||
:on-error="stnFileError"
|
||||
class="upload-demo"
|
||||
style="margin-top: 10px">
|
||||
<el-button slot="trigger" plain type="primary" icon="el-icon-thumb">选取工艺文件</el-button>
|
||||
<el-button style="margin-left: 10px;" plain type="warning" icon="el-icon-upload2" @click="uploadStandFile">上传文件</el-button>
|
||||
</el-upload>
|
||||
<div style="margin-top: 10px">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#F5F5F5'}"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="740"
|
||||
border
|
||||
highlight-current-row
|
||||
stripe
|
||||
size="mini">
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50"/>
|
||||
<el-table-column align="left" label="文件名称" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.fileName + '.' + scope.row.fileType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="编辑" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-view" @click="lookFile(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-download" style="color: #00893d" @click="downLoadFile(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-delete" style="color: red" @click="deleteFile(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<span v-if="fileName !== ''" style="font-size: 18px;font-weight: bolder">{{ fileName + '.' + fileType }}</span>
|
||||
<span v-else style="font-size: 18px;font-weight: bolder">请选择左侧文件进行预览</span>
|
||||
<div style="height: 814px;border: 1px solid #a1a1a1">
|
||||
<div v-show="fileContent !== ''">
|
||||
<el-image v-if="isImageType" :src="fileContentImg" lazy fit="fill"/>
|
||||
<div v-else-if="isPdfType">
|
||||
<iframe
|
||||
:src="fileContentPdf"
|
||||
width="100%"
|
||||
height="810px"/>
|
||||
</div>
|
||||
<div v-else class="noView">不支持的预览格式</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { action } from '@/utils/request'
|
||||
import $ from 'jquery'
|
||||
|
||||
export default {
|
||||
// props: ['opname'],
|
||||
data() {
|
||||
return {
|
||||
opname: '',
|
||||
imageType: ['bmp', 'jpg', 'png', 'gif'],
|
||||
pdfType: ['pdf'],
|
||||
currentDownLoadUrl: '',
|
||||
fileName: '',
|
||||
fileType: '',
|
||||
fileContent: '',
|
||||
fileContentImg: null,
|
||||
fileContentPdf: null,
|
||||
isImageType: false,
|
||||
isPdfType: false,
|
||||
action: action,
|
||||
fileList: [],
|
||||
processFileName: '',
|
||||
opnames: [],
|
||||
opnameThis: '',
|
||||
opnameThisName: '',
|
||||
listOP: [],
|
||||
loading: false,
|
||||
tableData: [],
|
||||
Data: {},
|
||||
total: 0, // 总条数
|
||||
pageSize: 50, // 每页显示条数
|
||||
PageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
// this.opnameThis = this.opname
|
||||
// this.searchTableOpName()
|
||||
// this.searchTable()
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 获取工位号
|
||||
searchTableOpName() {
|
||||
var param = []
|
||||
this.machineInfo_state = {}
|
||||
var Data = this.CreateData('11', '[AAA临工看板_主看板_查询数据]', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.opnames.push({
|
||||
label: response.data[i].工位号 + '-' + response.data[i].工位名称,
|
||||
value: response.data[i].工位号,
|
||||
id: response.data[i].id
|
||||
})
|
||||
if (response.data[i].工位号 === this.opnameThis) {
|
||||
this.opnameThisName = response.data[i].工位号 + '-' + response.data[i].工位名称
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询文件列表
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['opname', this.opnameThis]
|
||||
param[1] = ['fileName', this.processFileName]
|
||||
var Data = this.CreateData('11', 'LG_临工看板_工艺管理_工艺文件查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
},
|
||||
// 预览文件
|
||||
lookFile(row) {
|
||||
this.fileName = row.fileName
|
||||
this.fileType = row.fileType.toLowerCase()
|
||||
this.fileContent = row.fileContent
|
||||
this.fileContentImg = ''
|
||||
this.fileContentPdf = ''
|
||||
if (this.imageType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = true
|
||||
this.isPdfType = false
|
||||
this.fileContentImg = 'data:image/png;base64,' + this.fileContent
|
||||
} else if (this.pdfType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = false
|
||||
this.isPdfType = true
|
||||
this.fileContentPdf = this.solvePdfUrl(this.fileContent, this.fileType, this.fileName)
|
||||
} else {
|
||||
this.isImageType = false
|
||||
this.isPdfType = false
|
||||
}
|
||||
},
|
||||
// 处理pdf
|
||||
solvePdfUrl(content, type, fileName) {
|
||||
const bstr = atob(content)
|
||||
let n = bstr.length
|
||||
const u8arr = new Uint8Array(n)
|
||||
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
||||
// 确定解析格式,可能可以变成img,没有深入研究
|
||||
const blob = new Blob([u8arr], { type: 'application/pdf;chartset=UTF-8' })
|
||||
return window.URL.createObjectURL(blob)
|
||||
},
|
||||
// 下载文件
|
||||
downLoadFile(row) {
|
||||
let contentUrl = ''
|
||||
this.fileName = row.fileName
|
||||
this.fileType = row.fileType.toLowerCase()
|
||||
this.fileContent = row.fileContent
|
||||
this.fileContentImg = ''
|
||||
this.fileContentPdf = ''
|
||||
if (this.imageType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = true
|
||||
this.isPdfType = false
|
||||
this.fileContentImg = 'data:image/png;base64,' + this.fileContent
|
||||
contentUrl = 'data:image/png;base64,' + this.fileContent
|
||||
} else if (this.pdfType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = false
|
||||
this.isPdfType = true
|
||||
this.fileContentPdf = this.solvePdfUrl(this.fileContent, this.fileType, this.fileName)
|
||||
contentUrl = this.fileContentPdf
|
||||
} else {
|
||||
this.isImageType = false
|
||||
this.isPdfType = false
|
||||
this.$message.warning('不支持的下载格式!')
|
||||
return
|
||||
}
|
||||
var a = document.createElement('a')
|
||||
a.download = this.fileName + '.' + this.fileType
|
||||
a.href = contentUrl
|
||||
$('body').append(a)
|
||||
a.click()
|
||||
$(a).remove()
|
||||
},
|
||||
// 删除文件
|
||||
deleteFile(row) {
|
||||
this.$confirm('是否确认将文件进行删除' + '</div>', '提示', {
|
||||
distinguishCancelAndClose: true,
|
||||
center: true,
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('11', 'LG_临工看板_工艺管理_工艺文件删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.$message.success('删除成功!')
|
||||
this.searchTable()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消删除!'
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 移除上传文件
|
||||
*/
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = []
|
||||
},
|
||||
/**
|
||||
* 上传设备文件大小限制
|
||||
*/
|
||||
beforeAvatarUpload(file) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传工艺文档大小不能超过 10MB!')
|
||||
}
|
||||
return isLt2M
|
||||
},
|
||||
/**
|
||||
* 上传标准文件
|
||||
*/
|
||||
uploadStandFile() {
|
||||
if (this.$refs.uploadStandFile.uploadFiles.length === 0) {
|
||||
this.$message.warning('请选择文件进行上传!')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['opName', '']
|
||||
param[1] = ['fileName', '']
|
||||
param[2] = ['fileType', '']
|
||||
param[3] = ['fileContent', null]
|
||||
this.Data.param = this.CreateData('17', '', param)
|
||||
this.$refs.uploadStandFile.submit()
|
||||
},
|
||||
/**
|
||||
* 上传标准设备文件成功后
|
||||
*/
|
||||
stnFileSuccess(res, file) {
|
||||
this.$message.success('上传成功!')
|
||||
this.fileList = []
|
||||
this.searchTable()
|
||||
},
|
||||
stnFileError(err, file, fileList) {
|
||||
this.$message.success('上传失败,请重新上传!' + err.toString())
|
||||
this.fileList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.noView{
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
line-height: 800px;
|
||||
color: #b8b5b5;
|
||||
}
|
||||
</style>
|
||||
563
src/views/ProcessManagement/LoadingCardMangement/index.vue
Normal file
563
src/views/ProcessManagement/LoadingCardMangement/index.vue
Normal file
@@ -0,0 +1,563 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" width="60px" label="序号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.序号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查内容" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.检查内容 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查要求">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.检查要求 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查结果" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.检查结果 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="editInformation(scope.row)"><i class="el-icon-edit"/></el-button>
|
||||
<el-button type="text" style="color: #ff0000" @click="deleteInformation(scope.row)"><i class="el-icon-delete"/></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<!-- <el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">-->
|
||||
<!-- <el-select v-model="form.stationNumber" placeholder="请选择工位号" clearable size="small" style="width: 200px">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in stationNumber"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- size="mini"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="产品型号:" prop="moduleDescription" style="display: inline-block">-->
|
||||
<!-- <el-select v-model="form.moduleDescription" placeholder="请选择产品型号" clearable size="small" style="width: 200px">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in engineType"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- size="mini"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="序号" prop="number" style="display: inline-block">
|
||||
<el-input-number v-model="form.number" :min="1" :step="1" style="width:300px;" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查内容:" prop="text" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.text"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 300px"
|
||||
placeholder="请输入检查内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查要求:" prop="work" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.work"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 300px"
|
||||
placeholder="请输入检查要求"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="要领:" prop="text" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.fun"-->
|
||||
<!-- :rows="2"-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- style="width: 300px"-->
|
||||
<!-- placeholder="请输入要领"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '添加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" :title="title" center style="min-height: 200px;" width="500px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="序号:" prop="number" style="display: inline-block">
|
||||
<el-input-number v-model="form1.number" :min="1" :step="1" style="width:300px;" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查内容:" prop="text" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.text"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 300px;"
|
||||
placeholder="请输入检查内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查要求:" prop="work" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.work"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 300px"
|
||||
placeholder="请输入检查要求"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="要领:" prop="text" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form1.fun"-->
|
||||
<!-- :rows="2"-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- style="width: 300px"-->
|
||||
<!-- placeholder="请输入要领"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.stationNumberValue" placeholder="请选择工位号" size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.engineTypeValue" placeholder="请选择产品型号" size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff4()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
moduleDescription: [],
|
||||
moduleDescriptionValue: '',
|
||||
engineTypeValue: '',
|
||||
engineTypeValue1: '',
|
||||
engineTypeName: '',
|
||||
engineType: [],
|
||||
tagIDArr: [
|
||||
{
|
||||
label: 'lbl_datagrid_quality_name',
|
||||
value: 'lbl_datagrid_quality_name'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item1',
|
||||
value: 'lbl_datagrid_quality_item1'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item2',
|
||||
value: 'lbl_datagrid_quality_item2'
|
||||
}
|
||||
],
|
||||
isDisable: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
}, {
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
isDisableValue: 0,
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible4: false,
|
||||
title: '',
|
||||
form: {
|
||||
stationNumber: '',
|
||||
moduleDescription: '',
|
||||
number: '',
|
||||
text: '',
|
||||
work: '', // 作业
|
||||
fun: '' // 要领
|
||||
},
|
||||
rules: {
|
||||
stationNumber: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
moduleDescription: [{ required: true, message: '请选择产品型号', trigger: 'change' }],
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
text: [{ required: true, message: '请输入检查内容', trigger: 'blur' }],
|
||||
work: [{ required: true, message: '请输入检查要求', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
number: '',
|
||||
text: '',
|
||||
work: '',
|
||||
fun: ''
|
||||
},
|
||||
rules1: {
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
text: [{ required: true, message: '请输入操作内容', trigger: 'blur' }],
|
||||
work: [{ required: true, message: '请输入操作内容', trigger: 'blur' }]
|
||||
},
|
||||
form4: {
|
||||
engineTypeValue: '',
|
||||
stationNumberValue: ''
|
||||
},
|
||||
rules4: { // 订单下发验证
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token',
|
||||
'departmentName'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
// stationNumberValue() {
|
||||
// for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
// if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
// console.log(this.stationNumber[i].label, 'this.stationNumber[i].label')
|
||||
// this.stationName = this.stationNumber[i].labelName
|
||||
// }
|
||||
// }
|
||||
// if (!this.stationNumberValue) {
|
||||
// this.stationName = ''
|
||||
// }
|
||||
// },
|
||||
engineTypeValue1() {
|
||||
console.log(1234)
|
||||
for (let i = 0; i < this.engineType.length; i++) {
|
||||
if (this.engineType[i].value === this.engineTypeValue1) {
|
||||
this.engineTypeName = this.engineType[i].labelName
|
||||
console.log(this.engineTypeName, 'this.engineTypeName')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getStationNumber()
|
||||
// this.getEndStation()
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.searchTable()
|
||||
}, 300)
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) {
|
||||
this.stationNumberValue = response.data[0].工位号
|
||||
this.stationName = response.data[0].工位名称
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: `【${response.data[i].工位号}】${response.data[i].工位名称}`,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础信息_机型信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].机型ID
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].机型号,
|
||||
value: response.data[i].机型ID,
|
||||
labelName: response.data[i].机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询MES消息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础_装车单检查内容_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
copyOrder(formName) {
|
||||
if (this.tableData.length) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.dialogFormVisible4 = true
|
||||
} else {
|
||||
this.$message({
|
||||
message: '暂无可复制的数据!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
},
|
||||
async submitAdd4() {
|
||||
let number, text
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
number = this.tableData[i].工步号
|
||||
text = this.tableData[i].操作内容
|
||||
await this.submitAdd5(number, text)
|
||||
}
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible4 = false
|
||||
this.engineTypeValue = this.form4.engineTypeValue
|
||||
this.stationNumberValue = this.form4.stationNumberValue
|
||||
this.searchTable()
|
||||
},
|
||||
async submitAdd5(number, text) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form4.stationNumberValue]
|
||||
param[1] = ['产品型号代码', this.form4.engineTypeValue]
|
||||
param[2] = ['工步号', number]
|
||||
param[3] = ['操作内容', text]
|
||||
param[4] = ['发动机型号', this.form4.engineTypeValue]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
console.log('1')
|
||||
resolve(1)
|
||||
} else {
|
||||
console.log('0')
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
callOff4() {
|
||||
this.dialogFormVisible4 = false
|
||||
},
|
||||
addTo() {
|
||||
this.title = '添加'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['序号', this.form.number]
|
||||
param[1] = ['检查内容', this.form.text]
|
||||
param[2] = ['检查要求', this.form.work]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_新增', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.ID
|
||||
this.form1.number = row.序号
|
||||
this.form1.text = row.检查内容
|
||||
this.form1.work = row.检查要求
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['序号', this.form1.number]
|
||||
param[1] = ['检查内容', this.form1.text]
|
||||
param[2] = ['检查要求', this.form1.work]
|
||||
param[3] = ['ID', this.labelNumber]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
|
||||
::v-deep textarea{
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
359
src/views/ProcessManagement/LoadingDocuments/index.vue
Normal file
359
src/views/ProcessManagement/LoadingDocuments/index.vue
Normal file
@@ -0,0 +1,359 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" clearable style="width: 150px" @change="searchTable">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">工位名称:</span>
|
||||
<el-input v-model="stationName" readonly style="width:170px;" placeholder="" size="small"/>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="add()">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="工位号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测试方法" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测试方法 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="检测要求">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.检测要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工具/设备" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.检测设备 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)"/>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteOrder(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="合格证项目新增" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" placeholder="请选择工位号" size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测试方法" prop="testMethod" style="display: inline-block">
|
||||
<el-input v-model="form.testMethod" size="small" placeholder="请输入测试方法"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测要求" prop="testContent" style="display: inline-block">
|
||||
<el-input v-model="form.testContent" size="small" placeholder="请输入检测要求"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具/设备" prop="testTool" style="display: inline-block">
|
||||
<el-input v-model="form.testTool" size="small" placeholder="请输入工具/设备"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="addRhythm('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="合格证项目编辑" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="editForm" :model="editForm" :rules="editRules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-input v-model="editForm.stationNumberValue" readonly size="small" placeholder=""/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测试方法" prop="testMethod" style="display: inline-block">
|
||||
<el-input v-model="editForm.testMethod" size="small" placeholder="请输入测试方法"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测要求" prop="testContent" style="display: inline-block">
|
||||
<el-input v-model="editForm.testContent" size="small" placeholder="请输入检测要求"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具/设备" prop="testTool" style="display: inline-block">
|
||||
<el-input v-model="editForm.testTool" size="small" placeholder="请输入工具/设备"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('editForm')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitEdit('editForm')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rhythm: '',
|
||||
engineTypeValue: '',
|
||||
engineType: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
testMethod: '',
|
||||
stationNumberValue: '',
|
||||
opCodeName: '',
|
||||
testTool: '',
|
||||
testContent: ''
|
||||
},
|
||||
editForm: {
|
||||
id: '',
|
||||
stationNumberValue: '',
|
||||
opCodeName: '',
|
||||
testMethod: '',
|
||||
testTool: '',
|
||||
testContent: ''
|
||||
},
|
||||
rules: {
|
||||
stationNumberValue: [{ required: true, message: '请选择工位', trigger: 'change' }],
|
||||
testMethod: [{ required: true, message: '请输入测试方法', trigger: 'blur' }],
|
||||
testTool: [{ required: true, message: '请输入工具/设备', trigger: 'blur' }],
|
||||
testContent: [{ required: true, message: '请输入检测要求', trigger: 'blur' }]
|
||||
},
|
||||
editRules: {
|
||||
testMethod: [{ required: true, message: '请输入测试方法', trigger: 'blur' }],
|
||||
testTool: [{ required: true, message: '请输入工具/设备', trigger: 'blur' }],
|
||||
testContent: [{ required: true, message: '请输入检测要求', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
stationNumberValue() {
|
||||
for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
this.stationName = this.stationNumber[i].labelName
|
||||
}
|
||||
}
|
||||
if (!this.stationNumberValue) {
|
||||
this.stationName = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
// 初始化获取订单号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getProductType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础信息_机型信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].机型ID
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].机型号,
|
||||
value: response.data[i].机型ID,
|
||||
labelName: response.data[i].机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询信息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', 'CATL_基础_合格证项目_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.$refs['editForm'].resetFields()
|
||||
},
|
||||
// 新增节拍
|
||||
addRhythm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumberValue]
|
||||
param[1] = ['测试方法', this.form.testMethod]
|
||||
param[2] = ['检测要求', this.form.testContent]
|
||||
param[3] = ['检测设备', this.form.testTool]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('新增失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
edit(row) {
|
||||
this.dialogFormVisible1 = true
|
||||
this.editForm.id = row.ID
|
||||
this.editForm.stationNumberValue = row.工位号
|
||||
this.editForm.testMethod = row.测试方法
|
||||
this.editForm.testTool = row.检测设备
|
||||
this.editForm.testContent = row.检测要求
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.editForm.id]
|
||||
param[1] = ['测试方法', this.editForm.testMethod]
|
||||
param[2] = ['检测要求', this.editForm.testContent]
|
||||
param[3] = ['检测设备', this.editForm.testTool]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '编辑成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('编辑失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除订单
|
||||
deleteOrder(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'CATL_基础_合格证项目_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<input ref="excel-upload-input" class="excel-upload-input" type="file" accept=".xlsx, .xls" @change="handleClick">
|
||||
<div class="drop" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover">
|
||||
将Excel文件拖入或
|
||||
<el-button :loading="loading" style="margin-left: 16px" plain type="success" size="mini" @click="handleUpload">浏览</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
beforeUpload: Function, // eslint-disable-line
|
||||
onSuccess: Function// eslint-disable-line
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
excelData: {
|
||||
header: null,
|
||||
results: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateData({ header, results }) {
|
||||
this.excelData.header = header
|
||||
this.excelData.results = results
|
||||
this.onSuccess && this.onSuccess(this.excelData)
|
||||
},
|
||||
handleDrop(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
if (this.loading) return
|
||||
const files = e.dataTransfer.files
|
||||
if (files.length !== 1) {
|
||||
this.$message.error('Only support uploading one file!')
|
||||
return
|
||||
}
|
||||
const rawFile = files[0] // only use files[0]
|
||||
if (!this.isExcel(rawFile)) {
|
||||
this.$message.error('Only supports upload .xlsx, .xls, .csv suffix files')
|
||||
return false
|
||||
}
|
||||
this.upload(rawFile)
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
},
|
||||
handleDragover(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
handleUpload() {
|
||||
this.$refs['excel-upload-input'].click()
|
||||
},
|
||||
handleClick(e) {
|
||||
const files = e.target.files
|
||||
const rawFile = files[0] // only use files[0]
|
||||
if (!rawFile) return
|
||||
this.upload(rawFile)
|
||||
},
|
||||
upload(rawFile) {
|
||||
this.$refs['excel-upload-input'].value = null // fix can't select the same excel
|
||||
if (!this.beforeUpload) {
|
||||
this.readerData(rawFile)
|
||||
return
|
||||
}
|
||||
const before = this.beforeUpload(rawFile)
|
||||
if (before) {
|
||||
this.readerData(rawFile)
|
||||
}
|
||||
},
|
||||
readerData(rawFile) {
|
||||
this.loading = true
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = e => {
|
||||
const data = e.target.result
|
||||
const workbook = XLSX.read(data, { type: 'array' })
|
||||
const firstSheetName = workbook.SheetNames[0]
|
||||
const worksheet = workbook.Sheets[firstSheetName]
|
||||
const header = this.getHeaderRow(worksheet)
|
||||
const results = XLSX.utils.sheet_to_json(worksheet)
|
||||
this.generateData({ header, results })
|
||||
this.loading = false
|
||||
resolve()
|
||||
}
|
||||
reader.readAsArrayBuffer(rawFile)
|
||||
})
|
||||
},
|
||||
getHeaderRow(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r
|
||||
/* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
||||
/* find the cell in the first row */
|
||||
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
},
|
||||
isExcel(file) {
|
||||
return /\.(xlsx|xls|csv)$/.test(file.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.excel-upload-input{
|
||||
display: none;
|
||||
z-index: -9999;
|
||||
}
|
||||
.drop{
|
||||
border: 2px dashed #bbb;
|
||||
width: 600px;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
margin: 0 auto;
|
||||
font-size: 24px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
274
src/views/ProcessManagement/MessageMaintenance/index.vue
Normal file
274
src/views/ProcessManagement/MessageMaintenance/index.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<el-button type="primary" size="small" icon="el-icon-edit" @click="editAll()">编辑全部内容</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column align="center" label="工位号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="消息内容">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ScollNotice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="最近更新时间" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="topOrder(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="MES消息维护" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-input v-model="form.stationNumber" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="工位名称:" prop="stationName" style="display: inline-block">
|
||||
<el-input v-model="form.stationName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="消息内容:" prop="scollNotice" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.scollNotice"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
placeholder="请输入消息内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitUpdate('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="MES消息维护" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-input v-model="form1.stationNumber" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="工位名称:" prop="stationName" style="display: inline-block">
|
||||
<el-input v-model="form1.stationName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="消息内容:" prop="scollNotice" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.scollNotice"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
placeholder="请输入消息内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitUpdate1('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [], // 总数据数组
|
||||
scollNotice: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
mid: '',
|
||||
form: {
|
||||
stationNumber: '',
|
||||
stationName: '',
|
||||
scollNotice: ''
|
||||
},
|
||||
rules: {
|
||||
scollNotice: [{ required: true, message: '请输入MES消息', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
stationNumber: '编辑所有工位内容',
|
||||
stationName: '本线所有工位',
|
||||
scollNotice: ''
|
||||
},
|
||||
rules1: {
|
||||
scollNotice: [{ required: true, message: '请输入MES消息', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchMesMessage()
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// handleSelectionChange(val) {
|
||||
// if (val.length > 0) {
|
||||
// if (val.length > 1) {
|
||||
// this.$refs.multipleTable.clearSelection()
|
||||
// this.$refs.multipleTable.toggleRowSelection(val.pop())
|
||||
// } else {
|
||||
// this.mid = val.map((item) => item.ID)
|
||||
// this.form.scollNotice = val.map((item) => item.ScollNotice)
|
||||
// this.form.stationNumber = val.map((item) => item.工位号)
|
||||
// this.form.stationName = val.map((item) => item.工位名称)
|
||||
// }
|
||||
// } else {
|
||||
// this.mid = []
|
||||
// }
|
||||
// console.log(this.mid, 'this.mid')
|
||||
// console.log(this.form.scollNotice, 'this.scollNotice')
|
||||
// },
|
||||
// @select 事件方法
|
||||
// selectable(selection, row) {
|
||||
// return true
|
||||
// },
|
||||
// 查询MES消息
|
||||
searchMesMessage() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES界面显示_消息滚动_初始化', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
topOrder(row) {
|
||||
this.mid = row.ID
|
||||
this.form.scollNotice = row.ScollNotice
|
||||
this.form.stationNumber = row.工位号
|
||||
this.form.stationName = row.工位名称
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.mid]
|
||||
param[1] = ['ScollNotice', this.form.scollNotice]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', 'MES界面显示_消息滚动_修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchMesMessage()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
editAll() {
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
},
|
||||
submitUpdate1(formName1) {
|
||||
this.$refs[formName1].validate((valid1) => {
|
||||
if (valid1) {
|
||||
var param = []
|
||||
param[0] = ['ScollNotice', this.form1.scollNotice]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', 'MES界面显示_消息滚动_修改全部', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.searchMesMessage()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
207
src/views/ProcessManagement/MonitoringData/EngineModel.vue
Normal file
207
src/views/ProcessManagement/MonitoringData/EngineModel.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机型号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_发动机型号查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
207
src/views/ProcessManagement/MonitoringData/EngineNumber.vue
Normal file
207
src/views/ProcessManagement/MonitoringData/EngineNumber.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_发动机号查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="基本机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.基本机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机型号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="托盘号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.托盘号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="离开时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离开时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '电子看板_发动机号_线首工位查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="信号类型代码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.信号类型代码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到达时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到达时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="离开时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离开时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="在线时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.在线时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据设备状态日志_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
221
src/views/ProcessManagement/MonitoringData/OfflineStation.vue
Normal file
221
src/views/ProcessManagement/MonitoringData/OfflineStation.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发动机号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="托盘号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.托盘编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据发动机在线状态_下线工位查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
222
src/views/ProcessManagement/MonitoringData/Operator.vue
Normal file
222
src/views/ProcessManagement/MonitoringData/Operator.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作者工号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作者工号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="员工姓名">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.员工姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="报工时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.报工时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="班次代码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.班次代码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_操作者工号查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
207
src/views/ProcessManagement/MonitoringData/OrderNumber.vue
Normal file
207
src/views/ProcessManagement/MonitoringData/OrderNumber.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_订单号查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
207
src/views/ProcessManagement/MonitoringData/PalletNo.vue
Normal file
207
src/views/ProcessManagement/MonitoringData/PalletNo.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="托盘号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.托盘号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_托盘号查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
222
src/views/ProcessManagement/MonitoringData/StationStatus.vue
Normal file
222
src/views/ProcessManagement/MonitoringData/StationStatus.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="正产上线">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.正产上线 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="返修上线">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.返修上线 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="在线返修">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.在线返修 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="离线返修">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离线返修 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_工位状态查询_分页', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
207
src/views/ProcessManagement/MonitoringData/TransferModel.vue
Normal file
207
src/views/ProcessManagement/MonitoringData/TransferModel.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<!--操作者工号-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=30;pageCurrent=1;searchOrder()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="690px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="传递机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传递机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let stationNumberValue_check
|
||||
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0] + ' ' + '00:00:00']
|
||||
param[1] = ['结束时间', this.dateTime[1] + ' ' + '23:59:59']
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['PageCurrent', this.pageCurrent]
|
||||
param[5] = ['PageSize', this.pageSize]
|
||||
param[6] = ['PageCount', '1111', 'int', '1']
|
||||
param[7] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '测量数据工位_监控系统_传递机型', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
52
src/views/ProcessManagement/MonitoringData/index.vue
Normal file
52
src/views/ProcessManagement/MonitoringData/index.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="操作者" name="1"><Operator ref="fresh1"/></el-tab-pane>
|
||||
<el-tab-pane label="传递机型" name="2"><TransferModel ref="fresh3"/></el-tab-pane>
|
||||
<el-tab-pane label="订单号" name="3"><OrderNumber ref="fresh2"/></el-tab-pane>
|
||||
<el-tab-pane label="发动机号" name="4"><EngineNumber ref="fresh4"/></el-tab-pane>
|
||||
<el-tab-pane label="发动机型号" name="5"><EngineModel ref="fresh5"/></el-tab-pane>
|
||||
<el-tab-pane label="工位状态" name="6"><StationStatus ref="fresh6"/></el-tab-pane>
|
||||
<el-tab-pane label="托盘号" name="7"><PalletNo ref="fresh7"/></el-tab-pane>
|
||||
<el-tab-pane label="线首工位信息" name="8"><LineHeadStationInformation ref="fresh8"/></el-tab-pane>
|
||||
<el-tab-pane label="下线工位信息" name="9"><OfflineStation ref="fresh9"/></el-tab-pane>
|
||||
<el-tab-pane label="测量数据设备状态日志" name="10"><MeasurementDataEquipmentStatusLog ref="fresh10"/></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Operator from '@/views/ProcessManagement/MonitoringData/Operator.vue'
|
||||
import TransferModel from '@/views/ProcessManagement/MonitoringData/TransferModel.vue'
|
||||
import OrderNumber from '@/views/ProcessManagement/MonitoringData/OrderNumber.vue'
|
||||
import EngineNumber from '@/views/ProcessManagement/MonitoringData/EngineNumber.vue'
|
||||
import EngineModel from '@/views/ProcessManagement/MonitoringData/EngineModel.vue'
|
||||
import StationStatus from '@/views/ProcessManagement/MonitoringData/StationStatus.vue'
|
||||
import PalletNo from '@/views/ProcessManagement/MonitoringData/PalletNo.vue'
|
||||
import LineHeadStationInformation from '@/views/ProcessManagement/MonitoringData/LineHeadStationInformation.vue'
|
||||
import OfflineStation from '@/views/ProcessManagement/MonitoringData/OfflineStation.vue'
|
||||
import MeasurementDataEquipmentStatusLog from '@/views/ProcessManagement/MonitoringData/MeasurementDataEquipmentStatusLog.vue'
|
||||
export default {
|
||||
components: {
|
||||
'Operator': Operator,
|
||||
'TransferModel': TransferModel,
|
||||
'OrderNumber': OrderNumber,
|
||||
'EngineNumber': EngineNumber,
|
||||
'EngineModel': EngineModel,
|
||||
'StationStatus': StationStatus,
|
||||
'PalletNo': PalletNo,
|
||||
'LineHeadStationInformation': LineHeadStationInformation,
|
||||
'OfflineStation': OfflineStation,
|
||||
'MeasurementDataEquipmentStatusLog': MeasurementDataEquipmentStatusLog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: '1'
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
443
src/views/ProcessManagement/PdfCardMaintenance/index.vue
Normal file
443
src/views/ProcessManagement/PdfCardMaintenance/index.vue
Normal file
@@ -0,0 +1,443 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 250px" @change="getImgCheckDirectFileList">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="getImgCheckDirectFileList">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="uploadShowPDF()">上传</el-button>
|
||||
</div>
|
||||
<div class="main">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="imgCheckDirectFileList"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="640px"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column
|
||||
label="排序"
|
||||
type="index"
|
||||
align="center"
|
||||
width="80"/>
|
||||
<el-table-column prop="文件名称" label="文件名称" align="center">
|
||||
<template slot-scope="scope2">
|
||||
{{ scope2.row.文件名称 }}.{{ scope2.row.文件后缀 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="操作时间" label="导入时间" align="center" width="150">
|
||||
<template slot-scope="scope2">
|
||||
{{ scope2.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope2">
|
||||
<el-button type="text" icon="el-icon-view" size="mini" @click="imgCheckDirectFile(scope2.row)" >查看</el-button>
|
||||
<el-button type="text" icon="el-icon-download" size="mini" style="color: #67c23a" @click="downloadPDF(scope2.row)" >下载</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" size="mini" style="color: #ff0000" @click="deleteImgCheckDirectFileSubmit(scope2.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--上传文件-->
|
||||
<el-dialog v-el-drag-dialog :visible.sync="imgDialogFormVisible" :close-on-click-modal="!uploading" title="上传指导文件" center style="height: 800px" width="460px">
|
||||
<el-upload
|
||||
ref="uploadPDF"
|
||||
:on-remove="handelLimitStyle"
|
||||
:on-change="handelLimit"
|
||||
:multiple="true"
|
||||
:auto-upload="false"
|
||||
:on-success="uploadSuccessPDF"
|
||||
:on-progress="handleProgress"
|
||||
:on-error="handleUploadError"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-upload="beforeUploadFile"
|
||||
:on-exceed="warningExceedFile"
|
||||
:limit="limit"
|
||||
:data="DataPDF"
|
||||
:action="uploadPDF"
|
||||
:disabled="uploading"
|
||||
accept=".pdf,.zip"
|
||||
style="margin-left: 30px"
|
||||
drag>
|
||||
<i class="el-icon-upload"/>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传一个pdf文件,且不超过100mb</div>
|
||||
</el-upload>
|
||||
<!-- 上传进度条 -->
|
||||
<div v-if="uploading" style="margin-top: 20px; padding: 0 30px;">
|
||||
<el-progress
|
||||
:percentage="uploadPercent"
|
||||
:status="uploadPercent === 100 ? 'success' : undefined"
|
||||
:stroke-width="18"
|
||||
:text-inside="true"
|
||||
/>
|
||||
<div style="text-align: center; margin-top: 10px; color: #909399; font-size: 12px;">
|
||||
{{ uploadStatusText }}
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :disabled="uploading" @click="imgDialogFormVisible=false">取消</el-button>
|
||||
<el-button :loading="uploading" type="primary" style="width: 70px" @click="submitPicturePDF()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--展示文件列表-->
|
||||
<el-dialog v-el-drag-dialog :visible.sync="imgCheckDialogFormVisible" title="查看指导文件" center style="height: 100%;overflow: auto" width="80%">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-button type="text" size="mini" icon="el-icon-circle-check-outline" @click="getImgCheckDirectFileList">查看</el-button>
|
||||
<el-table
|
||||
:data="imgCheckDirectFileList"
|
||||
size="small"
|
||||
max-height="365px"
|
||||
style="width: 100%; height: 280px; font-size: 20px; color: #000; border: 1px solid #9e9b9b"
|
||||
>
|
||||
<el-table-column
|
||||
label="排序"
|
||||
type="index"
|
||||
align="center"
|
||||
width="100"/>
|
||||
<el-table-column prop="文件名称" label="文件名称" align="center">
|
||||
<template slot-scope="scope2">
|
||||
{{ scope2.row.文件名称 }}.{{ scope2.row.文件后缀 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="上传时间" label="导入时间" align="center">
|
||||
<template slot-scope="scope2">
|
||||
{{ scope2.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查看文件" align="center" width="150">
|
||||
<template slot-scope="scope2">
|
||||
<el-button type="warning" @click="imgCheckDirectFile(scope2.row)" >打开指导文件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope2">
|
||||
<el-button type="success" @click="downloadPDF(scope2.row)" >下载</el-button>
|
||||
<el-button type="warning" @click="deleteImgCheckDirectFileSubmit(scope2.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="imgCheckDialogFormVisible=false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { url } from '@/utils/request'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgDialogFormVisible: false,
|
||||
imgDialogObj: '', // 点检类型对象
|
||||
stationNumberValue: '', // 点检指导文件选择的工位号
|
||||
engineType: [], // 点检机型类型
|
||||
engineTypeValue: '', // 点检机型类型
|
||||
imgCheckDialogFormVisible: false, // 查看点检文件
|
||||
stationNumber: [],
|
||||
stationName: '',
|
||||
limit: 1,
|
||||
DataPDF: {},
|
||||
uploadPDF: url,
|
||||
imgCheckDirectFileList: [],
|
||||
dialogFormVisible: false,
|
||||
// 上传进度相关
|
||||
uploading: false,
|
||||
uploadPercent: 0,
|
||||
uploadStatusText: '正在上传...'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
},
|
||||
methods: {
|
||||
getEngineType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].发动机机型标志
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机机型标志
|
||||
})
|
||||
}
|
||||
this.searchOrder()
|
||||
})
|
||||
},
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.stationNumberValue = response.data[0].工位号
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: `【${response.data[i].工位号}】${response.data[i].工位名称}`,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 给样式的
|
||||
handelLimitStyle() {
|
||||
},
|
||||
handelLimit() {
|
||||
},
|
||||
// 上传成功回调
|
||||
uploadSuccessPDF(res) {
|
||||
this.uploading = false
|
||||
this.uploadPercent = 0
|
||||
this.uploadStatusText = '正在上传...'
|
||||
this.imgDialogFormVisible = false
|
||||
this.$refs.uploadPDF.clearFiles()
|
||||
this.$message.success('指导文件上传成功!')
|
||||
this.getImgCheckDirectFileList()
|
||||
},
|
||||
// 上传进度回调
|
||||
handleProgress(event, file, fileList) {
|
||||
this.uploading = true
|
||||
this.uploadPercent = Math.round(event.percent)
|
||||
if (this.uploadPercent < 100) {
|
||||
this.uploadStatusText = `正在上传: ${this.uploadPercent}%`
|
||||
} else {
|
||||
this.uploadStatusText = '文件已发送,等待服务器处理...'
|
||||
}
|
||||
},
|
||||
// 上传失败回调
|
||||
handleUploadError(err, file, fileList) {
|
||||
console.error('上传指导文件失败:', err)
|
||||
this.uploading = false
|
||||
this.uploadPercent = 0
|
||||
this.uploadStatusText = '正在上传...'
|
||||
this.$message.error('上传失败,请重试!')
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisiblePictureCard = true
|
||||
},
|
||||
// 上传前检测
|
||||
beforeUploadFile(file) {
|
||||
let isAllowFile = this.isAllowFile(file)
|
||||
if (!isAllowFile) {
|
||||
this.$message.error('只能上传PDF')
|
||||
}
|
||||
if (!this.stationNumberValue) {
|
||||
this.$message.error('请选择工位号')
|
||||
isAllowFile = false
|
||||
}
|
||||
return isAllowFile
|
||||
},
|
||||
isAllowFile(file) {
|
||||
const fileName = file.name ? file.name.toLowerCase() : ''
|
||||
return fileName.endsWith('.pdf') || fileName.endsWith('.zip')
|
||||
},
|
||||
warningExceedFile() {
|
||||
this.$message.error('仅可上传一份PDF指导文件')
|
||||
},
|
||||
// 预览指导文件按钮
|
||||
imgCheckDirectFile(row) {
|
||||
if (String(row.文件后缀).toLowerCase() === 'zip') {
|
||||
this.$message.warning('ZIP文件不支持在线预览,已为您下载')
|
||||
this.downloadPDF(row)
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查看文件', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response)
|
||||
if (response.data.length > 0) {
|
||||
this.pdfSrc = this.solvePdfUr1(response.data[0].指导文件)
|
||||
window.open(this.pdfSrc, '_blank')
|
||||
// this.imgCheckDialogFormVisible = true // 查看点检文件
|
||||
} else {
|
||||
this.$message.error('该工位此点检项目无指导文件,请设置后查看')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 下载PDF文件
|
||||
downloadPDF(row) {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查看文件', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
const content = response.data[0].指导文件
|
||||
const bstr = atob(content)
|
||||
let n = bstr.length
|
||||
const u8arr = new Uint8Array(n)
|
||||
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
||||
const blob = new Blob([u8arr], { type: this.getFileMimeType(row.文件后缀) })
|
||||
// 创建下载链接
|
||||
const link = document.createElement('a')
|
||||
link.href = window.URL.createObjectURL(blob)
|
||||
link.download = `${row.文件名称}.${row.文件后缀}`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(link.href)
|
||||
this.$message.success('文件下载成功!')
|
||||
} else {
|
||||
this.$message.error('该文件不存在')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 处理pdf 二进制流
|
||||
solvePdfUr1(content, type, fileName) {
|
||||
const bstr = atob(content)
|
||||
let n = bstr.length
|
||||
const u8arr = new Uint8Array(n)
|
||||
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
||||
// 确定解析格式,可能可以变成img,没有深入研究
|
||||
const blob = new Blob([u8arr], { type: 'application/pdf;chartset=UTF-8' })
|
||||
return window.URL.createObjectURL(blob)
|
||||
},
|
||||
getFileMimeType(fileSuffix) {
|
||||
const suffix = String(fileSuffix).toLowerCase()
|
||||
if (suffix === 'zip') {
|
||||
return 'application/zip'
|
||||
}
|
||||
return 'application/pdf'
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
},
|
||||
// 删除指导文件
|
||||
deleteImgCheckDirectFileSubmit(row) {
|
||||
this.$confirm('此操作将永久删除该指导文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', '基础数据_操作指南指导文件_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除指导文件成功!')
|
||||
this.getImgCheckDirectFileList()
|
||||
} else {
|
||||
this.$message.error('删除指导文件失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 添加指导文件
|
||||
uploadShowPDF(row) {
|
||||
this.imgDialogFormVisible = true
|
||||
},
|
||||
// 保存文件
|
||||
submitPicturePDF() {
|
||||
if (!this.stationNumberValue) {
|
||||
this.$message.error('请先选择工位号后提交!')
|
||||
return
|
||||
}
|
||||
// 检查是否选择了文件
|
||||
if (!this.$refs.uploadPDF.uploadFiles || this.$refs.uploadPDF.uploadFiles.length === 0) {
|
||||
this.$message.error('请先选择要上传的文件!')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['文件名称', '']
|
||||
param[2] = ['文件后缀', '']
|
||||
param[3] = ['文件内容', null]
|
||||
var Data1 = this.CreateData('15', '基础数据_操作指南指导文件_保存文件', param)
|
||||
this.DataPDF.param = Data1
|
||||
// 开始上传,显示进度条
|
||||
this.uploading = true
|
||||
this.uploadPercent = 0
|
||||
this.$refs.uploadPDF.submit()
|
||||
// 注意:不要在这里关闭弹窗!弹窗会在 uploadSuccessPDF 回调中关闭
|
||||
},
|
||||
// 查询指导文件列表
|
||||
getImgCheckDirectFileList() {
|
||||
if (!this.stationNumberValue) {
|
||||
this.$message.error('请选择工位号')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
this.imgCheckDirectFileList = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '基础数据_操作指南指导文件_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
this.imgCheckDirectFileList = response.data
|
||||
} else {
|
||||
this.$message.error('该工位无此点检指导文件,请添加后查看')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.NewlyAdded{
|
||||
background:rgb(253,246,236);
|
||||
border-color: #ff9759;
|
||||
color: #ff9759;
|
||||
&:hover{
|
||||
background: #ff9759;
|
||||
border-color: #ff9759;
|
||||
color: white;
|
||||
}
|
||||
&:focus{
|
||||
background: #ff9759;
|
||||
border-color: #ff9759;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
#dianjianbiao {
|
||||
/*.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{*/
|
||||
/*border-color: black !important;*/
|
||||
/*}*/
|
||||
/*.el-table--border::after, .el-table--group::after, .el-table::before{*/
|
||||
/*background-color: black !important;*/
|
||||
/*}*/
|
||||
/*th {*/
|
||||
/*background: white !important;*/
|
||||
/*color: black !important;*/
|
||||
/*}*/
|
||||
}
|
||||
.el-upload-dragger{
|
||||
width: 210px;
|
||||
//right: 30px;
|
||||
}
|
||||
</style>
|
||||
330
src/views/ProcessManagement/ProcessPictureMaintenance/index.vue
Normal file
330
src/views/ProcessManagement/ProcessPictureMaintenance/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<!-- <span style="margin-left: 10px">工位名称:</span>-->
|
||||
<!-- <el-input v-model="stationName" disabled style="width:150px;" placeholder="" size="small"/>-->
|
||||
<span style="margin-left: 10px">产品型号:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">上传</el-button>
|
||||
</div>
|
||||
<span>图片尺寸要求:宽*高(830 * 470),16:9</span>
|
||||
<div
|
||||
v-for="(url, key) in urls"
|
||||
:key="key"
|
||||
style="width: 860px;height: 500px;border: 1px solid black;text-align: center">
|
||||
<div style="height: 20px">
|
||||
第{{ key + 1 }}张图片 <el-link type="danger" @click="deleteImg(url)" >删除</el-link>
|
||||
</div>
|
||||
<el-image :key="url.url" :preview-src-list="urls1" :src="url.url" lazy style="width: 830px; height: 470px"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="上传图片" center width="300px">
|
||||
<el-upload
|
||||
id="invoiceScan"
|
||||
ref="upload"
|
||||
:on-remove="handelLimitStyle"
|
||||
:on-change="handelLimit"
|
||||
:multiple="true"
|
||||
:auto-upload="false"
|
||||
:on-success="uploadSuccess"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="warningExceed"
|
||||
:limit="limit"
|
||||
:data="Data"
|
||||
:action="upload"
|
||||
accept=".png,.jpg"
|
||||
style="margin-left: 60px"
|
||||
list-type="picture-card">
|
||||
<i class="el-icon-plus"/>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible=false">取消</el-button>
|
||||
<el-button type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { url } from '@/utils/request'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urls: [], // 图片数组
|
||||
urlsID: [], // 图片数组
|
||||
urls1: [], // 图片数组
|
||||
dialogVisiblePictureCard: false,
|
||||
dialogImageUrl: '',
|
||||
limit: 1,
|
||||
Data: {},
|
||||
upload: url,
|
||||
tableData: [], // 总数据数组
|
||||
tableData1: [], // 总数据数组
|
||||
tableData2: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
tableDataList: [],
|
||||
tableDataListOrigin: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
moduleDescription: [],
|
||||
moduleDescriptionValue: '',
|
||||
engineTypeValue: '',
|
||||
engineTypeValue1: '',
|
||||
engineTypeName: '',
|
||||
engineType: [],
|
||||
currentSelectRowList: [],
|
||||
isDisableValue: 0,
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
materialCodeSelect: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
currentSelectRow: false,
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token',
|
||||
'departmentName'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
// stationNumberValue() {
|
||||
// for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
// if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
// this.stationName = this.stationNumber[i].labelName
|
||||
// }
|
||||
// }
|
||||
// if (!this.stationNumberValue) {
|
||||
// this.stationName = ''
|
||||
// }
|
||||
// }
|
||||
},
|
||||
created() {
|
||||
// this.searchTable()
|
||||
// this.selectDate1()
|
||||
this.getStationNumber()
|
||||
this.getEndStation()
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: `【${response.data[i].工位号}】${response.data[i].工位名称}`,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
if (response.data.length > 0) this.stationNumberValue = response.data[0].工位号
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].发动机机型标志
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机机型标志
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询MES消息
|
||||
searchTable() {
|
||||
this.urls = []
|
||||
this.urls1 = []
|
||||
var param = []
|
||||
param[0] = ['发动机型号代码', this.engineTypeValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '电子看板_工位名称与产品型号产品图片_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].产品图片) {
|
||||
this.urls.push({
|
||||
url: 'data:image/png;base64,' + response.data[i].产品图片,
|
||||
name: response.data[i].数字孪生,
|
||||
data: [],
|
||||
id: response.data[i].ID
|
||||
})
|
||||
this.urls1.push('data:image/png;base64,' + response.data[i].产品图片)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
addTo() {
|
||||
this.title = '添加'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
handelLimit() {
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'block' || obj[0].style.display === '') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'none'
|
||||
}
|
||||
}
|
||||
},
|
||||
handelLimitStyle() {
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'none') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'block'
|
||||
}
|
||||
}
|
||||
},
|
||||
warningExceed() {
|
||||
this.$message.error('仅可上传一张照片')
|
||||
},
|
||||
beforeUpload(file) { // 上传前检测
|
||||
const isJPG = /^image\/.*/.test(file.type)
|
||||
if (!isJPG) {
|
||||
this.$message.error('只能上传图片。。')
|
||||
}
|
||||
return isJPG
|
||||
},
|
||||
uploadSuccess(res) { // 上传成功回调
|
||||
this.dialogFormVisible = false
|
||||
this.$refs.upload.clearFiles()
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'none') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'block'
|
||||
}
|
||||
}
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisiblePictureCard = true
|
||||
},
|
||||
submitPicture() {
|
||||
var param = []
|
||||
param[0] = ['发动机型号代码', this.engineTypeValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
param[2] = ['文件名称', '']
|
||||
param[3] = ['文件后缀', '']
|
||||
param[4] = ['文件内容', null]
|
||||
console.log(param)
|
||||
var Data1 = this.CreateData('15', '电子看板_工位名称与产品型号产品图片_保存图片新', param)
|
||||
this.Data.param = Data1
|
||||
this.$refs.upload.submit()
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.ID
|
||||
this.form1.number = row.工步号
|
||||
this.form1.text = row.操作内容
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 删除指定图片
|
||||
deleteImg(item) {
|
||||
console.log(item)
|
||||
// 提示是否需要删除
|
||||
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 删除图片
|
||||
var param = []
|
||||
param[0] = ['id', item.id]
|
||||
var Data = this.CreateData('11', '电子看板_工位名称与产品型号产品图片_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
background-color: white!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
941
src/views/ProcessManagement/ShuntingCacheManagement/index.vue
Normal file
941
src/views/ProcessManagement/ShuntingCacheManagement/index.vue
Normal file
@@ -0,0 +1,941 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询转线数据</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="740px"
|
||||
style="width: 63%"
|
||||
border
|
||||
size="mini"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<!-- <el-table-column align="center" label="物料号">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ scope.row.物料号 }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" label="工位号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工件编号" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总成号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工件类型" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.工位类型) === 0" size="mini" type="success">桥壳</el-tag>
|
||||
<el-tag v-if="Number(scope.row.工位类型) === 2" size="mini" type="warning">轮毂</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工件状态" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.工件状态 == 0" size="mini" type="info">无状态</el-tag>
|
||||
<el-tag v-if="scope.row.工件状态 == 1" size="mini" type="warning">待匹配</el-tag>
|
||||
<el-tag v-if="scope.row.工件状态 == 2" size="mini" type="success">已匹配</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="匹配桥壳号" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.匹配桥壳号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="零件数量">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ scope.row.零件数量 }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" label="是否异常">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.是否异常) === 1" size="mini" type="success">无异常</el-tag>
|
||||
<el-tag v-if="Number(scope.row.是否异常) === 0" size="mini" type="danger">异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="是否主物料">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span v-if="Number(scope.row.是否主物料) === 1">是</span>-->
|
||||
<!-- <span v-if="Number(scope.row.是否主物料) === 0">否</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" label="操作" width="120">
|
||||
<template slot-scope="scope">
|
||||
<!--<el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleEdit(scope.row)">修改</el-button>-->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color:#ff0000;"
|
||||
@click="deleteOrder(scope.row)">异常删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--<div class="block" style="margin-top: 10px;">-->
|
||||
<!-- <el-pagination-->
|
||||
<!-- v-if="!loading"-->
|
||||
<!-- :current-page="pageCurrent"-->
|
||||
<!-- :page-sizes="[15, 30, 40]"-->
|
||||
<!-- :page-size="pageSize"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- layout="total, sizes, prev, pager, next, jumper"-->
|
||||
<!-- @size-change="handleSizeChange"-->
|
||||
<!-- @current-change="handleCurrentChange"/>-->
|
||||
<!--</div>-->
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="创建物料" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form.engineTypeValue" size="small" placeholder="请选择物料号">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="物料号" prop="orderNumber" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.orderNumber"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入物料号"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="零件图号" prop="partDrawing" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.partDrawing"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入零件图号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件名称" prop="partName" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.partName"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="零件名称"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数量" prop="number" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.number"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入数量"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="生产厂家" prop="manufactor" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.manufactor"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入生产厂家"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否验证" prop="verificationValue" style="display: inline-block">
|
||||
<el-select v-model="form.verificationValue" size="small" placeholder="请选择产品型号">
|
||||
<el-option
|
||||
v-for="item in verification"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否主物料" prop="mainMaterialValue" style="display: inline-block">-->
|
||||
<!-- <el-select v-model="form.mainMaterialValue" size="small" placeholder="请选择产品型号">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in mainMaterial"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="编辑物料" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.stationNumberValue"
|
||||
readonly
|
||||
size="small"
|
||||
placeholder="工位号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件图号" prop="partDrawing" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.partDrawing"
|
||||
readonly
|
||||
size="small"
|
||||
placeholder="请输入零件图号"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="物料号" prop="orderNumber" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form1.orderNumber"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入物料号"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="零件名称" prop="partName" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.partName"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="零件名称"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数量" prop="number" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form1.number"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入数量"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="生产厂家" prop="manufactor" style="display: inline-block">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form1.manufactor"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入生产厂家"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否验证" prop="verificationValue" style="display: inline-block">
|
||||
<el-select v-model="form1.verificationValue" size="small" placeholder="请选择产品型号">
|
||||
<el-option
|
||||
v-for="item in verification"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否主物料" prop="mainMaterialValue" style="display: inline-block">-->
|
||||
<!-- <el-select v-model="form1.mainMaterialValue" size="small" placeholder="请选择产品型号">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in mainMaterial"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd1()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="物料导入" center style="min-height: 200px" width="900px">
|
||||
<div class="app-container">
|
||||
<upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/>
|
||||
<div style="margin-left: 395px">
|
||||
<span v-show="worksheet.length > 1" style="cursor: pointer;width: 50px;" @click="removeAll"><i class="el-icon-close"/></span>
|
||||
<el-upload :on-remove="handleRemove" :file-list="itemFile" style="width: 220px" action=""/>
|
||||
</div>
|
||||
<div v-if="worksheet.length !== 0" style="margin: 3px 0 0 395px">
|
||||
<el-button icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
|
||||
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.engineTypeValue" placeholder="请选择产品型号" size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff4()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sleep } from '../../../utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
worksheet: [],
|
||||
itemFile: [],
|
||||
unSpecification: [],
|
||||
method1: '', // 机床1加工方式
|
||||
method2: '', // 机床2加工方式
|
||||
method1Explain: '', // 机床1加工方式说明
|
||||
method2Explain: '', // 机床2加工方式说明
|
||||
stockQuantity: '', // 库存数量
|
||||
stockNum: '', // 库位号
|
||||
dialogFormVisible4: false,
|
||||
explain: false,
|
||||
orderNumber: [],
|
||||
orderNumberValue: '',
|
||||
engineTypeValue: '',
|
||||
engineType: [],
|
||||
OKWarehouseValue: '',
|
||||
OKWarehouse: [],
|
||||
NGWarehouseValue: '',
|
||||
NGWarehouse: [],
|
||||
verification: [
|
||||
{
|
||||
label: '否',
|
||||
value: 0
|
||||
}, {
|
||||
label: '是',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
mainMaterial: [
|
||||
{
|
||||
label: '否',
|
||||
value: 0
|
||||
}, {
|
||||
label: '是',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
form: { // 创建订单
|
||||
partName: '',
|
||||
stationNumberValue: '',
|
||||
orderNumber: '',
|
||||
engineTypeValue: '',
|
||||
partDrawing: '',
|
||||
number: '',
|
||||
manufactor: '',
|
||||
verificationValue: 1,
|
||||
mainMaterialValue: 0
|
||||
},
|
||||
rules: { // 创建订单验证
|
||||
partName: [{ required: true, message: '请输入零件名称', trigger: 'blur' }],
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
// orderNumber: [{ required: true, message: '请输入物料号', trigger: 'blur' }],
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
|
||||
partDrawing: [{ required: true, message: '请输入零件图号', trigger: 'blur' }],
|
||||
// number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
|
||||
// manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
|
||||
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }]
|
||||
// mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
|
||||
},
|
||||
form1: { // 修改订单
|
||||
partName: '',
|
||||
stationNumberValue: '',
|
||||
orderNumber: '',
|
||||
partDrawing: '',
|
||||
number: '',
|
||||
manufactor: '',
|
||||
verificationValue: 1,
|
||||
mainMaterialValue: 0,
|
||||
ID: ''
|
||||
},
|
||||
rules1: { // 修改订单验证
|
||||
partName: [{ required: true, message: '请输入零件名称', trigger: 'blur' }],
|
||||
// orderNumber: [{ required: true, message: '请输入物料号', trigger: 'blur' }],
|
||||
// partDrawing: [{ required: true, message: '请输入零件图号', trigger: 'blur' }],
|
||||
// number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
|
||||
// manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
|
||||
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }]
|
||||
// stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }]
|
||||
// mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
|
||||
},
|
||||
form2: { // 订单下发
|
||||
planQuantity: '',
|
||||
orderNumber: '',
|
||||
engineTypeValue: '',
|
||||
MID: '',
|
||||
IssuedQuantity: 1
|
||||
},
|
||||
form4: {
|
||||
engineTypeValue: ''
|
||||
},
|
||||
rules4: { // 订单下发验证
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }]
|
||||
},
|
||||
// planTime: [new Date(new Date().getTime() - 3600 * 1000 * 24 * 3000), new Date(new Date().getTime())],
|
||||
planTime: [],
|
||||
tableData: [],
|
||||
importData: [],
|
||||
dialogFormVisible: false, // 创建订单
|
||||
dialogFormVisible1: false, // 修改订单
|
||||
dialogFormVisible3: false, // 订单导入
|
||||
states: '', // 当前库存状态
|
||||
MIDGroup: [],
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
stationNumberValue() {
|
||||
for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
console.log(this.stationNumber[i].label, 'this.stationNumber[i].label')
|
||||
this.stationName = this.stationNumber[i].labelName
|
||||
}
|
||||
}
|
||||
if (!this.stationNumberValue) {
|
||||
this.stationName = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
this.getEndStation()
|
||||
},
|
||||
methods: {
|
||||
removeAll() {
|
||||
this.worksheet = []
|
||||
this.itemFile = []
|
||||
},
|
||||
async selected(data) { // 选择需要导入的文件
|
||||
console.log(data, 1111)
|
||||
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
|
||||
this.itemFile = data.itemFile
|
||||
},
|
||||
handleRemove(file) { // 移除文件
|
||||
for (let i = 0; i < this.itemFile.length; i++) {
|
||||
if (this.itemFile[i].name === file.name) {
|
||||
this.worksheet.splice(i, 1)
|
||||
this.itemFile.splice(i, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 验证内容是否英文数字以及下划线*/
|
||||
// isPassword(rule, value, callback) {
|
||||
// const reg = /^[_a-zA-Z0-9]+$/
|
||||
// if (value === '' || value === undefined || value == null) {
|
||||
// callback()
|
||||
// } else {
|
||||
// if (!reg.test(value) || value.length !== 7) {
|
||||
// callback(new Error('订单仅由数字和字母组成,且只能位7位'))
|
||||
// } else {
|
||||
// callback()
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data.length) this.engineTypeValue = response.data[0].发动机型号
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.searchOrder()
|
||||
})
|
||||
},
|
||||
// 初始化获取订单号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
// if (response.data.length) {
|
||||
// this.stationNumberValue = response.data[0].工位号
|
||||
// this.stationName = response.data[0].工序名称
|
||||
// }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '合力_轮毂桥壳缓存数据_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 创建订单
|
||||
creatOrder(formName) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.partName = ''
|
||||
this.form.stationNumberValue = ''
|
||||
this.form.orderNumber = ''
|
||||
this.form.engineTypeValue = ''
|
||||
this.form.partDrawing = ''
|
||||
this.form.number = ''
|
||||
this.form.manufactor = ''
|
||||
this.form.verificationValue = 1
|
||||
this.form.mainMaterialValue = 0
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 提交新增订单
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumberValue]
|
||||
param[1] = ['发动机型号', this.form.engineTypeValue]
|
||||
param[2] = ['物料号', this.form.orderNumber]
|
||||
param[3] = ['零件名称', this.form.partName]
|
||||
param[4] = ['零件图号', this.form.partDrawing]
|
||||
param[5] = ['生产厂家', this.form.manufactor]
|
||||
param[6] = ['是否验证', this.form.verificationValue]
|
||||
param[7] = ['是否主物料', this.form.mainMaterialValue]
|
||||
param[8] = ['零件数量', this.form.number]
|
||||
var Data = this.CreateData('11', '电子看板_装配零件_SPC_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0]['result'] === '1') {
|
||||
this.$message({
|
||||
message: response.data[0]['msg'],
|
||||
type: 'success'
|
||||
})
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error(response.data[0]['msg'])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消新增订单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
copyOrder(formName) {
|
||||
if (this.tableData.length) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.dialogFormVisible4 = true
|
||||
} else {
|
||||
this.$message({
|
||||
message: '暂无可复制的数据!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
},
|
||||
callOff4() {
|
||||
this.dialogFormVisible4 = false
|
||||
},
|
||||
async submitAdd4() {
|
||||
let stationNumberValue, orderNumber, partName, partDrawing, manufactor, verificationValue, mainMaterialValue, number
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
stationNumberValue = this.tableData[i].工位号
|
||||
orderNumber = this.tableData[i].物料号
|
||||
partName = this.tableData[i].零件名称
|
||||
partDrawing = this.tableData[i].零件图号
|
||||
manufactor = this.tableData[i].生产厂家
|
||||
verificationValue = this.tableData[i].是否验证
|
||||
mainMaterialValue = this.tableData[i].是否主物料
|
||||
number = this.tableData[i].零件数量
|
||||
await this.submitAdd5(stationNumberValue, orderNumber, partName, partDrawing, manufactor, verificationValue, mainMaterialValue, number)
|
||||
}
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible4 = false
|
||||
this.engineTypeValue = this.form4.engineTypeValue
|
||||
this.searchOrder()
|
||||
},
|
||||
async submitAdd5(stationNumberValue, orderNumber, partName, partDrawing, manufactor, verificationValue, mainMaterialValue, number) {
|
||||
var param = []
|
||||
param[0] = ['工位号', stationNumberValue]
|
||||
param[1] = ['发动机型号', this.form4.engineTypeValue]
|
||||
param[2] = ['物料号', orderNumber]
|
||||
param[3] = ['零件名称', partName]
|
||||
param[4] = ['零件图号', partDrawing]
|
||||
param[5] = ['生产厂家', manufactor]
|
||||
param[6] = ['是否验证', verificationValue]
|
||||
param[7] = ['是否主物料', mainMaterialValue]
|
||||
param[8] = ['零件数量', number]
|
||||
var Data = this.CreateData('12', '电子看板_装配零件_SPC_增加', param)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
console.log('1')
|
||||
resolve(1)
|
||||
} else {
|
||||
console.log('0')
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 导入订单
|
||||
importOrder() {
|
||||
this.dialogFormVisible3 = true
|
||||
},
|
||||
// 删除订单
|
||||
deleteOrder(row) {
|
||||
this.$confirm('此操作将永久删除该缓存数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['总成号', row.总成号]
|
||||
var Data = this.CreateData('12', '合力_轮毂桥壳缓存数据_不合格件_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改订单
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.form1.partName = row.零件名称
|
||||
this.form1.stationNumberValue = row.工位号
|
||||
// this.form1.orderNumber = row.物料号
|
||||
this.form1.partDrawing = row.零件图号
|
||||
// this.form1.number = row.零件数量
|
||||
// this.form1.manufactor = row.生产厂家
|
||||
this.form1.verificationValue = Number(row.是否验证)
|
||||
// this.form1.mainMaterialValue = Number(row.是否主物料)
|
||||
this.form1.ID = row.id
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 提交修改订单
|
||||
submitAdd1() {
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.form1.ID]
|
||||
param[1] = ['物料号', this.form1.orderNumber]
|
||||
param[2] = ['零件名称', this.form1.partName]
|
||||
param[3] = ['零件图号', this.form1.partDrawing]
|
||||
// param[5] = ['完成数量', this.form.quantityCompletion]
|
||||
param[4] = ['生产厂家', this.form1.manufactor]
|
||||
param[5] = ['是否验证', this.form1.verificationValue]
|
||||
param[6] = ['是否主物料', this.form1.mainMaterialValue]
|
||||
param[7] = ['零件数量', this.form1.number]
|
||||
param[8] = ['工位号', this.form1.stationNumberValue]
|
||||
param[9] = ['发动机型号', this.engineTypeValue]
|
||||
var Data = this.CreateData('12', '电子看板_装配零件_SPC_修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchOrder()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消修改订单
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
},
|
||||
// 多选
|
||||
handleSelectionChange(val) {
|
||||
this.MIDGroup = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.MIDGroup.push(val[i].MID)
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.$message.error('内容为空')
|
||||
} else {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '确认导入物料字典_新增', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) {
|
||||
this.notes = ''
|
||||
for (var i = 0; i < response.data.length; i++) {
|
||||
this.notes = response.data[i].导入结果 + '、 ' + this.notes
|
||||
}
|
||||
this.$message({
|
||||
message: '物料字典信息更新成功',
|
||||
type: 'warning'
|
||||
})
|
||||
this.isShow = true
|
||||
this.tableData = []
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.$message({
|
||||
message: '物料字典信息更新成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
searchTable() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '生产计划导入_确认导入前临时表_查询', param, this.pageSize, this.pageList)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
async basicPartsToSQL() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.err = 0
|
||||
for (let j = this.worksheet.length - 1; j >= 0; j--) {
|
||||
let partName,
|
||||
stationNumberValue,
|
||||
orderNumber,
|
||||
engineTypeValue,
|
||||
engineTypeNumber,
|
||||
partDrawing,
|
||||
partBatchNumber,
|
||||
number,
|
||||
manufactor,
|
||||
verificationValue,
|
||||
mainMaterialValue,
|
||||
isPreservation
|
||||
// var param = []
|
||||
// param[0] = ['物料号', this.worksheet[j].L2.v]
|
||||
// console.log('物料号', this.worksheet[j].L2.v)
|
||||
// var Data = this.CreateData('11', '电子看板_装配零件_总物料表_导入校验', param)
|
||||
// const response = await this.ExecDatabase(Data)
|
||||
// const res = response.data
|
||||
// if (res[0].Column1 !== 0) {
|
||||
// this.$notify.error(`${this.worksheet[j].L2.v}已经存在,请确认文件是否正确`)
|
||||
// this.loading = false
|
||||
// this.disabled = false
|
||||
// return
|
||||
// }
|
||||
for (let i = 0; i < 999; i++) {
|
||||
const attr = i + 2
|
||||
stationNumberValue = this.worksheet[j][`A${attr}`] ? this.worksheet[j][`A${attr}`].v : ''
|
||||
engineTypeNumber = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : ''
|
||||
partDrawing = this.worksheet[j][`C${attr}`] ? this.worksheet[j][`C${attr}`].v : ''
|
||||
partName = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : ''
|
||||
number = this.worksheet[j][`E${attr}`] ? this.worksheet[j][`E${attr}`].v : ''
|
||||
partBatchNumber = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : ''
|
||||
manufactor = this.worksheet[j][`G${attr}`] ? this.worksheet[j][`G${attr}`].v : ''
|
||||
engineTypeValue = this.worksheet[j][`H${attr}`] ? this.worksheet[j][`H${attr}`].v : ''
|
||||
verificationValue = this.worksheet[j][`I${attr}`] ? this.worksheet[j][`I${attr}`].v : ''
|
||||
mainMaterialValue = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : ''
|
||||
isPreservation = this.worksheet[j][`K${attr}`] ? this.worksheet[j][`K${attr}`].v : ''
|
||||
orderNumber = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : ''
|
||||
if (!stationNumberValue && !engineTypeNumber &&
|
||||
!partDrawing && !partName && !number && !partBatchNumber &&
|
||||
!manufactor && !engineTypeValue && !verificationValue && !mainMaterialValue && !isPreservation && !orderNumber) {
|
||||
break
|
||||
} else if (!orderNumber) { // 名称不能为空
|
||||
this.$notify.error(`物料号不能为空`)
|
||||
break
|
||||
} else if (Number(partDrawing) <= 0) { // 数量不能为0
|
||||
this.$notify.error(`零件图号不能为空`)
|
||||
break
|
||||
} else {
|
||||
if (orderNumber) {
|
||||
await sleep(50)
|
||||
await this.insertToSQL(stationNumberValue,
|
||||
engineTypeNumber,
|
||||
partDrawing,
|
||||
partName,
|
||||
number,
|
||||
partBatchNumber,
|
||||
manufactor,
|
||||
engineTypeValue,
|
||||
verificationValue,
|
||||
mainMaterialValue,
|
||||
isPreservation,
|
||||
orderNumber)
|
||||
} else {
|
||||
this.loading = false
|
||||
this.disabled = false
|
||||
this.$notify.error(`请确认导入文件是否正确`)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
this.itemFile.splice(j, 1)
|
||||
this.worksheet.splice(j, 1)
|
||||
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败物料个数为${this.err},请检查文件是否正确`)
|
||||
}
|
||||
this.loading = false
|
||||
this.searchOrder()
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.loading = false
|
||||
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
},
|
||||
async insertToSQL(stationNumberValue,
|
||||
engineTypeNumber,
|
||||
partDrawing,
|
||||
partName,
|
||||
number,
|
||||
partBatchNumber,
|
||||
manufactor,
|
||||
engineTypeValue,
|
||||
verificationValue,
|
||||
mainMaterialValue,
|
||||
isPreservation,
|
||||
orderNumber) {
|
||||
try {
|
||||
var param = []
|
||||
param[0] = ['工位号', stationNumberValue]
|
||||
param[1] = ['产品型号代码', engineTypeNumber]
|
||||
param[2] = ['零件图号', partDrawing]
|
||||
param[3] = ['零件名称', partName]
|
||||
param[4] = ['零件数量', number]
|
||||
param[5] = ['零件批号', partBatchNumber]
|
||||
param[6] = ['生产厂家', manufactor]
|
||||
param[7] = ['发动机型号', engineTypeValue]
|
||||
param[8] = ['是否验证', verificationValue]
|
||||
param[9] = ['是否主物料', mainMaterialValue]
|
||||
param[10] = ['是否保存', isPreservation]
|
||||
param[11] = ['物料号', orderNumber]
|
||||
var Data = this.CreateData('12', '物料数据_导入Excel', param)
|
||||
const response = await this.ExecDatabase(Data)
|
||||
const res = response.data
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${orderNumber}导入失败`)
|
||||
} else {
|
||||
this.$notify.error(`${orderNumber}导入成功`)
|
||||
}
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.$message.error(`导入数据错误`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
var param = []
|
||||
param[0] = ['发动机型号', this.engineTypeValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('2001', '电子看板_装配零件_总物料表_导出新', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
background-color: white!important;
|
||||
}
|
||||
</style>
|
||||
648
src/views/ProcessManagement/SpecialRequirementsList/index.vue
Normal file
648
src/views/ProcessManagement/SpecialRequirementsList/index.vue
Normal file
@@ -0,0 +1,648 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" width="60px" label="序号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.序号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="适用范围" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.适用范围 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="特殊需求">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.特殊需求 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="改制物料" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.改制物料 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="改制工具" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.改制工具 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="改制单号" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.改制单号 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工位号" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.工位号 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="有效日期" width="100px">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <div style="white-space: pre-line !important;">{{ scope.row.有效日期 }}</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="生产确认" width="100px">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <div style="white-space: pre-line !important;">{{ scope.row.生产确认 }}</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="editInformation(scope.row)"><i class="el-icon-edit"/></el-button>
|
||||
<el-button type="text" style="color: #ff0000" @click="deleteInformation(scope.row)"><i class="el-icon-delete"/></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="700px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="序号" prop="number" style="display: inline-block">
|
||||
<el-input-number v-model="form.number" :min="1" :step="1" style="width: 200px;" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工位号:" prop="工位号" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.工位号"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入工位号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="适用范围:" prop="适用范围" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.适用范围"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入适用范围"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="特殊需求:" prop="特殊需求" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.特殊需求"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入特殊需求"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="改制物料:" prop="改制物料" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.改制物料"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入改制物料"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="改制工具:" prop="改制工具" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.改制工具"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入改制工具"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="改制单号:" prop="改制单号" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.改制单号"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入改制单号"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '添加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" :title="title" center style="min-height: 200px;" width="700px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="序号:" prop="number" style="display: inline-block">
|
||||
<el-input-number v-model="form1.number" :min="1" :step="1" style="width: 200px;" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工位号:" prop="工位号" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.工位号"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入工位号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="适用范围:" prop="适用范围" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.适用范围"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入适用范围"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="特殊需求:" prop="特殊需求" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.特殊需求"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入特殊需求"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="改制物料:" prop="改制物料" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.改制物料"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入改制物料"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="改制工具:" prop="改制工具" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.改制工具"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入改制工具"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="改制单号:" prop="改制单号" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.改制单号"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 525px"
|
||||
placeholder="请输入改制单号"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.stationNumberValue" placeholder="请选择工位号" size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.engineTypeValue" placeholder="请选择产品型号" size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff4()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
moduleDescription: [],
|
||||
moduleDescriptionValue: '',
|
||||
engineTypeValue: '',
|
||||
engineTypeValue1: '',
|
||||
engineTypeName: '',
|
||||
engineType: [],
|
||||
tagIDArr: [
|
||||
{
|
||||
label: 'lbl_datagrid_quality_name',
|
||||
value: 'lbl_datagrid_quality_name'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item1',
|
||||
value: 'lbl_datagrid_quality_item1'
|
||||
}, {
|
||||
label: 'lbl_datagrid_quality_item2',
|
||||
value: 'lbl_datagrid_quality_item2'
|
||||
}
|
||||
],
|
||||
isDisable: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
}, {
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
isDisableValue: 0,
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible4: false,
|
||||
title: '',
|
||||
form: {
|
||||
number: '',
|
||||
适用范围: '',
|
||||
特殊需求: '',
|
||||
改制物料: '',
|
||||
改制工具: '',
|
||||
改制单号: '',
|
||||
工位号: '',
|
||||
有效日期: '',
|
||||
生产确认: ''
|
||||
},
|
||||
rules: {
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
ID: '',
|
||||
number: '',
|
||||
适用范围: '',
|
||||
特殊需求: '',
|
||||
改制物料: '',
|
||||
改制工具: '',
|
||||
改制单号: '',
|
||||
工位号: '',
|
||||
有效日期: '',
|
||||
生产确认: ''
|
||||
},
|
||||
rules1: {
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }]
|
||||
},
|
||||
form4: {
|
||||
engineTypeValue: '',
|
||||
stationNumberValue: ''
|
||||
},
|
||||
rules4: { // 订单下发验证
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token',
|
||||
'departmentName'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
// stationNumberValue() {
|
||||
// for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
// if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
// console.log(this.stationNumber[i].label, 'this.stationNumber[i].label')
|
||||
// this.stationName = this.stationNumber[i].labelName
|
||||
// }
|
||||
// }
|
||||
// if (!this.stationNumberValue) {
|
||||
// this.stationName = ''
|
||||
// }
|
||||
// },
|
||||
engineTypeValue1() {
|
||||
console.log(1234)
|
||||
for (let i = 0; i < this.engineType.length; i++) {
|
||||
if (this.engineType[i].value === this.engineTypeValue1) {
|
||||
this.engineTypeName = this.engineType[i].labelName
|
||||
console.log(this.engineTypeName, 'this.engineTypeName')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getStationNumber()
|
||||
// this.getEndStation()
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.searchTable()
|
||||
}, 300)
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) {
|
||||
this.stationNumberValue = response.data[0].工位号
|
||||
this.stationName = response.data[0].工位名称
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: `【${response.data[i].工位号}】${response.data[i].工位名称}`,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础信息_机型信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].机型ID
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].机型号,
|
||||
value: response.data[i].机型ID,
|
||||
labelName: response.data[i].机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询MES消息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础_装车单检查内容_特殊需求_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
copyOrder(formName) {
|
||||
if (this.tableData.length) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.dialogFormVisible4 = true
|
||||
} else {
|
||||
this.$message({
|
||||
message: '暂无可复制的数据!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
},
|
||||
async submitAdd4() {
|
||||
let number, text
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
number = this.tableData[i].工步号
|
||||
text = this.tableData[i].操作内容
|
||||
await this.submitAdd5(number, text)
|
||||
}
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible4 = false
|
||||
this.engineTypeValue = this.form4.engineTypeValue
|
||||
this.stationNumberValue = this.form4.stationNumberValue
|
||||
this.searchTable()
|
||||
},
|
||||
async submitAdd5(number, text) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form4.stationNumberValue]
|
||||
param[1] = ['产品型号代码', this.form4.engineTypeValue]
|
||||
param[2] = ['工步号', number]
|
||||
param[3] = ['操作内容', text]
|
||||
param[4] = ['发动机型号', this.form4.engineTypeValue]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
console.log('1')
|
||||
resolve(1)
|
||||
} else {
|
||||
console.log('0')
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
callOff4() {
|
||||
this.dialogFormVisible4 = false
|
||||
},
|
||||
addTo() {
|
||||
this.title = '添加'
|
||||
this.form.适用范围 = ''
|
||||
this.form.特殊需求 = ''
|
||||
this.form.改制物料 = ''
|
||||
this.form.改制工具 = ''
|
||||
this.form.改制单号 = ''
|
||||
this.form.工位号 = ''
|
||||
this.form.有效日期 = ''
|
||||
this.form.生产确认 = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['序号', this.form.number]
|
||||
param[1] = ['适用范围', this.form.适用范围]
|
||||
param[2] = ['特殊需求', this.form.特殊需求]
|
||||
param[3] = ['改制物料', this.form.改制物料]
|
||||
param[4] = ['改制工具', this.form.改制工具]
|
||||
param[5] = ['改制单号', this.form.改制单号]
|
||||
param[6] = ['工位号', this.form.工位号]
|
||||
param[7] = ['有效日期', this.form.有效日期]
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_特殊需求_新增', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.title = ''
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.ID
|
||||
this.form1.number = row.序号
|
||||
this.form1.适用范围 = row.适用范围
|
||||
this.form1.特殊需求 = row.特殊需求
|
||||
this.form1.改制物料 = row.改制物料
|
||||
this.form1.改制工具 = row.改制工具
|
||||
this.form1.改制单号 = row.改制单号
|
||||
this.form1.工位号 = row.工位号
|
||||
this.form1.有效日期 = row.有效日期
|
||||
this.form1.生产确认 = row.生产确认
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['序号', this.form1.number]
|
||||
param[1] = ['适用范围', this.form1.适用范围]
|
||||
param[2] = ['特殊需求', this.form1.特殊需求]
|
||||
param[3] = ['改制物料', this.form1.改制物料]
|
||||
param[4] = ['改制工具', this.form1.改制工具]
|
||||
param[5] = ['改制单号', this.form1.改制单号]
|
||||
param[6] = ['工位号', this.form1.工位号]
|
||||
param[7] = ['有效日期', this.form1.有效日期]
|
||||
param[8] = ['ID', this.labelNumber]
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_特殊需求_编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', 'CATL_基础_装车单检查内容_特殊需求_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
|
||||
::v-deep textarea{
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
1481
src/views/ProcessManagement/StepContentMaintenance/index.vue
Normal file
1481
src/views/ProcessManagement/StepContentMaintenance/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
630
src/views/ProcessManagement/WarehouseLocation/index.vue
Normal file
630
src/views/ProcessManagement/WarehouseLocation/index.vue
Normal file
@@ -0,0 +1,630 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<el-col :span="11">
|
||||
<div class="topDiv">
|
||||
<span>配方名称:</span>
|
||||
<el-input v-model="repiceName" style="width:150px;" placeholder="配方名称" size="small"/>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
<el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制配方</el-button>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="370px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
size="mini"
|
||||
@row-click="currentRepice">
|
||||
<el-table-column align="center" label="配方号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.配方号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="配方名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.配方名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="配方说明">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.配方说明 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: red" @click="deleteInformation(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="topDiv">
|
||||
<span>工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="工位号" clearable size="small" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-input v-model="stationName" readonly style="width:160px;" size="small"/>
|
||||
<span style="margin-left: 10px">操作名:</span>
|
||||
<el-input v-model="operationName" style="width:150px;" placeholder="操作名" size="small"/>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTableOperation()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData3"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="370px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="操作号码" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作号码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: red" @click="deleteInformation(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="topDiv" style="margin-left: 10px">
|
||||
<span style="margin-left: 10px">配方列表(请选择左侧配方查看),选择工位号进行筛选</span>
|
||||
<el-select v-model="stationRepiceValue" placeholder="工位号" clearable size="small" style="width: 120px" @change="changeTableData">
|
||||
<el-option
|
||||
v-for="item in stationRepiceNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData1"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="784px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="排序" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位排序 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作号码" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作号码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumber" placeholder="请选择工位号" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品型号:" prop="moduleDescription" style="display: inline-block">
|
||||
<el-select v-model="form.moduleDescription" placeholder="请选择产品型号" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="序号:" prop="number" style="display: inline-block">
|
||||
<el-input v-model="form.number" style="width:200px;" placeholder="请输入序号" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作内容:" prop="text" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.text"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入操作内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button v-if="title === '添加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" :title="title" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
|
||||
<el-form-item label="序号:" prop="number" style="display: inline-block">
|
||||
<el-input v-model="form1.number" style="width:200px;" placeholder="请输入序号" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作内容:" prop="text" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.text"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
placeholder="请输入操作内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.stationNumberValue" placeholder="请选择工位号" size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form4.engineTypeValue" placeholder="请选择产品型号" size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff4()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
stationRepiceNumberTemp: [],
|
||||
stationRepiceNumber: [],
|
||||
stationRepiceValue: '',
|
||||
isSearchRepice: false,
|
||||
operationName: '',
|
||||
repiceName: '',
|
||||
tableData: [], // 总数据数组
|
||||
tableData1: [], // 总数据数组
|
||||
tableData1Temp: [], // 总数据数组
|
||||
tableData3: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
stationName: '',
|
||||
moduleDescription: [],
|
||||
moduleDescriptionValue: '',
|
||||
engineTypeValue: '',
|
||||
engineTypeValue1: '',
|
||||
engineTypeName: '',
|
||||
engineType: [],
|
||||
isDisableValue: 0,
|
||||
labelText: '',
|
||||
labelNumber: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible4: false,
|
||||
title: '',
|
||||
form: {
|
||||
stationNumber: '',
|
||||
moduleDescription: '',
|
||||
number: '',
|
||||
text: ''
|
||||
},
|
||||
rules: {
|
||||
stationNumber: [{ required: true, message: '请选择工位号', trigger: 'change' }],
|
||||
moduleDescription: [{ required: true, message: '请选择产品型号', trigger: 'change' }],
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
text: [{ required: true, message: '请输入操作内容', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
number: '',
|
||||
text: ''
|
||||
},
|
||||
rules1: {
|
||||
number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
text: [{ required: true, message: '请输入操作内容', trigger: 'blur' }]
|
||||
},
|
||||
form4: {
|
||||
engineTypeValue: '',
|
||||
stationNumberValue: ''
|
||||
},
|
||||
rules4: { // 订单下发验证
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
|
||||
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token',
|
||||
'departmentName'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
stationNumberValue() {
|
||||
for (let i = 0; i < this.stationNumber.length; i++) {
|
||||
if (this.stationNumber[i].value === this.stationNumberValue) {
|
||||
console.log(this.stationNumber[i].label, 'this.stationNumber[i].label')
|
||||
this.stationName = this.stationNumber[i].labelName
|
||||
}
|
||||
}
|
||||
if (!this.stationNumberValue) {
|
||||
this.stationName = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.searchTable()
|
||||
this.searchTableOperation()
|
||||
}, 300)
|
||||
},
|
||||
methods: {
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询配方
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['配方名称', this.repiceName]
|
||||
var Data = this.CreateData('11', '北汽福田_配方_配方查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
currentRepice(row) {
|
||||
if (this.isSearchRepice) {
|
||||
this.$message({
|
||||
message: '正在查询,请稍等!',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.isSearchRepice = true
|
||||
this.tableData1 = []
|
||||
this.stationRepiceNumberTemp = []
|
||||
this.stationRepiceNumber = []
|
||||
this.stationRepiceValue = ''
|
||||
var param = []
|
||||
param[0] = ['配方号', row['配方号']]
|
||||
var Data = this.CreateData('11', '北汽福田_配方_配方详细查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData1 = response.data
|
||||
this.tableData1Temp = response.data
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
if (this.stationRepiceNumberTemp.indexOf(this.tableData1[i].工位号) === -1) {
|
||||
this.stationRepiceNumberTemp.push(this.tableData1[i].工位号)
|
||||
this.stationRepiceNumber.push({
|
||||
label: this.tableData1[i].工位号,
|
||||
value: this.tableData1[i].工位号
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isSearchRepice = false
|
||||
})
|
||||
},
|
||||
changeTableData(value) {
|
||||
if (value === '') {
|
||||
this.tableData1 = this.tableData1Temp
|
||||
return
|
||||
}
|
||||
this.tableData1 = this.tableData1Temp.filter(item => item.工位号 === value)
|
||||
},
|
||||
// 北汽福田_配方_配方操作查询
|
||||
searchTableOperation() {
|
||||
this.tableData3 = []
|
||||
var param = []
|
||||
param[0] = ['操作名称', this.operationName]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '北汽福田_配方_配方操作查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData3 = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
copyOrder(formName) {
|
||||
if (this.tableData.length) {
|
||||
if (this.$refs[formName] !== undefined) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.dialogFormVisible4 = true
|
||||
} else {
|
||||
this.$message({
|
||||
message: '暂无可复制的数据!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
},
|
||||
async submitAdd4() {
|
||||
let number, text
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
number = this.tableData[i].工步号
|
||||
text = this.tableData[i].操作内容
|
||||
await this.submitAdd5(number, text)
|
||||
}
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible4 = false
|
||||
this.engineTypeValue = this.form4.engineTypeValue
|
||||
this.stationNumberValue = this.form4.stationNumberValue
|
||||
this.searchTable()
|
||||
},
|
||||
async submitAdd5(number, text) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form4.stationNumberValue]
|
||||
param[1] = ['产品型号代码', this.form4.engineTypeValue]
|
||||
param[2] = ['工步号', number]
|
||||
param[3] = ['操作内容', text]
|
||||
param[4] = ['发动机型号', this.form4.engineTypeValue]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
console.log('1')
|
||||
resolve(1)
|
||||
} else {
|
||||
console.log('0')
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
callOff4() {
|
||||
this.dialogFormVisible4 = false
|
||||
},
|
||||
addTo() {
|
||||
this.title = '添加'
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form.stationNumber]
|
||||
param[1] = ['产品型号代码', this.form.moduleDescription]
|
||||
param[2] = ['工步号', this.form.number]
|
||||
param[3] = ['操作内容', this.form.text]
|
||||
param[4] = ['发动机型号', this.form.moduleDescription]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form1'].resetFields()
|
||||
this.form.stationNumber = ''
|
||||
this.form.moduleDescription = ''
|
||||
this.form.number = ''
|
||||
this.form.text = ''
|
||||
this.engineTypeName = ''
|
||||
this.title = ''
|
||||
},
|
||||
editInformation(row) {
|
||||
this.labelNumber = row.ID
|
||||
this.form1.number = row.工步号
|
||||
this.form1.text = row.操作内容
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['工步号', this.form1.number]
|
||||
param[1] = ['操作内容', this.form1.text]
|
||||
param[2] = ['ID', this.labelNumber]
|
||||
console.log(param)
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_修改_要点理由YC', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '订单删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('订单删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
393
src/views/ProcessManagement/WorkHourMaintenance/index.vue
Normal file
393
src/views/ProcessManagement/WorkHourMaintenance/index.vue
Normal file
@@ -0,0 +1,393 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">产品型号:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" clearable size="small" style="width: 150px" @change="searchTable()">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="add()">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
height="680px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="产品型号" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位节拍(S)" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.作业时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="返修节拍(S)" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.返修时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)"/>
|
||||
<el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteOrder(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="工艺节拍新增" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
|
||||
<el-form-item label="工位号:" prop="stationNumberValue" style="display: inline-block">
|
||||
<el-select v-model="form.stationNumberValue" placeholder="请选择工位号" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品型号:" prop="engineTypeValue" style="display: inline-block">
|
||||
<el-select v-model="form.engineTypeValue" placeholder="请选择产品型号" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工位节拍(s):" prop="rhythm" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="form.rhythm"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="请输入工位节拍"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="返修节拍(s):" prop="rhythm1" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="form.rhythm1"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="请输入返修节拍"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="addRhythm('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="工艺节拍编辑" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="editForm" :model="editForm" :rules="editRules" label-position="right" label-width="110px">
|
||||
<el-form-item label="产品型号:" prop="type" style="display: inline-block">
|
||||
<el-select v-model="editForm.type" placeholder="请选择产品型号" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工序号:" prop="stationNumber" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="editForm.stationNumber"
|
||||
readonly
|
||||
size="small"
|
||||
placeholder="请输入工序号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工位名称:" prop="name" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="editForm.name"
|
||||
readonly
|
||||
size="small"
|
||||
placeholder="请输入工位名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工位节拍(s):" prop="rhythm" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="editForm.rhythm"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="请输入工位节拍"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="返修节拍(s):" prop="rhythm1" style="display: inline-block">
|
||||
<el-input-number
|
||||
v-model="editForm.rhythm1"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="请输入返修节拍"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitEdit('editForm')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rhythm: '',
|
||||
engineTypeValue: '',
|
||||
engineType: [],
|
||||
tableData: [], // 总数据数组
|
||||
stationNumber: [],
|
||||
stationNumberValue: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
rhythm: '',
|
||||
rhythm1: '',
|
||||
stationNumberValue: '',
|
||||
engineTypeValue: ''
|
||||
},
|
||||
editForm: {
|
||||
id: '',
|
||||
id1: '',
|
||||
type: '',
|
||||
stationNumber: '',
|
||||
name: '',
|
||||
rhythm1: '',
|
||||
rhythm: ''
|
||||
},
|
||||
rules: {
|
||||
rhythm1: [{ required: true, message: '请输入节拍', trigger: 'blur' }],
|
||||
rhythm: [{ required: true, message: '请输入节拍', trigger: 'blur' }],
|
||||
stationNumberValue: [{ required: true, message: '请选择工位', trigger: 'blur' }],
|
||||
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }]
|
||||
},
|
||||
editRules: {
|
||||
rhythm1: [{ required: true, message: '请输入节拍', trigger: 'blur' }],
|
||||
rhythm: [{ required: true, message: '请输入节拍', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStationNumber()
|
||||
this.getProductType()
|
||||
},
|
||||
methods: {
|
||||
// 初始化获取订单号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号,
|
||||
labelName: response.data[i].工位名称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getProductType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'CATL_基础信息_机型信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length > 0) this.engineTypeValue = response.data[0].机型ID
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].机型号,
|
||||
value: response.data[i].机型ID,
|
||||
labelName: response.data[i].机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 查询信息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['机型代码', this.engineTypeValue]
|
||||
var Data = this.CreateData('11', 'CATL_基本数据_工位节拍_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.$refs['editForm'].resetFields()
|
||||
},
|
||||
// 新增节拍
|
||||
addRhythm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['基本机型', this.form.engineTypeValue]
|
||||
param[1] = ['工序节拍', this.form.rhythm]
|
||||
param[2] = ['工位号', this.form.stationNumberValue]
|
||||
param[3] = ['返修节拍', this.form.rhythm1]
|
||||
var Data = this.CreateData('12', 'CATL_基本数据_工位节拍_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('新增失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
edit(row) {
|
||||
// console.log(row, 'row')
|
||||
this.dialogFormVisible1 = true
|
||||
this.editForm.id = row.ID
|
||||
this.editForm.id1 = row.ID1
|
||||
this.editForm.type = row.机型代码
|
||||
this.editForm.stationNumber = row.工位号
|
||||
this.editForm.name = row.工位名称
|
||||
this.editForm.rhythm = row.作业时间
|
||||
this.editForm.rhythm1 = row.返修时间
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['id', this.editForm.id]
|
||||
param[1] = ['基本机型', this.editForm.type]
|
||||
param[2] = ['工序节拍', this.editForm.rhythm]
|
||||
param[3] = ['返修节拍', this.editForm.rhythm1]
|
||||
param[4] = ['id1', this.editForm.id1]
|
||||
var Data = this.CreateData('12', 'CATL_基本数据_工位节拍_修改', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '编辑成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('编辑失败!')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除订单
|
||||
deleteOrder(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
param[1] = ['ID1', row.ID1]
|
||||
var Data = this.CreateData('12', 'CATL_基本数据_工位节拍_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="height: 867px">
|
||||
<el-col :span="6">
|
||||
<div style="width: 145px;display: inline-block">
|
||||
<el-input v-model="processFileName" placeholder="请输入文件名称" clearable/>
|
||||
</div>
|
||||
<el-button :disabled="loading" type="success" plain icon="el-icon-search" style="margin-left: 10px" @click="searchTable()">查询文件</el-button>
|
||||
<br>
|
||||
<el-upload
|
||||
ref="uploadStandFile"
|
||||
:on-remove="handleRemove"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:file-list="fileList"
|
||||
:auto-upload="false"
|
||||
:action="action"
|
||||
:data="Data"
|
||||
:limit="1"
|
||||
:on-success="stnFileSuccess"
|
||||
:on-error="stnFileError"
|
||||
accept=".png,.jpg,.jpeg,.pdf,.gif"
|
||||
class="upload-demo"
|
||||
style="margin-top: 10px">
|
||||
<el-button slot="trigger" plain type="primary" icon="el-icon-thumb">选取工艺文件</el-button>
|
||||
<el-button style="margin-left: 10px;" plain type="warning" icon="el-icon-upload2" @click="uploadStandFile">上传文件</el-button>
|
||||
</el-upload>
|
||||
<div style="margin-top: 10px">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#F5F5F5'}"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="740"
|
||||
border
|
||||
highlight-current-row
|
||||
stripe
|
||||
size="mini">
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50"/>
|
||||
<el-table-column align="left" label="文件名称" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.fileName + '.' + scope.row.fileType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="编辑" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-view" @click="lookFile(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-download" style="color: #00893d" @click="downLoadFile(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-delete" style="color: red" @click="deleteFile(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<span v-if="fileName !== ''" style="font-size: 18px;font-weight: bolder">{{ fileName + '.' + fileType }}</span>
|
||||
<span v-else style="font-size: 18px;font-weight: bolder">请选择左侧文件进行预览</span>
|
||||
<div style="height: 814px;border: 1px solid #a1a1a1">
|
||||
<div v-show="fileContent !== ''">
|
||||
<el-image v-if="isImageType" :src="fileContentImg" lazy fit="fill"/>
|
||||
<div v-else-if="isPdfType">
|
||||
<iframe
|
||||
:src="fileContentPdf"
|
||||
width="100%"
|
||||
height="810px"/>
|
||||
</div>
|
||||
<div v-else class="noView">不支持的预览格式</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { action } from '@/utils/request'
|
||||
import $ from 'jquery'
|
||||
|
||||
export default {
|
||||
// props: ['opname'],
|
||||
data() {
|
||||
return {
|
||||
opname: '',
|
||||
imageType: ['bmp', 'jpg', 'png', 'gif'],
|
||||
pdfType: ['pdf'],
|
||||
currentDownLoadUrl: '',
|
||||
fileName: '',
|
||||
fileType: '',
|
||||
fileContent: '',
|
||||
fileContentImg: null,
|
||||
fileContentPdf: null,
|
||||
isImageType: false,
|
||||
isPdfType: false,
|
||||
action: action,
|
||||
fileList: [],
|
||||
processFileName: '',
|
||||
opnames: [],
|
||||
opnameThis: '',
|
||||
opnameThisName: '',
|
||||
listOP: [],
|
||||
loading: false,
|
||||
tableData: [],
|
||||
Data: {},
|
||||
total: 0, // 总条数
|
||||
pageSize: 50, // 每页显示条数
|
||||
PageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
// this.opnameThis = this.opname
|
||||
// this.searchTableOpName()
|
||||
// this.searchTable()
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 获取工位号
|
||||
searchTableOpName() {
|
||||
var param = []
|
||||
this.machineInfo_state = {}
|
||||
var Data = this.CreateData('11', '[AAA临工看板_主看板_查询数据]', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.opnames.push({
|
||||
label: response.data[i].工位号 + '-' + response.data[i].工位名称,
|
||||
value: response.data[i].工位号,
|
||||
id: response.data[i].id
|
||||
})
|
||||
if (response.data[i].工位号 === this.opnameThis) {
|
||||
this.opnameThisName = response.data[i].工位号 + '-' + response.data[i].工位名称
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询文件列表
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
var param = []
|
||||
param[0] = ['opname', this.opnameThis]
|
||||
param[1] = ['fileName', this.processFileName]
|
||||
var Data = this.CreateData('11', 'LG_临工看板_工艺管理_工艺文件查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
this.tableData = response.data
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
},
|
||||
// 预览文件
|
||||
lookFile(row) {
|
||||
this.fileName = row.fileName
|
||||
this.fileType = row.fileType.toLowerCase()
|
||||
this.fileContent = row.fileContent
|
||||
this.fileContentImg = ''
|
||||
this.fileContentPdf = ''
|
||||
if (this.imageType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = true
|
||||
this.isPdfType = false
|
||||
this.fileContentImg = 'data:image/png;base64,' + this.fileContent
|
||||
} else if (this.pdfType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = false
|
||||
this.isPdfType = true
|
||||
this.fileContentPdf = this.solvePdfUrl(this.fileContent, this.fileType, this.fileName)
|
||||
} else {
|
||||
this.isImageType = false
|
||||
this.isPdfType = false
|
||||
}
|
||||
},
|
||||
// 处理pdf
|
||||
solvePdfUrl(content, type, fileName) {
|
||||
const bstr = atob(content)
|
||||
let n = bstr.length
|
||||
const u8arr = new Uint8Array(n)
|
||||
while (n--) { u8arr[n] = bstr.charCodeAt(n) }
|
||||
// 确定解析格式,可能可以变成img,没有深入研究
|
||||
const blob = new Blob([u8arr], { type: 'application/pdf;chartset=UTF-8' })
|
||||
return window.URL.createObjectURL(blob)
|
||||
},
|
||||
// 下载文件
|
||||
downLoadFile(row) {
|
||||
let contentUrl = ''
|
||||
this.fileName = row.fileName
|
||||
this.fileType = row.fileType.toLowerCase()
|
||||
this.fileContent = row.fileContent
|
||||
this.fileContentImg = ''
|
||||
this.fileContentPdf = ''
|
||||
if (this.imageType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = true
|
||||
this.isPdfType = false
|
||||
this.fileContentImg = 'data:image/png;base64,' + this.fileContent
|
||||
contentUrl = 'data:image/png;base64,' + this.fileContent
|
||||
} else if (this.pdfType.indexOf(this.fileType) !== -1) {
|
||||
this.isImageType = false
|
||||
this.isPdfType = true
|
||||
this.fileContentPdf = this.solvePdfUrl(this.fileContent, this.fileType, this.fileName)
|
||||
contentUrl = this.fileContentPdf
|
||||
} else {
|
||||
this.isImageType = false
|
||||
this.isPdfType = false
|
||||
this.$message.warning('不支持的下载格式!')
|
||||
return
|
||||
}
|
||||
var a = document.createElement('a')
|
||||
a.download = this.fileName + '.' + this.fileType
|
||||
a.href = contentUrl
|
||||
$('body').append(a)
|
||||
a.click()
|
||||
$(a).remove()
|
||||
},
|
||||
// 删除文件
|
||||
deleteFile(row) {
|
||||
this.$confirm('是否确认将文件进行删除' + '</div>', '提示', {
|
||||
distinguishCancelAndClose: true,
|
||||
center: true,
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('11', 'LG_临工看板_工艺管理_工艺文件删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.$message.success('删除成功!')
|
||||
this.searchTable()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消删除!'
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 移除上传文件
|
||||
*/
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = []
|
||||
},
|
||||
/**
|
||||
* 上传设备文件大小限制
|
||||
*/
|
||||
beforeAvatarUpload(file) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传工艺文档大小不能超过 10MB!')
|
||||
}
|
||||
return isLt2M
|
||||
},
|
||||
/**
|
||||
* 上传标准文件
|
||||
*/
|
||||
uploadStandFile() {
|
||||
if (this.$refs.uploadStandFile.uploadFiles.length === 0) {
|
||||
this.$message.warning('请选择文件进行上传!')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['opName', this.opnameThis]
|
||||
param[1] = ['fileName', '']
|
||||
param[2] = ['fileType', '']
|
||||
param[3] = ['fileContent', null]
|
||||
this.Data.param = this.CreateData('15', 'LG_临工看板_工艺管理_工艺文件上传', param)
|
||||
this.$refs.uploadStandFile.submit()
|
||||
},
|
||||
/**
|
||||
* 上传标准设备文件成功后
|
||||
*/
|
||||
stnFileSuccess(res, file) {
|
||||
this.$message.success('上传成功!')
|
||||
this.fileList = []
|
||||
this.searchTable()
|
||||
},
|
||||
stnFileError(err, file, fileList) {
|
||||
this.$message.success('上传失败,请重新上传!' + err.toString())
|
||||
this.fileList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.noView{
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
line-height: 800px;
|
||||
color: #b8b5b5;
|
||||
}
|
||||
</style>
|
||||
477
src/views/ProcessManagement/processMarkingManagement/index.vue
Normal file
477
src/views/ProcessManagement/processMarkingManagement/index.vue
Normal file
@@ -0,0 +1,477 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
height="650px"
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
style="width: 70%"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column type="index" width="50px" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="标记名称" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标记名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" width="150px" label="标记图片">
|
||||
<template slot-scope="scope">
|
||||
<el-image :src="scope.row.fileContentImg" fit="contain">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"/>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="标记说明">
|
||||
<template slot-scope="scope">
|
||||
<div style="white-space: pre-line !important;">{{ scope.row.标记说明 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" style="color: #8400ff" @click="editInformation_pic(scope.row)"><i class="el-icon-picture-outline"/></el-button>
|
||||
<el-button type="text" @click="editInformation(scope.row)"><i class="el-icon-edit"/></el-button>
|
||||
<el-button type="text" style="color: #ff0000" @click="deleteInformation(scope.row)"><i class="el-icon-delete"/></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="添加工步标记" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="90px">
|
||||
<el-form-item label="标记名称" prop="markName" style="display: inline-block">
|
||||
<el-input v-model="form.markName" size="small" placeholder="请输入标记名称" style="width:250px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标记说明" prop="markContent" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.markContent"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 250px"
|
||||
placeholder="请输入标记说明"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="编辑工步标记" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="90px">
|
||||
<el-form-item label="标记名称" prop="markName" style="display: inline-block">
|
||||
<el-input v-model="form1.markName" readonly size="small" placeholder="请输入标记名称" class="myReadOnly-input" style="width:250px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标记说明" prop="markContent" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form1.markContent"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 250px"
|
||||
placeholder="请输入标记说明"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitUpdate('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible6" title="上传标记图片" center style="min-height: 200px;" width="400px">
|
||||
<el-form ref="form6" :model="form6" :rules="rules6" label-position="right" label-width="90px">
|
||||
<el-form-item label="标记名称" prop="stepContent" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form6.markName"
|
||||
size="small"
|
||||
readonly
|
||||
class="myReadOnly-input"
|
||||
style="width: 250px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="指导图片" prop="materialCodeName" style="display: inline-block">
|
||||
<el-upload
|
||||
id="invoiceScan"
|
||||
ref="upload"
|
||||
:on-remove="handelLimitStyle"
|
||||
:on-change="handelLimit"
|
||||
:multiple="true"
|
||||
:auto-upload="false"
|
||||
:on-success="uploadSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="warningExceed"
|
||||
:limit="limit"
|
||||
:data="Data"
|
||||
:action="upload"
|
||||
accept=".png,.jpg"
|
||||
style="margin-left: 0"
|
||||
list-type="picture-card">
|
||||
<i class="el-icon-plus"/>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOffBindingPicture('form6')">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitPicture('form6')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-image-viewer
|
||||
v-if="imgViewerVisible"
|
||||
:url-list="imgViewerList"
|
||||
:on-close="()=>{imgViewerVisible=false}"
|
||||
style="z-index: 98965"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { url } from '@/utils/request'
|
||||
import elImageViewer from 'element-ui/packages/image/src/image-viewer'
|
||||
export default {
|
||||
components: {
|
||||
'el-image-viewer': elImageViewer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageType: ['bmp', 'jpg', 'png', 'gif'],
|
||||
imgViewerList: [],
|
||||
imgViewerVisible: false,
|
||||
tableData: [], // 总数据数组
|
||||
loading1: false,
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible6: false,
|
||||
limit: 1,
|
||||
Data: {},
|
||||
upload: url,
|
||||
form: {
|
||||
markName: '',
|
||||
markContent: ''
|
||||
},
|
||||
rules: {
|
||||
markName: [{ required: true, message: '请输入标记名称', trigger: 'blur' }]
|
||||
},
|
||||
form1: {
|
||||
ID: '',
|
||||
markName: '',
|
||||
markContent: ''
|
||||
},
|
||||
rules1: {
|
||||
},
|
||||
form6: {
|
||||
markName: '',
|
||||
ID: ''
|
||||
},
|
||||
rules6: { // 订单下发验证
|
||||
},
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token',
|
||||
'departmentName'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 查询MES消息
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '电子看板_工序内容_标记_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
const fileType = response.data[i]['图片类型']
|
||||
let fileContentImg = response.data[i]['产品图片']
|
||||
if (this.imageType.indexOf(fileType) !== -1) {
|
||||
fileContentImg = 'data:image/png;base64,' + fileContentImg
|
||||
}
|
||||
response.data[i]['fileContentImg'] = fileContentImg
|
||||
}
|
||||
this.tableData = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
async submitAdd5(number, text) {
|
||||
var param = []
|
||||
param[0] = ['工位号', this.form4.stationNumberValue]
|
||||
param[1] = ['产品型号代码', this.form4.engineTypeValue]
|
||||
param[2] = ['工步号', number]
|
||||
param[3] = ['操作内容', text]
|
||||
param[4] = ['发动机型号', this.form4.engineTypeValue]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
console.log('1')
|
||||
resolve(1)
|
||||
} else {
|
||||
console.log('0')
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
callOff4() {
|
||||
this.dialogFormVisible4 = false
|
||||
},
|
||||
addTo() {
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['标记名称', this.form.markName]
|
||||
param[1] = ['标记说明', this.form.markContent]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_标记_增加', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
this.callOff('form')
|
||||
} else {
|
||||
this.$message.error('增加失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff(form) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[form].resetFields()
|
||||
},
|
||||
callOff1(form) {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs[form].resetFields()
|
||||
},
|
||||
editInformation(row) {
|
||||
this.form1.ID = row.ID
|
||||
this.form1.markName = row['标记名称']
|
||||
this.form1.markContent = row['标记说明']
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
editInformation_material(row) {
|
||||
this.multipleSelection = []
|
||||
this.form5.ID = row.ID
|
||||
this.form5.stepContent = row['操作内容']
|
||||
this.form5.materialCodeList = ''
|
||||
this.form5.materialCodeName = ''
|
||||
this.dialogFormVisible5 = true
|
||||
},
|
||||
editInformation_pic(row) {
|
||||
this.form6.ID = row.ID
|
||||
this.form6.markName = row['标记名称']
|
||||
this.dialogFormVisible6 = true
|
||||
setTimeout(() => {
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'none') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'block'
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 编辑消息
|
||||
submitUpdate(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var param = []
|
||||
param[0] = ['ID', this.form1.ID]
|
||||
param[1] = ['标记说明', this.form1.markContent]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_标记_编辑', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
this.callOff1('form1')
|
||||
} else {
|
||||
this.$message.error('修改失败!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteInformation(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['ID', row.ID]
|
||||
var Data = this.CreateData('12', '电子看板_工序内容_标记_删除', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('删除失败!')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 处理图片字符串的方法
|
||||
parseImages(imageString) {
|
||||
if (!imageString) return []
|
||||
return imageString
|
||||
.split('^')
|
||||
.map(item => item.trim())
|
||||
.filter(item => item)
|
||||
.map(item => {
|
||||
const [id, name] = item.split('&')
|
||||
return {
|
||||
id: id.trim(),
|
||||
name: name.trim()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 处理图片字符串的方法
|
||||
parseMaterialCode(materialString) {
|
||||
if (!materialString) return []
|
||||
return materialString
|
||||
.split('^')
|
||||
.map(item => item.trim())
|
||||
.filter(item => item)
|
||||
.map(item => {
|
||||
const [id, name] = item.split('&')
|
||||
return {
|
||||
id: id.trim(),
|
||||
name: name.trim()
|
||||
}
|
||||
})
|
||||
},
|
||||
handelLimit() {
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'block' || obj[0].style.display === '') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'none'
|
||||
}
|
||||
}
|
||||
},
|
||||
handelLimitStyle() {
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'none') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'block'
|
||||
}
|
||||
}
|
||||
},
|
||||
warningExceed() {
|
||||
this.$message.error('仅可上传一张照片')
|
||||
},
|
||||
beforeUpload(file) { // 上传前检测
|
||||
const isJPG = /^image\/.*/.test(file.type)
|
||||
if (!isJPG) {
|
||||
this.$message.error('只能上传图片。。')
|
||||
}
|
||||
return isJPG
|
||||
},
|
||||
uploadSuccess(res) { // 上传成功回调
|
||||
this.dialogFormVisible6 = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$message.success('上传成功!')
|
||||
this.searchTable()
|
||||
var obj = document.getElementsByClassName('el-upload--picture-card')
|
||||
if (obj[0].style.display === 'none') {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
obj[i].style.display = 'block'
|
||||
}
|
||||
}
|
||||
},
|
||||
submitPicture() {
|
||||
var param = []
|
||||
param[0] = ['ID', this.form6.ID]
|
||||
param[1] = ['文件名称', '']
|
||||
param[2] = ['文件后缀', '']
|
||||
param[3] = ['文件内容', null]
|
||||
var Data1 = this.CreateData('15', '电子看板_工序内容_标记_上传图片', param)
|
||||
this.Data.param = Data1
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
callOffBindingPicture(formName) {
|
||||
this.dialogFormVisible6 = false
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
|
||||
::v-deep.el-input.is-disabled .el-input__inner{
|
||||
color: #606266!important;
|
||||
}
|
||||
|
||||
::v-deep textarea{
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user