This commit is contained in:
2023-05-29 19:39:13 +08:00
50 changed files with 985 additions and 969 deletions

View File

@@ -11,20 +11,35 @@
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
<span/>
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button
icon="el-icon-check"
size="mini"
:loading="crud.cu === 2"
type="primary"
@click="crud.submitCU"
>保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
<el-form
ref="form"
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
:inline="true"
:model="form"
:rules="rules"
size="mini"
label-width="85px"
label-suffix=":"
>
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
@@ -64,12 +79,12 @@
<el-form-item label="货位" prop="struct_code">
<label slot="label">货&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位:</label>
<el-input v-model.trim="form.struct_code" style="width: 210px" disabled placeholder="选择货位">
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()" />
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()"/>
</el-input>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px"/>
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -84,7 +99,13 @@
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
<el-input
v-model.trim="form.remark"
style="width: 380px;"
rows="2"
type="textarea"
:disabled="crud.status.view > 0"
/>
</el-form-item>
</el-form>
@@ -92,7 +113,7 @@
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<slot name="left"/>
<!--<el-button
slot="left"
class="filter-item"
@@ -127,89 +148,31 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" width="150px">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.storagevehicle_code" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.storagevehicle_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" width="190" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.bucketunique" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-plus" @click="queryBucket(scope.$index, scope.row)" />
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)"/>
</el-input>
<span v-show="scope.row.edit">{{ scope.row.bucketunique }}</span>
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.bucketunique }}</span>
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="pcsn" label="批次号" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.quality_scode"
size="mini"
clearable
class="filter-item"
disabled
>
<el-option
v-for="item in dict.ST_QUALITY_SCODE"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_level" label="库存等级" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.ivt_level"
size="mini"
clearable
class="filter-item"
placeholder=""
disabled
>
<el-option
v-for="item in dict.ST_IVT_LEVEL"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="is_active" label="是否可用" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.is_active"
size="mini"
clearable
class="filter-item"
placeholder=""
disabled
>
<el-option
v-for="item in dict.is_used"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_qty" label="库存重量" align="center" :formatter="crud.formatNum3" />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip/>
<el-table-column v-if="!crud.status.view > 0" prop="ivt_qty" label="库存重量" align="center"
:formatter="crud.formatNum3"/>
<el-table-column prop="mol_qty" width="220" label="损溢重量" align="center">
<template scope="scope">
<el-input-number v-model="scope.row.mol_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
<el-input-number
v-model="scope.row.mol_qty"
:disabled="scope.row.edit"
:precision="3"
:controls="false"
:min="0"
style="width: 120px"
/>
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center"/>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="190" fixed="right">
<template scope="scope">
<el-button
@@ -241,17 +204,16 @@
</el-table-column>
</el-table>
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @tableChanged2="tableChanged2" />
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged" />
<BucketDialog :dialog-show.sync="bucketShow" @bucketChange="tableChanged2" />
<MaterDtl :dialog-show.sync="materShow" @setMaterValue="tableChanged2"/>
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged"/>
</el-dialog>
</template>
<script>
import crudOperation from '@crud/CRUD.operation'
import BucketDialog from '@/views/wms/storage_manage/product/productMoreOrless/NewBucketDialog'
import CRUD, { crud, form } from '@crud/crud'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import CRUD, {crud, form} from '@crud/crud'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudMoreOrless from '@/views/wms/storage_manage/product/productMoreOrless/moreorless'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import StructDiv from '@/views/wms/storage_manage/product/productMoreOrless/StructDiv'
@@ -275,7 +237,7 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { crudOperation, MaterDtl, StructDiv, BucketDialog },
components: {crudOperation, MaterDtl, StructDiv, BucketDialog},
mixins: [crud(), form(defaultForm)],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_MOL_TYPE'],
props: {
@@ -301,13 +263,13 @@ export default {
storlist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
{required: true, message: '仓库不能为空', trigger: 'blur'}
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
{required: true, message: '业务类型不能为空', trigger: 'blur'}
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
{required: true, message: '业务日期不能为空', trigger: 'blur'}
]
}
}
@@ -322,31 +284,30 @@ export default {
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({'stor_type': '3'}).then(res => {
this.storlist = res.content
})
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.getMlDtl({'mol_id': this.form.mol_id}).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.isadd = false
row.edit = true
this.$set(row, 'edit', false)
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
this.mater_btn = true
crudMoreOrless.queryMolDetail({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.getMlDtl({ 'mol_id': this.form.mol_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.$set(row, 'edit', true)
this.form.tableData.splice(i, 1, row)
}
})
@@ -385,13 +346,13 @@ export default {
return false
}
if (this.crud.status.add > 0) {
crudMoreOrless.getStructIvt({ 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.getStructIvt({'struct_id': this.form.struct_id}).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
}
if (this.crud.status.edit > 0) {
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.queryMolDtl({'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id}).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
@@ -399,17 +360,16 @@ export default {
},
tableChanged2(row) {
// 新增一行物料时,给行进行赋值
this.nowrow.material_code = row.material_code
this.nowrow.material_id = row.material_id
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.qty_unit_id
this.nowrow.qty_unit_name = row.qty_unit_name
this.nowrow.quality_scode = row.quality_scode
this.nowrow.is_active = row.is_active
this.nowrow.ivt_level = row.ivt_level
this.nowrow.pcsn = row.pcsn
this.nowrow.mol_qty = row.storage_qty
this.nowrow.bucketunique = row.bucketunique
this.$set(this.nowrow, 'material_code', row.material_code)
this.$set(this.nowrow, 'material_id', row.material_id)
this.$set(this.nowrow, 'material_name', row.material_name)
this.$set(this.nowrow, 'qty_unit_id', row.base_unit_id)
this.$set(this.nowrow, 'qty_unit_name', row.base_unit_name)
this.$set(this.nowrow, 'struct_id', this.form.struct_id)
this.$set(this.nowrow, 'struct_code', this.form.struct_code)
this.$set(this.nowrow, 'sect_id', this.form.sect_id)
this.$set(this.nowrow, 'sect_name', this.form.sect_name)
this.$set(this.nowrow, 'struct_name', this.form.struct_name)
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
tableChanged(row) {
@@ -418,8 +378,13 @@ export default {
this.form.sect_id = row.sect_id
this.form.sect_name = row.sect_name
this.form.struct_name = row.struct_name
crudMoreOrless.getStructIvt({ 'struct_id': row.struct_id }).then(res => {
crudMoreOrless.getStructIvt({'struct_id': row.struct_id}).then(res => {
this.form.tableData = res
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.$set(row, 'edit', false)
this.form.tableData.splice(i, 1, row)
}
this.form.dtl_num = this.form.tableData.length
})
},
@@ -443,7 +408,15 @@ export default {
this.nowrow = row
},
async insertdtl() {
this.form.tableData.push({ quality_scode: '02', ivt_qty: 0, mol_qty: 0, is_active: '1', ivt_level: '01', edit: false, is_add: true })
this.form.tableData.push({
quality_scode: '02',
ivt_qty: 0,
mol_qty: 0,
is_active: '1',
ivt_level: '01',
edit: false,
is_add: true
})
this.form.dtl_num = this.form.tableData.length
},
typeChange(val) {
@@ -461,7 +434,7 @@ export default {
},
handleEdit(index, row) {
if (!row.edit) {
if (parseFloat(row.mol_qty) <= 0) {
if (typeof (row.mol_qty) === 'undefined' | (parseFloat(row.mol_qty) <= 0)) {
this.crud.notify('不允许损溢数量为0', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
@@ -469,18 +442,6 @@ export default {
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.storagevehicle_code) {
this.crud.notify('载具号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.bucketunique) {
this.crud.notify('桶号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.pcsn) {
this.crud.notify('批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form.mol_type === '0' && (parseFloat(row.ivt_qty) < parseFloat(row.mol_qty))) {
this.crud.notify('不允许损数量大于库存数量!', CRUD.NOTIFICATION_TYPE.INFO)
return false

View File

@@ -29,10 +29,11 @@
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
/>
</el-col>
<el-col :span="6">
<rrOperation />
<rrOperation/>
</el-col>
</el-row>
<!--表格渲染-->
@@ -46,15 +47,15 @@
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="sect_name" label="库区名称" />
<el-table-column prop="lock_type" :formatter="lockFormat" label="是否锁定" />
<el-table-column prop="storagevehicle_code" label="存储载具号" />
<el-table-column type="selection" width="55"/>
<el-table-column prop="struct_code" label="货位编码"/>
<el-table-column prop="struct_name" label="货位名称"/>
<el-table-column prop="sect_name" label="库区名称"/>
<el-table-column prop="lock_type" :formatter="lockFormat" label="是否锁定"/>
<el-table-column prop="storagevehicle_code" label="存储载具号"/>
</el-table>
<!--分页组件-->
<pagination />
<pagination/>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
@@ -64,7 +65,7 @@
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
@@ -73,7 +74,7 @@ import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'StructDiv',
components: { crudOperation, rrOperation, pagination },
components: {crudOperation, rrOperation, pagination},
cruds() {
return CRUD({
title: '仓位',
@@ -81,8 +82,8 @@ export default {
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
query: { search: '', is_lock: '1', sect_id: '', stor_id: '' },
crudMethod: { ...crudStructattr }
query: {search: '', is_lock: '1', sect_id: '', stor_id: ''},
crudMethod: {...crudStructattr}
})
},
mixins: [presenter(), header()],
@@ -122,7 +123,7 @@ export default {
methods: {
open() {
this.crud.resetQuery(false)
crudSectattr.getSect({ 'is_materialstore': '1' }).then(res => {
crudSectattr.getSect({ 'stor_type': '3' }).then(res => {
this.sects = res.content
})
if (this.sect) {
@@ -192,22 +193,9 @@ export default {
return
}
// 溢单不允许选择已锁定或者有载具的货位
if (this.mol_type === '1') {
if (this.checkrow.lock_type !== '00') {
this.$message('溢单不允许选择已锁定的货位!')
return
}
}
// 损单不允许选择已锁定或者无载具的货位
if (this.mol_type === '0') {
if (this.checkrow.lock_type !== '00') {
this.$message('损单不允许选择已锁定的货位!')
return
}
if (this.checkrow.storagevehicle_code === '') {
this.$message('损单不允许选择无载具的货位!')
return
}
if (this.checkrow.lock_type !== '0') {
this.$message('不允许选择已锁定的货位!')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)

View File

@@ -11,12 +11,12 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-form-item label="单据编号">
<el-input
v-model="query.struct_search"
v-model="query.mol_code"
size="mini"
clearable
placeholder="货位编码、名称"
placeholder="单据编号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
@@ -69,7 +69,7 @@
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
v-model="query.status"
clearable
size="mini"
placeholder="单据状态"
@@ -77,7 +77,7 @@
@change="crud.toQuery"
>
<el-option
v-for="item in dict.mol_bill_status"
v-for="item in dict.MOL_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -149,8 +149,8 @@
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="单据状态" />
<el-table-column label="备注" align="center" min-width="100" prop="remark" />
<el-table-column prop="create_mode" min-width="100" :formatter="create_modeFormat" label="生成方式" />
<el-table-column label="制单人" align="center" min-width="100" prop="input_optname" />
<el-table-column label="制单时间" align="center" prop="input_time" min-width="150" />
<el-table-column label="制单人" align="center" min-width="100" prop="create_name" />
<el-table-column label="制单时间" align="center" prop="create_time" min-width="150" />
<el-table-column label="确认人" align="center" prop="confirm_optname" min-width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" min-width="150" />
</el-table>
@@ -170,10 +170,11 @@ import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/storage_manage/product/productMoreOrless/AddDialog'
import { mapGetters } from 'vuex'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudMoreOrless from '@/views/wms/storage_manage/product/productMoreOrless/moreorless'
export default {
name: 'MoreOrLess',
name: 'RawProductMl',
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
@@ -184,13 +185,13 @@ export default {
size: 20
},
idField: 'mol_id',
url: '/api/instor/mol',
url: '/api/stIvtMoreorlessmstCp',
crudMethod: { ...crudMoreOrless }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['mol_bill_status', 'ST_CREATE_MODE', 'ST_MOL_TYPE'],
dicts: ['MOL_BILL_STATUS', 'ST_CREATE_MODE', 'ST_MOL_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -217,7 +218,7 @@ export default {
}
},
created() {
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'stor_type': '3' }).then(res => {
this.storlist = res.content
})
},
@@ -266,7 +267,7 @@ export default {
}
},
stateFormat(row, column) {
return this.dict.label.mol_bill_status[row.status]
return this.dict.label.MOL_BILL_STATUS[row.status]
},
typeFormat(row, column) {
return this.dict.label.ST_MOL_TYPE[row.mol_type]

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/instor/mol',
url: '/api/stIvtMoreorlessmstCp',
method: 'post',
data
})
@@ -10,50 +10,42 @@ export function add(data) {
export function del(ids) {
return request({
url: '/api/instor/mol',
method: 'delete',
url: '/api/stIvtMoreorlessmstCp/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/instor/mol',
method: 'put',
url: '/api/stIvtMoreorlessmstCp/update',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/instor/mol/getStructIvt',
method: 'get',
url: '/api/stIvtStructivtYl/getStructIvt',
method: 'post',
params
})
}
export function queryMolDtl(params) {
export function getMlDtl(data) {
return request({
url: '/api/instor/mol/queryMolDtl',
method: 'get',
params
})
}
export function queryMolDetail(params) {
return request({
url: '/api/instor/mol/queryMolDetail',
method: 'get',
params
})
}
export function confirm(data) {
return request({
url: '/api/instor/mol/confirm',
url: '/api/stIvtMoreorlessmstCp/getMlDtl',
method: 'post',
data
})
}
export default { add, edit, del, getStructIvt, queryMolDtl, queryMolDetail, confirm }
export function confirm(data) {
return request({
url: '/api/stIvtMoreorlessmstCp/confirm',
method: 'post',
data
})
}
export default { add, edit, del, getStructIvt, getMlDtl, confirm }

View File

@@ -212,7 +212,7 @@
<el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" />
</el-table>
</el-card>
<StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl" />
<StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="closeDiv" />
</el-dialog>
</template>
@@ -334,7 +334,12 @@ export default {
this.currentRow.remark = ''
this.currentRow.stor_id = this.storId
this.currentRow.assign_qty = 0
productOut.getStructIvt(this.currentRow).then(res => {
res.forEach(item => {
item.edit = false
})
this.openParam = res
this.structshow = true
this.openRow = this.currentRow
@@ -361,6 +366,10 @@ export default {
handleDisCurrentChange(current) {
this.currentDis = current
},
closeDiv() {
this.queryTableDtl()
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
},
queryTableDtl() {
productOut.getIosInvDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
this.tableDtl = res

View File

@@ -52,7 +52,7 @@
</el-form-item>
<el-form-item label="关键字" prop="remark">
<el-input
v-model="queryrow.remark"
v-model="queryrow.search"
clearable
style="width: 220px"
size="mini"
@@ -82,7 +82,7 @@
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<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">
<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>
@@ -157,7 +157,13 @@ export default {
queryStruct() {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(this.queryrow.assign_qty)
this.queryrow.assign_qty = 0
this.queryrow.materia_id = this.rowmst.material_id
this.queryrow.sale_id = this.rowmst.sale_id
productOut.getStructIvt(this.queryrow).then(res => {
res.forEach(item => {
item.edit = false
})
this.tableDtl = res
})
},
@@ -217,7 +223,8 @@ export default {
rows.push(item)
}
})
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
productOut.manualDiv({ 'iostorinvdtl_id': this.queryrow.iostorinvdtl_id, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
@@ -230,7 +237,7 @@ export default {
rows.push(item)
}
})
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
productOut.manualDiv({ 'iostorinvdtl_id': this.queryrow.iostorinvdtl_id, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})

View File

@@ -80,6 +80,14 @@ export function getStructIvt(data) {
})
}
export function manualDiv(data) {
return request({
url: 'api/productOut/manualDiv',
method: 'post',
data
})
}
export default {
add,
edit,
@@ -90,5 +98,6 @@ export default {
allCancel,
setPoint,
confirm,
getStructIvt
getStructIvt,
manualDiv
}

View File

@@ -1,524 +0,0 @@
<template>
<el-dialog
:title="crud.status.title"
append-to-body
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
fullscreen
width="1200px"
@open="open"
@close="close"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
<el-select
v-model="form.stor_id"
clearable
placeholder="仓库"
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="损溢类型" prop="mol_type">
<el-select
v-model="form.mol_type"
style="width: 210px"
clearable
class="filter-item"
:disabled="crud.status.view > 0"
@change="typeChange"
>
<el-option
v-for="item in dict.ST_MOL_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="货位" prop="struct_code">
<label slot="label">货&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位:</label>
<el-input v-model.trim="form.struct_code" style="width: 210px" disabled placeholder="选择货位">
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()" />
</el-input>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
<el-input-number
v-model="form.total_qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
</el-form-item>
</el-form>
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!--<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-search"
size="mini"
:disabled="crud.status.view > 0"
@click="resetTable()"
>
重置表格
</el-button>-->
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="mater_btn"
@click="insertdtl()"
>
新增一行
</el-button>
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form.tableData"
style="width: 100%;"
size="mini"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" width="150px">
<template scope="scope">
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.storagevehicle_code" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.storagevehicle_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" width="190" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.bucketunique" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-plus" @click="queryBucket(scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.bucketunique }}</span>
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.bucketunique }}</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="pcsn" label="批次号" align="center" min-width="200" show-overflow-tooltip />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.quality_scode"
size="mini"
clearable
class="filter-item"
disabled
>
<el-option
v-for="item in dict.ST_QUALITY_SCODE"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_level" label="库存等级" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.ivt_level"
size="mini"
clearable
class="filter-item"
placeholder=""
disabled
>
<el-option
v-for="item in dict.ST_IVT_LEVEL"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="is_active" label="是否可用" align="center" width="150px">
<template slot-scope="scope">
<el-select
v-model="scope.row.is_active"
size="mini"
clearable
class="filter-item"
placeholder=""
disabled
>
<el-option
v-for="item in dict.is_used"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_qty" label="库存重量" align="center" :formatter="crud.formatNum3" />
<el-table-column prop="mol_qty" width="220" label="损溢重量" align="center">
<template scope="scope">
<el-input-number v-model="scope.row.mol_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="190" fixed="right">
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
/>
<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>
<el-button
v-show="scope.row.edit"
type="success"
class="filter-item"
size="mini"
icon="el-icon-check"
@click="handleEdit(scope.$index, scope.row)"
>完成
</el-button>
</template>
</el-table-column>
</el-table>
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @tableChanged2="tableChanged2" />
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged" />
<BucketDialog :dialog-show.sync="bucketShow" @bucketChange="tableChanged2" />
</el-dialog>
</template>
<script>
import crudOperation from '@crud/CRUD.operation'
import BucketDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/NewBucketDialog'
import CRUD, { crud, form } from '@crud/crud'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudMoreOrless from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/moreorless'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import StructDiv from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/StructDiv'
const defaultForm = {
mol_id: '',
mol_code: '',
mol_type: '',
stor_id: '',
total_qty: '0',
dtl_num: '0',
bill_type: '',
remark: '',
struct_id: '',
sect_id: '',
sect_name: '',
struct_code: '',
struct_name: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { crudOperation, MaterDtl, StructDiv, BucketDialog },
mixins: [crud(), form(defaultForm)],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_MOL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
materShow: false,
bucketShow: false,
structShow: false,
materType: '',
mater_btn: true,
storlist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.isadd = false
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
this.mater_btn = true
crudMoreOrless.queryMolDetail({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.beforeSubmit]() {
debugger
// 提交前校验
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
if (!this.form.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
const vehicle_code = this.form.tableData[i].storagevehicle_code
const same = this.form.tableData.some(mater => mater.storagevehicle_code !== vehicle_code)
if (same) {
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
},
billTypeChange(val) {
this.form.tableData = []
this.form.total_qty = 0
this.form.dtl_num = 0
},
resetTable() {
if (!this.form.struct_id) {
this.crud.notify('请先选择货物!')
return false
}
if (this.crud.status.add > 0) {
crudMoreOrless.getStructIvt({ 'struct_id': this.form.struct_id }).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
}
if (this.crud.status.edit > 0) {
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
}
},
tableChanged2(row) {
// 新增一行物料时,给行进行赋值
this.nowrow.material_code = row.material_code
this.nowrow.material_id = row.material_id
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.qty_unit_id
this.nowrow.qty_unit_name = row.qty_unit_name
this.nowrow.quality_scode = row.quality_scode
this.nowrow.is_active = row.is_active
this.nowrow.ivt_level = row.ivt_level
this.nowrow.pcsn = row.pcsn
this.nowrow.mol_qty = row.storage_qty
this.nowrow.bucketunique = row.bucketunique
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
tableChanged(row) {
this.form.struct_id = row.struct_id
this.form.struct_code = row.struct_code
this.form.sect_id = row.sect_id
this.form.sect_name = row.sect_name
this.form.struct_name = row.struct_name
crudMoreOrless.getStructIvt({ 'struct_id': row.struct_id }).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
},
async queryMater(index, row) {
this.materShow = true
this.nowindex = index
this.nowrow = row
},
async queryStruct() {
if (!this.form.mol_type) {
this.crud.notify('请先选择损溢类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.structShow = true
this.$refs.child.getMsg(this.form.mol_type)
},
async queryBucket(index, row) {
this.bucketShow = true
this.nowindex = index
this.nowrow = row
},
async insertdtl() {
this.form.tableData.push({ quality_scode: '02', ivt_qty: 0, mol_qty: 0, is_active: '1', ivt_level: '01', edit: false, is_add: true })
this.form.dtl_num = this.form.tableData.length
},
typeChange(val) {
if (val === '1') {
this.mater_btn = false
} else {
this.mater_btn = true
}
this.form.tableData = []
this.form.struct_id = ''
this.form.struct_code = ''
this.form.sect_id = ''
this.form.sect_name = ''
this.form.struct_name = ''
},
handleEdit(index, row) {
if (!row.edit) {
if (parseFloat(row.mol_qty) <= 0) {
this.crud.notify('不允许损溢数量为0', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.material_id) {
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.storagevehicle_code) {
this.crud.notify('载具号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.bucketunique) {
this.crud.notify('桶号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.pcsn) {
this.crud.notify('批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form.mol_type === '0' && (parseFloat(row.ivt_qty) < parseFloat(row.mol_qty))) {
this.crud.notify('不允许损数量大于库存数量!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
// 修改行的编辑状态
row.edit = !row.edit
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
if (row.edit) {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = this.form.total_qty + item.mol_qty
})
}
},
deleteRow(index, rows) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].mol_qty)
rows.splice(index, 1)
this.form.dtl_num = this.form.tableData.length
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>