Browse Source

opt:报表查询优化,入库接口加创建时间字段

master
zds 3 months ago
parent
commit
0d470f77d8
  1. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java
  2. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/material/service/dao/Material.java
  3. 29
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml
  4. 166
      lms/nladmin-ui/src/views/wms/sch/material/MaterialDialog.vue
  5. 153
      lms/nladmin-ui/src/views/wms/sch/material/WorkOrderDialog.vue
  6. 258
      lms/nladmin-ui/src/views/wms/sch/material/index.vue
  7. 35
      lms/nladmin-ui/src/views/wms/sch/material/material.js
  8. 5
      lms/nladmin-ui/src/views/wms/sch/report/index.vue

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java

@ -77,6 +77,7 @@ public class MesController {
for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) {
material.copyFrom(QPMES060RequestBody);
material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
material.setCreate_time(DateUtil.now());
materialMapper.insert(material);
}
qpmes060ResponseBody.setMESSAGE("原材料入库成功");

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/material/service/dao/Material.java

@ -68,6 +68,8 @@ public class Material implements Serializable {
private String weightCoefficientValue;
@ApiModelProperty(value = "线径")
private String lineDiameter;
@ApiModelProperty(value = "操作时间")
private String create_time;
public void copyFrom(QPMES060RequestBody source){

29
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml

@ -3,22 +3,23 @@
<mapper namespace="org.nl.wms.sch.report.service.dao.mapper.ReportMapper">
<select id="queryReport" resultType="org.nl.wms.sch.report.service.dto.ReportDto">
SELECT
DISTINCT p.point_code as pointCode,
p.point_name as pointName,
p.region_code as regionCode,
p.region_name as regionName,
p.vehicle_code2 as subTray,
p.vehicle_code as motherTray,
m.productDescription,
m.supplierName,
m.ingotBatch
SELECT DISTINCT
p.point_code AS pointCode,
p.point_name AS pointName,
p.region_code AS regionCode,
p.region_name AS regionName,
p.vehicle_code2 AS subTray,
p.vehicle_code AS motherTray,
m.productDescription,
m.supplierName,
m.ingotBatch
FROM
sch_base_point p
LEFT JOIN sch_base_material m ON p.vehicle_code2 = m.PalletSN
sch_base_point p,
sch_base_material m
WHERE
vehicle_code2 IS NOT NULL
AND vehicle_code2 != ''
p.vehicle_code2 = m.PalletSN
AND vehicle_code2 IS NOT NULL
AND vehicle_code2 != ''
<if test="query.supplierName != null">
and m.supplierName like CONCAT('%', #{query.supplierName}, '%')
</if>

166
lms/nladmin-ui/src/views/wms/sch/material/MaterialDialog.vue

@ -1,166 +0,0 @@
<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-input
v-model="query.blurry"
clearable
size="mini"
placeholder="物料名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="是否启用">
<el-switch
v-model="query.is_used"
:active-value="true"
:inactive-value="false"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" width="160" />
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="140" />
<!-- <el-table-column prop="class_name" label="物料分类" width="140" />-->
<el-table-column prop="standing_time" label="回温时间(小时)" width="130px" />
<el-table-column prop="update_name" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
</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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'MaterialDialog',
components: { rrOperation, pagination },
dicts: ['is_used'],
cruds() {
return CRUD({
title: '生产任务',
url: 'api/mdBaseMaterial',
optShow: {},
query: {
is_used: true
}
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
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.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
//
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

153
lms/nladmin-ui/src/views/wms/sch/material/WorkOrderDialog.vue

@ -1,153 +0,0 @@
<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-input
v-model="query.workorder_code"
clearable
size="mini"
placeholder="工单编号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="workorder_code" label="工单编号" width="120px" />
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="workshop_code" label="所属车间" min-width="120" show-overflow-tooltip />
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
<el-table-column prop="update_name" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150" />
</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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'WorkOrderDialog',
components: { rrOperation, pagination },
dicts: ['is_used', 'vehicle_type'],
cruds() {
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorder', optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
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.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
//
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

258
lms/nladmin-ui/src/views/wms/sch/material/index.vue

@ -76,158 +76,6 @@
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
<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="115px" label-suffix=":">
<el-form-item label="母托盘编码">
<el-input v-model="form.vehicle_code" style="width: 240px;" />
</el-form-item>
<!--<el-form-item label="子托盘编码">
<el-input v-model="form.child_vehicle_code" style="width: 240px;" />
</el-form-item>-->
<!-- <el-form-item v-if="false" label="来源载具">
<el-input v-model="form.source_vehicle_code" style="width: 240px;" />
</el-form-item> -->
<el-form-item label="托盘类型">
<el-radio-group v-model="form.vehicle_type" style="width: 240px">
<el-radio label="1">子托盘</el-radio>
<el-radio label="0">母托盘</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="回温开始时间">
<el-date-picker
v-model="form.instorage_time"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 240px;"
placeholder="选择日期时间"
/>
</el-form-item>
<el-form-item label="点位编码">
<el-select
v-model="form.point_code"
filterable
placeholder="请选择"
style="width: 240px;"
@change="setPointName"
>
<el-option
v-for="item in pointList"
:key="item.point_code"
:label="item.point_code"
:value="item.point_code"
>
<span style="float: left">{{ item.point_name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.point_code }}</span>
</el-option>
</el-select>
<!-- <el-input v-model="form.point_code" style="width: 240px;" />-->
</el-form-item>
<el-form-item label="点位名称">
<el-input v-model="form.point_name" style="width: 240px;" disabled />
</el-form-item>
<el-form-item label="是否满托">
<el-radio-group v-model="form.is_full" style="width: 240px">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="批次">
<el-input v-model="form.pcsn" style="width: 240px;" />
</el-form-item>
<el-form-item label="静置时间(分钟)">
<el-input-number
v-model.number="form.standing_time"
:min="1"
:max="999"
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="物料数量">
<el-input-number
v-model.number="form.material_qty"
:min="0"
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="物料重量">
<el-input-number
v-model.number="form.material_weight"
:min="0"
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="工单编码">
<el-input v-model="form.workorder_code" style="width: 240px;" />
</el-form-item>
<el-form-item label="物料来源">
<el-radio-group v-model="choose" size="mini" style="width: 240px;">
<el-radio-button label="物料" />
<el-radio-button label="工单" />
</el-radio-group>
</el-form-item>
<el-form-item v-if="false" label="物料名称">
<el-input v-model="form.material_id" suffix-icon="el-icon-date" clearable style="width: 370px;" @focus="getMaterial" />
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form.material_name" clearable style="width: 240px;" @clear="clearMaterial" @focus="getMaterial" />
</el-form-item>
<el-form-item label="物料编码">
<el-input v-model="form.material_code" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="物料规格">
<el-input v-model="form.material_spec" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="组盘次数">
<el-input v-model="form.group_number" style="width: 240px;" />
</el-form-item>
<el-form-item label="任务编码">
<el-input v-model="form.task_code" style="width: 240px;" />
</el-form-item>
<!--<el-form-item label="车间编码">
<el-input v-model="form.workshop_code" style="width: 240px;" />
</el-form-item>-->
<el-form-item label="组盘状态">
<el-select
v-model="form.group_status"
size="mini"
placeholder="点位状态"
class="filter-item"
style="width: 240px;"
clearable
>
<el-option
v-for="item in dict.group_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="是否首个流程任务">
<el-input v-model="form.is_first_flow_task" style="width: 240px;" />
</el-form-item>-->
<el-form-item label="流程编码">
<el-input v-model="form.flow_code" style="width: 240px;" />
</el-form-item>
<el-form-item label="流程顺序">
<el-input v-model="form.flow_num" style="width: 240px;" />
</el-form-item>
<el-form-item label="上一任务">
<el-input v-model="form.before_task_code" style="width: 240px;" />
</el-form-item>
<el-form-item label="下一任务">
<el-input v-model="form.next_task_code" style="width: 240px;" />
</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: 480px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column prop="simtOrderNo" label="入库单号" :min-width="flexWidth('simtOrderNo',crud.data,'入库单号')" />
@ -252,69 +100,29 @@
{{ dict.label.group_bind_material_status[scope.row.group_bind_material_status] }}
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />
<WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged="tableChanged" />
</div>
</template>
<script>
import crudMaterial from './material'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
import WorkOrderDialog from '@/views/wms/sch/group/WorkOrderDialog.vue'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
const defaultForm = {
group_id: null,
vehicle_code: null,
vehicle_type: null,
material_id: null,
child_vehicle_code: null,
source_vehicle_code: null,
point_code: null,
point_name: null,
is_full: true,
pcsn: null,
instorage_time: null,
standing_time: null,
material_qty: null,
material_weight: null,
workorder_code: null,
group_number: null,
task_code: null,
ext_data: null,
workshop_code: null,
group_status: null,
table_name: null,
table_fk: null,
table_fk_id: null,
buss_move_id: null,
is_first_flow_task: true,
flow_code: null,
flow_num: null,
before_task_code: null,
next_task_code: null,
remark: null,
is_delete: false
}
export default {
name: 'Material',
dicts: ['group_status', 'group_bind_material_status', 'vehicle_type'],
components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['group_bind_material_status'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '组盘信息管理',
title: '原材料入库管理',
url: 'api/material',
idField: 'group_id',
sort: 'vehicle_code,desc',
@ -327,8 +135,7 @@ export default {
},
query: {
group_bind_material_status: '2'
},
crudMethod: { ...crudMaterial }
}
})
},
data() {
@ -337,65 +144,16 @@ export default {
},
rules: {
},
workShopList: [],
pointList: [],
regionList: [],
choose: '物料',
materialDialog: false,
workOrderDialog: false
choose: '物料'
}
},
created() {
this.getWorkShopList()
this.getPointList()
this.getRegionList()
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
},
getWorkShopList() { //
crudMdBaseWorkShop.getWorkShopList().then(res => {
this.workShopList = res
})
},
getRegionList() {
crudSchBaseRegion.getRegionList().then(res => {
this.regionList = res
})
},
getMaterial() {
if (this.choose === '物料') {
this.materialDialog = true
} else {
this.workOrderDialog = true
}
},
getPointList() { //
crudSchBasePoint.getPointList().then(res => {
this.pointList = res
})
},
tableChanged(row) {
this.form.material_name = row.material_name
this.form.material_id = row.material_id
this.form.material_spec = row.material_spec
this.form.material_code = row.material_code
if (this.choose === '工单') {
this.form.workorder_code = row.workorder_code
}
},
clearMaterial() {
this.form.material_name = null
this.form.material_id = null
this.form.material_spec = null
this.form.material_code = null
},
setPointName(data) {
var point = this.pointList.find(item => item.point_code === data)
this.form.point_name = point.point_name
},
hand(value) {
this.crud.toQuery()
}

35
lms/nladmin-ui/src/views/wms/sch/material/material.js

@ -1,35 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/material',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/material/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/material',
method: 'put',
data
})
}
export function getGroup(data) {
return request({
url: 'api/material/getGroup',
method: 'post',
data
})
}
export default { add, edit, del, getGroup }

5
lms/nladmin-ui/src/views/wms/sch/report/index.vue

@ -120,12 +120,11 @@
<script>
import crudMaterial from './report'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
@ -135,7 +134,7 @@ export default {
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '组盘信息管理',
title: '统计报表',
url: 'api/report',
idField: 'group_id',
sort: 'pointCode,desc',

Loading…
Cancel
Save