rev:半成品出入库、拼盘

This commit is contained in:
2023-05-31 09:13:07 +08:00
parent 02bc0fdb96
commit 392443fbf4
25 changed files with 2060 additions and 323 deletions

View File

@@ -161,7 +161,8 @@
<el-table-column show-overflow-tooltip min-width="120" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip min-width="120" prop="plan_qty" label="总数量" />
<el-table-column show-overflow-tooltip min-width="120" prop="base_unit_name" label="单" />
<el-table-column show-overflow-tooltip min-width="120" prop="unit_weight" label="单" />
<el-table-column show-overflow-tooltip min-width="120" prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip min-width="120" prop="point_code" label="入库点" />
<el-table-column show-overflow-tooltip min-width="120" prop="struct_code" label="分配货位" />
<el-table-column label="备注" align="center" prop="remark" />
@@ -257,7 +258,7 @@ export default {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status == '1002'
return row.bill_status !== '10'
},
handleSelectionChange(val, row) {
if (val.length > 1) {

View File

@@ -0,0 +1,485 @@
<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 prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<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.material_code }}</span>
</template>
</el-table-column>
<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"
/>
</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" @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/rawproduct/rawproductmoreOrless/NewBucketDialog'
import CRUD, {crud, form} from '@crud/crud'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudMoreOrless from '@/views/wms/storage_manage/rawproduct/rawproductmoreOrless/moreorless'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import StructDiv from '@/views/wms/storage_manage/rawproduct/rawproductmoreOrless/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({'stor_type': '3'}).then(res => {
this.storlist = res.content
})
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
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]
this.$set(row, 'edit', false)
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
this.mater_btn = true
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]
this.$set(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.$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) {
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
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
})
},
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 (typeof (row.mol_qty) === 'undefined' | (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 (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>

View File

@@ -0,0 +1,365 @@
<template>
<el-dialog
title="拼盘单新增"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
@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-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
<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"
@change="storChange"
>
<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="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.ST_INV_TYPE_SF"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
placeholder="单据状态"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.SHUTFRAME_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model.trim="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
</el-form-item>
<el-form-item label="物料" prop="material_code">
<label slot="label">物&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;料:</label>
<el-input v-model.trim="form.material_code" style="width: 210px" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
</el-input>
</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>
<div class="crud-opts2">
<span class="role-span">拼盘明细</span>
</div>
<el-table
v-if="crud.status.cu <= 0"
ref="table"
:data="form.tableData"
style="width: 100%;"
max-height="300"
size="mini"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="100" align="center" />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" width="110px" />
<el-table-column show-overflow-tooltip prop="turnout_struct_code" label="移出货位" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="移出载具号" width="90" />
<el-table-column show-overflow-tooltip prop="qty" label="移出重量" width="120" align="center" :formatter="crud.formatNum3" />
<el-table-column prop="qty_unit_name" label="重量单位" align="center" />
<el-table-column show-overflow-tooltip prop="turnin_struct_code" label="移入货位" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code_in" label="移入载具号" width="90" />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
</el-table>
<el-row v-if="crud.status.cu > 0" :gutter="2">
<el-col :span="12">
<el-table
ref="table1"
:data="tableData1"
style="width: 100%;"
max-height="320"
:highlight-current-row="true"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="130px" />
<el-table-column show-overflow-tooltip prop="canuse_qty" :formatter="crud.formatNum3" label="数量" width="80px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" width="70px" sortable />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="85px" />
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重" width="85px" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" fixed="right">
<template scope="scope">
<el-button type="danger" class="filter-item" icon="el-icon-right" @click.native.prevent="deleteRow1(scope.$index, tableData1)" />
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<el-table
ref="table"
:data="form.tableData"
style="width: 100%;"
max-height="300"
:highlight-current-row="true"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" fixed="left">
<template scope="scope">
<el-button type="danger" class="filter-item" icon="el-icon-back" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
</template>
</el-table-column>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="数量" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重" width="85px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" />
</el-table>
</el-col>
</el-row>
<MaterDialog :dialog-show.sync="materShow" @setMaterValue="tableChanged" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import shutframe from '@/views/wms/storage_manage/semiproduct/semiproductShutFrame/shutframe'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
bill_type: '51',
remark: '',
biz_date: '',
create_mode: '',
material_code: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { MaterDialog },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
dicts: ['SHUTFRAME_BILL_STATUS', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable', 'ST_INV_TYPE_SF'],
data() {
return {
dialogVisible: false,
materShow: false,
hasButtonTexts: true,
storlist: [],
tableData1: [],
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) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'stor_type': '2' }).then(res => {
this.storlist = res.content
})
},
close() {
this.tableData1 = []
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
shutframe.getOutBillDtl({ 'shutframeinv_id': this.form.shutframeinv_id }).then(res => {
this.form.tableData = res
})
},
[CRUD.HOOK.afterToView]() {
shutframe.getOutBillDtl2({ 'shutframeinv_id': this.form.shutframeinv_id }).then(res => {
this.form.tableData = res
})
},
quality_scodeFormat(row) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
ivt_levelFormat(row) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
is_activeFormat(row) {
return this.dict.label.is_usable[row.is_active]
},
storChange(row) {
this.storlist.forEach((item) => {
if (item.stor_id === row) {
this.form.stor_code = item.stor_code
this.form.stor_name = item.stor_name
}
})
},
async queryMater() {
if (this.form.stor_id === '') {
this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.materShow = true
},
tableChanged(row) {
debugger
this.form.material_code = row.material_code
this.form.material_id = row.material_id
this.tableData1 = []
this.form.detail_count = this.form.tableData.length
shutframe.getBcpIvtInfo({ 'material_id': row.material_id, 'stor_id': this.form.stor_id }).then(res => {
this.tableData1 = res
this.right_flag = false
})
},
deleteRow(index, rows) {
debugger
const row = this.form.tableData[index]
const nowList = []
for (let i = 0; i < this.form.tableData.length; i++) {
debugger
if (this.form.tableData[i].storagevehicle_code === row.storagevehicle_code) {
this.tableData1.push(this.form.tableData[i])
} else {
nowList.push(this.form.tableData[i])
}
}
this.form.tableData = nowList
this.form.detail_count = this.form.tableData.length
},
deleteRow1(index, rows) {
debugger
const tablemap = new Map()
for (let i = 0; i < this.form.tableData.length; i++) {
tablemap.set(this.form.tableData[i].storagevehicle_code, this.form.tableData[i].storagevehicle_code)
}
const row = this.tableData1[index]
tablemap.set(row.storagevehicle_code, row.storagevehicle_code)
if (tablemap.size > 2) {
this.crud.notify('拼盘明细最多只能有两个载具!')
return false
}
const nowList = []
for (let i = 0; i < this.tableData1.length; i++) {
if (this.tableData1[i].storagevehicle_code === row.storagevehicle_code) {
this.form.tableData.push(this.tableData1[i])
} else {
nowList.push(this.tableData1[i])
}
}
this.tableData1 = nowList
this.form.detail_count = this.form.tableData.length
},
[CRUD.HOOK.beforeSubmit]() {
const tablemap = new Map()
for (let i = 0; i < this.form.tableData.length; i++) {
tablemap.set(this.form.tableData[i].storagevehicle_code, this.form.tableData[i].storagevehicle_code)
}
if (tablemap.size !== 2) {
this.crud.notify('拼盘明细必须有两个载具!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.input-with-select {
background-color: #fff;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,300 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="单据号">
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="拼盘单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料查询">
<el-input
v-model="query.material_code"
clearable
size="mini"
placeholder="物料编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="所属仓库">
<el-select
v-model="query.stor_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<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="单据状态">
<el-select
v-model="query.bill_status"
clearable
size="mini"
placeholder="单据状态"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.SHUTFRAME_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
clearable
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_TYPE_SF"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="车间">
<el-select
v-model="query.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation>
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="work_flag"
icon="el-icon-position"
size="mini"
@click="taskOpen"
>
任务下发
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
:max-height="590"
:highlight-current-row="true"
size="mini"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column
label="操作"
width="160"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column prop="bill_code" min-width="140" label="订单编码">
<template slot-scope="scope">
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column :formatter="stateFormat" min-width="100" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" min-width="100" />
<el-table-column prop="bill_type" :formatter="bill_typeFormat" min-width="100" label="业务类型" />
<el-table-column min-width="135" prop="biz_date" label="业务日期" />
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" min-width="100" />
<el-table-column label="制单人" align="center" prop="input_optname" min-width="100" />
<el-table-column prop="input_time" min-width="135" label="制单时间" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
</div>
</template>
<script>
import shutframe from '@/views/wms/storage_manage/semiproduct/semiproductShutFrame/shutframe'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/storage_manage/semiproduct/semiproductShutFrame/AddDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
export default {
name: 'ShutFrame',
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({ title: '拼盘',
props: {
// 每页数据条数
size: 20
},
idField: 'shutframeinv_id', url: 'api/shutframe', crudMethod: { ...shutframe },
optShow: {
add: true,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['SHUTFRAME_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_SF', 'product_area'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
work_flag: true,
mstrow: {},
currentRow: null,
storlist: []
}
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudStorattr.getStor({ 'stor_type': '2' }).then(res => {
this.storlist = res.content
})
},
methods: {
canUd(row) {
return row.bill_status !== '10'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.busi_classs_code = '02'
this.handleCurrentChange(null)
},
stateFormat(row) {
return this.dict.label.SHUTFRAME_BILL_STATUS[row.bill_status]
},
bill_typeFormat(row) {
return this.dict.label.ST_INV_TYPE_SF[row.bill_type]
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
}else{
this.handleCurrentChange(null)
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(current) {
if (current !== null) {
this.currentRow = current
if (current.bill_status === '10') {
this.work_flag = false
} else {
this.work_flag = true
}
}
},
handleCurrentChange(current) {
if (current === null) {
this.work_flag = true
this.currentRow = {}
}
},
taskOpen() {
shutframe.handdown({ 'shutframeinv_id': this.currentRow.shutframeinv_id }).then(res => {
this.querytable()
})
},
checkboxT(row) {
return row.bill_status !== '99'
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,110 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/shutframe',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/shutframe/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/shutframe',
method: 'put',
data
})
}
export function getOutBillDtl(params) {
return request({
url: '/api/shutframe/getOutBillDtl',
method: 'get',
params
})
}
export function getOutBillDtl2(params) {
return request({
url: '/api/shutframe/getOutBillDtl2',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/shutframe/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/shutframe/insertDtl',
method: 'post',
data
})
}
export function getBcpIvtInfo(data) {
return request({
url: '/api/bcp/getBcpIvtInfo',
method: 'post',
data
})
}
export function getStructIvt2(params) {
return request({
url: '/api/shutframe/getStructIvt2',
method: 'get',
params
})
}
export function getStruct(params) {
return request({
url: '/api/shutframe/getStruct',
method: 'get',
params
})
}
export function handdown(data) {
return request({
url: '/api/shutframe/handdown',
method: 'post',
data
})
}
export function getOutBillTask(params) {
return request({
url: '/api/shutframe/getOutBillTask',
method: 'get',
params
})
}
export function issueTask(data) {
return request({
url: '/api/shutframe/issueTask',
method: 'post',
data
})
}
export function finishTask(data) {
return request({
url: '/api/shutframe/finishTask',
method: 'post',
data
})
}
export function allCancel(data) {
return request({
url: '/api/shutframe/allCancel',
method: 'post',
data
})
}
export default { add, edit, del, getOutBillDtl, allCancel, getBcpIvtInfo, getOutBillTask, finishTask, issueTask, getInvTypes, handdown, getOutBillDtl2, getStructIvt2, getStruct }

View File

@@ -11,23 +11,26 @@
>
<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="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"
value-format="yyyy-MM-dd" :disabled="crud.status.view > 0"/>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">所属仓库:</label>
@@ -99,7 +102,7 @@
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px"/>
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -113,7 +116,8 @@
</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="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea"
:disabled="crud.status.view > 0"/>
</el-form-item>
</el-form>
@@ -121,7 +125,7 @@
<div v-show="crud.status.add === 1" 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"
@@ -130,7 +134,7 @@
size="mini"
@click="insertEvent()"
>
添加物料
添加库存物料
</el-button>
</span>
@@ -143,58 +147,14 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip prop="base_bill_code" label="订单号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].base_bill_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="plan_qty" label="数量">
<template slot-scope="scope">
<el-input-number
v-model="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
@change="changeQty"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重">
<template slot-scope="scope">
<el-input-number
v-model="form.tableData[scope.$index].unit_weight"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].storagevehicle_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位"/>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码"/>
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip prop="plan_qty" label="数量"/>
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重"/>
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号"/>
<el-table-column v-if="crud.status.add === 1" align="center" label="操作" width="170" fixed="right">
<template scope="scope">
<el-button
@@ -212,16 +172,16 @@
:dialog-show.sync="materShow"
:is-single="false"
:mater-opt-code="materType"
@setMaterValue="tableChanged"
@tableChanged="tableChanged"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import CRUD, {crud, form} from '@crud/crud'
import crudsemiproductIn from '@/views/wms/storage_manage/semiproduct/semiproductIn/semiproductIn'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import MaterDtl from '@/views/wms/storage_manage/semiproduct/semiproductout/StructIvt'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
const defaultForm = {
@@ -239,11 +199,11 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { MaterDtl },
components: {MaterDtl},
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_QUALITY_SCODE', 'ST_INV_OUT_TYPE', 'product_area'],
cruds() {
return CRUD({ title: '入库新增', crudMethod: { ...crudsemiproductIn }})
return CRUD({title: '入库新增', crudMethod: {...crudsemiproductIn}})
},
props: {
dialogShow: {
@@ -265,13 +225,19 @@ export default {
billtypelist: [],
rules: {
product_code: [
{ 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'}
],
stor_id: [
{ required: true, message: '所属仓库不能为空', trigger: 'blur'}
],
point_code: [
{ required: true, message: '出库点不能为空', trigger: 'blur'}
]
}
}
@@ -285,7 +251,7 @@ export default {
},
methods: {
open() {
crudStorattr.getStor({ 'stor_type': '2' }).then(res => {
crudStorattr.getStor({'stor_type': '2'}).then(res => {
this.storlist = res.content
})
},
@@ -294,7 +260,7 @@ export default {
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudsemiproductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
crudsemiproductIn.getIODtl({'iostorinv_id': this.form.iostorinv_id}).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
@@ -304,7 +270,7 @@ export default {
})
},
[CRUD.HOOK.afterToView]() {
crudsemiproductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
crudsemiproductIn.getIODtl({'bill_code': this.form.bill_code}).then(res => {
this.form.tableData = res.content
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
@@ -320,34 +286,6 @@ export default {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
if (!row.base_bill_code) {
this.crud.notify('订单号', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.plan_qty) {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.stor_id) {
this.crud.notify('所属仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.point_code) {
this.crud.notify('入库点不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.storagevehicle_code) {
this.crud.notify('载具不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.unit_weight) {
this.crud.notify('单重不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
},
deleteRow(index, rows) {
const material_code = rows[index].material_code
@@ -369,7 +307,7 @@ export default {
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
if (row.material_code === item.material_code && row.struct_code === item.struct_code) {
same_mater = false
}
})
@@ -377,7 +315,7 @@ export default {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = '1'
item.plan_qty = item.canuse_qty
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}

View File

@@ -0,0 +1,153 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1200px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="库区/货位">
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="库区/货位"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation/>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column show-overflow-tooltip width="100" prop="sect_code" label="库区"/>
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
<el-table-column show-overflow-tooltip prop="material_code" width="100" label="物料编号"/>
<el-table-column show-overflow-tooltip width="300" prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip width="150" prop="canuse_qty" label="数量(个)"/>
<el-table-column show-overflow-tooltip width="100" prop="unit_weight" label="单重"/>
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
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'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date()
export default {
name: 'AddDtl',
components: {crudOperation, rrOperation, pagination, DateRangePicker},
cruds() {
return CRUD({
title: '半成品可用库存',
url: '/api/bcp/getBcpIvt',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
rows: [],
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
open() {
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
},
submit() {
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
this.$emit('tableChanged', this.rows)
// this.form = this.$options.data().form
}
}
}
</script>

View File

@@ -157,12 +157,11 @@
<el-table-column prop="workshop_id" label="生产车间" width="130" show-overflow-tooltip />
<el-table-column prop="stor_name" label="仓库" width="130" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="业务类型" :formatter="bill_typeFormat" />
<el-table-column show-overflow-tooltip prop="base_bill_code" min-width="120" label="关联单据号" />
<el-table-column show-overflow-tooltip min-width="120" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip min-width="120" prop="plan_qty" label="总数量" />
<el-table-column show-overflow-tooltip min-width="120" prop="base_unit_name" label="单位" />
<el-table-column show-overflow-tooltip min-width="120" prop="point_code" label="库点" />
<el-table-column show-overflow-tooltip min-width="120" prop="qty_unit_name" label="单位" />
<el-table-column show-overflow-tooltip min-width="120" prop="point_code" label="库点" />
<el-table-column show-overflow-tooltip min-width="120" prop="struct_code" label="分配货位" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建人" align="center" prop="create_name" />
@@ -257,7 +256,7 @@ export default {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status == '1002'
return row.bill_status !== '10'
},
handleSelectionChange(val, row) {
if (val.length > 1) {
@@ -297,7 +296,7 @@ export default {
}
},
bill_typeFormat(row, column) {
return this.dict.label.bill_type[row.bill_type]
return this.dict.label.ST_INV_OUT_TYPE[row.bill_type]
},
toView(row) {
this.mstrow = row
@@ -314,6 +313,7 @@ export default {
}
crudsemiproductout.confirm(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.refresh()
})
},
confirmTask() {
@@ -323,6 +323,7 @@ export default {
}
crudsemiproductout.confirmTask(this.currentRow).then(res => {
this.crud.notify('单据下发任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.refresh()
})
},
stateFormat(row, column) {

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/in/semiproductIn/create',
url: '/api/out/semiproduct/create',
method: 'post',
data
})
@@ -10,7 +10,7 @@ export function add(data) {
export function del(ids) {
return request({
url: '/api/in/semiproductIn/delete',
url: '/api/out/semiproduct/delete',
method: 'post',
data: ids
})
@@ -18,7 +18,7 @@ export function del(ids) {
export function edit(data) {
return request({
url: '/api/in/semiproductIn/update',
url: '/api/out/semiproduct/update',
method: 'post',
data
})
@@ -26,7 +26,7 @@ export function edit(data) {
export function getType(params) {
return request({
url: '/api/in/semiproductIn/getType',
url: '/api/out/semiproduct/getType',
method: 'get',
params
})
@@ -34,7 +34,7 @@ export function getType(params) {
export function getIODtl(data) {
return request({
url: '/api/in/semiproductIn/getIODtl',
url: '/api/out/semiproduct/getIODtl',
method: 'post',
data
})
@@ -42,7 +42,7 @@ export function getIODtl(data) {
export function insertDtl(data) {
return request({
url: '/api/in/semiproductIn/insertDtl',
url: '/api/out/semiproduct/insertDtl',
method: 'post',
data
})
@@ -50,7 +50,7 @@ export function insertDtl(data) {
export function commit(data) {
return request({
url: '/api/in/semiproductIn/commit',
url: '/api/out/semiproduct/commit',
method: 'post',
data
})
@@ -58,7 +58,7 @@ export function commit(data) {
export function checkVehicle(data) {
return request({
url: '/api/in/semiproductIn/checkVehicle',
url: '/api/out/semiproduct/checkVehicle',
method: 'post',
data
})
@@ -66,7 +66,7 @@ export function checkVehicle(data) {
export function confirmvehicle(data) {
return request({
url: '/api/in/semiproductIn/confirmvehicle',
url: '/api/out/semiproduct/confirmvehicle',
method: 'post',
data
})
@@ -74,7 +74,7 @@ export function confirmvehicle(data) {
export function getDisDtl(data) {
return request({
url: '/api/in/semiproductIn/getDisDtl',
url: '/api/out/semiproduct/getDisDtl',
method: 'post',
data
})
@@ -82,7 +82,7 @@ export function getDisDtl(data) {
export function divStruct(data) {
return request({
url: '/api/in/semiproductIn/divStruct',
url: '/api/out/semiproduct/divStruct',
method: 'post',
data
})
@@ -90,7 +90,7 @@ export function divStruct(data) {
export function unDivStruct(data) {
return request({
url: '/api/in/semiproductIn/unDivStruct',
url: '/api/out/semiproduct/unDivStruct',
method: 'post',
data
})
@@ -98,7 +98,7 @@ export function unDivStruct(data) {
export function divPoint(data) {
return request({
url: '/api/in/semiproductIn/divPoint',
url: '/api/out/semiproduct/divPoint',
method: 'post',
data
})
@@ -106,7 +106,7 @@ export function divPoint(data) {
export function bucketDtl(data) {
return request({
url: '/api/in/semiproductIn/bucketDtl',
url: '/api/out/semiproduct/bucketDtl',
method: 'post',
data
})
@@ -114,7 +114,7 @@ export function bucketDtl(data) {
export function updateTask(data) {
return request({
url: '/api/in/semiproductIn/updateTask',
url: '/api/out/semiproduct/updateTask',
method: 'post',
data
})
@@ -122,7 +122,7 @@ export function updateTask(data) {
export function confirmTask(data) {
return request({
url: '/api/in/semiproductIn/confirmTask',
url: '/api/out/semiproduct/confirmTask',
method: 'post',
data
})
@@ -130,7 +130,7 @@ export function confirmTask(data) {
export function confirm(data) {
return request({
url: '/api/in/semiproductIn/confirm',
url: '/api/out/semiproduct/confirm',
method: 'post',
data
})
@@ -138,7 +138,7 @@ export function confirm(data) {
export function delDis(data) {
return request({
url: '/api/in/semiproductIn/delDis',
url: '/api/out/semiproduct/delDis',
method: 'post',
data
})
@@ -146,7 +146,7 @@ export function delDis(data) {
export function queryBoxMater(data) {
return request({
url: '/api/in/semiproductIn/queryBoxMater',
url: '/api/out/semiproduct/queryBoxMater',
method: 'post',
data
})
@@ -161,7 +161,7 @@ export function queryStor() {
export function getDisTask(data) {
return request({
url: '/api/in/semiproductIn/getDisTask',
url: '/api/out/semiproduct/getDisTask',
method: 'post',
data
})