This commit is contained in:
liushuai
2019-12-05 17:24:12 +08:00
parent 755feb2f83
commit 66d55c2c6a
6 changed files with 360 additions and 22 deletions

View File

@@ -174,12 +174,18 @@
</el-table-column>
<el-table-column label="待询价数" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
{{ Number(scope.row.零件类型) === 1 ? 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="60">
<el-table-column label="库存(BZ)" align="center" min-width="70" prop="库存">
<template slot-scope="scope">
{{ Number(scope.row.货位存量) }}
{{ Number(scope.row.零件类型) === 1 ? scope.row.库存 = Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量) : '-' }}
</template>
</el-table-column>
<el-table-column label="使用库存数量" align="center" min-width="105" prop="使用库存数">
<template slot-scope="scope">
<span v-if="Number(scope.row.零件类型) !== 1">-</span>
<el-input-number v-if="Number(scope.row.零件类型) === 1" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="已用滞货" align="center" min-width="70">
@@ -1086,7 +1092,7 @@
<script>
import { timeSearch, timeChange1, timeChange2, tiaozheng2, tiaozheng1, getPerson, getBillNum, searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2, searchMerge } from '@/api/PurchasingCenter/CreateInquirySheet'
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2, searchMerge, changeNum } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
import { exportExcelMethod } from './exportExcel'
import $ from 'jquery'
@@ -1316,6 +1322,16 @@ export default {
this.searchTable11()
})
},
changeNumber(row) {
changeNum(row.物料流水号, row.使用库存数, row.机床流水号, row.组件零件流水号, row.零件数量).then(response => {
if (response.data[0].result === '1') {
this.$message.success('使用成功')
this.searchTable11()
} else {
this.$message.success('使用失败')
}
})
},
handleSelection(val, row) {
this.tableData11.forEach((item, i) => {
if (item.组件零件流水号 === row.组件零件流水号) {

View File

@@ -47,15 +47,9 @@
style="width: 100%;max-height: 500px;"
height="500px"
size="mini"
@selection-change="handleSelectionChange1">
@selection-change="handleSelectionChange1"
@select="handleSelection">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column label="物料状态" prop="询价状态编号" 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" prop="物料名称" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
@@ -109,7 +103,7 @@
<el-table-column label="使用库存数量" align="center" min-width="105" prop="使用库存数">
<template slot-scope="scope">
<span v-if="Number(scope.row.零件类型) !== 1">-</span>
<el-input-number v-if="Number(scope.row.零件类型) === 1" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > Number(scope.row.货位存量) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量)) : Number(scope.row.零件数量)" :disabled="Number(scope.row.货位存量) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
<el-input-number v-if="Number(scope.row.零件类型) === 1" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="待采数量" align="center" min-width="70" prop="待采购数量">
@@ -171,11 +165,13 @@
<el-table
v-loading=""
:data="tableData22"
:row-class-name="tableRowClassName2"
border
style="width: 100%;max-height: 500px;"
height="500px"
size="mini"
@selection-change="handleSelectionChange1">
@selection-change="handleSelectionChange1"
@select="handleSelection1">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="名称" align="center" prop="物料名称" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
@@ -808,6 +804,8 @@ export default {
tableData4: [], // 合同模板
stipulateArrivalTime: '', // 规定到货时间
离线合同状态: '',
numbers: [],
numbers1: [],
paramRow: '', // 参数row
disable: true, // 其他的禁用
tabName: '标准件',
@@ -830,6 +828,55 @@ export default {
this.initDirection()
},
methods: {
handleSelection(val, row) {
console.log(row, 123)
this.tableData00.forEach((item, i) => {
if (item.组件零件流水号 === row.组件零件流水号 && row.组件零件流水号 !== '0') {
if (this.numbers.indexOf(i) === -1) {
this.numbers.push(i)
} else {
this.numbers.splice(this.numbers.indexOf(i), 1)
}
} else if (item.组件零件基本件流水号 === row.组件零件基本件流水号 && row.组件零件基本件流水号 !== '0') {
if (this.numbers.indexOf(i) === -1) {
this.numbers.push(i)
} else {
this.numbers.splice(this.numbers.indexOf(i), 1)
}
}
console.log(this.numbers, 123)
})
},
handleSelection1(val, row) {
this.tableData22.forEach((item, i) => {
if (item.物料流水号 === row.物料流水号) {
console.log(this.numbers1.indexOf(i), 234)
if (this.numbers1.indexOf(i) === -1) {
this.numbers1.push(i)
} else {
this.numbers1.splice(this.numbers1.indexOf(i), 1)
}
}
})
},
tableRowClassName({ row, rowIndex }) {
let color = ''
this.numbers.forEach((r, i) => {
if (rowIndex === r) {
color = 'MistyRose'
}
})
return color
},
tableRowClassName2({ row, rowIndex }) {
let color = ''
this.numbers1.forEach((r, i) => {
if (rowIndex === r) {
color = 'MistyRose'
}
})
return color
},
initDirection() {
const direction = this.$getDirection()
direction.on('keyup', function(e, val) {
@@ -1490,12 +1537,6 @@ export default {
})
})
},
tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) {
return 'MistyRose'
}
return ''
},
handleSelectionChange1(val) { // 标准件和外购件多选
this.标准件和外购件流水号 = []
this.基本件流水号 = []
@@ -1669,6 +1710,6 @@ export default {
</style>
<style>
.el-table .MistyRose {
background: MistyRose!important;
background: #9BD7FC!important;
}
</style>