This commit is contained in:
chenjianan
2019-04-12 12:14:36 +08:00
parent 61c767461b
commit 990e1d5956
2 changed files with 298 additions and 5 deletions

View File

@@ -1,14 +1,14 @@
import request from '@/utils/request'
// 查询库存数
export function searchInventoryNum(pageCurrent, pageSize, check1, name, check2, state1, state2) {
export function searchInventoryNum(pageCurrent, pageSize, check1, val1, check2, val2, check3, val3, check4, state1, state2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_离线合同_物料余量_查询数据',
param: `物料名称_check=${check1}&物料名称=${name}&库存状态_check=${check2}&库存状态=${state1}&采购状态=${state2}`,
param: `物料名称_check=${check1}&物料名称=${val1}&物料规格_check=${check2}&物料规格=${val2}&物料型号_check=${check3}&物料型号=${val3}&库存状态_check=${check4}&库存状态=${state1}&采购状态=${state2}`,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -158,3 +158,40 @@ export function setSafeValue(...params) {
}
})
}
// 查询分配后的标准件和外购件
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2, val2, check3, val3, person) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后',
param: `物料状态编号=${num1}&物料名称_check=${check1}&物料名称=${val1}&物料规格_check=${check2}&物料规格=${val2}&物料型号_check=${check3}&物料型号=${val3}&人员编号=${person}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 初始化离线合同
export function initOfflineContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_离线合同_查询数据',
param: `未全部到货=1`
}
})
}
// 提交绑定
export function submitBind(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_离线合同_物料绑定',
param: `组件零件流水号组=${params[0]}&离线合同流水号=${params[1]}`
}
})
}

View File

@@ -4,6 +4,116 @@
<div slot="header">
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
<span>物料状态:</span>
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select style="margin: 0"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent00=1;pageSize00=10;total00=0;searchTable00()">查询</el-button>
<el-button
:disabled="tableData02.length===0"
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="bindOfflineContract">绑定离线合同</el-button>
</div>
<el-table
v-loading=""
:data="tableData00"
:row-class-name="tableRowClassName"
border
show-summary
style="width: 100%;max-height: 500px;"
height="500px"
size="mini"
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column label="物料状态" align="center" width="80">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="物料类别" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column label="物料品种" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="分配数量" align="center" min-width="80" prop="零件数量">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0 0 0;">
<el-pagination
:current-page="pageCurrent00"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize00"
:total="total00"
style="display:inline-block;width:800px"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange00"
@current-change="handleCurrentChange00"/>
</div>
</el-card>
<el-card>
<div slot="header">
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
<span>库存状态:</span>
<el-select v-model="inventoryStateValue" placeholder="库存状态" size="small" clearable>
<el-option
@@ -96,7 +206,7 @@
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
style="display:inline-block;width:800px"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
@@ -430,6 +540,44 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible0" title="绑定到离线合同" center style="min-height: 300px">
<el-table :data="tableData02" border show-summary height="300" size="mini">
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="分配数量" align="center" min-width="80" prop="零件数量">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
</el-table>
确认将以上物料绑定到离线合同
<el-select v-model="offlineContractsValue" placeholder="离线合同号" filterable size="small" style="margin: 10px">
<el-option
v-for="item in offlineContracts"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
上。
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible0=false">取消</el-button>
<el-button type="primary" size="small" @click="submitBind">确定</el-button>
</div>
</el-dialog>
<div id="offlineContract" style="width: 800px;margin: 0 auto;display: none">
<table class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr>
@@ -473,7 +621,7 @@
<script>
import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel,
addMateriel, deleteMateriel, saveOfflineContact, doneOfflineContact, setSafeValue } from '@/api/PurchasingCenter/OfflineContract'
addMateriel, deleteMateriel, saveOfflineContact, doneOfflineContact, setSafeValue, searchMaterial, initOfflineContract, submitBind } from '@/api/PurchasingCenter/OfflineContract'
import QRCode from 'qrcode'
import $ from 'jquery'
import { mapGetters } from 'vuex'
@@ -482,6 +630,36 @@ export default {
name: '', // 离线合同
data() {
return {
groupPartNumGroup: [], // 组件零件流水号组
offlineContractsValue: '',
offlineContracts: [],
tableData02: [],
dialogVisible0: false,
materialStatusValue: [0], // 物料状态
materialStatus: [
{
value: 0,
label: '全部'
},
{
value: 1,
label: '未询价'
}, {
value: 2,
label: '已询价',
children: [{
value: 3,
label: '未采购'
}, {
value: 4,
label: '已采购'
}]
}
], // 物料状态
total00: 0,
pageCurrent00: 1,
pageSize00: 10,
tableData00: [],
showMaterialTable: true,
loading1: false,
title2: '',
@@ -500,6 +678,8 @@ export default {
check3: 0,
check4: 0,
materialName: '',
materialSpec: '',
materialModel: '',
inventoryStateValue: '', // 库存状态
inventoryState: [
{
@@ -594,6 +774,7 @@ export default {
this.fetchData()
this.searchTable1()
this.searchTable2()
this.searchTable00()
},
methods: {
editing(row) {
@@ -622,9 +803,12 @@ export default {
fetchData() {},
searchTable1() { // 查询物料库物料
this.loading1 = true
let check2, check3
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
this.materialName ? this.check1 = 1 : this.check1 = 0
this.inventoryStateValue ? this.check2 = 1 : this.check2 = 0
searchInventoryNum(this.pageCurrent1, this.pageSize1, this.check1, this.materialName, this.check2, this.inventoryStateValue, this.purchaseStateValue).then(response => {
searchInventoryNum(this.pageCurrent1, this.pageSize1, this.check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.check2, this.inventoryStateValue, this.purchaseStateValue).then(response => {
this.tableData1 = response.data.rows
this.tableData1.map(v => {
this.$set(v, 'changeSafeValue', false)
@@ -1049,6 +1233,73 @@ export default {
message: '已取消操作'
})
})
},
tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) {
return 'MistyRose'
}
return ''
},
handleSelectionChange1(val) { // 标准件和外购件多选
console.log(val)
this.groupPartNumGroup = []
this.tableData02 = val
for (let i = 0; i < val.length; i++) {
this.groupPartNumGroup.push(val.组件零件流水号)
}
},
selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
},
searchTable00() { // 查询标准件和外购件列表
this.pageCurrent1 = 1
this.pageSize1 = 10
this.total1 = 0
this.searchTable1()
let check1, check2, check3
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
searchMaterial(this.pageCurrent00, this.pageSize00, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id).then(response => {
console.log(response.data.rows)
this.tableData00 = response.data.rows
this.total00 = response.data.total
})
},
handleSizeChange00(val) { // 标准件和外购件列表分页
this.pageSize00 = val
this.pageCurrent00 = 1
this.searchTable00()
},
handleCurrentChange00(val) { // 标准件和外购件列表分页
this.pageCurrent00 = val
this.searchTable00()
},
// 绑定离线合同
bindOfflineContract() {
this.offlineContracts = []
initOfflineContract().then(res => {
for (let i = 0; i < res.data.length; i++) {
this.offlineContracts.push({
value: res.data[i].离线合同流水号,
label: res.data[i].离线合同编号
})
}
})
this.dialogVisible0 = true
},
submitBind() {
if (this.offlineContractsValue) {
console.log('改物料询价状态,采购状态,往物料附上离线合同流水号')
submitBind(this.groupPartNumGroup, this.offlineContractsValue).then(res => {
if (res.data[0].result === '1') {
this.searchTable00()
this.dialogVisible0 = false
} else { this.$message.error('操作失败') }
})
} else {
this.$message.warning('请选择需要绑定的离线合同')
}
}
}
}
@@ -1089,3 +1340,8 @@ export default {
top: 5px;
}
</style>
<style>
.el-table .MistyRose {
background: MistyRose!important;
}
</style>