更新采购订单、发货记录、车间派工、物料维护、采购入库和仓储汇总等多个页面
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
v-model="PartType"
|
||||
type="border-card"
|
||||
style="height: 850px;padding: 0"
|
||||
@tab-click="pageCurrent=1;pageCurrent1=1;getData()">
|
||||
@tab-click="pageCurrent=1;pageCurrent1=1">
|
||||
<el-tab-pane label="采购入库" name="采购入库">
|
||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||
<el-select
|
||||
@@ -15,7 +15,7 @@
|
||||
size="small"
|
||||
filterable
|
||||
clearable
|
||||
@change="getContractState();searchTable1();onChangeSupplierSelection();">
|
||||
@change="handleSupplierChange">
|
||||
<el-option
|
||||
v-for="item in supplierSelection"
|
||||
:key="item.value"
|
||||
@@ -44,7 +44,7 @@
|
||||
size="small"
|
||||
@click="submitInStorage">入库
|
||||
</el-button>
|
||||
<el-badge :value="tableDataRKD ? tableDataRKD.length : 0" class="item">
|
||||
<el-badge :value="tableDataRKDMerged ? tableDataRKDMerged.length : 0" class="item">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-s-home"
|
||||
@@ -54,6 +54,14 @@
|
||||
@click="showRKDDialog">入库单
|
||||
</el-button>
|
||||
</el-badge>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
style="margin-left: 10px"
|
||||
plain
|
||||
size="small"
|
||||
@click="selectInStockableRows">勾选当前页可入库项
|
||||
</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-printer"
|
||||
@@ -68,8 +76,6 @@
|
||||
v-loading="loading"
|
||||
ref="table"
|
||||
:data="tableData1"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
@@ -113,9 +119,16 @@
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" label="库位" align="center">
|
||||
<el-table-column width="120px" label="库位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.货位名称 }}
|
||||
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
|
||||
<el-option
|
||||
v-for="item in locateName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span v-else>{{ scope.row.货位名称 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('数量')" label="采购数" prop="采购数" align="center">
|
||||
@@ -150,6 +163,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column width="80px" label="操作" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
|
||||
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -271,9 +285,7 @@
|
||||
v-loading="loading"
|
||||
ref="table2"
|
||||
:data="tableData3"
|
||||
:summary-method="getSummaries1"
|
||||
highlight-current-row
|
||||
show-summary
|
||||
border
|
||||
stripe
|
||||
size="small"
|
||||
@@ -313,9 +325,16 @@
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="70px" label="库位" align="center" show-overflow-tooltip>
|
||||
<el-table-column width="120px" label="库位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.货位名称 }}
|
||||
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
|
||||
<el-option
|
||||
v-for="item in locateName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span v-else>{{ scope.row.货位名称 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -383,8 +402,9 @@
|
||||
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="72px" label="操作" align="center">
|
||||
<el-table-column width="100px" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
|
||||
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter1(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -443,8 +463,6 @@
|
||||
<div>
|
||||
<el-table
|
||||
:data="tableData30"
|
||||
:summary-method="getSummaries2"
|
||||
show-summary
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
@@ -526,7 +544,7 @@
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleRKD" title="入库单" center width="700px">
|
||||
<el-table :data="tableDataRKD" border stripe size="small" height="400px">
|
||||
<el-table :data="tableDataRKDMerged" border stripe size="small" height="400px">
|
||||
<el-table-column prop="入库单号" label="入库单号" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
||||
@@ -706,7 +724,22 @@ export default {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token'
|
||||
])
|
||||
]),
|
||||
tableDataRKDMerged() {
|
||||
var map = {}
|
||||
var result = []
|
||||
for (var i = 0; i < this.tableDataRKD.length; i++) {
|
||||
var row = this.tableDataRKD[i]
|
||||
var key = row.入库单号
|
||||
if (map[key] !== undefined) {
|
||||
result[map[key]].到货数 = Number(result[map[key]].到货数 || 0) + Number(row.到货数 || 0)
|
||||
} else {
|
||||
map[key] = result.length
|
||||
result.push(Object.assign({}, row, { 到货数: Number(row.到货数 || 0) }))
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
if (this.$refs['']) {
|
||||
@@ -735,18 +768,39 @@ export default {
|
||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
||||
})
|
||||
},
|
||||
handleSupplierChange() {
|
||||
this.contractStateValue = ''
|
||||
this.contractNumber = ''
|
||||
this.contractState = []
|
||||
if (!this.supplierSelectionValue) {
|
||||
this.supplierSelectionName = ''
|
||||
this.tableData1 = []
|
||||
this.multipleSelection = []
|
||||
this.returns = []
|
||||
this.totalAmount = ''
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.clearSelection()
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
this.getContractState()
|
||||
this.searchTable1()
|
||||
this.onChangeSupplierSelection()
|
||||
},
|
||||
onChangeSupplierSelection() {
|
||||
let obj = {}
|
||||
obj = this.supplierSelection.find((item) => {
|
||||
return item.value === this.supplierSelectionValue
|
||||
})
|
||||
this.supplierSelectionName = obj.label
|
||||
this.supplierSelectionName = obj ? obj.label : ''
|
||||
},
|
||||
showRKDDialog() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false )
|
||||
this.dialogFormVisibleRKD = true
|
||||
})
|
||||
},
|
||||
@@ -998,11 +1052,17 @@ export default {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.locateName.push({
|
||||
label: response.data[i].货位名称,
|
||||
value: response.data[i].货位流水号
|
||||
value: String(response.data[i].货位流水号)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onLocateChange(row) {
|
||||
var obj = this.locateName.find(function(item) {
|
||||
return item.value === row.货位流水号
|
||||
})
|
||||
row.货位名称 = obj ? obj.label : ''
|
||||
},
|
||||
getData() {
|
||||
if (this.PartType === '采购入库') {
|
||||
this.searchTable1()
|
||||
@@ -1027,6 +1087,18 @@ export default {
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
if (!this.supplierSelectionValue) {
|
||||
this.tableData1 = []
|
||||
this.multipleSelection = []
|
||||
this.returns = []
|
||||
this.totalAmount = ''
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.clearSelection()
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < this.contractState.length; i++) {
|
||||
if (this.contractStateValue === this.contractState[i].value) {
|
||||
this.contractNumber = this.contractState[i].label
|
||||
@@ -1042,23 +1114,35 @@ export default {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData1 = response.data
|
||||
console.log('采购件入库', response.data)
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
var row = this.tableData1[i]
|
||||
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
|
||||
row.货位流水号 = String(row.货位流水号)
|
||||
}
|
||||
this.$set(row, '_editing', false)
|
||||
}
|
||||
if (this.tableData1.length === 0) {
|
||||
this.getContractState()
|
||||
this.getSummaries()
|
||||
} else {
|
||||
this.$nextTick(function() {
|
||||
this.tableData1.forEach(function(row) {
|
||||
if (Number(row.等待入库数量) > 0) {
|
||||
this.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
}.bind(this))
|
||||
}.bind(this))
|
||||
}
|
||||
})
|
||||
},
|
||||
selectable(row) {
|
||||
return (Number(row.采购数) !== Number(row.已到数)) && Number(row.本次到货数) !== 0
|
||||
},
|
||||
selectInStockableRows() {
|
||||
if (!this.$refs.table) return
|
||||
this.$refs.table.clearSelection()
|
||||
this.$nextTick(function() {
|
||||
this.tableData1.forEach(function(row) {
|
||||
if ((Number(row.采购数) !== Number(row.已到数)) && Number(row.本次到货数) !== 0) {
|
||||
this.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
}.bind(this))
|
||||
}.bind(this))
|
||||
},
|
||||
toggleRowEdit(row) {
|
||||
this.$set(row, '_editing', !row._editing)
|
||||
},
|
||||
submitInStorage() {
|
||||
// this.exportTable()
|
||||
if (!this.multipleSelection || this.multipleSelection.length === 0) {
|
||||
@@ -1087,7 +1171,7 @@ export default {
|
||||
this.multipleSelection_variable = this.multipleSelection
|
||||
this.multipleSelection = []
|
||||
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
|
||||
if (this.multipleSelection_variable[i].货位流水号 === 0) {
|
||||
if (!this.multipleSelection_variable[i].货位流水号 && this.multipleSelection_variable[i].货位流水号 !== 0) {
|
||||
this.$message.warning('存在未绑定货位的物料')
|
||||
return
|
||||
}
|
||||
@@ -1196,6 +1280,13 @@ export default {
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData3 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
for (let i = 0; i < this.tableData3.length; i++) {
|
||||
var row = this.tableData3[i]
|
||||
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
|
||||
row.货位流水号 = String(row.货位流水号)
|
||||
}
|
||||
this.$set(row, '_editing', false)
|
||||
}
|
||||
})
|
||||
},
|
||||
selectable2(row) {
|
||||
@@ -1216,7 +1307,7 @@ export default {
|
||||
this.multipleSelection_variable2 = this.multipleSelection2
|
||||
this.multipleSelection2 = []
|
||||
for (let i = 0; i < this.multipleSelection_variable2.length; i++) {
|
||||
if (this.multipleSelection_variable2[i].货位流水号 === 0) {
|
||||
if (!this.multipleSelection_variable2[i].货位流水号 && this.multipleSelection_variable2[i].货位流水号 !== 0) {
|
||||
this.$message.warning('存在未绑定货位的物料')
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user