This commit is contained in:
liushuai
2019-12-03 18:01:28 +08:00
parent 490d6d008d
commit 266a82f423
3 changed files with 126 additions and 102 deletions

View File

@@ -29,7 +29,7 @@
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<el-input v-model="materialName" placeholder="名称规格型号" size="small" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()"/>
<el-input v-model="materialName" placeholder="名称规格型号" size="small" clearable @keyup.enter.native="pageCurrent0=1;pageSize0=50;total0=0;searchTable0()"/>
<el-select v-model="machineValue" placeholder="机床图号" size="small" filterable clearable @change="machineChange">
<el-option
v-for="item in machine"
@@ -84,7 +84,9 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent0=1;pageSize0=20;total0=0;searchTable0()">查询</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent0=1;pageSize0=50;total0=0;searchTable0()">查询</el-button>
<el-radio v-model="radio" label="1" style="margin-left: 10px" @change="pageCurrent0=1;pageSize0=50;total0=0;searchTable0()">未分配</el-radio>
<el-radio v-model="radio" label="2" style="margin-left: 10px" @change="pageCurrent0=1;pageSize0=50;total0=0;searchTable0()">已分配</el-radio>
<div style="float:right;">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
@@ -113,7 +115,7 @@
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData0" size="mini" height="800px" border stripe @selection-change="handleSelectionChange1">
<el-table v-loading="loading" :data="tableData0" size="mini" height="800px" border stripe @selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="采购情况" prop="询价状态编号" min-width="100px">
<template slot-scope="scope">
@@ -183,27 +185,27 @@
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column align="center" label="生产分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.操作日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="姓名">
<!--<el-table-column align="center" label="计划到货时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料计划到货时间.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="生产分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.操作日期.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="姓名">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="采购分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
<!--<el-table-column align="center" label="采购分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" align="center" label="撤回分配" min-width="100px" fixed="right">
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="撤回已分配的采购任务" placement="top">
<el-button
@@ -220,7 +222,7 @@
<div class="block">
<el-pagination
:current-page="pageCurrent0"
:page-sizes="[10, 20, 30, 40]"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize0"
:total="total0"
style="display:inline-block;width:50%"
@@ -238,7 +240,7 @@
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<el-input v-model="materialName" placeholder="名称规格型号" size="small" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()"/>
<el-input v-model="materialName" placeholder="名称规格型号" size="small" clearable @keyup.enter.native="pageCurrent1=1;pageSize1=50;total1=0;searchTable1()"/>
<el-select v-model="machineValue" placeholder="机床图号" size="small" filterable clearable>
<el-option
v-for="item in machine"
@@ -280,7 +282,9 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent1=1;pageSize1=50;total1=0;searchTable1()">查询</el-button>
<el-radio v-model="radio" label="1" style="margin-left: 10px" @change="pageCurrent1=1;pageSize1=50;total1=0;searchTable1()">未分配</el-radio>
<el-radio v-model="radio" label="2" style="margin-left: 10px" @change="pageCurrent1=1;pageSize1=50;total1=0;searchTable1()">已分配</el-radio>
<div style="float:right;">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
@@ -295,7 +299,7 @@
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData1" size="mini" height="800px" border stripe @selection-change="handleSelectionChange1">
<el-table v-loading="loading" :data="tableData1" size="mini" height="800px" border stripe @selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" prop="询价状态编号" label="采购情况" min-width="100px">
<template slot-scope="scope">
@@ -365,27 +369,27 @@
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column align="center" label="生产分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.操作日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="姓名">
<!--<el-table-column align="center" label="计划到货时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料计划到货时间.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="生产分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.操作日期.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="姓名">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="采购分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
<!--<el-table-column align="center" label="采购分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" align="center" label="撤回分配" min-width="100px" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
@@ -400,7 +404,7 @@
<div class="block">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
@@ -418,7 +422,7 @@
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<el-input v-model="partNum" placeholder="图号名称规格材料" size="small" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()"/>
<el-input v-model="partNum" placeholder="图号名称规格材料" size="small" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=50;total2=0;searchTable2()"/>
<el-select v-model="machineValue" placeholder="机床图号" size="small" filterable clearable>
<el-option
v-for="item in machine"
@@ -437,7 +441,9 @@
<!--:value="item.value"/>-->
<!--</el-select>-->
<!--<el-cascader :options="materialStatus" :props="{ checkStrictly: true }" v-model="materialStatusValue" size="small"/>-->
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()">查询</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent2=1;pageSize2=50;total2=0;searchTable2()">查询</el-button>
<el-radio v-model="radio" label="1" style="margin-left: 10px" @change="pageCurrent2=1;pageSize2=50;total2=0;searchTable2()">未分配</el-radio>
<el-radio v-model="radio" label="2" style="margin-left: 10px" @change="pageCurrent2=1;pageSize2=50;total2=0;searchTable2()">已分配</el-radio>
<div style="float:right">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
@@ -452,7 +458,7 @@
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData2" size="mini" height="800px" border stripe @selection-change="handleSelectionChange2">
<el-table v-loading="loading" :data="tableData2" size="mini" height="800px" border stripe @selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" prop="询价状态编号" label="采购情况" min-width="80px">
<template slot-scope="scope">
@@ -512,27 +518,27 @@
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column align="center" label="生产分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.操作日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="buyer">
<!--<el-table-column align="center" label="计划到货时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料计划到货时间.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="生产分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.操作日期.split(' ')[0] }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="80px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="采购分配时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
<!--<el-table-column align="center" label="采购分配时间" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column v-if="radio==='2'" align="center" label="撤回分配" min-width="100px" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
@@ -547,7 +553,7 @@
<div class="block">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
@@ -605,8 +611,10 @@ export default {
}
}]
},
loading: false,
dateRange: '',
timer2: '',
radio: '1',
machines: [],
source: [
{
@@ -636,7 +644,6 @@ export default {
groupValue: '',
group: [],
materialName: '',
materialStatusValue: [0], // 物料状态
materialStatus: [
{
value: 0,
@@ -679,13 +686,13 @@ export default {
groupAndPart: [],
groupAndPartBasic: [],
pageCurrent0: 1,
pageSize0: 20,
pageSize0: 50,
total0: 0,
pageCurrent1: 1,
pageSize1: 20,
pageSize1: 50,
total1: 0,
pageCurrent2: 1,
pageSize2: 20,
pageSize2: 50,
total2: 0
}
},
@@ -752,7 +759,6 @@ export default {
})
}
this.machineValue = machine
this.materialStatusValue = [1]
this.searchTable0()
this.searchTable1()
this.searchTable2()
@@ -796,6 +802,7 @@ export default {
})
},
fetchData() { // 初始化
console.log(this.radio, 222)
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
@@ -850,6 +857,7 @@ export default {
}
},
searchTable0() { // 查询标准件
this.loading = true
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0
@@ -860,12 +868,14 @@ export default {
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
// this.dateRange ? check4 = 0 : (check4 = 0, this.dateRange = '')
searchTable1(this.pageCurrent0, this.pageSize0, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, this.materialStatusValue[this.materialStatusValue.length - 1], check2, this.materialSpec, check3, this.materialModel, 1, 0, '', '').then(response => {
searchTable1(this.pageCurrent0, this.pageSize0, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, parseInt(this.radio), check2, this.materialSpec, check3, this.materialModel, 1, 0, '', '').then(response => {
this.tableData0 = response.data.rows
this.total0 = response.data.total
this.loading = false
})
},
searchTable1() { // 查询外购件
this.loading = true
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0
@@ -875,12 +885,14 @@ export default {
this.materialName ? this.check4 = 1 : this.check4 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, this.materialStatusValue[this.materialStatusValue.length - 1], check2, this.materialSpec, check3, this.materialModel, 2).then(response => {
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, parseInt(this.radio), check2, this.materialSpec, check3, this.materialModel, 2).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.loading = false
})
},
searchTable2() { // 查询基本件
this.loading = true
this.projectValue ? this.check3 = 1 : this.check3 = 0
let check1, check2, check3, check4, check5, check6
this.partNum ? check1 = 1 : check1 = 0
@@ -889,9 +901,10 @@ export default {
this.partMaterial ? check4 = 1 : check4 = 0
this.machineValue ? check5 = 1 : check5 = 0
this.groupValue ? check6 = 1 : check6 = 0
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, check5, this.machineValue, check6, this.groupValue, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, check4, this.partMaterial).then(response => {
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, check5, this.machineValue, check6, this.groupValue, parseInt(this.radio), check1, this.partNum, check2, this.partName, check3, this.partSpec, check4, this.partMaterial).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
this.loading = false
})
},
handleSelectionChange1(val) { // 标准件和外购件多选
@@ -1086,6 +1099,9 @@ export default {
width:150px;
margin-right: 10px;
}
.el-radio{
margin-right: 0px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.item {