Merge branch 'master' of ssh://192.168.0.149:29418/高精2.0

This commit is contained in:
jiangfuzhuang
2019-05-29 20:29:49 +08:00
14 changed files with 629 additions and 45 deletions

View File

@@ -10,14 +10,13 @@
:value="item.value"/>
</el-select>
<span>零件图号:</span>
<el-select v-model="partNumValue" filterable placeholder="零件图号" style="margin-right: 10px" size="small" clearable @clear="returnDate = ''">
<el-select v-model="partNumValue" filterable placeholder="零件图号" style="margin-right: 10px" size="small" @change="tableData1=[];tableData2=[];returnDate = '';searchData();">
<el-option
v-for="item in partNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchData()">查询</el-button>
<span>打回时间:</span>
<el-date-picker v-model="returnDate" :clearable="false" type="datetime" placeholder="打回时间" size="small" readonly/>
</el-card>
@@ -219,15 +218,11 @@ export default {
tableRowClassName2({ row }) {
for (let i = 0; i < this.tableData1.length; i++) {
row.工艺编号 === null ? row.工艺编号 = 0 : row.工艺编号
if (this.tableData1[i].工序流水号 === row.工序流水号 && this.tableData1[i].工艺编号 !== null) {
if (this.tableData1[i].工序顺序 === row.工序顺序) {
if (this.tableData1[i].工艺编号 !== row.工艺编号 || this.tableData1[i].工艺要求 !== row.工艺要求 || this.tableData1[i].工艺难度等级 !== row.工艺难度等级) {
return 'change'
} else {
if (this.tableData1[i].工序顺序 !== row.工序顺序 && (row.工艺要求 || row.工艺难度等级)) {
return 'change'
} else {
return ''
}
return ''
}
}
}
@@ -235,15 +230,11 @@ export default {
tableRowClassName1({ row }) {
for (let i = 0; i < this.tableData2.length; i++) {
row.工艺编号 === null ? row.工艺编号 = 0 : row.工艺编号
if (this.tableData2[i].工序流水号 === row.工序流水号 && this.tableData2[i].工艺编号 !== null) {
if (this.tableData2[i].工序顺序 === row.工序顺序) {
if (this.tableData2[i].工艺编号 !== row.工艺编号 || this.tableData2[i].工艺要求 !== row.工艺要求 || this.tableData2[i].工艺难度等级 !== row.工艺难度等级) {
return 'change'
} else {
if (this.tableData1[i].工序顺序 !== row.工序顺序 && (row.工艺要求 || row.工艺难度等级)) {
return 'change'
} else {
return ''
}
return ''
}
}
}

View File

@@ -0,0 +1,169 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-col style="width: 330px">
<span style="margin-left: 10px">原材料名称:</span>
<el-input v-model="RawMaterialName" placeholder="原材料名称" size="small" clearable/>
</el-col>
<el-col style="width: 200px">
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageCurrent=1;searchTableData()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">增加</el-button>
</el-col>
</el-row>
</el-card>
<el-card style="margin-top: 15px">
<el-table :data="tableData" style="width: 100%;min-height: 500px" height="500" size="mini" highlight-current-row border>
<el-table-column align="center" label="原材料名称">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-form-item label="原材料名称" prop="RawMaterialName">
<el-input v-model="form.RawMaterialName" placeholder="原材料名称" size="small" clearable/>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取消</el-button>
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchTableData, addData, editData, deleteCategory } from '@/api/ManufacturingCenter/RawMaterialsMaintenance'
export default {
data() {
return {
RawMaterialNumber: '',
RawMaterialName: '',
param: 0,
tableData: [],
pageCurrent: 1,
pageSize: 10,
total: null,
dialogFormVisible: false,
title: '',
form: {
RawMaterialName: ''
},
rules: {
RawMaterialName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }]
}
}
},
created() {
this.searchTableData()
},
methods: {
// 获取原材料
searchTableData() {
searchTableData(this.RawMaterialName, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = parseInt(response.data.total)
})
},
// 增加
handleAdd() {
this.addForm('form', [this.dialogFormVisible = true, this.title = '增加'])
},
// 提交增加
submitAdd() {
this.addTable(addData, [this.form.RawMaterialName], 'form', function() {
this.dialogFormVisible = false
this.pageCurrent = 1
this.searchTableData()
})
},
// 编辑
handleEdit(row) {
this.editForm(row, 'form', [this.title = '编辑', this.dialogFormVisible = true])
this.form.RawMaterialName = row.原材料名称
this.RawMaterialNumber = row.原材料流水号
},
// 提交编辑
submitEdit() {
this.editTable(editData, [this.RawMaterialNumber, this.form.RawMaterialName], 'form', function() {
this.searchTableData()
this.dialogFormVisible = false
})
},
// 取消
cancel() {
this.dialogFormVisible = false
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteCategory(row.原材料流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
if (this.tableData && this.tableData.length === 1 && this.pageCurrent > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageCurrent--
}
this.searchTableData()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTableData()
}
}
}
</script>
<style scoped>
span {
margin: 10px 0px 10px 10px;
}
.el-select{
width:190px
}
.el-input{
width:190px
}
</style>

View File

@@ -0,0 +1,130 @@
<template>
<div class="app-container">
<el-card style="margin-top: 5px">
<el-row>
<el-col :span="7">
<span>原材料名称:</span>
<el-input v-model="RawMaterialName" placeholder="原材料名称" size="mini" clearable style="width: 120px"/>
<el-button type="success" icon="el-icon-search" size="mini" style="margin-left: 10px" @click="pageCurrent=1;searchTableData()">查询</el-button>
<el-table :data="tableData" style="margin-top: 15px;width: 100%" height="500" size="mini" border @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column align="center" label="原材料名称">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="16" style="margin-left: 20px">
<span>原材料名称:</span>
<el-input v-model="RawMaterialName" placeholder="原材料名称" size="mini" clearable style="width: 120px"/>
<el-button type="success" icon="el-icon-search" size="mini" style="margin-left: 10px" @click="pageCurrent=1;searchTableData()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="mini" @click="handleAdd()">增加</el-button>
<el-table :data="tableData" style="margin-top: 15px;width: 100%" height="500" size="mini" highlight-current-row border>
<el-table-column align="center" label="原材料名称">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-col>
</el-row>
<el-row style="margin-top: 10px">
<el-table :data="tableData" style="width: 100%" height="500" size="mini" highlight-current-row border>
<el-table-column align="center" label="原材料名称">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-row>
</el-card>
</div>
</template>
<script>
import { searchTableData } from '@/api/ManufacturingCenter/SparePartsPurchase'
export default {
data() {
return {
RawMaterialNumber: '',
RawMaterialName: '',
param: 0,
tableData: [],
pageCurrent: 1,
pageSize: 10,
total: null,
dialogFormVisible: false,
title: '',
form: {
RawMaterialName: ''
},
rules: {
RawMaterialName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }]
}
}
},
created() {
this.searchTableData()
},
methods: {
// 获取原材料
searchTableData() {
searchTableData(this.RawMaterialName, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = parseInt(response.data.total)
})
},
// tabledata分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTableData()
},
// 多选
handleSelectionChange(val) {
this.materielGroup = []
for (let i = 0; i < val.length; i++) {
this.materielGroup.push(val[i].物料流水号)
}
}
}
}
</script>
<style scoped>
span {
margin: 10px 0px 10px 10px;
}
.el-select{
width:190px
}
.el-input{
width:190px
}
</style>