更新采购订单查询、零件追溯、库存查询和采购入库页面

This commit is contained in:
Developer
2026-06-08 17:14:36 +08:00
parent 6569ed2cf3
commit 7b969f0eb6
4 changed files with 265 additions and 15 deletions

View File

@@ -62,6 +62,7 @@
placeholder="订单备注"
@keyup.enter.native="pageCurrent=1;searchLeftTable()"/>
<el-button type="success" size="mini" style="margin-left: 100px" @click="exportExcel()">导出</el-button>
<el-button type="distribution" icon="el-icon-plus" size="mini" @click="addArrivalNotice()">生成入库单</el-button>
</div>
<el-row style="display: flex">
<el-col style="margin-left: 7px;width: 571px">
@@ -561,6 +562,98 @@
<el-table-column label="最近一次采购单价" align="center" prop="最近单价"/>
</el-table>
</el-dialog>
<el-dialog v-el-drag-dialog title="到货通知" :visible.sync="dialogFormVisible4" center width="1000px">
<el-form label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row style="display: flex; align-items: center;">
<el-col>
<el-select v-model="arrivalSupplierName" filterable clearable placeholder="请选择供应商" size="small" style="width: 200px" @change="getArrivalContract()">
<el-option v-for="item in suppliers" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-col>
<el-col>
<el-select v-model="arrivalContractNo" filterable clearable placeholder="请选择合同号" size="small" style="width: 200px" @change="onArrivalContractChange">
<el-option v-for="item in arrivalContract" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-col>
<el-col>
<el-button icon="el-icon-search" type="primary" plain size="small" @click="searchArrivalDetail()">查询</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="max-height: 400px; overflow: auto;">
<el-table :data="arrivalTableData" border stripe size="small" style="width: 100%;">
<el-table-column label="合同号" align="center" show-overflow-tooltip width="180">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购件" align="center" show-overflow-tooltip width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" show-overflow-tooltip width="150">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="采购数" align="center" show-overflow-tooltip width="100">
<template slot-scope="scope">
{{ scope.row.采购数 }}
</template>
</el-table-column>
<el-table-column label="已到数" align="center" show-overflow-tooltip width="100">
<template slot-scope="scope">
{{ scope.row.已到数 || 0 }}
</template>
</el-table-column>
<el-table-column label="本次到货数量" align="center" width="150">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.到货数量"
:max="scope.row.采购数 - (scope.row.已到数 || 0)"
:min="0"
size="small"
style="width: 120px"
controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="是否需要质检" align="center" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.需要质检"
:disabled="scope.row.到货数量 === 0"
active-text=""
inactive-text=""/>
</template>
</el-table-column>
<el-table-column label="推送部门" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.需要质检" style="color: #E6A23C;">质检部</span>
<span v-else style="color: #67C23A;">仓库</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
<el-row v-if="hasArrivalData" style="margin-top: 15px;">
<el-col :span="24">
<el-divider content-position="left">到货汇总</el-divider>
<div style="font-size: 12px; color: #606266; background: #f5f7fa; padding: 10px; border-radius: 4px;">
<span>本次到货物料数<span style="color: #409EFF; font-weight: bold;">{{ arrivalCount }}</span> </span>
<span>其中需质检<span style="color: #E6A23C; font-weight: bold;">{{ qualityCheckCount }}</span> 推送质检部</span>
<span>免检直接入库<span style="color: #67C23A; font-weight: bold;">{{ noQualityCheckCount }}</span> 推送仓库</span>
</div>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOffArrival()">取消</el-button>
<el-button type="primary" size="small" @click="submitArrivalNotice()"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -636,14 +729,34 @@ export default {
最高单价: '',
最近单价: ''
},
historyPriceList: []
historyPriceList: [],
// 生成入库单相关
dialogFormVisible4: false,
arrivalSupplierName: '',
arrivalContractNo: '',
arrivalContract: [],
arrivalContractLabel: '',
arrivalNoticeLabel: '',
arrivalTableData: []
}
},
computed: {
...mapGetters([
'id',
'token'
])
]),
hasArrivalData() {
return this.arrivalTableData.some(item => item.到货数量 > 0)
},
arrivalCount() {
return this.arrivalTableData.filter(item => item.到货数量 > 0).length
},
qualityCheckCount() {
return this.arrivalTableData.filter(item => item.到货数量 > 0 && item.需要质检).length
},
noQualityCheckCount() {
return this.arrivalTableData.filter(item => item.到货数量 > 0 && !item.需要质检).length
}
},
updated() {
this.$nextTick(() => {
@@ -1293,6 +1406,110 @@ export default {
}
return approverId
},
addArrivalNotice() {
this.arrivalSupplierName = ''
this.arrivalContractNo = ''
this.arrivalContractLabel = ''
this.arrivalNoticeLabel = ''
this.arrivalContract = []
this.arrivalTableData = []
this.dialogFormVisible4 = true
},
getArrivalContract() {
if (!this.arrivalSupplierName) {
this.arrivalContract = []
return
}
let check = this.arrivalSupplierName ? 1 : 0
this.arrivalContract = []
this.arrivalContractNo = ''
var param = []
param[0] = ['供应商流水号_check', check]
param[1] = ['供应商流水号', this.arrivalSupplierName]
var Data = this.CreateData('11', '仓储管理_采购入库合同_查询', param)
this.ExecDatabase(Data).then(response => {
this.arrivalContract = response.data.map(item => ({
label: item.采购合同编号,
value: item.采购合同流水号
}))
})
},
onArrivalContractChange(val) {
const selected = this.arrivalContract.find(item => item.value === val)
if (selected) {
this.arrivalContractLabel = selected.label
this.arrivalNoticeLabel = selected.label
}
},
searchArrivalDetail() {
if (!this.arrivalSupplierName) {
this.$message.warning('请先选择供应商')
return
}
if (!this.arrivalContractNo) {
this.$message.warning('请先选择合同号')
return
}
var param = []
param[0] = ['供应商流水号', this.arrivalSupplierName]
param[1] = ['采购合同流水号', this.arrivalContractNo]
var Data = this.CreateData('11', '采购管理_采购入库合同明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.arrivalTableData = response.data.map(item => ({
...item,
到货数量: 0,
需要质检: false
}))
if (this.arrivalTableData.length === 0) {
this.$message.info('该合同下没有物料明细')
}
})
},
submitArrivalNotice() {
const arrivalData = this.arrivalTableData.filter(item => item.到货数量 > 0)
if (arrivalData.length === 0) {
this.$message.warning('请至少填写一个物料的到货数量!')
return
}
const toQualityCheck = arrivalData.filter(item => item.需要质检 === true)
const toWarehouse = arrivalData.filter(item => item.需要质检 === false)
var param = []
param[0] = ['通知内容', this.arrivalNoticeLabel]
param[1] = ['发起人', this.id]
param[2] = ['采购合同流水号', this.arrivalContractNo]
param[3] = ['到货数组', arrivalData.map(item => item.到货数量).join(',')]
param[4] = ['物料流水号组', arrivalData.map(item => item.物料流水号).join(',')]
param[5] = ['质检标志组', arrivalData.map(item => item.需要质检 ? 1 : 0).join(',')]
param[6] = ['采购合同', this.arrivalContractLabel]
param[7] = ['供应商流水号', this.arrivalSupplierName]
var Data = this.CreateData('12', '采购管理_到货内容_新增', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
let message = '通知成功!'
if (toQualityCheck.length > 0) {
message += toQualityCheck.length + '个物料送质检部'
}
if (toWarehouse.length > 0) {
message += (toQualityCheck.length > 0 ? '' : '') + toWarehouse.length + '个物料直接入库'
}
this.$message({
message: message,
type: 'success',
duration: 3000
})
this.searchLeftTable()
this.dialogFormVisible4 = false
} else {
this.$message.error('通知失败')
}
}).catch(() => {
this.$message.error('操作失败,请重试')
})
},
callOffArrival() {
this.dialogFormVisible4 = false
this.$message.warning('已取消')
},
showHistoryPrice(row) {
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]

View File

@@ -151,7 +151,6 @@
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 20px;width: 955px">
<!-- <el-card>-->
<div style="margin-top: 10px">
@@ -213,6 +212,16 @@
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column width="135px" label="总工时" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.总工时 }}
</template>
</el-table-column>
<el-table-column width="75px" label="单个工时" align="center" show-overflow-tooltip prop="单个工时">
<template slot-scope="scope">
{{ scope.row.单个工时 }}
</template>
</el-table-column>
<el-table-column width="135px" label="开始加工" align="center">
<template slot-scope="scope">
@@ -224,16 +233,6 @@
{{ scope.row.完成时间 }}
</template>
</el-table-column>
<el-table-column width="135px" label="自检时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.检测时间 }}
</template>
</el-table-column>
<el-table-column width="75px" label="自检数量" align="center" show-overflow-tooltip prop="检测数量">
<template slot-scope="scope">
{{ scope.row.检测数量 }}
</template>
</el-table-column>
<el-table-column width="70px" label="派工人" align="center">
<template slot-scope="scope">
{{ scope.row.调拨员 }}

View File

@@ -174,7 +174,18 @@
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="需求数" align="center">
<template slot-scope="scope">
{{ scope.row.需求量 }}
<el-popover
placement="bottom"
width="400"
trigger="click"
@show="getDemandDetail(scope.row)">
<el-table :data="demandDetailData" border stripe size="mini" max-height="300" v-loading="demandDetailLoading">
<el-table-column prop="订单编号" label="订单号" align="center" show-overflow-tooltip/>
<el-table-column prop="最终需求量" label="需求量" align="center"/>
<el-table-column prop="简称" label="客户" align="center"/>
</el-table>
<span slot="reference" style="cursor: pointer; color: #409EFF; text-decoration: underline;">{{ scope.row.需求量 }}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="可用库存" align="center">
@@ -384,7 +395,9 @@ export default {
pageSize1: 30, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
multipleSelection: [] // 选中的行
multipleSelection: [], // 选中的行
demandDetailData: [],
demandDetailLoading: false
}
},
computed: {
@@ -423,6 +436,19 @@ export default {
}
})
},
getDemandDetail(row) {
this.demandDetailLoading = true
this.demandDetailData = []
var param = []
param[0] = ['物料流水号', row.物料流水号]
var Data = this.CreateData('11', '仓储管理_报缺补货_需求量明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.demandDetailData = response.data.filter(item => item.最终需求量 !== 0)
this.demandDetailLoading = false
}).catch(() => {
this.demandDetailLoading = false
})
},
handleSizeChanges1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val

View File

@@ -1045,6 +1045,14 @@ export default {
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))
}
})
},