opt: 入库管理

This commit is contained in:
2025-05-23 09:53:40 +08:00
parent de9098f68a
commit c999737451
27 changed files with 4167 additions and 0 deletions

View File

@@ -0,0 +1,203 @@
<template>
<el-dialog
title="货位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="库区">
<el-cascader
v-model="defaultList"
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="货位">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@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>
<!--分页组件-->
<pagination />
<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, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudStructattr from '@/views/wms/basedata/structattr/structattr'
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
export default {
name: 'StructDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: '仓位',
optShow: {},
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
query: { search: '', is_lock: '1', lock_type: '', sect_id: '', stor_id: '' },
crudMethod: { ...crudStructattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object
},
storId: {
type: String,
default: String
},
layerNum: {
type: String,
default: String
}
},
data() {
return {
sects: [],
classes: [],
dialogVisible: false,
sect: {},
checkrow: {},
rows: [],
dialogDis: true,
lock: '',
defaultList: ['1582991156504039424', '1645705331612979200']
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
this.sect = newValue
}
}
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.dialogDis = msg
this.lock = '1'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.stor_id = this.storId
this.crud.query.layer_num = this.layerNum
this.query.lock_type = this.lock
if (this.storId === this.defaultList[0]) {
this.crud.query.sect_id = this.defaultList[1]
}
return true
},
open() {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
this.query.is_lock = '1'
this.query.lock_type = this.lock
this.query.is_used = '1'
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
this.crud.toQuery()
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选仓位')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)
}
}
}
</script>

View File

@@ -0,0 +1,349 @@
<template>
<el-dialog
:title="crud.status.title"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
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="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="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.view > 0"
@change="billTypeChange"
>
<el-option
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:disabled="item.value === '0003'"
: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"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.id"
: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="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>
<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="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="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-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="primary"
icon="el-icon-plus"
size="mini"
@click="insertEvent()"
>
添加箱号物料
</el-button>
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form.tableData"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip width="150" prop="pcsn" label="批次号" />
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip width="170" prop="plan_qty" label="数量" />
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" 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)"
/>
</template>
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" :open-param="opendtlParam" @tableChanged="tableChanged" />
</el-dialog>
</template>
<script>
import crudOperation from '@crud/CRUD.operation'
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/st/inbill/AddDtl'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
const defaultForm = {
bill_code: '',
stor_id: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
bill_type: '',
remark: '',
biz_date: new Date(),
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_INV_IN_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
dtlShow: false,
opendtlParam: null,
bill_btn: false,
mater_btn: false,
storlist: [],
billtypelist: [],
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() {
crudBsrealstorattr.getStor().then(res => {
this.storlist = res
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToAdd]() {
this.bill_btn = false
this.mater_btn = false
},
[CRUD.HOOK.afterToView]() {
this.bill_btn = true
this.mater_btn = true
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
},
billTypeChange(val) {
if (val === '000101') {
this.bill_btn = false
this.mater_btn = true
} else if (val === '000102') {
this.bill_btn = true
this.mater_btn = false
} else {
this.bill_btn = true
this.mater_btn = true
}
this.form.tableData = []
this.form.total_qty = 0
this.form.detail_count = 0
},
fun(val) {
return Number(val).toFixed(3)
},
async insertdtl() {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.form.tableData.push({ quality_scode: '01', is_active: '1', ivt_level: '01', plan_qty: '0' })
this.form.detail_count = this.form.tableData.length
},
deleteRow(index, rows) {
const pcsn = rows[index].pcsn
let len = rows.length
while (len--) {
const obj = rows[len]
if (pcsn === obj.pcsn) {
const index = rows.indexOf(obj)
if (index > -1) { // 移除找到的指定元素
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
}
}
}
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.pcsn === item.pcsn) {
same_mater = false
}
})
if (same_mater) {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
async insertEvent(row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.opendtlParam = {
optType: 'add'
}
this.dtlShow = true
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>

View File

@@ -0,0 +1,161 @@
<template>
<el-dialog
title="物料新增"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
<el-input
v-model="query.storagevehicle_code"
clearable
size="mini"
placeholder="载具编码"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.pcsn"
clearable
size="mini"
placeholder="批次号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.material_code"
clearable
size="mini"
placeholder="物料编码"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</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="150" prop="storagevehicle_code" label="载具编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
<el-table-column width="200" prop="pcsn" label="批次号" />
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
</el-table>
<!--分页组件-->
<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 crudRawAssist from '@/views/wms/st/inbill/rawassist'
const start = new Date()
export default {
name: 'AddDtl',
components: { crudOperation, rrOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
title: '用户',
url: '/api/in/rawAssist/getBillDtl',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
opendtlParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
rows: [],
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.bill_type = '000101'
return true
},
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
console.log('获取的rows:')
console.log(this.rows)
this.$emit('tableChanged', this.rows)
// crudRawAssist.queryBoxMater(this.rows).then(res => {
// this.rows = res
// this.$emit('tableChanged', this.rows)
// })
// this.form = this.$options.data().form
}
}
}
</script>

View File

@@ -0,0 +1,113 @@
<template>
<el-dialog
title="载具明细"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
>
<!--表格渲染-->
<el-table
ref="table2"
:data="this.bucketParam"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column prop="bucketunique" label="桶号" min-width="100" show-overflow-tooltip />
<el-table-column prop="label" label="桶类别" />
<el-table-column prop="material_code" label="物料编码" width="120px" />
<el-table-column prop="material_name" label="物料名称" min-width="120" />
<el-table-column prop="pcsn" label="批次" min-width="100" show-overflow-tooltip />
<el-table-column prop="storage_qty" label="数量">
<template slot-scope="scope">
{{ fun(scope.row.storage_qty) }}
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" />
<el-table-column prop="quality_scode" :formatter="qualityFormat" label="品质类型" />
<el-table-column prop="ivt_level" :formatter="ivtFormat" label="库存等级" />
<el-table-column prop="is_active" :formatter="activeFormat" label="是否可用" />
<el-table-column prop="storagevehicle_code" label="载具号" />
<el-table-column prop="record_order" label="顺序号" />
<el-table-column prop="bag_qty" label="袋数" />
</el-table>
<!--分页组件-->
<pagination />
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
export default {
name: 'BucketDtlDiv',
components: { crudOperation, pagination },
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
bucketParam: {
type: Array,
default: () => { return [] }
}
},
dicts: ['MD_BUCKET_TYPE', 'bucket_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'IS_OR_NOT'],
data() {
return {
sects: [],
classes: [],
dialogVisible: false,
checkrow: {},
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
[CRUD.HOOK.beforeRefresh]() {
return true
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.$emit('update:dialogShow', false)
},
qualityFormat(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
ivtFormat(row, column) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
activeFormat(row, column) {
return this.dict.label.IS_OR_NOT[row.is_active]
}
}
}
</script>

View File

@@ -0,0 +1,468 @@
<template>
<el-dialog
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
@open="open"
>
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">入库分配</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left">
<el-button
:loading="allDivBtn"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="allDivStruct()"
>
全部分配
</el-button>
</slot>
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span">入库明细项</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="dtl_table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:row-class-name="tableRowClassName"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.bill_status"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<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="plan_qty"
:formatter="crud.formatNum3"
label="重量"
align="center"
/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
</el-table>
</el-card>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="入库点" prop="point_code">
<el-select
v-model="form.point_code"
clearable
placeholder="请选择"
class="filter-item"
style="width: 200px;"
>
<el-option
v-for="item in pointlist"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code"
/>
</el-select>
</el-form-item>
</el-form>
</el-card>
<div class="crud-opts2">
<span class="role-span">载具物料明细</span>
<div class="crud-opts-form">
<el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="库区" prop="gender5">
<el-cascader
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item prop="checked">
<el-checkbox v-model="form.checked">自动分配货位</el-checkbox>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
:loading="divBtn"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="divStruct()"
>
分配货位
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="unDivStruct()"
>
取消分配
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-delete"
size="mini"
@click="divPoint()"
>
设置起点
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="dis_table"
:data="form.tableMater"
style="width: 100%;"
max-height="300"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<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="plan_qty"
:formatter="crud.formatNum3"
label="重量"
align="center"
/>
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
</el-table>
</el-card>
<StructDiv
ref="child"
:stor-id="storId"
:dialog-show.sync="structShow"
:sect-prop="sectProp"
@tableChanged="tableChanged"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
import StructDiv from '@/views/wms/pub/StructDialog'
import crudRawAssist, { allDivStruct } from '@/views/wms/st/inbill/rawassist'
import crudPoint from '@/views/wms/sch/point/schBasePoint'
import { getPointList } from '../../sch/point/schBasePoint'
export default {
name: 'DivDialog',
components: { StructDiv },
mixins: [crud()],
dicts: ['io_bill_status'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Array,
default: () => {
return []
}
},
billType: {
type: String,
default: null
},
storId: {
type: String,
default: null
}
},
data() {
return {
dialogVisible: false,
stor_id: '',
sect_id: '',
sectProp: null,
bucketProp: {},
structShow: false,
bucketObj: null,
divBtn: false,
allDivBtn: false,
bucketShow: false,
sects: [],
sect_val: null,
form: {
dtl_row: null,
storage_qty: '',
point_code: null,
checked: true,
tableMater: []
},
storlist: [],
pointlist: [],
rules: {}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
const area_type = 'NBJ01'
crudPoint.getPointList({ 'region_code': area_type }).then(res => {
this.pointlist = res
})
},
toDelete(data) {
data.pop = true
},
close() {
this.form.tableMater = []
this.form.dtl_row = null
this.sectProp = null
this.sects = []
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
this.crud.refresh()
this.$refs['form2'].resetFields()
},
clcikRow(row, column, event) {
this.form.dtl_row = row
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
this.openParam = res
this.form.dtl_row = res[row.index]
})
crudRawAssist.getDisDtl(row).then(res => {
this.form.tableMater = res
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
deleteRow(index, rows) {
// 如果桶状态不是生成调后台逻辑
if (rows[index].status !== '01') {
crudRawAssist.deleteDisDtl(rows[index]).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
})
rows[index].pop = false
}).catch(err => {
rows[index].pop = false
return
})
}
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) - parseFloat(rows[index].storage_qty)
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) + parseFloat(rows[index].storage_qty)
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
rows.splice(index, 1)
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.stor_id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.stor_id = ''
}
if (val.length === 2) {
this.stor_id = val[0]
this.sect_id = val[1]
}
},
tableChanged(row) {
// 新增一行物料时,给行进行赋值
for (let i = 0; i < this.form.tableMater.length; i++) {
this.form.tableMater[i].struct_code = row.struct_code
this.form.tableMater[i].sect_id = row.sect_id
this.form.tableMater[i].struct_id = row.struct_id
this.form.tableMater[i].struct_name = row.struct_name
this.form.tableMater[i].sect_code = row.sect_code
this.form.tableMater[i].sect_name = row.sect_name
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
}
crudRawAssist.divStruct(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
this.form.tableMater = []
})
},
divPoint() {
if (!this.form.point_code) {
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
return
}
debugger
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudRawAssist.divPoint(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('设置起点成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
allDivStruct() {
if (!this.sect_id) {
this.crud.notify('请先选择虚拟库区区域!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.allDivBtn = true
const data = {}
data.sect_id = this.sect_id
data.iostorinv_id = this.openParam[0].iostorinv_id
crudRawAssist.allDivStruct(data).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.openParam[0].bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
}).finally(() => {
this.allDivBtn = false
})
},
divStruct() {
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 如果勾选了,直接跳后台
if (this.form.checked) {
if (!this.sect_id) {
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.divBtn = true
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
crudRawAssist.divStruct(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.divBtn = false
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).finally(() => {
this.divBtn = false
})
} else {
this.structShow = true
this.$refs.child.getMsg(false)
}
},
doCancel(data) {
data.pop = false
},
unDivStruct() {
if (this.form.tableMater.length <= 0) {
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const flag = this.form.tableMater.some(mater => !mater.struct_code)
if (flag) {
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 如果勾选了,直接跳后台
crudRawAssist.unDivStruct(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,280 @@
<template>
<el-dialog
append-to-body
title="入库详情"
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" 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-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="true"
>
<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="true"
>
<el-option
v-for="item in dict.INANDOUT_BILL_TYPE"
: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"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.id"
: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="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>
<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="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="true" />
</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="true" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">入库明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<!-- <el-table-column min-width="120" show-overflow-tooltip prop="bill_code" label="单据号" align="center" />-->
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="pcsn" label="批次号" width="150" align="center" />
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />-->
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />-->
<!-- <el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />-->
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="pcsn" label="批次号" align="center" width="150" />
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />-->
<el-table-column prop="box_no" label="载具号" align="center" />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="next_point_code" label="起始位置" align="center" />
<el-table-column prop="struct_code" label="目的位置" align="center" />
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_type_name" label="任务类型" align="center" width="150px" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import rawassist from '@/views/wms/st/inbill/rawassist'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
export default {
name: 'ViewDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'INANDOUT_BILL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
tabledis: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
created() {
crudBsrealstorattr.getStor().then(res => {
this.storlist = res
})
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
// checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
// this.tableDtl = res
// })
rawassist.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,398 @@
<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="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-input
v-model="query.bill_code"
size="mini"
clearable
placeholder="单据号"
@keyup.enter.native="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="创建时间" prop="createTime">
<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.create_mode"
clearable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_CREATE_MODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</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.io_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_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="批次号">
<el-input
v-model="query.pcsn"
size="mini"
clearable
placeholder="批次号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="dis_flag"
icon="el-icon-position"
size="mini"
@click="divOpen"
>
分配
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="task_flag"
@click="confirm"
>
强制确认
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
size="mini"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column
v-permission="['admin','inbill:del','inbill:edit']"
label="操作"
width="115"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100px;" />
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式" />
<el-table-column label="明细数" align="center" prop="detail_count" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<!-- <el-table-column label="交货单" align="center" prop="vbeln" width="150px" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="制单人" align="center" prop="input_optname" width="100px;" />
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_optname" width="100px;" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_optname" width="140px" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig" @AddChanged="querytable" />
</div>
</template>
<script>
import rawAssist from '@/views/wms/st/inbill/rawassist'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
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 DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/st/inbill/AddDialog'
import DivDialog from '@/views/wms/st/inbill/DivDialog'
import ViewDialog from '@/views/wms/st/inbill/ViewDialog'
// import TaskDialog from '@/views/wms/st/inbill/TaskDialog'
import { mapGetters } from 'vuex'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
export default {
name: 'Rawassist',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
cruds() {
return CRUD({
title: '',
optShow: { add: true, reset: true },
idField: 'iostorinv_id',
url: '/api/in/rawAssist',
crudMethod: { ...rawAssist },
queryOnPresenterCreated: false
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_IN_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'inbill:add'],
edit: ['admin', 'inbill:edit'],
del: ['admin', 'inbill:del']
},
audit_flag: true,
dis_flag: true,
task_flag: true,
disShow: false,
viewShow: false,
mstrow: {},
divShow: false,
taskShow: false,
openParam: [],
billType: null,
bussConfig: null,
currentRow: null,
storlist: [],
createtypelist: [],
statuslist: [],
storId: null
}
},
computed: {
...mapGetters([
'user'
])
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudBsrealstorattr.getStor().then(res => {
this.storlist = res
})
this.initQuery()
},
methods: {
/* 搜索框创建时间默认最近一周*/
initQuery() {
const end = new Date()
const start = new Date()
const endYear = end.getFullYear()
var endMonth = end.getMonth() + 1
if (end.getMonth() + 1 < 10) {
endMonth = '0' + endMonth.toString()
}
var endDay = end.getDate()
if (end.getDate() < 10) {
endDay = '0' + endDay.toString()
}
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
const startYear = start.getFullYear()
var startMonth = start.getMonth() + 1
if (start.getMonth() + 1 < 10) {
startMonth = '0' + startMonth.toString()
}
var startDay = start.getDate()
if (start.getDate() < 10) {
startDay = '0' + startDay.toString()
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.$set(this.query, 'createTime', [startDate, endDate])
this.crud.toQuery()
},
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status !== '10'
},
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(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30' || currentRow.bill_status === '40') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (currentRow.bill_status === '30' || currentRow.bill_status === '40') {
this.task_flag = false
} else {
this.task_flag = true
}
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.dis_flag = true
this.task_flag = true
this.currentRow = {}
}
},
bill_typeFormat(row, column) {
return this.dict.label.ST_INV_IN_TYPE[row.bill_type]
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
confirm() {
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudRawAssist.confirm(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
stateFormat(row, column) {
return this.dict.label.io_bill_status[row.bill_status]
},
create_modeFormat(row, column) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
divOpen() {
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
this.storId = this.currentRow.stor_id
this.billType = this.currentRow.bill_type
this.divShow = true
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,189 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/in/rawAssist',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/in/rawAssist',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/in/rawAssist',
method: 'put',
data
})
}
export function getBillDtl(params) {
return request({
url: '/api/in/rawAssist/getBillDtl',
method: 'get',
params
})
}
export function getIODtl(params) {
return request({
url: '/api/in/rawAssist/getIODtl',
method: 'get',
params
})
}
export function insertDtl(data) {
return request({
url: '/api/in/rawAssist/insertDtl',
method: 'post',
data
})
}
export function commit(data) {
return request({
url: '/api/in/rawAssist/commit',
method: 'post',
data
})
}
export function checkVehicle(data) {
return request({
url: '/api/in/rawAssist/checkVehicle',
method: 'post',
data
})
}
export function deleteDisDtl(data) {
return request({
url: '/api/in/rawAssist/deleteDisDtl',
method: 'post',
data
})
}
export function getDisDtl(data) {
return request({
url: '/api/in/rawAssist/getDisDtl',
method: 'post',
data
})
}
export function divStruct(data) {
return request({
url: '/api/in/rawAssist/divStruct',
method: 'post',
data
})
}
export function allDivStruct(data) {
return request({
url: '/api/in/rawAssist/allDivStruct',
method: 'post',
data
})
}
export function unDivStruct(data) {
return request({
url: '/api/in/rawAssist/unDivStruct',
method: 'post',
data
})
}
export function divPoint(data) {
return request({
url: '/api/in/rawAssist/divPoint',
method: 'post',
data
})
}
export function queryTask(data) {
return request({
url: '/api/in/rawAssist/queryTask',
method: 'post',
data
})
}
export function bucketDtl(data) {
return request({
url: '/api/in/rawAssist/bucketDtl',
method: 'post',
data
})
}
export function updateTask(data) {
return request({
url: '/api/in/rawAssist/updateTask',
method: 'post',
data
})
}
export function delTask(data) {
return request({
url: '/api/in/rawAssist/delTask',
method: 'post',
data
})
}
export function reIssueTask(data) {
return request({
url: '/api/in/rawAssist/reIssueTask',
method: 'post',
data
})
}
export function confirmTask(data) {
return request({
url: '/api/in/rawAssist/confirmTask',
method: 'post',
data
})
}
export function cancelTask(data) {
return request({
url: '/api/in/rawAssist/cancelTask',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/in/rawAssist/confirm',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/in/rawAssist/backConfirm',
method: 'post',
data
})
}
export default { add, edit, del, insertDtl, getIODtl, commit, checkVehicle,
deleteDisDtl, getDisDtl, divStruct, allDivStruct, unDivStruct, divPoint,
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }

View File

@@ -0,0 +1,265 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/checkoutbill',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/checkoutbill/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/checkoutbill',
method: 'put',
data
})
}
export function getOutBillDtl(params) {
return request({
url: '/api/checkoutbill/getOutBillDtl',
method: 'get',
params
})
}
export function getOutBillDis(params) {
return request({
url: '/api/checkoutbill/getOutBillDis',
method: 'get',
params
})
}
export function getOutBillDis2(params) {
return request({
url: '/api/checkoutbill/getOutBillDis2',
method: 'get',
params
})
}
export function getOutBillDisDtl(params) {
return request({
url: '/api/checkoutbill/getOutBillDisDtl',
method: 'get',
params
})
}
export function getOutBillTask(params) {
return request({
url: '/api/checkoutbill/getOutBillTask',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/checkoutbill/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/checkoutbill/insertDtl',
method: 'post',
data
})
}
export function allDiv(data) {
return request({
url: '/api/checkoutbill/allDiv',
method: 'post',
data
})
}
export function allDivOne(data) {
return request({
url: '/api/checkoutbill/allDivOne',
method: 'post',
data
})
}
export function allCancel(data) {
return request({
url: '/api/checkoutbill/allCancel',
method: 'post',
data
})
}
export function oneCancel(data) {
return request({
url: '/api/checkoutbill/oneCancel',
method: 'post',
data
})
}
export function setPoint(data) {
return request({
url: '/api/checkoutbill/setPoint',
method: 'post',
data
})
}
export function oneSetPoint(data) {
return request({
url: '/api/checkoutbill/oneSetPoint',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/checkoutbill/getStructIvt',
method: 'get',
params
})
}
export function manualDiv(data) {
return request({
url: '/api/checkoutbill/manualDiv',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/checkoutbill/confirm',
method: 'post',
data
})
}
export function issueTask(data) {
return request({
url: '/api/checkoutbill/issueTask',
method: 'post',
data
})
}
export function finishTask(data) {
return request({
url: '/api/checkoutbill/finishTask',
method: 'post',
data
})
}
export function cancleTaskfinish(data) {
return request({
url: '/api/checkoutbill/cancleTaskfinish',
method: 'post',
data
})
}
export function paramByCodeType(data) {
return request({
url: '/api/checkoutbill/paramByCodeType',
method: 'post',
data
})
}
export function schAreaType(data) {
return request({
url: '/api/checkoutbill/schAreaType',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/checkoutbill/backConfirm',
method: 'post',
data
})
}
export function getType() {
return request({
url: '/api/checkoutbill/getType',
method: 'get'
})
}
export function moneySubmit(data) {
return request({
url: '/api/checkoutbill/moneySubmit',
method: 'post',
data
})
}
export function getDisNum(data) {
return request({
url: '/api/checkoutbill/getDisNum',
method: 'post',
data
})
}
export function queryBox(data) {
return request({
url: '/api/checkoutbill/queryBox',
method: 'post',
data
})
}
export function getOutBillTask2(data) {
return request({
url: '/api/checkoutbill/getOutBillTask2',
method: 'post',
data
})
}
export function cancelTask(data) {
return request({
url: '/api/checkoutbill/cancelTask',
method: 'post',
data
})
}
export function allSetPoint(data) {
return request({
url: '/api/checkoutbill/allSetPoint',
method: 'post',
data
})
}
export function oneSetPoint2(data) {
return request({
url: '/api/checkoutbill/oneSetPoint2',
method: 'post',
data
})
}
export function outReturn(data) {
return request({
url: '/api/checkoutbill/outReturn',
method: 'post',
data
})
}
export function updataIsOverdue(data) {
return request({
url: '/api/checkoutbill/updataIsOverdue',
method: 'post',
data
})
}
export function excelImport(data) {
return request({
url: '/api/checkoutbill/importExcel',
method: 'post',
data
})
}
export function saveUpdate(data) {
return request({
url: '/api/checkoutbill/saveUpdate',
method: 'post',
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, getOutBillDis2, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn, updataIsOverdue, excelImport, saveUpdate }