采购任务分配:重新调整

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' 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() { export function initProject() {
return request({ return request({
@@ -24,15 +47,15 @@ export function initBuyer() {
}) })
} }
// 查询表1 // 查询表1
export function searchTable1(pageCurrent, pageSize, check1, num1, check2, name, state) { export function searchTable1(...params) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '1', type: '1',
name: '采购管理_采购部采购_查询物料', name: '采购管理_采购部采购_查询物料',
param: `项目流水号_check=${check1}&项目流水号=${num1}&物料名称_check=${check2}&物料名称=${name}&分配状态=${state}`, param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&物料名称_check=${params[8]}&物料名称=${params[9]}&分配状态=${params[10]}`,
Pagination: pageCurrent + '&' + pageSize Pagination: params[0] + '&' + params[1]
} }
}) })
} }

View File

@@ -473,7 +473,7 @@ export default {
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData1[j].订货数量 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].未税单价 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[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 document.getElementsByClassName('tableData')[j].children[8].innerHTML = `备注` + j
} }
} }

View File

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