更新
This commit is contained in:
@@ -2,24 +2,24 @@
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>项目名称:</span>
|
||||
<el-select
|
||||
v-model="entryNameValue"
|
||||
:remote-method="remoteMethod"
|
||||
placeholder="项目名称"
|
||||
style="margin-right: 10px; width: 150px"
|
||||
size="small"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
@change="projectChange"
|
||||
@focus="projectInit">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<!--<span>项目名称:</span>-->
|
||||
<!--<el-select-->
|
||||
<!--v-model="entryNameValue"-->
|
||||
<!--:remote-method="remoteMethod"-->
|
||||
<!--placeholder="项目名称"-->
|
||||
<!--style="margin-right: 10px; width: 150px"-->
|
||||
<!--size="small"-->
|
||||
<!--clearable-->
|
||||
<!--filterable-->
|
||||
<!--remote-->
|
||||
<!--@change="projectChange"-->
|
||||
<!--@focus="projectInit">-->
|
||||
<!--<el-option-->
|
||||
<!--v-for="item in entryName"-->
|
||||
<!--:key="item.value"-->
|
||||
<!--:label="item.label"-->
|
||||
<!--:value="item.value"/>-->
|
||||
<!--</el-select>-->
|
||||
<span>机床图号:</span>
|
||||
<el-select v-model="machineNameValue" placeholder="机床号" style="margin-right: 10px; width: 150px" size="small" clearable @change="machineChange">
|
||||
<el-option
|
||||
@@ -208,7 +208,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchMachine, searchGroupNum, searchTable, searchTable1, searchTable2 } from '@/api/ManufacturingCenter/DiscardedPartsInquiry'
|
||||
import { searchMachine, searchGroupNum, searchTable, searchTable1, searchTable2 } from '@/api/ManufacturingCenter/DiscardedPartsInquiry'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -242,52 +242,15 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.projectInit()
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.projectChange()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.list = []
|
||||
initProject().then(response => { // 初始化项目名称
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.list.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
setTimeout(() => {
|
||||
this.entryName = this.list.filter(item => {
|
||||
return item.label.toLowerCase()
|
||||
.indexOf(query.toLowerCase()) > -1
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
this.entryName = []
|
||||
}
|
||||
},
|
||||
projectInit() { // 初始化项目
|
||||
this.entryName = []
|
||||
initProject().then(response => { // 初始化项目名称
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.entryName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
projectChange() {
|
||||
this.machineName = []
|
||||
this.machineNameValue = ''
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
searchMachine(this.entryNameValue).then(response => {
|
||||
searchMachine().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machineName.push({
|
||||
label: response.data[i].机床图号,
|
||||
@@ -309,27 +272,18 @@ export default {
|
||||
})
|
||||
},
|
||||
searchData1() {
|
||||
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
|
||||
this.listLoading2 = true
|
||||
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
|
||||
this.check = 1
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
if (this.machineNameValue !== '' && this.machineNameValue !== null) {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.check1 = 0
|
||||
}
|
||||
searchTable2(this.check, this.entryNameValue, this.check1, this.machineNameValue, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
console.log(response)
|
||||
this.tableData2 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
this.listLoading2 = false
|
||||
})
|
||||
this.listLoading2 = true
|
||||
if (this.machineNameValue !== '' && this.machineNameValue !== null) {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.$message.warning('请选择项目')
|
||||
this.check1 = 0
|
||||
}
|
||||
searchTable2(this.check1, this.machineNameValue, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
console.log(response)
|
||||
this.tableData2 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
this.listLoading2 = false
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
|
||||
Reference in New Issue
Block a user