rev:代码合并
This commit is contained in:
@@ -79,17 +79,16 @@
|
||||
>
|
||||
自动取消
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="button3"
|
||||
@click="openStructIvt"
|
||||
>
|
||||
手工分配
|
||||
</el-button>-->
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
@@ -327,6 +326,12 @@ export default {
|
||||
}
|
||||
},
|
||||
openStructIvt() {
|
||||
debugger
|
||||
if (this.currentRow.iostorinv_id === undefined) {
|
||||
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
this.currentRow.remark = ''
|
||||
this.currentRow.stor_id = this.storId
|
||||
productOut.getStructIvt(this.currentRow).then(res => {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
@@ -21,7 +20,7 @@
|
||||
</div>
|
||||
</span>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span" style="width: 100px">可分配库存</span>
|
||||
<span class="role-span">可分配库存</span>
|
||||
<div class="crud-opts-form">
|
||||
<el-form ref="form2" :inline="true" :model="queryrow" size="mini">
|
||||
<el-form-item label="待分配" prop="unassign_qty">
|
||||
@@ -57,29 +56,7 @@
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="货位编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="sap批次" prop="remark">
|
||||
<el-input
|
||||
v-model="queryrow.sap_pcsn"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="sap批次"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号" prop="remark">
|
||||
<el-input
|
||||
v-model="queryrow.pcsn"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="子卷号"
|
||||
placeholder="货位编码、名称或载具号"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
@@ -93,7 +70,7 @@
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="500"
|
||||
max-height="400"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@@ -101,18 +78,17 @@
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" align="center" width="250px" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="子卷批次号" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip sortable prop="sap_pcsn" label="sap批次" align="center" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
||||
<!-- <el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">-->
|
||||
<!-- <template scope="scope">-->
|
||||
<!-- <el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />-->
|
||||
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />-->
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
@@ -126,9 +102,8 @@
|
||||
<script>
|
||||
|
||||
import CRUD, { header } from '@crud/crud'
|
||||
// import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import productOut from '@/views/wms/storage_manage/product/productOut/productout'
|
||||
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
export default {
|
||||
name: 'StructIvt',
|
||||
@@ -145,17 +120,12 @@ export default {
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
},
|
||||
storId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogVisible2: false,
|
||||
goal_unassign_qty: 0,
|
||||
queryrow: {},
|
||||
sects: [],
|
||||
tableDtl: []
|
||||
@@ -175,24 +145,21 @@ export default {
|
||||
rowmst: {
|
||||
handler(newValue, oldValue) {
|
||||
this.queryrow = newValue
|
||||
this.goal_unassign_qty = JSON.parse(JSON.stringify(this.queryrow.unassign_qty))
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
/* crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSect({ 'stor_id': this.queryrow.stor_id }).then(res => {
|
||||
this.sects = res.content
|
||||
})*/
|
||||
this.query.source_bill_code = this.queryrow.source_bill_code
|
||||
this.query.material_id = this.queryrow.material_id
|
||||
})
|
||||
},
|
||||
queryStruct() {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(this.queryrow.assign_qty)
|
||||
this.queryrow.assign_qty = 0
|
||||
/* productOut.getStructIvt(this.queryrow).then(res => {
|
||||
productOut.getStructIvt(this.queryrow).then(res => {
|
||||
this.tableDtl = res
|
||||
})*/
|
||||
})
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
@@ -210,28 +177,27 @@ export default {
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (row.edit === undefined) {
|
||||
this.$set(row, 'edit', false)
|
||||
if (!row.edit) {
|
||||
if (row.plan_qty > this.queryrow.unassign_qty) {
|
||||
this.crud.notify('出库重量不能超过未分配数', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (row.plan_qty > row.canuse_qty) {
|
||||
this.crud.notify('出库重量不能超过库存可出重量', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (row.plan_qty === 0) {
|
||||
this.crud.notify('出库重量为0不能保存', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
if (row.edit) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - row.plan_qty
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + row.plan_qty
|
||||
} else {
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
|
||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||
} else {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
|
||||
}
|
||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||
}
|
||||
// 如果已分配汇总量 > 明细重量 则待分配重量为0
|
||||
if (this.queryrow.assign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = parseFloat('0')
|
||||
}
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + row.plan_qty
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - row.plan_qty
|
||||
}
|
||||
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
@@ -251,7 +217,7 @@ export default {
|
||||
rows.push(item)
|
||||
}
|
||||
})
|
||||
productOut.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed')
|
||||
})
|
||||
@@ -264,7 +230,7 @@ export default {
|
||||
rows.push(item)
|
||||
}
|
||||
})
|
||||
productOut.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed')
|
||||
})
|
||||
|
||||
@@ -72,6 +72,14 @@ export function confirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getStructIvt(data) {
|
||||
return request({
|
||||
url: 'api/productOut/getStructIvt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
@@ -81,5 +89,6 @@ export default {
|
||||
allDivIvt,
|
||||
allCancel,
|
||||
setPoint,
|
||||
confirm
|
||||
confirm,
|
||||
getStructIvt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user