2022 0823

This commit is contained in:
LIUHAO
2022-08-23 10:41:50 +08:00
parent 44e29b8242
commit cd26a75a0b
9 changed files with 1048 additions and 99 deletions

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1661133464940" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1922" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M76.818347 981.333333a188.330667 188.330667 0 0 1-57.6-12.8A57.344 57.344 0 0 1 0.018347 924.245333a54.613333 54.613333 0 0 1 19.2-38.058666 91.52 91.52 0 0 1 38.4-12.8h32c19.2 0 38.4 6.357333 64 6.357333a69.418667 69.418667 0 0 0 51.2-12.8 297.472 297.472 0 0 0 38.4-95.146667l89.6-361.514666H224.018347l19.2-69.76h115.2v-12.8a428.970667 428.970667 0 0 1 51.2-152.234667 243.2 243.2 0 0 1 102.4-95.146667 388.608 388.608 0 0 1 121.6-38.058666 121.429333 121.429333 0 0 1 51.2 12.8 57.344 57.344 0 0 1 19.2 44.416 89.6 89.6 0 0 1-12.8 38.058666 91.52 91.52 0 0 1-38.4 12.8 229.205333 229.205333 0 0 1-64-12.8c-12.8 0-19.2-6.357333-32-6.357333a66.261333 66.261333 0 0 0-44.8 31.701333 554.666667 554.666667 0 0 0-32 95.146667l-25.6 82.432 275.2-6.357333h6.4a55.466667 55.466667 0 0 1 38.4 19.029333 434.517333 434.517333 0 0 1 19.2 50.730667l6.4 25.386666 19.2-25.386666a302.037333 302.037333 0 0 1 64-63.402667 199.168 199.168 0 0 1 83.2-38.058667 91.52 91.52 0 0 1 38.4 12.8 42.112 42.112 0 0 1 0 63.402667l-6.4 6.357333c-6.4 6.357333-19.2 12.8-57.6 12.8a73.045333 73.045333 0 0 0-51.2 19.029334A437.717333 437.717333 0 0 0 819.218347 499.2v12.8l25.6 133.205333c12.8 50.730667 44.8 101.461333 64 101.461334s19.2-12.8 25.6-19.029334v-6.357333a67.498667 67.498667 0 0 1 44.8-38.058667c12.8 0 19.2 6.357333 32 12.8a48.213333 48.213333 0 0 1 12.8 31.701334 66.474667 66.474667 0 0 1-32 57.088 96.768 96.768 0 0 1-70.4 25.386666 157.866667 157.866667 0 0 1-102.4-38.058666 356.736 356.736 0 0 1-70.4-126.848l-6.4-25.386667-19.2 19.029333A641.578667 641.578667 0 0 1 640.018347 740.309333a96.768 96.768 0 0 1-70.4 25.386667 58.368 58.368 0 0 1-44.8-19.029333 54.613333 54.613333 0 0 1-19.2-38.058667 46.336 46.336 0 0 1 12.8-38.058667c6.4-12.8 19.2-12.8 32-12.8a45.738667 45.738667 0 0 1 38.4 19.029334l6.4 12.8 12.8-6.357334 19.2-19.029333a318.549333 318.549333 0 0 0 44.8-50.730667l57.6-82.432-25.6-120.490666-256-6.357334-70.4 285.397334a530.517333 530.517333 0 0 1-108.8 215.637333A317.738667 317.738667 0 0 1 76.818347 981.333333z" p-id="1923"></path></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -12,7 +12,12 @@
size="mini"/> size="mini"/>
</el-select> </el-select>
<div style="margin-top: 10px;margin-left: 10px"> <div style="margin-top: 10px;margin-left: 10px">
<el-transfer v-model="value" :data="data" :titles="titles" style="height: 700px"/> <el-transfer
v-model="value"
:data="data"
:titles="titles"
style="height: 700px"
@change="distributionStation"/>
</div> </div>
</div> </div>
</el-card> </el-card>
@@ -45,7 +50,7 @@ export default {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.people.push({ this.people.push({
label: response.data[i].姓名, label: response.data[i].姓名,
value: response.data[i].考勤编号 value: response.data[i].人员编号
}) })
} }
}) })
@@ -97,6 +102,22 @@ export default {
} }
} }
}) })
},
distributionStation(value, direction, keyArr) {
// let followsArr = []
// value为左/右的所有数值direction为方向left or rightkeyArr为选中的key
switch (direction) {
// 右到左 绑定
case 'left':
console.log(value, keyArr)
// 调用后端api绑定接口
break
// 从左到右 解绑
case 'right':
console.log(value, keyArr)
// 调用后端api解绑接口
break
}
} }
} }
} }

View File

@@ -63,7 +63,13 @@
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px"> <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 ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
<el-form-item label="PLC" prop="PLCIP" style="display: inline-block"> <el-form-item label="PLC" prop="PLCIP" style="display: inline-block">
<el-input v-model="form.PLCIP" clearable size="small" placeholder="PLCIP"/> <el-select v-model="form.PLCIP" placeholder="IP" clearable size="small">
<el-option
v-for="item in PLCIP"
:key="item.value1"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="报警数" prop="numberAlarms" style="display: inline-block"> <el-form-item label="报警数" prop="numberAlarms" style="display: inline-block">
<el-input <el-input
@@ -112,6 +118,7 @@ export default {
loading: true, loading: true,
worksheet: [], worksheet: [],
itemFile: [], itemFile: [],
PLCIP: [],
unSpecification: [], unSpecification: [],
dataTypeValue: '', dataTypeValue: '',
dataType: [], dataType: [],
@@ -145,6 +152,7 @@ export default {
}, },
created() { created() {
this.getNumber() this.getNumber()
this.getIP()
this.searchTable() this.searchTable()
}, },
methods: { methods: {
@@ -202,7 +210,7 @@ export default {
}) })
}, },
selectable(row) { selectable(row) {
return row.IP && row.报警数 && row.质量组数 return row.PLC && row.报警数 && row.质量组数
}, },
getNumber() { getNumber() {
this.dataType = [] this.dataType = []
@@ -224,6 +232,25 @@ export default {
} }
}) })
}, },
getIP() {
this.PLCIP = []
request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT [设备IP],[ID] FROM [dbo].[MES_基本变量设备类型对应表] ORDER BY ID`
}
}).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.PLCIP.push({
label: response.data[i].设备IP,
value: response.data[i].设备IP,
value1: response.data[i].ID
})
}
})
},
changeName(val) { changeName(val) {
for (let i = 0; i < this.dataType.length; i++) { for (let i = 0; i < this.dataType.length; i++) {
if (this.dataType[i].value === val) { if (this.dataType[i].value === val) {
@@ -296,7 +323,7 @@ export default {
if (this.$refs['form'] !== undefined) { if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields() this.$refs['form'].resetFields()
} }
this.form.IP = row.IP this.form.PLCIP = row.PLC
this.form.numberAlarms = row.报警数 this.form.numberAlarms = row.报警数
this.form.massNumber = row.质量组数 this.form.massNumber = row.质量组数
this.form.stationNo = row.工位号 this.form.stationNo = row.工位号
@@ -308,7 +335,7 @@ export default {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
var param = [] var param = []
param[0] = ['IP', this.form.IP] param[0] = ['IP', this.form.PLCIP]
param[1] = ['工位号', this.form.stationNo] param[1] = ['工位号', this.form.stationNo]
param[2] = ['工位代码', this.form.fourNumber] param[2] = ['工位代码', this.form.fourNumber]
param[3] = ['报警数', this.form.numberAlarms] param[3] = ['报警数', this.form.numberAlarms]

View File

@@ -527,7 +527,13 @@
<el-input v-model="formData.fileName" clearable size="small" placeholder="文件名称"/> <el-input v-model="formData.fileName" clearable size="small" placeholder="文件名称"/>
</el-form-item> </el-form-item>
<el-form-item label="PLC" prop="PLC" style="display: inline-block"> <el-form-item label="PLC" prop="PLC" style="display: inline-block">
<el-input v-model="formData.PLC" clearable size="small" placeholder="PLC"/> <el-select v-model="formData.PLC" placeholder="PLC" clearable size="small">
<el-option
v-for="item in PLCIP"
:key="item.value1"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="PLC代码" prop="PLCCode" style="display: inline-block"> <el-form-item label="PLC代码" prop="PLCCode" style="display: inline-block">
<el-input v-model="formData.PLCCode" clearable size="small" placeholder="PLC代码"/> <el-input v-model="formData.PLCCode" clearable size="small" placeholder="PLC代码"/>
@@ -765,6 +771,7 @@ export default {
unSpecification: [], unSpecification: [],
dataTypeValue: '', dataTypeValue: '',
dataType: [], dataType: [],
PLCIP: [],
tableData: [], tableData: [],
activeValue: '', activeValue: '',
active: [{ active: [{
@@ -865,6 +872,7 @@ export default {
} }
}, },
created() { created() {
this.getIP()
this.getNumber() this.getNumber()
this.searchTable() this.searchTable()
}, },
@@ -896,6 +904,25 @@ export default {
} }
}) })
}, },
getIP() {
this.PLCIP = []
request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT [设备IP],[ID] FROM [dbo].[MES_基本变量设备类型对应表] ORDER BY ID`
}
}).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.PLCIP.push({
label: response.data[i].设备IP,
value: response.data[i].设备IP,
value1: response.data[i].ID
})
}
})
},
changeName(val) { changeName(val) {
for (let i = 0; i < this.dataType.length; i++) { for (let i = 0; i < this.dataType.length; i++) {
if (this.dataType[i].value === val) { if (this.dataType[i].value === val) {

View File

@@ -0,0 +1,327 @@
<template>
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">设备IP</span>
<el-input v-model="equipmentIP" style="width:150px;" clearable placeholder="" size="small"/>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询</el-button>
<el-button type="distribution" size="small" icon="el-icon-circle-plus" @click="creatOrder('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="790px"
style="width: 100%;"
border
size="mini">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column align="center" label="设备IP">
<template slot-scope="scope">
{{ scope.row.设备IP }}
</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="操作" 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"
@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="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="IP" prop="equipmentIP" style="display: inline-block">
<el-input
v-model="form.equipmentIP"
clearable
size="small"
placeholder="设备IP"/>
</el-form-item>
<el-form-item label="设备类型" prop="equipmentType" style="display: inline-block">
<el-input
v-model="form.equipmentType"
clearable
size="small"
placeholder="设备类型"/>
</el-form-item>
<el-form-item label="是否启用" prop="enable" style="display: inline-block">
<el-select v-model="form.enable" placeholder="请选择" size="small" style="display: inline-block">
<el-option
v-for="item in enableArr"
: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="submitAdd('form')">确定</el-button>
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitAdd1('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
equipmentIP: '',
title: '',
enableArr: [{
label: '是',
value: 1
}, {
label: '否',
value: 0
}],
form: { // 创建订单
equipmentIP: '',
equipmentType: '',
enable: '',
ID: ''
},
rules: { // 创建订单验证
equipmentIP: [{ required: true, message: '请输入', trigger: 'blur' }],
enable: [{ required: true, message: '请选择', trigger: 'change' }],
equipmentType: [{ required: true, message: '请输入', trigger: 'blur' }]
},
tableData: [],
dialogFormVisible: false, // 创建订单
// total: 0, // 总条数
// pageList: 15, // 每页显示条数
// pageSize: 15, // 每页显示条数
// pageCurrent: 1, // 后台获取页
loading: false
}
},
watch: {
},
created() {
this.searchOrder()
},
methods: {
// 查询订单
searchOrder() {
this.loading = true
this.tableData = []
let equipmentIP_check
this.equipmentIP ? (equipmentIP_check = 1) : (equipmentIP_check = 0)
var param = []
param[0] = ['IP_check', equipmentIP_check]
param[1] = ['IP', this.equipmentIP]
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
}
this.loading = false
})
},
// 创建订单
creatOrder(formName) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.title = '增加'
this.form.equipmentIP = ''
this.form.equipmentType = ''
this.form.enable = ''
this.dialogFormVisible = true
},
// 提交新增订单
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['设备IP', this.form.equipmentIP]
param[1] = ['设备类型', this.form.equipmentType]
param[2] = ['是否启用', this.form.enable]
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.searchOrder()
} else {
this.$message.error('增加失败!')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 取消新增订单
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 删除订单
deleteOrder(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['ID', row.ID]
var Data = this.CreateData('12', 'MES_基本变量设备类型_删除', 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.title = '编辑'
this.form.equipmentIP = row.设备IP
this.form.equipmentType = row.设备类型
this.form.enable = Number(row.是否启用)
this.form.ID = row.ID
this.dialogFormVisible = true
},
// 提交修改订单
submitAdd1() {
this.$refs['form'].validate((valid) => {
if (valid) {
var param = []
param[0] = ['设备IP', this.form.equipmentIP]
param[1] = ['设备类型', this.form.equipmentType]
param[2] = ['是否启用', this.form.enable]
param[3] = ['ID', this.form.ID]
var Data = this.CreateData('12', 'MES_基本变量设备类型_编辑', 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
}
})
}
// // 分页
// 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;
}
/deep/.el-input.is-disabled .el-input__inner{
color: #606266!important;
}
/deep/.el-input.is-disabled .el-input__inner{
background-color: white!important;
}
</style>

View File

@@ -3,7 +3,7 @@
<el-card class="topCard"> <el-card class="topCard">
<div class="topDiv"> <div class="topDiv">
<span style="margin-left: 10px">工位号</span> <span style="margin-left: 10px">工位号</span>
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 150px"> <el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable size="small" style="width: 150px">
<el-option <el-option
v-for="item in stationNumber" v-for="item in stationNumber"
:key="item.value" :key="item.value"
@@ -14,7 +14,7 @@
<span style="margin-left: 10px">工位名称</span> <span style="margin-left: 10px">工位名称</span>
<el-input v-model="stationName" disabled style="width:150px;" placeholder="" size="small"/> <el-input v-model="stationName" disabled style="width:150px;" placeholder="" size="small"/>
<span style="margin-left: 10px">产品型号</span> <span style="margin-left: 10px">产品型号</span>
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" size="small" style="width: 150px"> <el-select v-model="engineTypeValue" placeholder="请选择产品型号" size="small" style="width: 150px" @change="searchOrder()">
<el-option <el-option
v-for="item in engineType" v-for="item in engineType"
:key="item.value" :key="item.value"
@@ -24,6 +24,7 @@
</el-select> </el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询物料</el-button> <el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询物料</el-button>
<el-button type="distribution" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">创建物料</el-button> <el-button type="distribution" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">创建物料</el-button>
<el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制物料</el-button>
<el-button type="info" plain size="small" icon="el-icon-upload2" @click="importOrder('form')">物料导入</el-button> <el-button type="info" plain size="small" icon="el-icon-upload2" @click="importOrder('form')">物料导入</el-button>
<el-button type="info" plain size="small" icon="el-icon-download" @click="exportExcel()">物料导出</el-button> <el-button type="info" plain size="small" icon="el-icon-download" @click="exportExcel()">物料导出</el-button>
</div> </div>
@@ -38,7 +39,8 @@
element-loading-background="rgba(0, 0, 0, 0.2)" element-loading-background="rgba(0, 0, 0, 0.2)"
class="main" class="main"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%;max-height: 700px" height="740px"
style="width: 100%"
border border
size="mini" size="mini"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
@@ -48,6 +50,11 @@
{{ scope.row.物料号 }} {{ scope.row.物料号 }}
</template> </template>
</el-table-column> </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="零件名称"> <el-table-column align="center" label="零件名称">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.零件名称 }} {{ scope.row.零件名称 }}
@@ -107,7 +114,7 @@
@current-change="handleCurrentChange"/> @current-change="handleCurrentChange"/>
</div> </div>
</el-card> </el-card>
<el-dialog :visible.sync="dialogFormVisible" title="创建生产订单" center style="min-height: 200px;" width="800px"> <el-dialog :visible.sync="dialogFormVisible" title="创建物料" center style="min-height: 200px;" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px"> <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-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号"> <el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
@@ -186,8 +193,17 @@
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button> <el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogFormVisible1" title="编辑生产订单" center style="min-height: 200px" width="400px"> <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 ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form1.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="orderNumber" style="display: inline-block"> <el-form-item label="物料号" prop="orderNumber" style="display: inline-block">
<el-input <el-input
v-model="form1.orderNumber" v-model="form1.orderNumber"
@@ -247,7 +263,7 @@
<el-button type="primary" size="small" @click="submitAdd1()">确定</el-button> <el-button type="primary" size="small" @click="submitAdd1()">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="订单导入" center style="min-height: 200px" width="900px"> <el-dialog :visible.sync="dialogFormVisible3" title="物料导入" center style="min-height: 200px" width="900px">
<div class="app-container"> <div class="app-container">
<upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/> <upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/>
<div style="margin-left: 395px"> <div style="margin-left: 395px">
@@ -259,6 +275,24 @@
</div> </div>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
@@ -283,6 +317,7 @@ export default {
method2Explain: '', // 机床2加工方式说明 method2Explain: '', // 机床2加工方式说明
stockQuantity: '', // 库存数量 stockQuantity: '', // 库存数量
stockNum: '', // 库位号 stockNum: '', // 库位号
dialogFormVisible4: false,
explain: false, explain: false,
orderNumber: [], orderNumber: [],
orderNumberValue: '', orderNumberValue: '',
@@ -334,6 +369,7 @@ export default {
}, },
form1: { // 修改订单 form1: { // 修改订单
partName: '', partName: '',
stationNumberValue: '',
orderNumber: '', orderNumber: '',
partDrawing: '', partDrawing: '',
number: '', number: '',
@@ -349,6 +385,7 @@ export default {
number: [{ required: true, message: '请输入数量', trigger: 'blur' }], number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }], manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }], verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }],
stationNumberValue: [{ required: true, message: '请选择', trigger: 'change' }],
mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }] mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
}, },
form2: { // 订单下发 form2: { // 订单下发
@@ -358,11 +395,11 @@ export default {
MID: '', MID: '',
IssuedQuantity: 1 IssuedQuantity: 1
}, },
rules2: { // 订单下发验证 form4: {
planQuantity: [{ required: true, message: '请输入计划数量', trigger: 'blur' }], engineTypeValue: ''
orderNumber: [{ required: true, message: '请输入订单号', trigger: 'blur' }], },
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }], rules4: { // 订单下发验证
IssuedQuantity: [{ required: true, message: '请输入订单下发数量', trigger: 'blur' }] engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }]
}, },
// planTime: [new Date(new Date().getTime() - 3600 * 1000 * 24 * 3000), new Date(new Date().getTime())], // planTime: [new Date(new Date().getTime() - 3600 * 1000 * 24 * 3000), new Date(new Date().getTime())],
planTime: [], planTime: [],
@@ -374,8 +411,8 @@ export default {
states: '', // 当前库存状态 states: '', // 当前库存状态
MIDGroup: [], MIDGroup: [],
total: 0, // 总条数 total: 0, // 总条数
pageList: 15, // 每页显示条数 pageList: 30, // 每页显示条数
pageSize: 15, // 每页显示条数 pageSize: 30, // 每页显示条数
pageCurrent: 1, // 后台获取页 pageCurrent: 1, // 后台获取页
loading: false loading: false
} }
@@ -396,7 +433,6 @@ export default {
created() { created() {
this.getStationNumber() this.getStationNumber()
this.getEndStation() this.getEndStation()
this.searchOrder()
}, },
methods: { methods: {
removeAll() { removeAll() {
@@ -442,6 +478,8 @@ export default {
value: response.data[i].发动机型号 value: response.data[i].发动机型号
}) })
} }
}).then(() => {
this.searchOrder()
}) })
}, },
// 初始化获取订单号 // 初始化获取订单号
@@ -450,10 +488,10 @@ export default {
var param = [] var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param) var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data.length) { // if (response.data.length) {
this.stationNumberValue = response.data[0].工位号 // this.stationNumberValue = response.data[0].工位号
this.stationName = response.data[0].工序名称 // this.stationName = response.data[0].工序名称
} // }
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({ this.stationNumber.push({
label: response.data[i].工位号, label: response.data[i].工位号,
@@ -469,11 +507,12 @@ export default {
var param = [] var param = []
param[0] = ['工位号', this.stationNumberValue] param[0] = ['工位号', this.stationNumberValue]
param[1] = ['发动机型号', this.engineTypeValue] param[1] = ['发动机型号', this.engineTypeValue]
var Data = this.CreateData('11', '电子看板_装配零件_查询', param) var Data = this.CreateData('11', '电子看板_装配零件_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
console.log(response, 66) console.log(response, 66)
if (response.data.length !== 0) { if (response.data.length !== 0) {
this.tableData = response.data this.tableData = response.data.rows
this.total = response.data.total
} }
}) })
}, },
@@ -503,7 +542,6 @@ export default {
param[2] = ['物料号', this.form.orderNumber] param[2] = ['物料号', this.form.orderNumber]
param[3] = ['零件名称', this.form.partName] param[3] = ['零件名称', this.form.partName]
param[4] = ['零件图号', this.form.partDrawing] param[4] = ['零件图号', this.form.partDrawing]
// param[5] = ['完成数量', this.form.quantityCompletion]
param[5] = ['生产厂家', this.form.manufactor] param[5] = ['生产厂家', this.form.manufactor]
param[6] = ['是否验证', this.form.verificationValue] param[6] = ['是否验证', this.form.verificationValue]
param[7] = ['是否主物料', this.form.mainMaterialValue] param[7] = ['是否主物料', this.form.mainMaterialValue]
@@ -532,6 +570,68 @@ export default {
this.dialogFormVisible = false this.dialogFormVisible = false
this.$refs[formName].resetFields() 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]
console.log(param, 'param')
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() { importOrder() {
this.dialogFormVisible3 = true this.dialogFormVisible3 = true
@@ -548,7 +648,7 @@ export default {
method: 'post', method: 'post',
data: { data: {
type: '4', type: '4',
name: `delete from 电子看板_装配零件 where id = ${row.ID}` name: `delete from 电子看板_装配零件 where ID = ${row.id}`
} }
}).then(response => { }).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
@@ -572,13 +672,14 @@ export default {
} }
console.log(row.排序) console.log(row.排序)
this.form1.partName = row.零件名称 this.form1.partName = row.零件名称
this.form1.stationNumberValue = row.工位号
this.form1.orderNumber = row.物料号 this.form1.orderNumber = row.物料号
this.form1.partDrawing = row.零件图号 this.form1.partDrawing = row.零件图号
this.form1.number = row.零件数量 this.form1.number = row.零件数量
this.form1.manufactor = row.生产厂家 this.form1.manufactor = row.生产厂家
this.form1.verificationValue = Number(row.是否验证) this.form1.verificationValue = Number(row.是否验证)
this.form1.mainMaterialValue = Number(row.是否主物料) this.form1.mainMaterialValue = Number(row.是否主物料)
this.form1.ID = row.ID this.form1.ID = row.id
this.dialogFormVisible1 = true this.dialogFormVisible1 = true
}, },
// 提交修改订单 // 提交修改订单
@@ -595,7 +696,7 @@ export default {
param[5] = ['是否验证', this.form1.verificationValue] param[5] = ['是否验证', this.form1.verificationValue]
param[6] = ['是否主物料', this.form1.mainMaterialValue] param[6] = ['是否主物料', this.form1.mainMaterialValue]
param[7] = ['零件数量', this.form1.number] param[7] = ['零件数量', this.form1.number]
param[8] = ['工位号', this.stationNumberValue] param[8] = ['工位号', this.form1.stationNumberValue]
param[9] = ['发动机型号', this.engineTypeValue] param[9] = ['发动机型号', this.engineTypeValue]
var Data = this.CreateData('12', '电子看板_装配零件_SPC_修改', param) var Data = this.CreateData('12', '电子看板_装配零件_SPC_修改', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
@@ -692,18 +793,18 @@ export default {
verificationValue, verificationValue,
mainMaterialValue, mainMaterialValue,
isPreservation isPreservation
var param = [] // var param = []
param[0] = ['物料号', this.worksheet[j].L2.v] // param[0] = ['物料号', this.worksheet[j].L2.v]
console.log('物料号', this.worksheet[j].L2.v) // console.log('物料号', this.worksheet[j].L2.v)
var Data = this.CreateData('11', '电子看板_装配零件_总物料表_导入校验', param) // var Data = this.CreateData('11', '电子看板_装配零件_总物料表_导入校验', param)
const response = await this.ExecDatabase(Data) // const response = await this.ExecDatabase(Data)
const res = response.data // const res = response.data
if (res[0].Column1 !== 0) { // if (res[0].Column1 !== 0) {
this.$notify.error(`${this.worksheet[j].C2.v}已经存在,请确认文件是否正确`) // this.$notify.error(`${this.worksheet[j].L2.v}已经存在,请确认文件是否正确`)
this.loading = false // this.loading = false
this.disabled = false // this.disabled = false
return // return
} else { // }
for (let i = 0; i < 999; i++) { for (let i = 0; i < 999; i++) {
const attr = i + 2 const attr = i + 2
stationNumberValue = this.worksheet[j][`A${attr}`] ? this.worksheet[j][`A${attr}`].v : '' stationNumberValue = this.worksheet[j][`A${attr}`] ? this.worksheet[j][`A${attr}`].v : ''
@@ -751,7 +852,6 @@ export default {
} }
} }
} }
}
this.itemFile.splice(j, 1) this.itemFile.splice(j, 1)
this.worksheet.splice(j, 1) this.worksheet.splice(j, 1)
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败物料个数为${this.err},请检查文件是否正确`) this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败物料个数为${this.err},请检查文件是否正确`)
@@ -791,21 +891,13 @@ export default {
param[9] = ['是否主物料', mainMaterialValue] param[9] = ['是否主物料', mainMaterialValue]
param[10] = ['是否保存', isPreservation] param[10] = ['是否保存', isPreservation]
param[11] = ['物料号', orderNumber] param[11] = ['物料号', orderNumber]
param[12] = ['导入类型', '1', 'int', '1']
var Data = this.CreateData('12', '物料数据_导入Excel', param) var Data = this.CreateData('12', '物料数据_导入Excel', param)
const response = await this.ExecDatabase(Data) const response = await this.ExecDatabase(Data)
const res = response.data const res = response.data
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') { if (res[0].result === '0') {
this.$notify.error(`${orderNumber}导入失败`) this.$notify.error(`${orderNumber}导入失败`)
}
} else { } else {
if (res.result[0].result === '0') { this.$notify.error(`${orderNumber}导入成功`)
this.$notify.error(`${orderNumber}导入失败`)
}
if (res.output[0].导入类型 === '2') {
this.$notify.warning(`${orderNumber}存在重复数据`)
}
} }
} catch (e) { } catch (e) {
this.err++ this.err++

View File

@@ -0,0 +1,453 @@
<template>
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">发动机型号</span>
<el-input v-model="equipmentType" style="width:150px;" clearable placeholder="发动机型号" size="small"/>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询</el-button>
<el-button type="distribution" size="small" icon="el-icon-circle-plus" @click="creatOrder('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="790px"
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">
<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="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"
@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="title" center style="min-height: 200px;" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="120px">
<el-form-item label="发动机型号" prop="equipmentType" style="display: inline-block">
<el-input
v-model="form.equipmentType"
clearable
size="small"
placeholder="发动机型号"/>
</el-form-item>
<el-form-item label="配方号" prop="formula" style="display: inline-block">
<el-input
v-model="form.formula"
clearable
size="small"
placeholder="配方号"/>
</el-form-item>
<el-form-item label="总成物料号" prop="itemNo" style="display: inline-block">
<el-input
v-model="form.itemNo"
clearable
size="small"
placeholder="总成物料号"/>
</el-form-item>
<el-form-item label="箱体标志" prop="boxSign" style="display: inline-block">
<el-select v-model="form.boxSign" placeholder="请选择" size="small" style="display: inline-block">
<el-option
v-for="item in boxSign"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
</el-form-item>
<el-form-item label="吨位标志" prop="tonnageSign" style="display: inline-block">
<el-select v-model="form.tonnageSign" placeholder="请选择" size="small" style="display: inline-block" @change="selectValue(form.tonnageSign)">
<el-option
v-for="item in tonnageSign"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
</el-form-item>
<el-form-item label="发动机机型标志" prop="equipmentSign" style="display: inline-block">
<el-input
v-model="form.equipmentSign"
disabled
clearable
size="small"
placeholder="发动机机型标志"/>
</el-form-item>
<el-form-item label="是否禁用" prop="enDisable" style="display: inline-block">
<el-select v-model="form.enDisable" placeholder="请选择" size="small" style="display: inline-block">
<el-option
v-for="item in disableArr"
: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="submitAdd('form')">确定</el-button>
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitAdd1('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
export default {
data() {
return {
equipmentType: '',
title: '',
boxSign: [],
tonnageSign: [],
disableArr: [{
label: '是',
value: 1
}, {
label: '否',
value: 0
}],
form: { // 创建订单
equipmentType: '',
equipmentSign: '',
itemNo: '',
boxSign: '',
tonnageSign: '',
enDisable: 0,
formula: '',
ID: ''
},
rules: { // 创建订单验证
equipmentSign: [{ required: true, message: '请输入', trigger: 'blur' }],
enDisable: [{ required: true, message: '请选择', trigger: 'change' }],
tonnageSign: [{ required: true, message: '请选择', trigger: 'change' }],
boxSign: [{ required: true, message: '请选择', trigger: 'change' }],
equipmentType: [{ required: true, message: '请输入', trigger: 'blur' }],
formula: [{ required: true, message: '请输入', trigger: 'blur' }]
},
tableData: [],
dialogFormVisible: false, // 创建订单
// total: 0, // 总条数
// pageList: 15, // 每页显示条数
// pageSize: 15, // 每页显示条数
// pageCurrent: 1, // 后台获取页
loading: false
}
},
watch: {
},
created() {
this.getBox()
this.getTonnageSign()
this.searchOrder()
},
methods: {
getBox() {
this.boxSign = []
request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT [箱体标志],[箱体名称]FROM [MES_基本变量_机型代码_箱体标志]`
}
}).then(response => {
if (response.data.length) {
for (let i = 0; i < response.data.length; i++) {
this.boxSign.push({
label: response.data[i].箱体名称,
value: response.data[i].箱体标志
})
}
}
})
},
getTonnageSign() {
this.tonnageSign = []
request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT [吨位标志],[吨位名称]FROM [MES_基本变量_机型代码_吨位标志]`
}
}).then(response => {
if (response.data.length) {
for (let i = 0; i < response.data.length; i++) {
this.tonnageSign.push({
label: response.data[i].吨位名称,
value: response.data[i].吨位标志
})
}
}
})
},
// 查询订单
searchOrder() {
this.loading = true
this.tableData = []
let equipmentType_check
this.equipmentType ? (equipmentType_check = 1) : (equipmentType_check = 0)
var param = []
param[0] = ['发动机型号_check', equipmentType_check]
param[1] = ['发动机型号', this.equipmentType]
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
}
this.loading = false
})
},
selectValue(val) {
this.form.equipmentSign = val
},
// 创建订单
creatOrder(formName) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.title = '增加'
this.form.equipmentType = ''
this.form.formula = ''
this.form.equipmentSign = ''
this.form.itemNo = ''
this.form.boxSign = ''
this.form.tonnageSign = ''
this.form.enDisable = 0
this.dialogFormVisible = true
},
// 提交新增订单
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['发动机型号', this.form.equipmentType]
param[1] = ['发动机机型标志', this.form.equipmentSign]
param[2] = ['总成物料号', this.form.itemNo]
param[3] = ['箱体标志', this.form.boxSign]
param[4] = ['吨位标志', this.form.tonnageSign]
param[5] = ['是否禁用', this.form.enDisable]
param[6] = ['配方号', this.form.formula]
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.searchOrder()
} else {
this.$message.error('增加失败!')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 取消新增订单
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 删除订单
deleteOrder(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['序号', row.序号]
var Data = this.CreateData('12', 'MES_基本变量_机型代码_删除数据', 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.title = '编辑'
this.form.equipmentType = row.发动机型号
this.form.equipmentSign = row.发动机机型标志
this.form.itemNo = row.总成物料号
this.form.boxSign = Number(row.箱体标志)
this.form.tonnageSign = Number(row.吨位标志)
this.form.enDisable = Number(row.是否禁用)
this.form.formula = row.配方号
this.form.ID = row.序号
this.dialogFormVisible = true
},
// 提交修改订单
submitAdd1() {
this.$refs['form'].validate((valid) => {
if (valid) {
var param = []
param[0] = ['发动机型号', this.form.equipmentType]
param[1] = ['发动机机型标志', this.form.equipmentSign]
param[2] = ['总成物料号', this.form.itemNo]
param[3] = ['箱体标志', this.form.boxSign]
param[4] = ['吨位标志', this.form.tonnageSign]
param[5] = ['是否禁用', this.form.enDisable]
param[6] = ['序号', this.form.ID]
param[7] = ['配方号', this.form.formula]
var Data = this.CreateData('12', 'MES_基本变量_机型代码_编辑数据', 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
}
})
}
// // 分页
// 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;
}
/deep/.el-input.is-disabled .el-input__inner{
color: #606266!important;
}
/deep/.el-input.is-disabled .el-input__inner{
background-color: white!important;
}
</style>

View File

@@ -490,7 +490,7 @@ export default {
// param[6] = ['结果', '1111', 'int', '1'] // param[6] = ['结果', '1111', 'int', '1']
var Data = this.CreateData('12', 'MES_计划BOM_发动机订单计划_订单手动增加', param) var Data = this.CreateData('12', 'MES_计划BOM_发动机订单计划_订单手动增加', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data.output[0].结果 === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '订单创建成功', message: '订单创建成功',
type: 'success' type: 'success'
@@ -498,7 +498,7 @@ export default {
this.pageCurrent = 1 this.pageCurrent = 1
this.pageSize = 15 this.pageSize = 15
this.searchOrder() this.searchOrder()
} else if (response.data.output[0].结果 === '2') { } else if (response.data[0].result.结果 === '2') {
this.$message.error('订单重复,创建失败!') this.$message.error('订单重复,创建失败!')
} else { } else {
this.$message.error('订单创建失败!') this.$message.error('订单创建失败!')

View File

@@ -118,7 +118,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="下发时间"> <el-table-column align="center" label="下发时间">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.部装开始时间 }} {{ scope.row.下发时间 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="是否禁用"> <el-table-column align="center" label="是否禁用">