使用滞货

This commit is contained in:
chenjianan
2019-03-28 16:38:37 +08:00
parent 035b9bcd31
commit 40e88b96cd
3 changed files with 86 additions and 44 deletions

View File

@@ -1,27 +1,27 @@
import request from '@/utils/request'
// 查询分配后的标准件和外购件
export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2, person) {
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, person) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后',
param: `询价状态编号_check=${check1}&询价状态编号=${num1}&物料名称_check=${check2}&物料名称=${num2}&人员编号=${person}`,
param: `物料状态编号=${num1}&物料名称_check=${check1}&物料名称=${val1}&人员编号=${person}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询分配后的基本件
export function searchPart(pageCurrent, pageSize, check1, num1, person) {
export function searchPart(pageCurrent, pageSize, num1, person) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_基本件_分配后',
param: `询价状态编号_check=${check1}&询价状态编号=${num1}&人员编号=${person}`,
param: `物料状态编号=${num1}&人员编号=${person}`,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -183,3 +183,15 @@ export function saveOrder(num1, num2, num3) {
}
})
}
// 编辑询价单
export function submitUseInventory(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_使用滞货',
param: `物料流水号=${params[0]}&使用滞货数量=${params[1]}&组件零件流水号=${params[2]}`
}
})
}

View File

@@ -4,13 +4,7 @@
<el-tab-pane label="标准件和外购件">
<el-row style="margin-bottom: 10px">
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-button
@@ -95,17 +89,17 @@
</el-table-column>
<el-table-column label="待询价数量" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用数量) }}
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
</template>
</el-table-column>
<el-table-column label="使用滞货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ Number(scope.row.使用数量) }}
{{ Number(scope.row.使用滞货数量) }}
</template>
</el-table-column>
<el-table-column label="使用滞货" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="useInventory(scope.row)">使用滞货</el-button>
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="useInventory(scope.row)">使用滞货</el-button>
</template>
</el-table-column>
<el-table-column label="滞货数量" align="center" min-width="80">
@@ -140,13 +134,7 @@
<el-tab-pane label="基本件">
<el-row style="margin-bottom: 10px">
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
<el-button
type="success"
size="small"
@@ -336,12 +324,12 @@
{{ scope.row.组件零件流水号 ? scope.row.物料规格 : scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="技术下达数量" align="center" width="110">
<el-table-column label="待询价数量" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.技术下达数量 }}
</template>
</el-table-column>
<el-table-column label="实际采购数量" align="center" width="110">
<el-table-column label="实际询价(采购)数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.数量" size="mini" style="width:100%"/>
</template>
@@ -593,7 +581,7 @@
<script>
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder } from '@/api/PurchasingCenter/CreateInquirySheet'
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder, submitUseInventory } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
import { exportExcelMethod } from './exportExcel'
@@ -601,18 +589,29 @@ export default {
name: '', // 创建询价单
data() {
return {
check1: 0, // 询价状态
check2: 0, // 物料名称
check3: 0, // 供应商
check4: 0, // 询价单号
inquiryStateValue: '', // 询价状态
inquiryState: [{
label: '未询价',
value: 1
}, {
label: '已询价',
value: 3
}],
materialStatusValue: [0], // 物料状态
materialStatus: [
{
value: 0,
label: '全部'
},
{
value: 1,
label: '未询价'
}, {
value: 2,
label: '已询价',
children: [{
value: 3,
label: '未采购'
}, {
value: 4,
label: '已采购'
}]
}
], // 物料状态
materialName: '',
tableData11: [], // 标准件和外购件列表
total11: 0,
@@ -688,13 +687,13 @@ export default {
supplierExport: '',
useNumber: '',
maxUseNumber: '',
dialogVisible4: false
dialogVisible4: false,
backlogGroupPartNum: '',
backlogMaterialNum: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
@@ -710,14 +709,24 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dialogVisible4 = false
submitUseInventory(this.backlogMaterialNum, this.useNumber, this.backlogGroupPartNum).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.searchTable11()
this.dialogVisible4 = false
this.$message.success('操作成功')
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message.info('已取消操作')
})
},
useInventory(row) { // 使用滞货
console.log(row)
this.useNumber = 0
this.maxUseNumber = Number(row.滞货数量)
this.backlogMaterialNum = row.物料流水号
this.backlogGroupPartNum = row.组件零件流水号
this.dialogVisible4 = true
},
saveOrder() { // 保存询价单
@@ -742,9 +751,10 @@ export default {
return row['供货商'] === value
},
searchTable11() { // 查询标准件和外购件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => {
console.log(this.materialStatusValue)
let check1
this.materialName ? check1 = 1 : check1 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, this.id).then(response => {
this.tableData11 = response.data.rows
console.log(response.data.rows)
this.total11 = response.data.total
@@ -760,8 +770,7 @@ export default {
this.searchTable11()
},
searchTable12() { // 查询基本件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
searchPart(this.pageCurrent12, this.pageSize12, this.check1, this.inquiryStateValue, this.id).then(response => {
searchPart(this.pageCurrent12, this.pageSize12, this.materialStatusValue[this.materialStatusValue.length - 1], this.id).then(response => {
this.tableData12 = response.data.rows
console.log(response.data.rows)
this.total12 = response.data.total
@@ -945,9 +954,10 @@ export default {
handleSelectionChange1(val) { // 标准件和外购件多选
this.groupPartNum = []
this.allNum = []
console.log(val)
for (let i = 0; i < val.length; i++) {
this.groupPartNum[i] = val[i].组件零件流水号
this.allNum[i] = val[i].零件数量
this.allNum[i] = val[i].待询价数量
}
},
handleSelectionChange2(val) { // 基本件多选

View File

@@ -89,6 +89,16 @@
{{ 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">
<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.物料类别 }}
@@ -215,6 +225,16 @@
{{ 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">
<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.零件图号 }}