test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
2 changed files with 184 additions and 4 deletions
Showing only changes of commit 100d28fd68 - Show all commits

View File

@ -0,0 +1,182 @@
<!--
filename: index.vue
author: liubin
date: 2023-08-30 14:02:49
description: 设备加工数量
-->
<template>
<div class="equipment-process-amount">
<!-- side bar -->
<div class="side-bar__left"></div>
<!-- main area -->
<div class="main-content">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- tabs -->
<div class="table" v-if="mode == 'table'">
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<!-- <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</base-table>
</div>
<div class="graph" v-else>
<!-- graph -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'EquipmentProcessAmount',
components: {},
props: {},
data() {
return {
sidebarContent: [
{
factory: '工厂',
children: [
{
pl: '产线1',
children: [
{
ws: '工段1',
},
{
ws: '工段2',
},
{
ws: '工段3',
},
],
},
{
pl: '产线2',
children: [
{
ws: '工段1',
},
{
ws: '工段2',
},
{
ws: '工段3',
},
],
},
],
},
],
searchBarFormConfig: [
{
type: 'input',
label: '分组名称',
placeholder: '请输入设备分组名称',
param: 'name',
},
{
type: 'input',
label: '分组编码',
placeholder: '请输入设备分组编码',
param: 'codes',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:equipment-group:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
// {
// type: this.$auth.hasPermi('base:equipment-group:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
tableProps: [
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'name', label: '产线', align: 'center' },
{ prop: 'code', label: '工段', align: 'center' },
{ prop: 'remark', label: '设备编码', align: 'center' },
{ prop: 'remark', label: '设备名称', align: 'center' },
{ prop: 'remark', label: '加工数量', align: 'center' },
// {
// _action: 'equipment-group-show-alert',
// label: '',
// align: 'center',
// subcomponent: {
// props: ['injectData'],
// render: function (h) {
// const _this = this;
// return h(
// 'el-button',
// {
// props: { type: 'text', size: 'mini' },
// on: {
// click: function () {
// console.log('inejctdata', _this.injectData);
// _this.$emit('emitData', {
// action: _this.injectData._action,
// // value: _this.injectData.id,
// value: _this.injectData,
// });
// },
// },
// },
// ''
// );
// },
// },
// },
],
mode: 'table', // table | graph
queryParams: {
pageNo: 1,
pageSize: 999,
},
list: [],
};
},
computed: {},
methods: {
handleEmitFun() {},
handleSearchBarBtnClick() {},
},
};
</script>
<style scoped lang="scss"></style>

View File

@ -503,7 +503,7 @@ export default {
// span // span
this.spanInfo[rowIndex] = data.length; this.spanInfo[rowIndex] = data.length;
for (const equipment of data) { for (const equipment of data) {
rowIndex+=1 rowIndex += 1;
for (const [key, hourData] of Object.entries(equipment.hourData)) { for (const [key, hourData] of Object.entries(equipment.hourData)) {
const { equipmentName, totalQuantity } = equipment; const { equipmentName, totalQuantity } = equipment;
const { inQuantity, outQuantity, nokQuantity, scrapRatio } = const { inQuantity, outQuantity, nokQuantity, scrapRatio } =
@ -518,12 +518,10 @@ export default {
row[key + '__out'] = outQuantity; row[key + '__out'] = outQuantity;
row[key + '__nok'] = nokQuantity; row[key + '__nok'] = nokQuantity;
row[key + '__ratio'] = scrapRatio; row[key + '__ratio'] = scrapRatio;
console.log('row', row);
return;
this.list.push(row); this.list.push(row);
} }
return;
} }
console.log('list:', this.list, 'spanInfo:', this.spanInfo);
} }
}, },