This commit is contained in:
2022-11-27 11:18:19 +08:00
parent 48f42dd3c4
commit 5e8cc534dc
19 changed files with 1663 additions and 42 deletions

View File

@@ -323,9 +323,20 @@ export default {
this.form.detail_count = this.form.tableData.length
},
deleteRow(index, rows) {
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
debugger
const package_box_sn = rows[index].package_box_sn
let len = rows.length
while (len--) {
const obj = rows[len]
if (package_box_sn === obj.package_box_sn) {
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) {
debugger
@@ -341,7 +352,6 @@ export default {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = item.need_qty
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}

View File

@@ -63,7 +63,7 @@
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip width="200" prop="sale_order_name" label="订单号" />
<el-table-column show-overflow-tooltip width="150" prop="customer_name" label="客户编号" />
<el-table-column prop="customer_name" label="客户名称" />
<el-table-column width="200" prop="customer_description" label="客户名称" />
<el-table-column show-overflow-tooltip prop="package_box_sn" width="250" label="箱号" />
<el-table-column show-overflow-tooltip width="100" prop="quanlity_in_box" label="箱内子卷数" />
<el-table-column show-overflow-tooltip width="150" prop="container_name" label="子卷号" />
@@ -90,6 +90,7 @@ 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 {
@@ -162,8 +163,11 @@ export default {
debugger
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
crudRawAssist.queryBoxMater(this.rows).then(res => {
this.rows = res
this.$emit('tableChanged', this.rows)
})
// this.form = this.$options.data().form
this.$emit('tableChanged', this.rows)
}
}
}

View File

@@ -136,14 +136,12 @@
<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" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="bucket_num" label="桶数" :formatter="crud.formatNum0" align="center" />
<el-table-column prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" 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="start_point_code" label="起始位置" align="center" />
<el-table-column prop="next_point_code" label="目的位置" align="center" />
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
</el-table>
</el-card>
</el-dialog>

View File

@@ -182,7 +182,7 @@
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单编码">
<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>

View File

@@ -192,6 +192,22 @@ export function backConfirm(data) {
})
}
export function delDis(data) {
return request({
url: '/api/in/rawAssist/delDis',
method: 'post',
data
})
}
export function queryBoxMater(data) {
return request({
url: '/api/in/rawAssist/queryBoxMater',
method: 'post',
data
})
}
export default { add, edit, del, getType, getBillDtl, insertDtl, getIODtl, commit, checkVehicle,
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint,
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }

View File

@@ -0,0 +1,209 @@
<template>
<el-dialog
append-to-body
title="出入库详情"
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</el-col>
</el-row>
<div class="crud-opts2">
<span class="role-span">出入库明细</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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" />
<el-table-column show-overflow-tooltip prop="seq_no" 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" label="重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配重量" :formatter="crud.formatNum3" align="center" />
<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-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" 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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘号" align="center" />
<el-table-column show-overflow-tooltip prop="bucketunique" 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="real_qty" label="出入库重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" align="center" />
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="point_code" label="出入库点" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
export default {
name: 'DivDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'is_usable'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
mstrow: {},
tabledis: [],
currentRow: {},
invtypelist: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue) {
this.mstrow = newValue
}
}
},
created() {
checkoutbill.getInvTypes().then(res => {
this.invtypelist = res
})
},
methods: {
close() {
this.currentRow = null
this.tableDtl = []
this.tabledis = []
this.$emit('DivChanged')
this.$emit('update:dialogShow', false)
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
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]
},
invtypeFormat(row) {
for (const item of this.invtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.currentRow = current
this.tabledis = []
this.getOutBillDisDtl(current.iostorinvdtl_id)
} else {
this.mstrow.iostorinvdtl_id = ''
this.currentRow = {}
this.tabledis = []
}
},
queryTableDtl() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
getOutBillDisDtl(iostorinvdtl_id) {
checkoutbill.getOutBillDisDtl({ 'iostorinvdtl_id': 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,221 @@
<template>
<el-dialog
append-to-body
title="出入库单指令"
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid #ffffff">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</el-col>
</el-row>
<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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column show-overflow-tooltip prop="bill_code" label="出库单号" align="center" />
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" 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="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="start_point_code" label="起始位置" align="center" :formatter="start_point_codeFormat" />
<el-table-column show-overflow-tooltip prop="point_code" label="目的位置" align="center" :formatter="point_codeFormat" />
<el-table-column prop="work_status" label="任务状态" align="center" width="110px" :formatter="work_statusFormat" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" 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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<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="storagevehicle_code" label="载具号" align="center" />
<el-table-column show-overflow-tooltip prop="bucket_num" label="桶数" align="center" />
<el-table-column show-overflow-tooltip prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="start_point_code" label="起始位置" align="center" />
<el-table-column show-overflow-tooltip prop="next_point_code" label="目的位置" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
export default {
name: 'TaskDialog',
components: { },
mixins: [crud()],
dicts: ['work_status', 'task_status', 'io_bill_status', 'SCH_TASK_TYPE_DTL'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
mstrow: {},
tabledis: [],
currentdtl: null,
currentDis: {},
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue) {
this.mstrow = newValue
}
}
},
methods: {
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]
},
start_point_codeFormat(row) {
if(row.io_type==='1'){
return row.start_point_code
}else if(row.io_type==='0'){
return row.point_code
}
},
point_codeFormat(row) {
if(row.io_type==='1'){
return row.point_code
}else if(row.io_type==='0'){
return row.start_point_code
}
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
this.tableDtl = []
checkoutbill.getOutBillDis({ 'iostorinv_id': this.mstrow.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,386 @@
<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-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.io_type"
clearable
size="mini"
placeholder="出入类型"
class="filter-item"
@change="ioTypeChange"
>
<el-option
v-for="item in dict.io_type"
: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 billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</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-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.is_upload"
clearable
size="mini"
placeholder="是否回传"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.is_upload"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_code"
size="mini"
clearable
placeholder="物料编码或名称模糊查询"
@keyup.enter.native="crud.toQuery"
/>
</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>
<el-form-item label="品质类型">
<el-select
v-model="query.quality_scode"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_QUALITY_SCODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</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>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="dis_flag"
@click="divOpen"
>
单据明细
</el-button>
<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"
size="mini"
:data="crud.data"
:max-height="590"
style="width: 100%;"
:highlight-current-row="true"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="订单编码" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="100" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column prop="io_type" label="出入库类型" :formatter="ioFormat" min-width="100" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" min-width="120" label="业务类型" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
<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="input_optname" />
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_optname" />
<el-table-column label="修改时间" align="center" prop="update_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-column label="回传人" align="center" prop="upload_optname" width="150" />
<el-table-column label="回传时间" align="center" prop="upload_time" width="150" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
</div>
</template>
<script>
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
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 DivDialog from '@/views/wms/statistics/ioStorQuery/DivDialog'
import TaskDialog from '@/views/wms/statistics/ioStorQuery/TaskDialog'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudRawAssist from '@/api/wms/st/core/inbill/rawassist'
export default {
name: 'IoStorQuery',
components: { crudOperation, rrOperation, pagination, TaskDialog, DivDialog },
cruds() {
return CRUD({ title: '出入库单报表',
props: {
// 每页数据条数
size: 20
},idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['ST_QUALITY_SCODE', 'io_bill_status', 'ST_CREATE_MODE', 'io_type', 'is_upload'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
},
divShow: false,
taskShow: false,
dis_flag: true,
work_flag: true,
openParam: [],
mstrow: {},
currentRow: null,
checkrows: [],
storlist: [],
billtypelist: []
}
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
checkoutbill.getType().then(res => {
this.billtypelist = res
})
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.handleCurrentChange(null)
},
fun(val) {
return Number(val).toFixed(3)
},
ioFormat(row, column) {
return this.dict.label.io_type[row.io_type]
},
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
this.dis_flag = false
this.work_flag = false
}
},
ioTypeChange(value) {
if (value === '1') {
crudRawAssist.getType({ 'io_code': '', 'io_flag': '01' }).then(res => {
this.billtypelist = res
})
} else if (value === '0') {
crudRawAssist.getType({ 'io_code': '', 'io_flag': '00' }).then(res => {
this.billtypelist = res
})
} else {
checkoutbill.getType().then(res => {
this.billtypelist = res
})
}
this.crud.toQuery()
},
stateFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
bill_typeFormat(row) {
for (const item of this.billtypelist) {
if (item.code === row.bill_type) {
return item.name
}
}
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
handleCurrentChange(current) {
if (current === null) {
this.dis_flag = true
this.work_flag = true
this.currentRow = {}
}
},
divOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.divShow = true
this.mstrow = this.currentRow
})
},
taskOpen() {
checkoutbill.getOutBillDis({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.taskShow = true
this.mstrow = this.currentRow
})
},
querytable() {
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,34 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/iostordaily',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/iostordaily/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/iostordaily',
method: 'put',
data
})
}
export function getStor() {
return request({
url: 'api/iostordaily/getStor',
method: 'get'
})
}
export default { add, edit, del, getStor }

View File

@@ -0,0 +1,344 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
size="mini"
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="仓库">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-select
v-model="query.stor_id"
clearable
style="width: 220px;"
size="mini"
placeholder="请选择"
class="filter-item"
@change="hand"
>
<el-option
v-for="item in this.storList"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="日期">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
style="width: 220px"
v-model="query.material_code"
clearable
placeholder="物料编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="批次">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input
style="width: 220px"
v-model="query.pcsn"
clearable
placeholder="请输入批次"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料类别">
<treeselect
v-model="query.material_type_id"
:load-options="loadClass"
:options="classes"
style="width: 220px;"
placeholder="请选择"
/>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"/>
<!--表格渲染-->
<el-table ref="table" :cell-style="cellStyleMst" show-summary :summary-method="getSum" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column prop="stor_name" label="仓库"/>
<el-table-column prop="class_code" label="物料分类编码" width="100px" />
<el-table-column prop="class_name" label="物料分类名称" width="100px" />
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip/>
<el-table-column prop="material_model" label="型号/牌号" min-width="150" show-overflow-tooltip/>
<el-table-column prop="unit_name" label="主单位"/>
<el-table-column prop="pcsn" label="批次号" min-width="120" show-overflow-tooltip/>
<el-table-column prop="dept_name" label="所属组织" min-width="120" show-overflow-tooltip/>
<!-- <el-table-column prop="quality_scode" label="品质类型" :formatter="formatQualityName" />-->
<el-table-column prop="ivt_level" label="质量等级" :formatter="formatIvtName" />
<!-- <el-table-column prop="is_active" label="是否可用" :formatter="formatIsName" />-->
<el-table-column prop="start_num" label="期初主数量" :formatter="crud.formatNum3" width="100px" />
<el-table-column prop="in_num" label="入库主数量" :formatter="crud.formatNum3" width="100px" />
<el-table-column prop="out_num" label="出库主数量" :formatter="crud.formatNum3" width="100px" />
<!-- <el-table-column prop="less_num" label="其他出" :formatter="crud.formatNum3"/>-->
<!-- <el-table-column prop="more_num" label="其他入" :formatter="crud.formatNum3"/>-->
<el-table-column prop="end_num" label="结存主数量" :formatter="crud.formatNum3" width="100px" />
</el-table>
<!--分页组件-->
<pagination/>
</div>
</div>
</template>
<script>
import crudIostordaily from '@/api/wms/statistics/iostordaily'
import CRUD, {crud, form, 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'
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
import crudBucketrecord from "@/api/wms/basedata/master/bucketrecord";
const defaultForm = {
stordaily_id: null,
stor_id: null,
stor_code: null,
stor_name: null,
sect_date: null,
material_id: null,
quality_scode: null,
pcsn: null,
ivt_level: null,
is_active: null,
start_num: null,
in_num: null,
out_num: null,
more_num: null,
less_num: null,
end_num: null,
qty_unit_id: null,
qty_unit_name: null
}
export default {
name: 'SendReceiveQuery',
components: {pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect},
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '收发存查询',
url: 'api/iostordaily',
idField: 'stordaily_id',
sort: '',
crudMethod: {...crudIostordaily},
props: {
// 每页数据条数
size: 20
},
optShow: {
add: false,
edit: false,
del: false,
download: false,
reset: true
}
})
},
data() {
return {
permission: {},
classes: [],
QualityList: [],
IvtList: [],
class_idStr: null,
storList: []
}
},
created() {
crudIostordaily.getStor().then(res => {
this.storList = res
})
const param = {
'materOpt_code': '00'
}
crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = res.class_idStr
this.queryClassId()
})
crudBucketrecord.getQualityList().then(res => {
this.QualityList = res
})
crudBucketrecord.getIvtList().then(res => {
this.IvtList = res
})
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
queryClassId() {
const param = {
'class_idStr': this.class_idStr
}
crudClassstandard.queryClassById(param).then(res => {
this.classes = res.content.map(obj => {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
loadClass({ action, parentNode, callback}) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({pid: parentNode.id}).then(res => {
parentNode.children = res.content.map(function (obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
},
hand(value) {
this.crud.toQuery()
},
formatIvtName(row, column) {
for (const item of this.IvtList) {
if (item.code === row.ivt_level) {
return item.name
}
}
},
formatQualityName(row, column) {
for (const item of this.QualityList) {
if (item.code === row.quality_scode) {
return item.name
}
}
},
formatIsName(row, column) {
if (row.is_active === '1') {
return '是'
} else if (row.is_active === '0') {
return '否'
}
},
getSum(param) {
// 将所有number的字段合计
const {columns, data} = param
const sums = []
let values = []
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = '合计'
return
}
values = data.map(item => Number(item[column.property]))
if (column.property === 'start_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else if (column.property === 'in_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else if (column.property === 'out_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else if (column.property === 'end_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else if (column.property === 'more_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else if (column.property === 'less_num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
} else {
sums[index] = '--'
}
})
return sums
},
cellStyleMst({ row, column, rowIndex, columnIndex }) {
if (column.property === 'dept_name') {
if (row.is_yellow !== undefined) {
return 'background: yellow'
}
}
}
}
}
</script>
<style scoped>
</style>