采购任务分配:重新调整

This commit is contained in:
chenjianan
2018-12-08 17:45:25 +08:00
parent 39a0b8ef13
commit e055d3cb2e
3 changed files with 129 additions and 40 deletions

View File

@@ -1,5 +1,28 @@
import request from '@/utils/request'
// 物料类别
export function initMaterialCategory(check, DepartmentValue) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_物料类别编号_查询数据_根据物料部门编号',
param: '物料部门流水号_check=' + check + '=int&物料部门流水号=' + DepartmentValue
}
})
}
// 物料品种
export function initMaterialVariety(MaterialCategoryValue) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_物料品种编号_查询数据',
param: '物料类别流水号=' + MaterialCategoryValue
}
})
}
// 初始化项目(车间传递来的)
export function initProject() {
return request({
@@ -24,15 +47,15 @@ export function initBuyer() {
})
}
// 查询表1
export function searchTable1(pageCurrent, pageSize, check1, num1, check2, name, state) {
export function searchTable1(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料',
param: `项目流水号_check=${check1}&项目流水号=${num1}&物料名称_check=${check2}&物料名称=${name}&分配状态=${state}`,
Pagination: pageCurrent + '&' + pageSize
param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&物料名称_check=${params[8]}&物料名称=${params[9]}&分配状态=${params[10]}`,
Pagination: params[0] + '&' + params[1]
}
})
}

View File

@@ -473,7 +473,7 @@ export default {
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData1[j].订货数量
this.haTtax === '含税' ? document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].含税单价 : document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].未税单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = Number(document.getElementsByClassName('tableData')[j].children[5].innerHTML) * Number(this.tableData1[j].订货数量)
document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData1[j].物料计划到货时间.split(' ')[0]
this.tableData1[j].物料计划到货时间 ? document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData1[j].物料计划到货时间.split(' ')[0] : document.getElementsByClassName('tableData')[j].children[7].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[8].innerHTML = `备注` + j
}
}

View File

@@ -3,30 +3,61 @@
<el-row :gutter="10">
<el-col :span="16">
<el-card>
<span style="margin:0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
: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="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">物料类别:</span>
<el-select
v-model="MaterialCategoryValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety">
<el-option
v-for="item in MaterialCategory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable>
<el-option
v-for="item in MaterialVariety"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
<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-row>
<el-row>
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
</el-card>
</el-col>
<el-col :span="8">
@@ -71,27 +102,42 @@
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" min-width="150px">
<el-table-column align="center" label="物料类别" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号" min-width="150px">
<el-table-column align="center" label="物料品种" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格" min-width="150px">
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量" min-width="80px">
<el-table-column align="center" label="数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="150px">
<el-table-column align="center" label="备注" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="100px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
@@ -123,13 +169,17 @@
</template>
<script>
import { initProject, initBuyer, searchTable1, allocateTask, executeReturn } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchTable1, allocateTask, executeReturn } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购任务分配
data() {
return {
MaterialCategoryValue: '', // 物料类别
MaterialCategory: [], // 物料类别数组
MaterialVarietyValue: '', // 物料品种
MaterialVariety: [], // 物料品种数组
projectValue: '',
project: [],
materialName: '',
@@ -152,6 +202,8 @@ export default {
person: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
tableData1: [],
standardAndPurchase: [],
groupAndPart: [],
@@ -170,6 +222,7 @@ export default {
},
created() {
this.fetchData()
this.searchMaterialCategory()
},
methods: {
fetchData() { // 初始化
@@ -191,11 +244,24 @@ export default {
}
})
},
searchMaterialCategory() { // 获取物料类别
this.MaterialCategory = []
this.MaterialVariety = []
this.MaterialCategoryValue = ''
this.MaterialVarietyValue = ''
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory', [0, this.DepartmentValue])
},
searchMaterialVariety() { // 初始化物料品种
this.MaterialVariety = []
this.MaterialVarietyValue = ''
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety', this.MaterialCategoryValue)
},
searchTable1() { // 查询
this.projectValue ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.materialName, this.allocateStateValue).then(response => {
console.log(response.data)
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0
this.materialName ? this.check4 = 1 : this.check4 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, this.check4, this.materialName, this.allocateStateValue).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})