add:统计分析

This commit is contained in:
zhangzhiqiang
2023-10-08 10:22:18 +08:00
parent d20e5f8282
commit 418b40f683
18 changed files with 1566 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package org.nl.wms.analysis_manage.workTask.controller;
/*
* @author ZZQ
* @Date 2023/10/7 10:07
*/
import lombok.extern.slf4j.Slf4j;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
import org.nl.wms.product_manage.service.workorder.IPdmProduceWorkorderService;
import org.nl.wms.product_manage.service.workorder.dto.WorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/workingGood")
@Slf4j
public class WorkTaskController {
@Autowired
private IPdmProduceWorkorderService iPdmProduceWorkorderService;
@GetMapping
@Log("查询工单管理")
//("查询工单管理")
public ResponseEntity<Object> query(WorkorderQuery query, PageQuery page) {
return new ResponseEntity<>(iPdmProduceWorkorderService.queryAll(query, page), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,62 @@
package org.nl.wms.analysis_manage.workingGoods.controller;
/*
* @author ZZQ
* @Date 2023/10/7 10:07
*/
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.TableDataInfo;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
import org.nl.wms.product_manage.service.processroute.dto.ProcessrouteQuery;
import org.nl.wms.product_manage.service.workorder.IPdmProduceWorkorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/workinggood")
@Slf4j
public class WorkingGoodController {
@Autowired
private IPdmProduceWorkorderService workorderService;
@GetMapping("/byMaterial")
@Log("根据物料查询在制品")
public ResponseEntity<Object> byMaterial(ByProcessQuery query,PageQuery page) {
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
List<Map> list = workorderService.goodAnilysis(query);
TableDataInfo build = TableDataInfo.build(list);
build.setTotalElements(result.getTotal());
return new ResponseEntity<>(build, HttpStatus.OK);
}
@GetMapping("/byworkprocess")
@Log("根据工序查询在制品")
public ResponseEntity<Object> byworkprocess(ByProcessQuery json,PageQuery page) {
//workorderService.getDtl(json),
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/processDtl")
@Log("工序编码在制品详情")
public ResponseEntity<Object> processDtl(ByProcessQuery json,PageQuery page) {
//workorderService.getDtl(json),
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,23 @@
package org.nl.wms.analysis_manage.workingGoods.service.dto;
/*
* @author ZZQ
* @Date 2023/10/7 10:11
*/
public class ByMaterialQuery {
public void sdfds(){
System.out.println(this.getClass().getName()+"调用方法");
}
@Override
protected void finalize() throws Throwable {
System.out.println("对象被释放");
}
}
class demo{
public static void main(String[] args) {
ByMaterialQuery query = new ByMaterialQuery();
query.sdfds();
}
}

View File

@@ -0,0 +1,44 @@
package org.nl.wms.analysis_manage.workingGoods.service.dto;
import lombok.Data;
/*
* @author ZZQ
* @Date 2023/10/7 10:11
*/
public class ByProcessQuery {
private String product_area;
private String blurry;
private String[] create_time;
private String start_time;
private String end_time;
public String getProduct_area() {
return product_area;
}
public void setProduct_area(String product_area) {
this.product_area = product_area;
}
public String getBlurry() {
return blurry;
}
public void setBlurry(String blurry) {
this.blurry = blurry;
}
public String[] getCreate_time() {
return create_time;
}
public void setCreate_time(String[] create_time) {
this.create_time = create_time;
if (create_time!=null && create_time.length == 2){
this.start_time = create_time[0];
this.end_time = create_time[1];
}
}
}

View File

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
import org.nl.wms.product_manage.service.workorder.dao.PdmProduceWorkorder;
import org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto;
import org.nl.wms.product_manage.service.workorder.dto.ReportQuery;
@@ -154,6 +155,8 @@ public interface IPdmProduceWorkorderService extends IService<PdmProduceWorkorde
List<Map> reportQuery(ReportQuery query);
List<Map> goodAnilysis(ByProcessQuery query);
void download(Map map, HttpServletResponse response)
throws IOException;
}

View File

@@ -3,6 +3,7 @@ package org.nl.wms.product_manage.service.workorder.dao.mapper;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
import org.nl.wms.product_manage.service.workorder.dao.PdmProduceWorkorder;
import org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto;
import org.nl.wms.product_manage.service.workorder.dto.WorkorderQuery;
@@ -39,4 +40,11 @@ public interface PdmProduceWorkorderMapper extends BaseMapper<PdmProduceWorkorde
*/
void insertBatch(@Param("entities") List<PdmProduceWorkorder> entities);
/**
* 在制品分析
* @param query
* @return
*/
List<Map> goodAnalysis(ByProcessQuery query);
}

View File

@@ -228,5 +228,47 @@
</foreach>
</insert>
<select id="goodAnalysis" resultType="java.util.Map">
SELECT
sum( pdm_produce_workorder.real_qty ) real_qty,
sum( pdm_produce_workorder.dq_real_qty ) dq_real_qty,
sum( pdm_produce_workorder.nok_qty ) nok_qty,
md_me_materialbase.material_name,
md_me_materialbase.material_spec,
sum( pdm_produce_workorder.real_qty )*rate_qty*1000 as rate_weight,
sum( pdm_produce_workorder.real_qty )*md_me_materialbase.net_weight as product_weight,
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.real_qty )*md_me_materialbase.net_weight/(sum( pdm_produce_workorder.real_qty )*rate_qty*1000),1) as yield_rate,
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.nok_qty )/sum(pdm_produce_workorder.real_qty ),0) as nok_rate,
if(sum(pdm_produce_workorder.real_qty )>0,1-sum( pdm_produce_workorder.nok_qty )/sum(pdm_produce_workorder.real_qty ),1) as endproduct_rate,
MD_ME_SemiRealRawMaterial.raw_material_code,
pdm_bi_workprocedure.workprocedure_name,
md_me_materialbase.material_code
FROM
pdm_produce_workorder
LEFT JOIN pdm_bi_workprocedure ON pdm_produce_workorder.workprocedure_id = pdm_bi_workprocedure.workprocedure_id
LEFT JOIN md_me_materialbase ON pdm_produce_workorder.material_id = md_me_materialbase.material_id
LEFT JOIN MD_ME_SemiRealRawMaterial ON pdm_produce_workorder.material_id = MD_ME_SemiRealRawMaterial.semi_material_id
WHERE
pdm_bi_workprocedure.is_first = '1'
AND md_me_materialbase.material_code IS NOT NULL
<if test="start_time != null and start_time != ''">
and pdm_produce_workorder.create_time >= #{start_time}
</if>
<if test="product_area != null and product_area != ''">
and pdm_produce_workorder.product_area >= #{product_area}
</if>
<if test="start_time != null and start_time != ''">
and #{end_time} >= pdm_produce_workorder.create_time
</if>
<if test="blurry != null and blurry != ''">
and (
md_me_materialbase.material_code like '%${blurry}%' or
md_me_materialbase.material_spec like '%${blurry}%' )
</if>
GROUP BY
md_me_materialbase.material_code,
pdm_bi_workprocedure.workprocedure_name
</select>
</mapper>

View File

@@ -28,6 +28,7 @@ import org.nl.common.utils.api.RestBusinessTemplate;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.FileUtil;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
import org.nl.wms.ext_manage.acs.service.WmsToAcsService;
import org.nl.wms.masterdata_manage.master.service.classstandard.IMdPbClassstandardService;
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
@@ -870,4 +871,9 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
public List<PdmProduceWorkorderDto> getOrderByDevLimit(Map<String,String> param) {
return this.baseMapper.orderListByDevLimit(param);
}
@Override
public List<Map> goodAnilysis(ByProcessQuery query) {
return this.baseMapper.goodAnalysis(query);
}
}

View File

@@ -0,0 +1 @@
INSERT INTO `hl_one_mes`.`sys_menu`(`menu_id`, `pid`, `sub_count`, `type`, `title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_name`, `update_name`, `create_time`, `update_time`, `is_pc`, `system_type`, `create_id`, `category`, `update_id`) VALUES ('1710496480147673088', '1710494665352024064', 0, 2, '在制品分析', NULL, 'wms/analysis_manage/workingGoods/indexByMaterial', 999, 'chart', 'workgoodbymaterial', 0, b'0', b'0', NULL, NULL, NULL, '2021-11-04 15:35:31', NULL, 1, '1', 1, NULL, NULL);

View File

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

View File

@@ -0,0 +1,242 @@
<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-cascader
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
class="filter-item"
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.blurry"
clearable
size="mini"
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="warning"
icon="el-icon-check"
size="mini"
@click="sync"
>
同步
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="warning"-->
<!-- icon="el-icon-check"-->
<!-- size="mini"-->
<!-- :disabled="confirm_flag"-->
<!-- @click="sync"-->
<!-- >-->
<!-- 导出-->
<!-- </el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<!--
<el-table-column type="selection" width="55" />
-->
<el-table-column prop="stor_name" label="所属仓库" width="120" show-overflow-tooltip />
<el-table-column prop="sect_name" label="所属库区" width="120" show-overflow-tooltip />
<el-table-column prop="struct_code" label="所属仓位" width="120" />
<el-table-column prop="material_code" label="物料编码" width="150" />
<el-table-column prop="material_spec" label="物料规格" width="150" />
<el-table-column prop="material_id" label="物料id" width="150" />
<el-table-column prop="canuse_qty" label="可用总数" width="150" />
<el-table-column prop="ivt_qty" label="库存总数" width="150" />
<el-table-column prop="frozen_qty" label="冻结总数" width="150" />
<el-table-column prop="warehousing_qty" label="待入总数" width="150" />
<el-table-column prop="qty_unit_id" label="单位" width="150" :formatter="formatUnit" />
<el-table-column prop="create_time" label="统计日期" width="150" fixed="right" align="center" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import dailyStructivt from '@/views/wms/masterdata_manage/st/dailyStructivt/dailyStructivt'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import rrOperation from '@crud/RR.operation'
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
import { downloadFile } from '@/utils'
const defaultForm = {
struct_id: null,
cascader: null,
struct_code: null,
struct_name: null,
simple_name: null,
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
material_code: null,
stor_code: null,
stor_name: null,
stor_type: null,
capacity: null,
width: null,
height: null,
zdepth: null,
weight: null,
xqty: null,
yqty: null,
zqty: null,
is_tempstruct: '0',
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
back_ground_color: null,
front_ground_color: null,
back_ground_pic: null,
font_direction_scode: null,
is_used: true,
is_zdepth: null,
storagevehicle_id: null,
storagevehicle_code: null,
storagevehicle_type: null,
is_emptyvehicle: null,
storagevehicle_qty: null,
lock_type: null,
material_height_type: null,
ext_id: null,
remark: null
}
export default {
name: 'Structattr',
dicts: ['ST_INV_BCP_IN_TYPE'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: false, reset: true },
url: 'api/structivtDaily',
idField: 'id',
crudMethod: { ...dailyStructivt }
})
},
data() {
const numberOne = (rule, value, callback) => {
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
const numRe = new RegExp(numReg)
if (value) {
if (!numRe.test(value)) {
callback(new Error('只能输入数字'))
} else {
callback()
}
} else {
callback()
}
}
return {
measure_unit: [],
sects: [],
downloadLoading: false,
permission: {
add: ['admin', 'dept:add'],
edit: ['admin', 'dept:edit'],
del: ['admin', 'dept:del']
},
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
crudMdPbMeasureunit.getSelect().then(res => {
this.measure_unit = res.content
})
},
methods: {
sync() {
dailyStructivt.sync(Array.of('st_ivt_structivt_bcp', 'st_ivt_structivt_cp', 'st_ivt_structivt_yl')).then(result => {
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => { })
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
},
beforeInit() {
return true
},
sectChange(val) {
this.form.sect_id = val[1]
},
formatUnit(row, column) {
const values = this.measure_unit.filter(v => {
return v.value === row.qty_unit_id
})
return values[0].label
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>

View File

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

View File

@@ -0,0 +1,242 @@
<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-cascader
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
class="filter-item"
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.blurry"
clearable
size="mini"
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="warning"
icon="el-icon-check"
size="mini"
@click="sync"
>
同步
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="warning"-->
<!-- icon="el-icon-check"-->
<!-- size="mini"-->
<!-- :disabled="confirm_flag"-->
<!-- @click="sync"-->
<!-- >-->
<!-- 导出-->
<!-- </el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<!--
<el-table-column type="selection" width="55" />
-->
<el-table-column prop="stor_name" label="所属仓库" width="120" show-overflow-tooltip />
<el-table-column prop="sect_name" label="所属库区" width="120" show-overflow-tooltip />
<el-table-column prop="struct_code" label="所属仓位" width="120" />
<el-table-column prop="material_code" label="物料编码" width="150" />
<el-table-column prop="material_spec" label="物料规格" width="150" />
<el-table-column prop="material_id" label="物料id" width="150" />
<el-table-column prop="canuse_qty" label="可用总数" width="150" />
<el-table-column prop="ivt_qty" label="库存总数" width="150" />
<el-table-column prop="frozen_qty" label="冻结总数" width="150" />
<el-table-column prop="warehousing_qty" label="待入总数" width="150" />
<el-table-column prop="qty_unit_id" label="单位" width="150" :formatter="formatUnit" />
<el-table-column prop="create_time" label="统计日期" width="150" fixed="right" align="center" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import dailyStructivt from '@/views/wms/masterdata_manage/st/dailyStructivt/dailyStructivt'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import rrOperation from '@crud/RR.operation'
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
import { downloadFile } from '@/utils'
const defaultForm = {
struct_id: null,
cascader: null,
struct_code: null,
struct_name: null,
simple_name: null,
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
material_code: null,
stor_code: null,
stor_name: null,
stor_type: null,
capacity: null,
width: null,
height: null,
zdepth: null,
weight: null,
xqty: null,
yqty: null,
zqty: null,
is_tempstruct: '0',
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
back_ground_color: null,
front_ground_color: null,
back_ground_pic: null,
font_direction_scode: null,
is_used: true,
is_zdepth: null,
storagevehicle_id: null,
storagevehicle_code: null,
storagevehicle_type: null,
is_emptyvehicle: null,
storagevehicle_qty: null,
lock_type: null,
material_height_type: null,
ext_id: null,
remark: null
}
export default {
name: 'Structattr',
dicts: ['ST_INV_BCP_IN_TYPE'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: false, reset: true },
url: 'api/structivtDaily',
idField: 'id',
crudMethod: { ...dailyStructivt }
})
},
data() {
const numberOne = (rule, value, callback) => {
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
const numRe = new RegExp(numReg)
if (value) {
if (!numRe.test(value)) {
callback(new Error('只能输入数字'))
} else {
callback()
}
} else {
callback()
}
}
return {
measure_unit: [],
sects: [],
downloadLoading: false,
permission: {
add: ['admin', 'dept:add'],
edit: ['admin', 'dept:edit'],
del: ['admin', 'dept:del']
},
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
crudMdPbMeasureunit.getSelect().then(res => {
this.measure_unit = res.content
})
},
methods: {
sync() {
dailyStructivt.sync(Array.of('st_ivt_structivt_bcp', 'st_ivt_structivt_cp', 'st_ivt_structivt_yl')).then(result => {
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => { })
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
},
beforeInit() {
return true
},
sectChange(val) {
this.form.sect_id = val[1]
},
formatUnit(row, column) {
const values = this.measure_unit.filter(v => {
return v.value === row.qty_unit_id
})
return values[0].label
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>

View File

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

View File

@@ -0,0 +1,242 @@
<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-cascader
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
class="filter-item"
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.blurry"
clearable
size="mini"
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="warning"
icon="el-icon-check"
size="mini"
@click="sync"
>
同步
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="warning"-->
<!-- icon="el-icon-check"-->
<!-- size="mini"-->
<!-- :disabled="confirm_flag"-->
<!-- @click="sync"-->
<!-- >-->
<!-- 导出-->
<!-- </el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<!--
<el-table-column type="selection" width="55" />
-->
<el-table-column prop="stor_name" label="所属仓库" width="120" show-overflow-tooltip />
<el-table-column prop="sect_name" label="所属库区" width="120" show-overflow-tooltip />
<el-table-column prop="struct_code" label="所属仓位" width="120" />
<el-table-column prop="material_code" label="物料编码" width="150" />
<el-table-column prop="material_spec" label="物料规格" width="150" />
<el-table-column prop="material_id" label="物料id" width="150" />
<el-table-column prop="canuse_qty" label="可用总数" width="150" />
<el-table-column prop="ivt_qty" label="库存总数" width="150" />
<el-table-column prop="frozen_qty" label="冻结总数" width="150" />
<el-table-column prop="warehousing_qty" label="待入总数" width="150" />
<el-table-column prop="qty_unit_id" label="单位" width="150" :formatter="formatUnit" />
<el-table-column prop="create_time" label="统计日期" width="150" fixed="right" align="center" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import dailyStructivt from '@/views/wms/masterdata_manage/st/dailyStructivt/dailyStructivt'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import rrOperation from '@crud/RR.operation'
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
import { downloadFile } from '@/utils'
const defaultForm = {
struct_id: null,
cascader: null,
struct_code: null,
struct_name: null,
simple_name: null,
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
material_code: null,
stor_code: null,
stor_name: null,
stor_type: null,
capacity: null,
width: null,
height: null,
zdepth: null,
weight: null,
xqty: null,
yqty: null,
zqty: null,
is_tempstruct: '0',
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
back_ground_color: null,
front_ground_color: null,
back_ground_pic: null,
font_direction_scode: null,
is_used: true,
is_zdepth: null,
storagevehicle_id: null,
storagevehicle_code: null,
storagevehicle_type: null,
is_emptyvehicle: null,
storagevehicle_qty: null,
lock_type: null,
material_height_type: null,
ext_id: null,
remark: null
}
export default {
name: 'Structattr',
dicts: ['ST_INV_BCP_IN_TYPE'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: false, reset: true },
url: 'api/structivtDaily',
idField: 'id',
crudMethod: { ...dailyStructivt }
})
},
data() {
const numberOne = (rule, value, callback) => {
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
const numRe = new RegExp(numReg)
if (value) {
if (!numRe.test(value)) {
callback(new Error('只能输入数字'))
} else {
callback()
}
} else {
callback()
}
}
return {
measure_unit: [],
sects: [],
downloadLoading: false,
permission: {
add: ['admin', 'dept:add'],
edit: ['admin', 'dept:edit'],
del: ['admin', 'dept:del']
},
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
crudMdPbMeasureunit.getSelect().then(res => {
this.measure_unit = res.content
})
},
methods: {
sync() {
dailyStructivt.sync(Array.of('st_ivt_structivt_bcp', 'st_ivt_structivt_cp', 'st_ivt_structivt_yl')).then(result => {
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => { })
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
},
beforeInit() {
return true
},
sectChange(val) {
this.form.sect_id = val[1]
},
formatUnit(row, column) {
const values = this.measure_unit.filter(v => {
return v.value === row.qty_unit_id
})
return values[0].label
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,246 @@
<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-select
v-model="query.product_area"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生产日期">
<el-date-picker
v-model="query.create_time"
type="daterange"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00','23:59:59']"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.blurry"
clearable
size="mini"
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="warning"-->
<!-- icon="el-icon-check"-->
<!-- size="mini"-->
<!-- @click="sync"-->
<!-- >-->
<!-- 同步-->
<!-- </el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<!--
<el-table-column type="selection" width="55" />
-->
<el-table-column prop="material_code" label="物料编码" width="150" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="150" />
<el-table-column prop="material_name" label="物料名称" width="150" show-overflow-tooltip />
<el-table-column prop="real_qty" label="生产数量" width="150" />
<el-table-column prop="nok_qty" label="报废数量" width="150" />
<el-table-column prop="rate_weight" label="原材料重量" width="150" />
<el-table-column prop="product_weight" label="生产重量" width="150" />
<el-table-column prop="endproduct_rate" label="成品率" width="150" />
<el-table-column prop="yield_rate" label="成材率" width="150" />
<el-table-column prop="nok_rate" label="废品率" width="150" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import workinggood from '@/views/wms/analysis_manage/workingGoods/workinggood'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import rrOperation from '@crud/RR.operation'
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
import { downloadFile } from '@/utils'
const defaultForm = {
struct_id: null,
cascader: null,
struct_code: null,
struct_name: null,
simple_name: null,
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
material_code: null,
stor_code: null,
stor_name: null,
stor_type: null,
capacity: null,
width: null,
height: null,
zdepth: null,
weight: null,
xqty: null,
yqty: null,
zqty: null,
is_tempstruct: '0',
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
back_ground_color: null,
front_ground_color: null,
back_ground_pic: null,
font_direction_scode: null,
is_used: true,
is_zdepth: null,
storagevehicle_id: null,
storagevehicle_code: null,
storagevehicle_type: null,
is_emptyvehicle: null,
storagevehicle_qty: null,
lock_type: null,
material_height_type: null,
ext_id: null,
remark: null
}
export default {
name: 'WorkGood',
dicts: ['product_area'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: false, reset: true },
url: 'api/workinggood/byMaterial',
idField: 'id',
crudMethod: { ...workinggood }
})
},
data() {
const numberOne = (rule, value, callback) => {
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
const numRe = new RegExp(numReg)
if (value) {
if (!numRe.test(value)) {
callback(new Error('只能输入数字'))
} else {
callback()
}
} else {
callback()
}
}
return {
measure_unit: [],
sects: [],
downloadLoading: false,
permission: {
add: ['admin', 'dept:add'],
edit: ['admin', 'dept:edit'],
del: ['admin', 'dept:del']
},
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
crudMdPbMeasureunit.getSelect().then(res => {
this.measure_unit = res.content
})
},
methods: {
sync() {
dailyStructivt.sync(Array.of('st_ivt_structivt_bcp', 'st_ivt_structivt_cp', 'st_ivt_structivt_yl')).then(result => {
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => { })
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
},
beforeInit() {
return true
},
sectChange(val) {
this.form.sect_id = val[1]
},
formatUnit(row, column) {
const values = this.measure_unit.filter(v => {
return v.value === row.qty_unit_id
})
return values[0].label
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,242 @@
<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-cascader
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
class="filter-item"
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.blurry"
clearable
size="mini"
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="warning"
icon="el-icon-check"
size="mini"
@click="sync"
>
同步
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="warning"-->
<!-- icon="el-icon-check"-->
<!-- size="mini"-->
<!-- :disabled="confirm_flag"-->
<!-- @click="sync"-->
<!-- >-->
<!-- 导出-->
<!-- </el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<!--
<el-table-column type="selection" width="55" />
-->
<el-table-column prop="stor_name" label="所属仓库" width="120" show-overflow-tooltip />
<el-table-column prop="sect_name" label="所属库区" width="120" show-overflow-tooltip />
<el-table-column prop="struct_code" label="所属仓位" width="120" />
<el-table-column prop="material_code" label="物料编码" width="150" />
<el-table-column prop="material_spec" label="物料规格" width="150" />
<el-table-column prop="material_id" label="物料id" width="150" />
<el-table-column prop="canuse_qty" label="可用总数" width="150" />
<el-table-column prop="ivt_qty" label="库存总数" width="150" />
<el-table-column prop="frozen_qty" label="冻结总数" width="150" />
<el-table-column prop="warehousing_qty" label="待入总数" width="150" />
<el-table-column prop="qty_unit_id" label="单位" width="150" :formatter="formatUnit" />
<el-table-column prop="create_time" label="统计日期" width="150" fixed="right" align="center" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import workinggood from '@/views/wms/analysis_manage/workingGoods/workinggood'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import rrOperation from '@crud/RR.operation'
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
import { downloadFile } from '@/utils'
const defaultForm = {
struct_id: null,
cascader: null,
struct_code: null,
struct_name: null,
simple_name: null,
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
material_code: null,
stor_code: null,
stor_name: null,
stor_type: null,
capacity: null,
width: null,
height: null,
zdepth: null,
weight: null,
xqty: null,
yqty: null,
zqty: null,
is_tempstruct: '0',
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
back_ground_color: null,
front_ground_color: null,
back_ground_pic: null,
font_direction_scode: null,
is_used: true,
is_zdepth: null,
storagevehicle_id: null,
storagevehicle_code: null,
storagevehicle_type: null,
is_emptyvehicle: null,
storagevehicle_qty: null,
lock_type: null,
material_height_type: null,
ext_id: null,
remark: null
}
export default {
name: 'WorkGood',
dicts: ['ST_INV_BCP_IN_TYPE'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: false, reset: true },
url: 'api/workinggood/byMaterial',
idField: 'id',
crudMethod: { ...workinggood }
})
},
data() {
const numberOne = (rule, value, callback) => {
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
const numRe = new RegExp(numReg)
if (value) {
if (!numRe.test(value)) {
callback(new Error('只能输入数字'))
} else {
callback()
}
} else {
callback()
}
}
return {
measure_unit: [],
sects: [],
downloadLoading: false,
permission: {
add: ['admin', 'dept:add'],
edit: ['admin', 'dept:edit'],
del: ['admin', 'dept:del']
},
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
crudMdPbMeasureunit.getSelect().then(res => {
this.measure_unit = res.content
})
},
methods: {
sync() {
dailyStructivt.sync(Array.of('st_ivt_structivt_bcp', 'st_ivt_structivt_cp', 'st_ivt_structivt_yl')).then(result => {
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => { })
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
},
beforeInit() {
return true
},
sectChange(val) {
this.form.sect_id = val[1]
},
formatUnit(row, column) {
const values = this.measure_unit.filter(v => {
return v.value === row.qty_unit_id
})
return values[0].label
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>

View File

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