add:统计分析
This commit is contained in:
269
mes/qd/src/views/wms/analysis_manage/productCapacity/index.vue
Normal file
269
mes/qd/src/views/wms/analysis_manage/productCapacity/index.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<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.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码,规格"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工序">
|
||||
<el-select v-model="query.workprocedure_id" class="filter-item" clearable filterable placeholder="所属工序" size="small" style="width: 280px">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</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 prop="product_area" width="120" label="所属车间">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编号" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" width="150" />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="plan_qty" label="计划生产数量" width="120" />
|
||||
<el-table-column prop="real_qty" label="实际生产数量" width="120" />
|
||||
<el-table-column prop="hours" label="实际生产耗时(h)" width="120" :formatter="crud.formatNum0"/>
|
||||
<el-table-column prop="theory" label="设计产能(ph)" width="120" />
|
||||
<el-table-column prop="realty" label="实际产能(ph)" width="120" />
|
||||
<el-table-column prop="realty" label="产能利用率(%)" width="120" >
|
||||
<template slot-scope="scope" :formatter="crud.formatNum0">
|
||||
<span>{{ Number(scope.row.realty/scope.row.theory).toFixed(3)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orders" label="工单列表" width="150" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<div id="main2" style="width: 100%;height:350px;"></div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import productCap from '@/views/wms/analysis_manage/productCapacity/productCap'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import { downloadFile } from '@/utils'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
import echarts from 'echarts'
|
||||
|
||||
const defaultForm = {
|
||||
product_area: null,
|
||||
device_code: null,
|
||||
device_name: null,
|
||||
workprocedure_name: null,
|
||||
theory: null,
|
||||
real_qty: null,
|
||||
plan_qty: null,
|
||||
realty: null,
|
||||
hours: null,
|
||||
orders: 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/productCap',
|
||||
idField: 'id',
|
||||
crudMethod: { ...productCap }
|
||||
})
|
||||
},
|
||||
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: [],
|
||||
workList: [],
|
||||
downloadLoading: false,
|
||||
permission: {
|
||||
add: ['admin', 'dept:add'],
|
||||
edit: ['admin', 'dept:edit'],
|
||||
del: ['admin', 'dept:del']
|
||||
},
|
||||
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkprocedure()
|
||||
},
|
||||
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(() => { })
|
||||
},
|
||||
getWorkprocedure() { // 获取工序下拉框
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
var pigdata =[]
|
||||
this.crud.data.forEach(a=>{
|
||||
pigdata.push({"value":a.realty,"name":a.device_name})
|
||||
}
|
||||
)
|
||||
var myChart = echarts.init(document.getElementById('main2'));
|
||||
var option = {
|
||||
title: {
|
||||
text: '实际产能饼图',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '实际产能',
|
||||
type: 'pie',
|
||||
radius: '70%',
|
||||
data: pigdata,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(option);
|
||||
},
|
||||
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>
|
||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/structivtDaily',
|
||||
url: 'api/scrapRate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -10,24 +10,18 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/structivtDaily',
|
||||
url: 'api/scrapRate',
|
||||
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',
|
||||
url: 'api/scrapRate',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, sync }
|
||||
export default { add, edit, del }
|
||||
@@ -9,51 +9,67 @@
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属库区">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
<el-form-item label="车间">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
@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-form-item label="设备编号">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码,规格"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工序">
|
||||
<el-select v-model="query.workprocedure_id" class="filter-item" clearable filterable placeholder="所属工序" size="small" style="width: 280px">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</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>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="sync"-->
|
||||
<!-- >-->
|
||||
<!-- 同步-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -64,96 +80,68 @@
|
||||
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-column prop="product_area" width="120" label="所属车间">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编号" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" width="150" />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="plan_qty" label="计划生产数量" width="120" />
|
||||
<el-table-column prop="real_qty" label="实际生产数量" width="120" />
|
||||
<el-table-column prop="hours" label="实际生产耗时(h)" width="120" :formatter="crud.formatNum0"/>
|
||||
<el-table-column prop="theory" label="设计产能(ph)" width="120" />
|
||||
<el-table-column prop="realty" label="实际产能(ph)" width="120" />
|
||||
<el-table-column prop="realty" label="产能利用率(%)" width="120" >
|
||||
<template slot-scope="scope" :formatter="crud.formatNum0">
|
||||
<span>{{ Number(scope.row.realty/scope.row.theory).toFixed(3)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orders" label="工单列表" width="150" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<div id="main2" style="width: 100%;height:350px;"></div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dailyStructivt from '@/views/wms/masterdata_manage/st/dailyStructivt/dailyStructivt'
|
||||
import productCap from '@/views/wms/analysis_manage/productCapacity/productCap'
|
||||
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'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
import echarts from 'echarts'
|
||||
|
||||
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
|
||||
product_area: null,
|
||||
device_code: null,
|
||||
device_name: null,
|
||||
workprocedure_name: null,
|
||||
theory: null,
|
||||
real_qty: null,
|
||||
plan_qty: null,
|
||||
realty: null,
|
||||
hours: null,
|
||||
orders: null,
|
||||
}
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_INV_BCP_IN_TYPE'],
|
||||
name: 'WorkGood',
|
||||
dicts: ['product_area'],
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
title: '废品统计',
|
||||
optShow: { add: false, reset: true },
|
||||
url: 'api/structivtDaily',
|
||||
url: 'api/productCap',
|
||||
idField: 'id',
|
||||
crudMethod: { ...dailyStructivt }
|
||||
crudMethod: { ...productCap }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@@ -173,6 +161,7 @@ export default {
|
||||
return {
|
||||
measure_unit: [],
|
||||
sects: [],
|
||||
workList: [],
|
||||
downloadLoading: false,
|
||||
permission: {
|
||||
add: ['admin', 'dept:add'],
|
||||
@@ -183,19 +172,57 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSectattr.getSect({}).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
crudMdPbMeasureunit.getSelect().then(res => {
|
||||
this.measure_unit = res.content
|
||||
})
|
||||
this.getWorkprocedure()
|
||||
},
|
||||
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(() => { })
|
||||
},
|
||||
getWorkprocedure() { // 获取工序下拉框
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
var pigdata =[]
|
||||
this.crud.data.forEach(a=>{
|
||||
pigdata.push({"value":a.realty,"name":a.device_name})
|
||||
}
|
||||
)
|
||||
var myChart = echarts.init(document.getElementById('main2'));
|
||||
var option = {
|
||||
title: {
|
||||
text: '实际产能饼图',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '实际产能',
|
||||
type: 'pie',
|
||||
radius: '70%',
|
||||
data: pigdata,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(option);
|
||||
},
|
||||
downloadMethod() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
|
||||
27
mes/qd/src/views/wms/analysis_manage/qlmanage/productCap.js
Normal file
27
mes/qd/src/views/wms/analysis_manage/qlmanage/productCap.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del }
|
||||
259
mes/qd/src/views/wms/analysis_manage/scrapRate/index.vue
Normal file
259
mes/qd/src/views/wms/analysis_manage/scrapRate/index.vue
Normal file
@@ -0,0 +1,259 @@
|
||||
<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.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码,规格"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工序">
|
||||
<el-select v-model="query.workprocedure_id" class="filter-item" clearable filterable placeholder="所属工序" size="small" style="width: 280px">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</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="product_area" width="150" label="所属车间">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编号" width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" width="200" />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="250" show-overflow-tooltip />
|
||||
<el-table-column prop="real_qty" label="生产总数量" width="200" />
|
||||
<el-table-column prop="nok_qty" label="报废总数量" width="200" />
|
||||
<el-table-column prop="nok_rate" label="废品率" width="200" />
|
||||
</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'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
|
||||
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/scrapRate',
|
||||
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: [],
|
||||
workList: [],
|
||||
downloadLoading: false,
|
||||
permission: {
|
||||
add: ['admin', 'dept:add'],
|
||||
edit: ['admin', 'dept:edit'],
|
||||
del: ['admin', 'dept:del']
|
||||
},
|
||||
trueorfalse: [{ value: true, label: '是' }, { value: false, label: '否' }]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkprocedure()
|
||||
},
|
||||
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(() => { })
|
||||
},
|
||||
getWorkprocedure() { // 获取工序下拉框
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
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>
|
||||
27
mes/qd/src/views/wms/analysis_manage/scrapRate/scrapRate.js
Normal file
27
mes/qd/src/views/wms/analysis_manage/scrapRate/scrapRate.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/scrapRate',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user