update 设备加工数量

This commit is contained in:
lb 2023-08-30 15:36:16 +08:00
parent 14eb83932e
commit 72393caee1
2 changed files with 130 additions and 105 deletions

View File

@ -46,6 +46,8 @@ export default {
.app-main { .app-main {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 120px - 8px); min-height: calc(100vh - 120px - 8px);
display: flex;
flex-direction: column;
} }
.fixed-header + .app-main { .fixed-header + .app-main {

View File

@ -6,36 +6,50 @@
--> -->
<template> <template>
<div class="equipment-process-amount"> <div style="flex: 1; display: flex; background: #f2f4f9">
<!-- side bar --> <div
<div class="side-bar__left"></div> class="app-container"
style="margin-right: 12px; border-radius: 8px; background: #fff">
<!-- side bar -->
<div
class="side-bar__left"
style="width: 240px; padding: 12px; height: 100%">
<el-tree
:data="sidebarContent"
:props="treeProps"
@node-click="handleSidebarItemClick" />
</div>
</div>
<div
class="app-container equipment-process-amount"
style="flex: 1; border-radius: 8px; background: #fff">
<!-- main area -->
<div class="main-content">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- main area --> <!-- tabs -->
<div class="main-content"> <div class="table" v-if="mode == 'table'">
<SearchBar <base-table
:formConfigs="searchBarFormConfig" :table-props="tableProps"
ref="search-bar" :page="queryParams.pageNo"
@headBtnClick="handleSearchBarBtnClick" /> :limit="queryParams.pageSize"
:table-data="list"
<!-- tabs --> @emitFun="handleEmitFun">
<div class="table" v-if="mode == 'table'"> <!-- <method-btn
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> --> @clickBtn="handleTableBtnClick" /> -->
</base-table> </base-table>
</div> </div>
<div class="graph" v-else> <div class="graph" v-else>
<!-- graph --> <!-- graph -->
</div>
</div> </div>
</div> </div>
</div> </div>
@ -50,33 +64,43 @@ export default {
return { return {
sidebarContent: [ sidebarContent: [
{ {
factory: '工厂', id: 'fc1',
children: [ name: '工厂',
lines: [
{ {
pl: '产线1', name: '产线1',
children: [ id: 'pl1',
sections: [
{ {
ws: '工段1', name: '工段1',
id: 'pl1ws1',
}, },
{ {
ws: '工段2', name: '工段2',
id: 'pl1ws2',
}, },
{ {
ws: '工段3', name: '工段3',
id: 'pl1ws3',
}, },
], ],
}, },
{ {
pl: '产线2', name: '产线2',
children: [ id: 'pl2',
sections: [
{ {
ws: '工段1', name: '工段1',
id: 'pl2ws1',
}, },
{ {
ws: '工段2', name: '工段2',
id: 'pl2ws2',
}, },
{ {
ws: '工段3', name: '工段3',
id: 'pl2ws3',
}, },
], ],
}, },
@ -85,16 +109,17 @@ export default {
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'input', type: 'datePicker',
label: '分组名称', label: '时间段',
placeholder: '请输入设备分组名称', dateType: 'daterange', // datetimerange
param: 'name', format: 'yyyy-MM-dd',
}, valueFormat: 'yyyy-MM-dd HH:mm:ss',
{ rangeSeparator: '-',
type: 'input', startPlaceholder: '开始日期',
label: '分组编码', endPlaceholder: '结束日期',
placeholder: '请输入设备分组编码', defaultTime: ['00:00:00', '23:59:59'],
param: 'codes', param: 'timeVal',
width: 350,
}, },
{ {
type: 'button', type: 'button',
@ -102,79 +127,77 @@ export default {
name: 'search', name: 'search',
color: 'primary', 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: [ tableProps: [
// { { prop: 'lineName', label: '产线', align: 'center' },
// prop: 'createTime', { prop: 'sectionName', label: '工段', align: 'center' },
// label: '', { prop: 'externalCode', label: '设备编码', align: 'center' },
// fixed: true, { prop: 'equipmentName', label: '设备名称', align: 'center' },
// width: 180, { prop: 'totalQuantity', label: '加工数量', align: 'center' },
// 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 mode: 'table', // table | graph
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 999, pageSize: 999,
recordTime: [],
equipmentId: null,
lineId: null,
sectionId: null,
productId: null,
}, },
list: [], list: [],
treeProps: {
children: 'children',
label: 'label',
},
}; };
}, },
computed: {}, mounted() {
this.getList();
},
methods: { methods: {
/** build side bar tree */
buildTree(data) {
data.forEach((factory) => {
this.$set(factory, 'label', factory.name);
delete factory.name;
factory.children = factory.lines;
delete factory.lines;
factory.children.forEach((line) => {
this.$set(line, 'label', line.name);
delete line.name;
line.children = line.sections;
delete line.sections;
line.children.forEach((ws) => {
this.$set(ws, 'label', ws.name);
delete ws.name;
});
});
});
},
async getList() {
this.buildTree(this.sidebarContent);
console.log('sidebar final', this.sidebarContent);
},
handleSidebarItemClick({ label, id }) {
console.log('lable clicked!', label, id);
},
handleEmitFun() {}, handleEmitFun() {},
handleSearchBarBtnClick() {},
handleSearchBarBtnClick(btn) {
console.log('btn', btn);
this.queryParams.recordTime = btn.timeVal;
this.handleQuery();
},
handleQuery() {
console.log(this.queryParams)
}
}, },
}; };
</script> </script>