更新
This commit is contained in:
@@ -2,16 +2,6 @@
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
size="small"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="加工日期"
|
||||
style="width: 140px;margin-top: 10px"
|
||||
clearable
|
||||
@change="change"/>
|
||||
<el-select v-model="Person" style="width:100px" placeholder="操作工" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in Persons"
|
||||
@@ -19,27 +9,12 @@
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-input v-model="partNumber" size="small" placeholder="零件图号" style="width: 150px" clearable/>
|
||||
<el-input v-model="partName" size="small" placeholder="零件名称" style="width: 140px" clearable/>
|
||||
<el-input v-model="partNumber" size="small" placeholder="零件图号及名称" style="width: 200px" clearable/>
|
||||
<el-input v-model="procedureName" size="small" placeholder="工序名称" style="width: 100px" clearable/>
|
||||
<span>数量</span>
|
||||
<el-input-number v-model="number" :min="0" :step="1" size="small" placeholder="数量" style="width: 120px" clearable/>
|
||||
<span>单件工时</span>
|
||||
<el-input-number v-model="workTime" :min="0" :step="1" size="small" placeholder="单件工时" style="width: 120px" clearable/>
|
||||
<el-select v-model="PersonLiable" style="width:100px" placeholder="责任人" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in Persons"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-select v-model="ConfirmingPerson" style="width:100px" placeholder="确认人" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in Persons"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="saveDate">保存</el-button>
|
||||
@@ -66,16 +41,11 @@
|
||||
{{ scope.row.操作工姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" align="center" width="150">
|
||||
<el-table-column label="零件图号及名称" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序名称" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序 }}
|
||||
@@ -91,16 +61,6 @@
|
||||
{{ scope.row.单件工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="责任人" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.责任人姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="确认人" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.确认人姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录入人" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.录入人姓名 }}
|
||||
@@ -116,7 +76,6 @@ import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
time: '',
|
||||
Person: '',
|
||||
Persons: [],
|
||||
partNumber: '',
|
||||
@@ -124,10 +83,8 @@ export default {
|
||||
procedureName: '',
|
||||
number: '',
|
||||
workTime: '',
|
||||
PersonLiable: '',
|
||||
ConfirmingPerson: '',
|
||||
tableData: [],
|
||||
monthValue: ''
|
||||
monthValue: new Date()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -141,11 +98,9 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.searchPerson()
|
||||
this.getNowFormatDate()
|
||||
},
|
||||
methods: {
|
||||
change() {
|
||||
console.log(this.time.slice(0, 7))
|
||||
},
|
||||
searchPerson() {
|
||||
searchPerson().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
@@ -156,6 +111,14 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getNowFormatDate() {
|
||||
var year = this.monthValue.getFullYear()
|
||||
var month = this.monthValue.getMonth() + 1
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = '0' + month
|
||||
}
|
||||
this.monthValue = year + '-' + month
|
||||
},
|
||||
fetchDate() {
|
||||
if (this.monthValue) {
|
||||
fetchDate(this.monthValue).then(response => {
|
||||
@@ -166,11 +129,10 @@ export default {
|
||||
}
|
||||
},
|
||||
saveDate() {
|
||||
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
|
||||
saveDate(this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
|
||||
if (this.Person && this.partNumber && this.procedureName && this.number && this.workTime) {
|
||||
saveDate(this.Person, this.partNumber, this.procedureName, this.id, this.number, this.workTime).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.monthValue = this.time.slice(0, 7)
|
||||
this.RemoveDate()
|
||||
this.fetchDate()
|
||||
} else {
|
||||
@@ -182,11 +144,10 @@ export default {
|
||||
}
|
||||
},
|
||||
editDate() {
|
||||
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
|
||||
editDate(this.ID, this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
|
||||
if (this.Person && this.partNumber && this.procedureName && this.number && this.workTime) {
|
||||
editDate(this.ID, this.Person, this.partNumber, this.procedureName, this.id, this.number, this.workTime).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.monthValue = this.time.slice(0, 7)
|
||||
this.RemoveDate()
|
||||
this.fetchDate()
|
||||
} else {
|
||||
@@ -218,26 +179,18 @@ export default {
|
||||
})
|
||||
},
|
||||
RemoveDate() {
|
||||
this.time = ''
|
||||
this.Person = ''
|
||||
this.partNumber = ''
|
||||
this.partName = ''
|
||||
this.number = 0
|
||||
this.workTime = 0
|
||||
this.procedureName = ''
|
||||
this.PersonLiable = ''
|
||||
this.ConfirmingPerson = ''
|
||||
},
|
||||
searchTable(row) {
|
||||
this.time = row.加工日期
|
||||
this.Person = row.操作工流水号
|
||||
this.partNumber = row.零件图号
|
||||
this.partName = row.名称
|
||||
this.procedureName = row.工序
|
||||
this.number = row.数量
|
||||
this.workTime = row.单件工时
|
||||
this.PersonLiable = row.责任人流水号
|
||||
this.ConfirmingPerson = row.确认人流水号
|
||||
this.ID = row.ID
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user