add:增加仓储服务,增加需求单至出库单流程
This commit is contained in:
@@ -128,18 +128,19 @@
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
fit
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="pcsn" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="ext_code" label="源单号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="ext_type" label="源单类型" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right">
|
||||
<el-table-column show-overflow-tooltip min-width="140" prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="140" prop="pcsn" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip min-width="140" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="180" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="110" prop="qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip min-width="130" prop="qty_unit_name" label="计量单位名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="140" prop="ext_code" label="源单号" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="ext_type" label="源单类型" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="100" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
@@ -309,21 +310,20 @@ export default {
|
||||
}
|
||||
},
|
||||
tableChanged(rows) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.pcsn === item.pcsn && row.material_id === item.material_id && row.storagevehicle_code === item.storagevehicle_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
const exists = this.form.tableData.some(row => this.isSameMaterialRow(row, item))
|
||||
if (!exists) {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.qty)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
this.form.tableData.push(item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
isSameMaterialRow(row, item) {
|
||||
const rowKey = [row.pcsn || '', row.material_id || row.material_code || '', row.storagevehicle_code || ''].join('_')
|
||||
const itemKey = [item.pcsn || '', item.material_id || item.material_code || '', item.storagevehicle_code || ''].join('_')
|
||||
return rowKey === itemKey
|
||||
},
|
||||
async insertEvent(row) {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
|
||||
@@ -144,13 +144,14 @@ export default {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
const selection = this.$refs.multipleTable.selection || []
|
||||
if (!selection.length) {
|
||||
this.$message.warning('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
console.log('获取的rows:')
|
||||
console.log(this.rows)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
group.getAllGroupInfo(this.rows).then(res => {
|
||||
this.rows = res.content
|
||||
group.getAllGroupInfo(selection).then(res => {
|
||||
this.rows = res.content || []
|
||||
this.$emit('tableChanged', this.rows)
|
||||
})
|
||||
// this.form = this.$options.data().form
|
||||
|
||||
Reference in New Issue
Block a user