序间外协和预算项目机床分组

This commit is contained in:
zhangdingyu
2018-11-29 16:24:46 +08:00
parent 366739d040
commit 228f104c0f
3 changed files with 124 additions and 38 deletions

View File

@@ -7,28 +7,33 @@
<el-radio :label="1">未编制</el-radio>
<el-radio :label="2">已编制</el-radio>
</el-radio-group>
<span>项目名称:</span>
<el-select v-model="entryNameValue" clearable filterable size="small" style="margin-bottom:10px" placeholder="项目名称" @change="typeChange()">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床名称:</span>
<el-select v-model="toolNumValue" clearable filterable size="small" placeholder="机床号" style="margin-bottom:10px" @change="typeChange1()">
<el-option
v-for="item in toolNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分组:</span>
<el-select v-model="NumValue" clearable filterable size="small" style="margin-bottom:10px" placeholder="机床组号">
<el-option
v-for="item in Num"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件图号:</span>
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<span>开始时间:</span>
<el-date-picker
v-model="date01"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
size="small"
placeholder="选择开始日期"/>
<span>结束时间:</span>
<el-date-picker
v-model="date02"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
size="small"
placeholder="选择结束日期"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize2=10; pageCurrent2=1;searchPartNum()">查询</el-button>
</el-row>
@@ -165,10 +170,16 @@
</template>
<script>
import { searchPartNum1, searchPartNum2, searchTable, saveWeightArea, saveMaterialPrice, saveRowPrice } from '@/api/Outsourcing/InterBudgetaryBudgets'
import { machine, getToolNum, getNum, searchPartNum1, searchTable, saveWeightArea, saveMaterialPrice, saveRowPrice } from '@/api/Outsourcing/InterBudgetaryBudgets'
export default {
data() {
return {
entryNameValue: '',
entryName: [], // 项目名称
toolNumValue: '',
toolNum: [], // 机床号
NumValue: '',
Num: [], // 分组
lingjianhao: '',
dialogFormVisible: false,
form: {
@@ -183,8 +194,6 @@ export default {
result2: [],
radio: 1,
partName: '', // 零件名称
date01: '', // 开始时间
date02: '', // 结束时间
loading0: false,
tableData: [],
loading2: false,
@@ -194,33 +203,91 @@ export default {
pageCurrent2: 1 // 后台获取页
}
},
created() {
this.fetchData()
},
methods: {
radioChange() {
this.tableData2 = []
this.entryNameValue = ''
this.toolNumValue = ''
this.NumValue = ''
},
fetchData() {
this.entryNameValue = ''
this.entryName = []
machine().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.entryName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
typeChange() {
this.toolNumValue = ''
this.toolNum = []
this.NumValue = ''
this.Num = []
getToolNum(this.entryNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
typeChange1() {
this.NumValue = ''
this.Num = []
getNum(this.toolNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Num.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 查零件号
searchPartNum() {
if (this.partName === null) {
this.partName = ''
}
if (this.date01 === '') {
this.date01 = null
if (this.entryNameValue !== null && this.entryNameValue !== '') {
this.check_entryNameValue = 1
} else {
this.check_entryNameValue = 0
}
if (this.date02 === '') {
this.date02 = null
if (this.toolNumValue !== null && this.toolNumValue !== '') {
this.check_toolNumValue = 1
} else {
this.check_toolNumValue = 0
}
if (this.NumValue !== null && this.NumValue !== '') {
this.check_NumValue = 1
} else {
this.check_NumValue = 0
}
if (this.partName !== null && this.partName !== '') {
this.check_partName = 1
} else {
this.check_partName = 0
}
this.loading2 = true
this.tableData2 = []
this.tableData = []
if (this.radio === 1) {
searchPartNum1(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
searchPartNum1(this.check_entryNameValue, this.entryNameValue, this.check_toolNumValue, this.toolNumValue, this.check_NumValue, this.NumValue, this.check_partName, this.partName, 0, this.pageCurrent2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
}).then(() => {
this.loading2 = false
})
} else {
searchPartNum2(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
searchPartNum1(this.check_entryNameValue, this.entryNameValue, this.check_toolNumValue, this.toolNumValue, this.check_NumValue, this.NumValue, this.check_partName, this.partName, 1, this.pageCurrent2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
}).then(() => {

View File

@@ -165,7 +165,6 @@ export default {
this.entryNameValue = ''
this.entryName = []
machine().then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.entryName.push({
label: response.data[i].项目名称,