Compare commits

...

32 Commits

Author SHA1 Message Date
zwq
d3d93acd0f 修改成本新的权限字段 2024-04-10 14:48:37 +08:00
a4fceeb981 Merge pull request 'projects/mesxc-zjl' (#321) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #321
2024-04-09 13:09:55 +08:00
84468cc883 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-09 13:06:21 +08:00
ea04d55fc1 驾驶舱 2024-04-09 13:04:40 +08:00
ef1078360a Merge pull request '更新成本' (#319) from projects/mesxc-zwq into projects/mesxc-test
Reviewed-on: #319
2024-04-09 11:06:14 +08:00
zwq
60f6c3a8fe 更新成本 2024-04-09 11:05:37 +08:00
a4b340ac5d Merge pull request 'projects/mesxc-dy' (#318) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #318
2024-04-09 08:18:01 +08:00
helloDy
2592551e66 Merge branch 'projects/mesxc-test' into projects/mesxc-dy 2024-04-08 17:03:21 +08:00
helloDy
1fde96e677 工单bug,改动 2024-04-08 17:02:55 +08:00
0b16e1fe0d Merge pull request '驾驶舱修改' (#317) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #317
2024-04-08 16:39:30 +08:00
abcec3bcdc Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-08 16:38:59 +08:00
bdd14eec70 驾驶舱修改 2024-04-08 16:38:12 +08:00
44e7e219a4 Merge pull request 'projects/mesxc-zhp' (#316) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #316
2024-04-08 16:37:26 +08:00
‘937886381’
ec51beb8ea Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 15:14:37 +08:00
‘937886381’
433618e71d 修改bug 2024-04-08 15:13:52 +08:00
812b72f10d Merge pull request 'projects/mesxc-zhp' (#315) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #315
2024-04-08 15:11:34 +08:00
‘937886381’
05f10ab51d Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 14:49:46 +08:00
‘937886381’
e7828fd277 修改bug 2024-04-08 14:49:20 +08:00
58457487d1 Merge pull request 'projects/mesxc-zhp' (#314) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #314
2024-04-08 14:09:52 +08:00
‘937886381’
6c54c223c5 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 13:55:56 +08:00
‘937886381’
b2cc509f8e 权限 2024-04-08 13:55:22 +08:00
b6236e89b1 Merge pull request '1' (#313) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #313
2024-04-08 12:26:34 +08:00
cbc7cbc574 1 2024-04-08 12:25:44 +08:00
b5b952e1cc Merge pull request 'projects/mesxc-zjl' (#312) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #312
2024-04-08 10:44:09 +08:00
33ed9f15fa Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-08 10:42:42 +08:00
c85c6e4323 能源 2024-04-08 10:41:43 +08:00
30d22b34e1 Merge pull request '成本按钮权限' (#311) from projects/mesxc-zwq into projects/mesxc-test
Reviewed-on: #311
2024-04-08 09:05:52 +08:00
zwq
3d3fa2ccee 成本按钮权限 2024-04-08 09:05:10 +08:00
f960ece594 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-07 16:14:52 +08:00
f52815abe6 Merge pull request 'projects/mesxc-zhp' (#310) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #310
2024-04-07 16:09:32 +08:00
‘937886381’
ac4cea0c7e Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-07 16:07:30 +08:00
‘937886381’
93fea84c79 修改bug 2024-04-07 16:07:04 +08:00
80 changed files with 6192 additions and 5677 deletions

View File

@@ -1,7 +1,7 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-04-03 11:22:19 # @LastEditTime: 2024-04-08 16:46:49
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###
@@ -25,8 +25,10 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082' # VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# socket地址 # socket地址
VUE_APP_Socket_API = 'ws://10.70.2.2:8080' # VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081' # VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
VUE_APP_Socket_Dcs_API = 'ws://192.168.0.33:8080'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://10.70.2.22:8080' VUE_APP_JIMU_API = 'http://10.70.2.22:8080'

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-29 16:50:26 * @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-04-03 17:10:15 * @LastEditTime: 2024-04-07 16:05:59
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -418,7 +418,7 @@ export default {
// yield:ele.yield // yield:ele.yield
// }) // })
sumAreaList.push(ele.sumArea) sumAreaList.push(ele.sumArea)
yieldList.push((ele.yield * 100).toFixed(3)) yieldList.push((ele.yield * 100).toFixed(0))
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList) this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
@@ -625,8 +625,8 @@ export default {
`<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`,
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div> `<div style = "${(item.product * 100).toFixed(0) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
<div style = "${(item.product * 100).toFixed(2) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>` <div style = "${(item.product * 100).toFixed(0) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>`
]) ])
this.cutConfig.data = cutArr this.cutConfig.data = cutArr
// this.$nextTick(() => { // this.$nextTick(() => {

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-22 08:53:20 * @LastEditTime: 2024-04-08 10:21:46
* @Description: * @Description:
--> -->
<template> <template>
@@ -214,7 +214,9 @@ export default {
actualQuantity: this.dataForm.actualQuantity actualQuantity: this.dataForm.actualQuantity
}).then(response => { }).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!"); this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.saveData(tempList) if (tempList.length > 0) {
this.saveData(tempList)
}
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
}); });

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-21 16:52:46 * @LastEditTime: 2024-04-08 14:27:29
* @Description: * @Description:
--> -->
<template> <template>
@@ -182,7 +182,8 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="orderList"> :table-data="orderList"
:max-height="tableH">
<method-btn <method-btn
v-if="!isdetail" v-if="!isdetail"
slot="handleBtn" slot="handleBtn"
@@ -209,7 +210,8 @@
:table-props="tableProps1" :table-props="tableProps1"
:page="listQuery1.pageNo" :page="listQuery1.pageNo"
:limit="listQuery1.pageSize" :limit="listQuery1.pageSize"
:table-data="materialList" /> :table-data="materialList"
:max-height="tableH" />
<!-- <pagination <!-- <pagination
v-show="listQuery1.total > 0" v-show="listQuery1.total > 0"
:total="listQuery1.total" :total="listQuery1.total"
@@ -235,6 +237,7 @@ import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict"; import { publicFormatter } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import topTabVue from '../../order/base/orderManage/components/topTab.vue'; import topTabVue from '../../order/base/orderManage/components/topTab.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableBtn = [ const tableBtn = [
{ {
@@ -292,9 +295,11 @@ const tableProps1 = [
]; ];
export default { export default {
mixins: [tableHeightMixin],
components: { SmallTitle, topTabVue }, components: { SmallTitle, topTabVue },
data() { data() {
return { return {
heightNum: 380,
tableBtn, tableBtn,
tableProps, tableProps,
tableProps1, tableProps1,
@@ -455,7 +460,7 @@ export default {
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); });
// 获取预使用原料列表 // 获取预使用原料列表
console.log() console.log('111我看看', this.dataForm.materialMethod)
if (this.dataForm.id) { if (this.dataForm.id) {
if (this.dataForm.materialMethod === 1) { if (this.dataForm.materialMethod === 1) {
// 产品 // 产品

View File

@@ -9,7 +9,8 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="tableData"> :table-data="tableData"
:max-height="tableH">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
@@ -62,7 +63,7 @@ import {
getCoreWOList getCoreWOList
} from '@/api/base/coreWorkOrder'; } from '@/api/base/coreWorkOrder';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -132,7 +133,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage, tableHeightMixin],
components: { components: {
AddWorkOrder, AddWorkOrder,
AddOrUpdate, AddOrUpdate,

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-02-28 10:38:34 * @LastEditTime: 2024-04-08 11:49:33
* @Description: * @Description:
--> -->
<template> <template>
@@ -128,7 +128,7 @@ export default {
param: 'createTime', param: 'createTime',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
btnName: '搜索', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -32,6 +32,7 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -61,7 +62,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage,tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -70,7 +71,6 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@@ -92,13 +92,15 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:cost-energy-search:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('cost:energyCost:export') type: this.$auth.hasPermi('extend:cost-energy-search:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@@ -111,9 +113,6 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getEnergyTypeListAll().then((response) => { getEnergyTypeListAll().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@@ -32,6 +32,7 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -71,7 +72,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage,tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -80,7 +81,6 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@@ -116,13 +116,15 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:cost-enery-auto-report:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('cost:energyCostHis:export') type: this.$auth.hasPermi('extend:cost-enery-auto-report:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@@ -135,9 +137,6 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@@ -12,7 +12,7 @@
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:max-height="tableH" :max-height="tableH"
:table-data="tableData"> :table-data="tableData">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@@ -53,6 +53,7 @@ import {
} from '@/api/cost/costMaterialSet'; } from '@/api/cost/costMaterialSet';
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -91,7 +92,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage,tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -99,15 +100,14 @@ export default {
deleteURL: deleteCostMaterialSet, deleteURL: deleteCostMaterialSet,
}, },
tableProps, tableProps,
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`cost:rawMaterialConfig:update`) this.$auth.hasPermi(`extend:cost-material-set:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`cost:rawMaterialConfig:delete`) this.$auth.hasPermi(`extend:cost-material-set:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@@ -124,16 +124,22 @@ export default {
filterable: true, filterable: true,
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:cost-material-set:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type:
this.$auth.hasPermi('extend:cost-material-set:create') &&
this.$auth.hasPermi('extend:cost-material-set:query')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialConfig:create') type: this.$auth.hasPermi('extend:cost-material-set:create')
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@@ -148,9 +154,6 @@ export default {
AddOrUpdate, AddOrUpdate,
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => { getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@@ -32,6 +32,7 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -66,7 +67,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage,tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -75,7 +76,6 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@@ -97,13 +97,15 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:cost-material-search:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialCost:export') type: this.$auth.hasPermi('extend:cost-material-search:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@@ -116,9 +118,6 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => { getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@@ -32,6 +32,7 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@@ -70,7 +71,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage,tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -79,7 +80,6 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@@ -115,13 +115,15 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:cost-material-auto-report:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialCostHis:export') type: this.$auth.hasPermi('extend:cost-material-auto-report:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@@ -134,9 +136,6 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@@ -1,234 +1,258 @@
<template> <template>
<div style="height: 370px;"> <div style="height: 370px">
<NotMsg v-show="notMsg"/> <NotMsg v-show="notMsg" />
<div id="numRateChart" class="num-rate-chart" style="width:900px;height:420px;" v-show='!notMsg'></div> <div
</div> id="numRateChart"
class="num-rate-chart"
style="width: 900px; height: 420px"
v-show="!notMsg"></div>
</div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import resize from './../mixins/resize' import resize from './../mixins/resize';
import NotMsg from './../components/NotMsg' import NotMsg from './../components/NotMsg';
export default { export default {
name: 'NumRateChart', name: 'NumRateChart',
mixins: [resize], mixins: [resize],
components:{ NotMsg }, components: { NotMsg },
data() { data() {
return { return {
chart: null, chart: null,
notMsg:true notMsg: true,
} };
}, },
computed: { computed: {
productline() { productline() {
return this.$store.state.websocket.productline return this.$store.state.websocket.productline;
} },
}, },
watch:{ watch: {
productline: { productline: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal === oldVal) { if (newVal === oldVal) {
return false return false;
} }
this.updateChart() this.updateChart();
this.$emit('emitFun') this.$emit('emitFun');
} },
} },
}, },
mounted() { mounted() {
this.$el.addEventListener('resize', () => { this.$el.addEventListener('resize', () => {
console.log('resziing.....'); console.log('resziing.....');
}); });
this.updateChart() this.updateChart();
}, },
methods: { methods: {
updateChart() { updateChart() {
if (this.productline && this.productline.length > 0) { if (this.productline && this.productline.length > 0) {
this.notMsg = false this.notMsg = false;
} else { } else {
this.notMsg = true this.notMsg = true;
return return;
} }
let xData = [] let xData = [];
let outputNum = [] let outputNum = [];
let passRate = [] let passRate = [];
this.productline && this.productline.length > 0 && this.productline.map(item => { for (let i = 0; i < this.productline.length - 1; i++) {
if ((item.lineName).includes('D')) { // 二次循环,注意:再减去外层的循环次数,向后依次两两相互比较转换;
xData.push(item.lineName) for (let j = 0; j < this.productline.length - i - 1; j++) {
outputNum.push(item.outputNum) // 当前一个值大于后一个值
passRate.push(item.passRate?item.passRate*100:null) if (
} this.productline[j].lineName.substr(
}) this.productline[j].lineName.length - 1,
if ( 1
this.chart !== null && ) >
this.chart !== '' && this.productline[j + 1].lineName.substr(
this.chart !== undefined this.productline[j + 1].lineName.length - 1,
) { 1
this.chart.dispose() )
} ) {
this.chart = echarts.init(document.getElementById('numRateChart')); // 定义变量,以赋值的形式前后交换,直到换到最小的在前面,左右再无比较,则循环结束形成排序结果
var option = { let temp = this.productline[j];
grid: { top: 82, right: 60, bottom: 20, left: 90 }, this.productline[j] = this.productline[j + 1];
tooltip: { this.productline[j + 1] = temp;
trigger: "axis", }
axisPointer: { }
type: "shadow", }
}, this.productline &&
className: "num-rate-chart-tooltip" this.productline.length > 0 &&
}, this.productline.map((item) => {
legend: { if (item.lineName.includes('D')) {
itemWidth:10, xData.push(item.lineName);
itemHeight:10, outputNum.push(item.outputNum);
top: '2.5%', passRate.push(item.passRate);
}
});
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose();
}
this.chart = echarts.init(document.getElementById('numRateChart'));
var option = {
grid: { top: 82, right: 60, bottom: 20, left: 90 },
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
className: 'num-rate-chart-tooltip',
},
legend: {
itemWidth: 10,
itemHeight: 10,
top: '2.5%',
right: '20px', right: '20px',
icon: 'rect', icon: 'rect',
data: [ data: [
{name:'产线产量',itemStyle:{color:'#364BFE'}}, { name: '产线产量', itemStyle: { color: '#364BFE' } },
{name:'良品率',itemStyle:{color:'#FFCB59'}} { name: '良品率', itemStyle: { color: '#FFCB59' } },
], ],
textStyle: { textStyle: {
color: "#DFF1FE", color: '#DFF1FE',
fontSize: 12, fontSize: 12,
} },
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
data: xData, data: xData,
axisLabel: { axisLabel: {
color: "#fff", color: '#fff',
fontSize: 12, fontSize: 12,
}, },
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow',
}, },
axisTick: { show: false }, axisTick: { show: false },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
width: 1, width: 1,
color: "#213259", color: '#213259',
}, },
}, },
} },
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name: '产量/片', name: '产量/片',
nameTextStyle: { nameTextStyle: {
color: '#fff', color: '#fff',
fontSize: 10, fontSize: 10,
align: 'right', align: 'right',
}, },
axisLabel: { axisLabel: {
color: "#fff", color: '#fff',
fontSize: 12, fontSize: 12,
formatter: '{value}' },
}, axisLine: {
axisLine: { show: true,
show: true, lineStyle: {
lineStyle: { color: '#213259',
color: "#213259", },
}, },
}, splitLine: {
splitLine: { lineStyle: {
lineStyle: { color: '#213259a0',
color: "#213259a0", },
}, },
} },
}, {
{ type: 'value',
type: 'value', name: '良品率',
name: '良品率', nameTextStyle: {
nameTextStyle: { color: '#fff',
color: '#fff', fontSize: 10,
fontSize: 10, align: 'LEFT',
align: 'LEFT', },
}, axisLabel: {
axisLabel: { color: '#fff',
color: "#fff", fontSize: 12,
fontSize: 12, formatter: '{value}%',
formatter: () =>{ },
return value ? '{value} %': '-' axisLine: {
} show: true,
}, lineStyle: {
axisLine: { color: '#213259',
show: true, },
lineStyle: { },
color: "#213259", splitLine: {
}, lineStyle: {
}, color: '#213259a0',
splitLine: { },
lineStyle: { },
color: "#213259a0", },
}, ],
} series: [
} {
], name: '产线产量',
series: [ type: 'bar',
{ tooltip: {
name: '产线产量', valueFormatter: function (value) {
type: 'bar', return value;
tooltip: { },
valueFormatter: function (value) { },
return value; barWidth: 20,
} itemStyle: {
},
barWidth: 20,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#5CB7FF' },
{ offset: 1, color: '#364BFE' }
])
},
data: outputNum
},
{
name: '良品率',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value?value + '%':'-';
}
},
itemStyle: {
color: '#FFD160'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + "40" }, { offset: 0, color: '#5CB7FF' },
{ offset: 0.5, color: '#FFCB59' + "20" }, { offset: 1, color: '#364BFE' },
{ offset: 1, color: '#FFCB59' + "00" }, ]),
]), },
}, data: outputNum,
lineStyle: { },
width: 1 {
}, name: '良品率',
symbol: 'circle', type: 'line',
symbolSize: 5, yAxisIndex: 1,
data: passRate tooltip: {
} valueFormatter: function (value) {
] return value ? value + '%' : '-';
}; },
option && this.chart.setOption(option) },
} itemStyle: {
} color: '#FFD160',
} },
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + '40' },
{ offset: 0.5, color: '#FFCB59' + '20' },
{ offset: 1, color: '#FFCB59' + '00' },
]),
},
lineStyle: {
width: 1,
},
symbol: 'circle',
symbolSize: 5,
data: passRate,
},
],
};
option && this.chart.setOption(option);
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.num-rate-chart { .num-rate-chart {
width: 100%; width: 100%;
height: 100%; height: 100%;
top: -50px; top: -50px;
} }
</style> </style>
<style> <style>
.num-rate-chart-tooltip { .num-rate-chart-tooltip {
background: #0a2b4f77 !important; background: #0a2b4f77 !important;
border: none !important; border: none !important;
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
} }
.num-rate-chart-tooltip * { .num-rate-chart-tooltip * {
color: #fff !important; color: #fff !important;
} }
</style> </style>

View File

@@ -1,66 +1,83 @@
<template> <template>
<div style="flex: 1;"> <div style="flex: 1">
<Container name="各工序缺陷汇总" size="middle" style=""> <Container
<TimePrompt class="timeShow" :timestr="timestr" /> name="各工序缺陷汇总"
<div style="padding: 5px 10px;"> size="middle"
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='defectScrollBoard'/> style="">
</div> <TimePrompt
</Container> class="timeShow"
</div> :timestr="timestr" />
<div style="padding: 5px 10px">
<dv-scroll-board
:config="config"
style="width: 575px; height: 380px"
ref="defectScrollBoard" />
</div>
</Container>
</div>
</template> </template>
<script> <script>
import Container from '../components/Container.vue'; import Container from '../components/Container.vue';
import TimePrompt from '../components/TimePrompt'; import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils' import { switchShowTime } from '../utils';
export default { export default {
name: 'DefectSum', name: 'DefectSum',
components: { Container, TimePrompt }, components: { Container, TimePrompt },
computed: { computed: {
defectSum() { defectSum() {
return this.$store.state.websocket.defectSum return this.$store.state.websocket.defectSum;
} },
}, },
data() { data() {
return { return {
timestr: '', timestr: '',
config: { config: {
header: ['序号', '产线', '工序','损耗片数','缺陷类型'], header: ['序号', '产线', '工序', '损耗片数', '缺陷类型'],
headerBGC: 'rgba(32, 55, 96, 0.8)', headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)', oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)', evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60], columnWidth: [60],
align: ['center'], align: ['center'],
data: [], data: [
// data: [[1, 'Y61', '破损','10','气泡']], //假数据
rowNum: 10 [1, 'D61', '成型', '3片', '细长泡'],
} [2, 'D62', '组合落板', '4片', '细长泡'],
} [3, 'D61', '磨边', '6片', '开口泡'],
}, [4, 'D63', '清洗', '5片', '结石'],
mounted() { [5, 'D64', '打孔', '2片', '结石'],
this.timestr = switchShowTime('日') [6, 'D63', '成型', '7片', '开口泡'],
}, [7, 'D61', '上片', '8片', '结石'],
watch:{ ],
defectSum: { // data: [],
rowNum: 10,
},
};
},
mounted() {
this.timestr = switchShowTime('日');
},
watch: {
defectSum: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
let outArr = this.defectSum.map((item, index) => [ let outArr = this.defectSum.map((item, index) => [
index+1, index + 1,
item.productionLineName, item.productionLineName,
item.sectionName, item.sectionName,
item.count, item.count,
item.inspectionTypeName item.inspectionTypeName,
]); ]);
this.config.data = outArr this.config.data = outArr;
this.$refs['defectScrollBoard'].updateRows(outArr) this.$refs['defectScrollBoard'].updateRows(outArr);
this.timestr = switchShowTime('日') this.timestr = switchShowTime('日');
} },
} },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.timeShow { .timeShow {
position: absolute; position: absolute;
top: 20px; top: 20px;
left: 240px; left: 240px;
} }
</style> </style>

View File

@@ -1,24 +1,23 @@
<!--
filename: MaterialCost.vue
author: liubin
date: 2023-12-06 09:09:27
description:
-->
<template> <template>
<Container name="原料用量统计" size="middle" style=""> <Container
<div style="flex: 1; display: flex; gap: 8px;flex-direction: column;"> name="原料用量统计"
size="middle"
style="">
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
<div <div
class="absolute" class="absolute"
style=" style="
flex:3; flex: 2;
padding: 12px 12px 0 12px; padding: 12px 12px 0 12px;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(2, 1fr);
grid-auto-rows: repeat(4, 1fr); grid-auto-rows: repeat(4, 1fr);
gap: 8px; gap: 8px;
"> ">
<ShadowRect v-for="(item, index) in materialMsg1" :key="index" :rounded="false"> <ShadowRect
v-for="(item, index) in materialMsg"
:key="index"
:rounded="false">
<div <div
class="material" class="material"
style=" style="
@@ -30,43 +29,24 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
"> ">
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"> <span
{{item.materialUsed}} style="
color: #0ee8e4;
font-weight: 500;
font-size: 32px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
">
{{ item.materialUsed }}
</span> </span>
<span style="color: #fff; font-size: 16px; letter-spacing: 1px"> <span style="color: #fff; font-size: 16px; letter-spacing: 1px">
- {{item.materialName}}/kg- - {{ item.materialName }}/kg-
</span>
</div>
</ShadowRect>
</div>
<div style="flex:1;
padding: 0 12px 12px 12px;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;">
<ShadowRect v-for="(item, index) in materialMsg2" :key="index" :rounded="false">
<div
class="material"
style="
flex: 1;
padding-bottom: 3px;
display: flex;
flex-direction: column;
gap: 4px;
align-items: center;
justify-content: center;
">
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
{{item.materialUsed}}
</span>
<span style="color: #fff; font-size: 16px; letter-spacing: 1px">
- {{item.materialName}}/kg-
</span> </span>
</div> </div>
</ShadowRect> </ShadowRect>
</div> </div>
</div> </div>
</Container> </Container>
</template> </template>
@@ -81,12 +61,9 @@ export default {
return {}; return {};
}, },
computed: { computed: {
materialMsg1() { materialMsg() {
return this.$store.state.websocket.material.slice(0,9) return this.$store.state.websocket.material;
}, },
materialMsg2() {
return this.$store.state.websocket.material.slice(9)
}
}, },
methods: {}, methods: {},
}; };

View File

@@ -1,313 +1,324 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="160"
slot="handleBtn" label="操作"
:width="160" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增 -->
:total="total" <base-dialog
@pagination="getList"
/>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="centervisible" :dialogVisible="centervisible"
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="50%" width="50%">
> <add-or-update
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" /> ref="addOrUpdate"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 装车 --> <!-- 装车 -->
<base-dialog <base-dialog
dialogTitle="装车" dialogTitle="装车"
:dialogVisible="centervisible2" :dialogVisible="centervisible2"
@cancel="handleCancel2" @cancel="handleCancel2"
@confirm="handleConfirm2" @confirm="handleConfirm2"
:before-close="handleCancel2" :before-close="handleCancel2"
width="50%" width="50%">
> <loaded-page
<loaded-page ref="loadedPage" @successSubmit="successSubmit2" /> ref="loadedPage"
@successSubmit="successSubmit2" />
</base-dialog> </base-dialog>
<!-- 发货详情 --> <!-- 发货详情 -->
<delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' /> <delivery-log-detail
</div> ref="deliveryLogDetail"
v-if="showDetail" />
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery' import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery';
import AddOrUpdate from './components/addOrUpdate' import AddOrUpdate from './components/addOrUpdate';
import LoadedPage from './components/loadedPage' import LoadedPage from './components/loadedPage';
import DeliveryLogDetail from './components/deliveryLogDetail.vue' import DeliveryLogDetail from './components/deliveryLogDetail.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'orderName', prop: 'orderName',
label: '订单名', label: '订单名',
minWidth: 100, minWidth: 100,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'name', prop: 'name',
label: '发货单名称', label: '发货单名称',
minWidth: 100, minWidth: 100,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'deliveryTime', prop: 'deliveryTime',
label: '发货时间', label: '发货时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'code', prop: 'code',
label: '发货单号', label: '发货单号',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'deliverPerName', prop: 'deliverPerName',
label: '发货负责人', label: '发货负责人',
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'principal', prop: 'principal',
label: '运输负责人', label: '运输负责人',
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'principalCall', prop: 'principalCall',
label: '运输联系方式', label: '运输联系方式',
minWidth: 110, minWidth: 110,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'principalCost', prop: 'principalCost',
label: '运输费用', label: '运输费用',
align: 'right' align: 'right',
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: "DeliveryLog", name: 'DeliveryLog',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '订单名', type: 'input',
param: 'orderName', label: '订单名',
defaultSelect: '' param: 'orderName',
}, defaultSelect: '',
{ },
type: 'input', {
label: '发货单名称', type: 'input',
param: 'name' label: '发货单名称',
}, param: 'name',
{ },
type: 'input', {
label: '发货单号', type: 'input',
param: 'code' label: '发货单号',
}, param: 'code',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('extend:delivery-log:create')
{ ? 'separate'
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '', : '',
btnName: '新增', },
name: 'add', {
color: 'success', type: this.$auth.hasPermi('extend:delivery-log:create')
plain: true ? 'button'
} : '',
], btnName: '新增',
// 查询参数 name: 'add',
queryParams: { color: 'success',
pageNo: 1, plain: true,
pageSize: 20, },
orderName: '', ],
code: '', // 查询参数
name: '' queryParams: {
}, pageNo: 1,
tableProps, pageSize: 20,
list: [], orderName: '',
tableH: this.tableHeight(260), code: '',
total: 0, name: '',
tableBtn: [ },
this.$auth.hasPermi('extend:delivery-log:loaded') tableProps,
? { list: [],
type: 'loaded', total: 0,
btnName: '装车' tableBtn: [
} this.$auth.hasPermi('extend:delivery-log:loaded')
: undefined, ? {
this.$auth.hasPermi('extend:delivery-log:detail') type: 'loaded',
? { btnName: '装车',
type: 'detail', }
btnName: '详情' : undefined,
} this.$auth.hasPermi('extend:delivery-log:detail')
: undefined, ? {
this.$auth.hasPermi('extend:delivery-log:update') type: 'detail',
? { btnName: '详情',
type: 'edit', }
btnName: '编辑' : undefined,
} this.$auth.hasPermi('extend:delivery-log:update')
: undefined, ? {
this.$auth.hasPermi('extend:delivery-log:delete') type: 'edit',
? { btnName: '编辑',
type: 'delete', }
btnName: '删除' : undefined,
} this.$auth.hasPermi('extend:delivery-log:delete')
: undefined ? {
].filter((v) => v), type: 'delete',
addOrEditTitle: '', btnName: '删除',
centervisible: false, }
centervisible2: false, : undefined,
showDetail: false ].filter((v) => v),
} addOrEditTitle: '',
}, centervisible: false,
created() { centervisible2: false,
window.addEventListener('resize', () => { showDetail: false,
this.tableH = this.tableHeight(260) };
}) },
if (location.href.indexOf('?') > 0) { created() {
let arr = location.href.split('?')[1] if (location.href.indexOf('?') > 0) {
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]) let arr = location.href.split('?')[1];
} else { this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
this.formConfig[0].defaultSelect = '' } else {
} this.formConfig[0].defaultSelect = '';
this.queryParams.orderName = this.formConfig[0].defaultSelect }
this.getList(); this.queryParams.orderName = this.formConfig[0].defaultSelect;
}, this.getList();
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail }, },
watch: { components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
$route: 'initData' watch: {
}, $route: 'initData',
methods: { },
initData(to) { methods: {
if (to.name === 'DeliveryLog') { initData(to) {
if (location.href.indexOf('?') > 0) { if (to.name === 'DeliveryLog') {
let arr = location.href.split('?')[1] if (location.href.indexOf('?') > 0) {
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]) let arr = location.href.split('?')[1];
} else { this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
this.formConfig[0].defaultSelect = '' } else {
} this.formConfig[0].defaultSelect = '';
this.queryParams.orderName = this.formConfig[0].defaultSelect }
this.getList() this.queryParams.orderName = this.formConfig[0].defaultSelect;
} this.getList();
}, }
getList() { },
deliveryLogPage({...this.queryParams}).then(res => { getList() {
let arr = res.data.list || [] deliveryLogPage({ ...this.queryParams }).then((res) => {
arr && arr.map(item => { let arr = res.data.list || [];
item.principalCost = item.principalCost.toFixed(2) arr &&
}) arr.map((item) => {
this.list = arr item.principalCost = item.principalCost.toFixed(2);
this.total = res.data.total || 0 });
}) this.list = arr;
}, this.total = res.data.total || 0;
buttonClick(val) { });
if (val.btnName === 'search') { },
this.queryParams.name = val.name buttonClick(val) {
this.queryParams.orderName = val.orderName if (val.btnName === 'search') {
this.queryParams.code = val.code this.queryParams.name = val.name;
this.getList() this.queryParams.orderName = val.orderName;
} else { this.queryParams.code = val.code;
this.addOrEditTitle = '新增' this.getList();
this.centervisible = true } else {
this.$nextTick(() => { this.addOrEditTitle = '新增';
this.$refs.addOrUpdate.init() this.centervisible = true;
}) this.$nextTick(() => {
} this.$refs.addOrUpdate.init();
}, });
handleClick(val) { }
console.log(val) },
switch (val.type) { handleClick(val) {
case 'edit': console.log(val);
this.addOrEditTitle = '编辑' switch (val.type) {
this.centervisible = true case 'edit':
this.$nextTick(() => { this.addOrEditTitle = '编辑';
this.$refs.addOrUpdate.init(val.data.id) this.centervisible = true;
}) this.$nextTick(() => {
break this.$refs.addOrUpdate.init(val.data.id);
case 'delete': });
this.handleDelete(val.data) break;
break case 'delete':
case 'loaded': this.handleDelete(val.data);
this.centervisible2 = true break;
this.$nextTick(() => { case 'loaded':
this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId) this.centervisible2 = true;
}) this.$nextTick(() => {
break this.$refs.loadedPage.init(
default: val.data.id,
this.showDetail = true val.data.code,
this.$nextTick(() => { val.data.orderId
this.$refs.deliveryLogDetail.init(val.data) );
}) });
} break;
}, default:
// 新增 this.showDetail = true;
handleCancel() { this.$nextTick(() => {
this.$refs.addOrUpdate.formClear() this.$refs.deliveryLogDetail.init(val.data);
this.centervisible = false });
this.addOrEditTitle = '' }
}, },
handleConfirm() { // 新增
this.$refs.addOrUpdate.submitForm() handleCancel() {
}, this.$refs.addOrUpdate.formClear();
successSubmit() { this.centervisible = false;
this.handleCancel() this.addOrEditTitle = '';
this.getList() },
}, handleConfirm() {
// 删除 this.$refs.addOrUpdate.submitForm();
handleDelete(val) { },
this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() { successSubmit() {
return deliveryLogDelete({ id: val.id }) this.handleCancel();
}).then(() => { this.getList();
this.getList(); },
this.$modal.msgSuccess("操作成功"); // 删除
}).catch(() => {}); handleDelete(val) {
}, this.$modal
// 装车 .confirm('是否确认删除发货单名为"' + val.name + '"的数据项?')
handleCancel2() { .then(function () {
this.$refs.loadedPage.formClear() return deliveryLogDelete({ id: val.id });
this.centervisible2 = false })
}, .then(() => {
handleConfirm2() { this.getList();
this.$refs.loadedPage.submitForm() this.$modal.msgSuccess('操作成功');
}, })
successSubmit2() { .catch(() => {});
this.handleCancel2() },
this.getList() // 装车
} handleCancel2() {
} this.$refs.loadedPage.formClear();
} this.centervisible2 = false;
},
handleConfirm2() {
this.$refs.loadedPage.submitForm();
},
successSubmit2() {
this.handleCancel2();
this.getList();
},
},
};
</script> </script>

View File

@@ -1,130 +1,124 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="80"
slot="handleBtn" label="操作"
:width="80" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 详情抽屉 -->
:total="total" <delivery-log-det-detail ref="deliveryLogDetail" />
@pagination="getList" </div>
/>
<!-- 详情抽屉 -->
<delivery-log-det-detail ref='deliveryLogDetail'/>
</div>
</template> </template>
<script> <script>
import { deliveryProgressPage } from '@/api/base/delivery' import { deliveryProgressPage } from '@/api/base/delivery';
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue' import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'orderName', prop: 'orderName',
label: '订单名', label: '订单名',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'customerName', prop: 'customerName',
label: '客户名称', label: '客户名称',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位' label: '单位',
}, },
{ {
prop: 'orderNum', prop: 'orderNum',
label: '订单数量' label: '订单数量',
}, },
{ {
prop: 'num', prop: 'num',
label: '发货数量' label: '发货数量',
}, },
{ {
prop: 'rate', prop: 'rate',
label: '累计发货比例(%)' label: '累计发货比例(%)',
} },
] ];
export default { export default {
name: "DeliveryLogDet", name: 'DeliveryLogDet',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '订单名', type: 'input',
param: 'orderName' label: '订单名',
}, param: 'orderName',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
} color: 'primary',
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
orderName: '' pageSize: 20,
}, orderName: '',
tableProps, },
list: [], tableProps,
tableH: this.tableHeight(260), list: [],
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('extend:delivery-log-det:detail') this.$auth.hasPermi('extend:delivery-log-det:detail')
? { ? {
type: 'detail', type: 'detail',
btnName: '详情' btnName: '详情',
} }
: undefined : undefined,
].filter((v) => v) ].filter((v) => v),
} };
}, },
components: { DeliveryLogDetDetail }, components: { DeliveryLogDetDetail },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList(); getList() {
}, deliveryProgressPage({ ...this.queryParams }).then((res) => {
methods: { this.list = res.data.list || [];
getList() { this.total = res.data.total || 0;
deliveryProgressPage({...this.queryParams}).then(res => { });
this.list = res.data.list || [] },
this.total = res.data.total || 0 buttonClick(val) {
}) this.queryParams.orderName = val.orderName;
}, this.getList();
buttonClick(val) { },
this.queryParams.orderName = val.orderName handleClick(val) {
this.getList() console.log(val);
}, this.$nextTick(() => {
handleClick(val) { this.$refs.deliveryLogDetail.init(val.data);
console.log(val) });
this.$nextTick(() => { },
this.$refs.deliveryLogDetail.init(val.data) },
}) };
}
}
}
</script> </script>

View File

@@ -187,8 +187,11 @@
@click="resetBtn"> @click="resetBtn">
重置 重置
</el-button> </el-button>
<span class="separateStyle"></span> <span
class="separateStyle"
v-hasPermi="['analysis:contrast-analysis:export']"></span>
<el-button <el-button
v-hasPermi="['analysis:contrast-analysis:export']"
type="primary" type="primary"
size="small" size="small"
plain plain

View File

@@ -80,10 +80,13 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span class="separateStyle"></span> <span
class="separateStyle"
v-hasPermi="['analysis:qoq-analysis:export']"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-hasPermi="['analysis:qoq-analysis:export']"
type="primary" type="primary"
size="small" size="small"
@click="exportData" @click="exportData"

View File

@@ -170,8 +170,11 @@
@click="resetBtn"> @click="resetBtn">
重置 重置
</el-button> </el-button>
<span class="separateStyle"></span> <span
class="separateStyle"
v-hasPermi="['analysis:trend-analysis:export']"></span>
<el-button <el-button
v-hasPermi="['analysis:trend-analysis:export']"
type="primary" type="primary"
size="small" size="small"
plain plain

View File

@@ -69,10 +69,13 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span class="separateStyle"></span> <span
class="separateStyle"
v-hasPermi="['analysis:yoy-analysis:export']"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-hasPermi="['analysis:yoy-analysis:export']"
type="primary" type="primary"
size="small" size="small"
@click="exportData" @click="exportData"

View File

@@ -1,197 +1,219 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> :formConfigs="formConfig"
<!-- 列表 --> ref="searchBarForm"
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" @headBtnClick="buttonClick" />
:max-height="tableH"> <!-- 列表 -->
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" <base-table
@clickBtn="handleClick" /> :page="queryParams.pageNo"
</base-table> :limit="queryParams.pageSize"
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" :table-props="tableProps"
@pagination="getList" /> :table-data="list"
<!-- 新增 --> :max-height="tableH">
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel" <method-btn
@confirm="handleConfirm" :before-close="handleCancel"> v-if="tableBtn.length"
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" /> slot="handleBtn"
</base-dialog> :width="80"
</div> label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-add
ref="energyPlc"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc"; import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
// import { publicFormatter } from '@/utils/dict' import EnergyPlcAdd from './components/energyPlcAdd.vue';
import EnergyPlcAdd from './components/energyPlcAdd.vue' import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名', label: '关联表名',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '关联表编码', label: '关联表编码',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'name', prop: 'name',
label: '标识名', label: '标识名',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'enName', prop: 'enName',
label: '英文标识名' label: '英文标识名',
}, },
{ {
prop: 'collection', prop: 'collection',
label: '是否采集' label: '是否采集',
}, },
{ {
prop: 'description', prop: 'description',
label: '描述', label: '描述',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: "EnergyPlc", name: 'EnergyPlc',
components: { EnergyPlcAdd }, components: { EnergyPlcAdd },
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '标识名', type: 'input',
placeholder: '标识名', label: '标识名',
param: 'name' placeholder: '标识名',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
tableProps, ],
tableBtn: [ tableProps,
this.$auth.hasPermi('base:energy-plc:update') tableBtn: [
? { this.$auth.hasPermi('base:energy-plc:update')
type: 'edit', ? {
btnName: '编辑' type: 'edit',
} btnName: '编辑',
: undefined, }
this.$auth.hasPermi('base:energy-plc:delete') : undefined,
? { this.$auth.hasPermi('base:energy-plc:delete')
type: 'delete', ? {
btnName: '删除' type: 'delete',
} btnName: '删除',
: undefined }
].filter((v) => v), : undefined,
tableH: this.tableHeight(260), ].filter((v) => v),
collectionList: [ collectionList: [
{ value: 0, label: '否' }, { value: 0, label: '否' },
{ value: 1, label: '是' } { value: 1, label: '是' },
], ],
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
list: [], list: [],
// 弹出层标题 // 弹出层标题
addOrEditTitle: "", addOrEditTitle: '',
// 是否显示弹出层 // 是否显示弹出层
centervisible: false, centervisible: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null name: null,
} },
}; };
}, },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList(); buttonClick(val) {
}, switch (val.btnName) {
methods: { case 'search':
buttonClick(val) { this.queryParams.pageNo = 1;
switch (val.btnName) { this.queryParams.name = val.name;
case 'search': this.getList();
this.queryParams.pageNo = 1; break;
this.queryParams.name = val.name default:
this.getList() this.addOrEditTitle = '新增';
break this.centervisible = true;
default: this.$nextTick(() => {
this.addOrEditTitle = '新增' this.$refs.energyPlc.init();
this.centervisible = true });
this.$nextTick(() => { }
this.$refs.energyPlc.init() },
}) /** 查询列表 */
} getList() {
}, getEnergyPlcPage(this.queryParams).then((response) => {
/** 查询列表 */ let arr = response.data.list || [];
getList() { arr &&
getEnergyPlcPage(this.queryParams).then(response => { arr.map((item) => {
let arr = response.data.list || []; this.collectionList.map((i) => {
arr && arr.map(item => { if (item.collection === i.value) {
this.collectionList.map(i => { item.collection = i.label;
if (item.collection === i.value) { }
item.collection = i.label });
} });
}) this.list = arr;
}) this.total = response.data.total;
this.list = arr });
this.total = response.data.total; },
}); handleClick(val) {
}, switch (val.type) {
handleClick(val) { case 'edit':
switch (val.type) { this.addOrEditTitle = '编辑';
case 'edit': this.$nextTick(() => {
this.addOrEditTitle = '编辑' this.$refs.energyPlc.init(val.data.id);
this.$nextTick(() => { });
this.$refs.energyPlc.init(val.data.id) this.centervisible = true;
}) break;
this.centervisible = true default:
break this.handleDelete(val.data);
default: }
this.handleDelete(val.data) },
} handleCancel() {
}, this.$refs.energyPlc.formClear();
handleCancel() { this.centervisible = false;
this.$refs.energyPlc.formClear() this.addOrEditTitle = '';
this.centervisible = false },
this.addOrEditTitle = '' handleConfirm() {
}, this.$refs.energyPlc.submitForm();
handleConfirm() { },
this.$refs.energyPlc.submitForm() successSubmit() {
}, this.handleCancel();
successSubmit() { this.getList();
this.handleCancel() },
this.getList() /** 删除按钮操作 */
}, handleDelete(row) {
/** 删除按钮操作 */ this.$modal
handleDelete(row) { .confirm('是否确认删除关联表名为"' + row.name + '"的数据项?')
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function () { .then(function () {
return deleteEnergyPlc(row.id); return deleteEnergyPlc(row.id);
}).then(() => { })
this.queryParams.pageNo = 1; .then(() => {
this.getList(); this.queryParams.pageNo = 1;
this.$modal.msgSuccess("删除成功"); this.getList();
}).catch(() => { }); this.$modal.msgSuccess('删除成功');
} })
} .catch(() => {});
},
},
}; };
</script> </script>

View File

@@ -1,226 +1,258 @@
<template> <template>
<div> <div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'> <el-drawer
<div class="box"> :title="drawerTitle"
<el-form :inline="true"> :visible.sync="visible"
<el-form-item label="关联表名"> size="70%"
<el-input v-model="plcTableName" size='small' readonly></el-input> @close="closeD"
</el-form-item> :show-close="false">
<el-form-item label="对象"> <div class="box">
<el-input v-model="objName" size='small' readonly></el-input> <el-form :inline="true">
</el-form-item> <el-form-item label="关联表名">
<el-form-item v-if="showBtn"> <el-input
<el-button type="success" size='small' plain @click="addNew">新增</el-button> v-model="plcTableName"
</el-form-item> size="small"
</el-form> readonly
<base-table style="width: 250px"></el-input>
:page="queryParams.pageNo" </el-form-item>
:limit="queryParams.pageSize" <el-form-item label="对象">
:table-props="tableProps" <el-input
:table-data="tableData" v-model="objName"
:max-height="tableH" size="small"
> readonly
<method-btn style="width: 250px"></el-input>
v-if="tableBtn.length" </el-form-item>
slot="handleBtn" <el-form-item v-if="showBtn">
:width="100" <el-button
label="操作" type="success"
:method-list="tableBtn" size="small"
@clickBtn="handleClick" plain
/> @click="addNew">
</base-table> 新增
<pagination </el-button>
:page.sync="queryParams.pageNo" </el-form-item>
:limit.sync="queryParams.pageSize" </el-form>
:total="total" <base-table
@pagination="getList" :page="queryParams.pageNo"
/> :limit="queryParams.pageSize"
</div> :table-props="tableProps"
</el-drawer> :table-data="tableData"
<!-- 新增 --> :max-height="tableH">
<base-dialog <method-btn
:dialogTitle="addOrEditTitle" v-if="tableBtn.length"
:dialogVisible="centervisible" slot="handleBtn"
@cancel="handleCancel" :width="100"
@confirm="handleConfirm" label="操作"
:before-close="handleCancel" :method-list="tableBtn"
> @clickBtn="handleClick" />
<energy-plc-param-add ref="energyPlcParam" @successSubmit="successSubmit" /> </base-table>
</base-dialog> <pagination
</div> :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-param-add
ref="energyPlcParam"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getEnergyPlcParamPage, deleteEnergyPlcParam } from '@/api/base/energyPlcParam' import {
import EnergyPlcParamAdd from './energyPlcParamAdd' getEnergyPlcParamPage,
import { publicFormatter } from '@/utils/dict' deleteEnergyPlcParam,
} from '@/api/base/energyPlcParam';
import EnergyPlcParamAdd from './energyPlcParamAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'typeId', prop: 'typeId',
label: '能源类型' label: '能源类型',
}, filter: publicFormatter('energy_type'),
{ },
prop: 'plcParamName', {
label: '参数列名' prop: 'plcParamName',
}, label: '参数列名',
{ },
prop: 'name', {
label: '参数名称' prop: 'name',
}, label: '参数名称',
{ },
prop: 'unit', {
label: '单位', prop: 'unit',
filter: publicFormatter('energy_unit') label: '单位',
}, filter: publicFormatter('unit_dict'),
{ },
prop: 'collection', {
label: '是否采集' prop: 'collection',
}, label: '是否采集',
{ },
prop: 'description', {
label: '描述' prop: 'description',
} label: '描述',
] },
];
export default { export default {
name: 'EnergyPlcParam', name: 'EnergyPlcParam',
props: { props: {
energyTypeList: { energyTypeList: {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return [] return [];
} },
} },
}, },
data() { data() {
return { return {
visible: false, visible: false,
drawerTitle: '', drawerTitle: '',
tableProps, tableProps,
tableData: [], tableData: [],
tableBtn: [], tableBtn: [],
tableH: this.tableHeight(115), tableH: this.tableHeight(115),
total: 0, total: 0,
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 30, pageSize: 30,
connectId: null connectId: null,
}, },
plcTableName: '', plcTableName: '',
objName: '', objName: '',
// 弹出层标题 // 弹出层标题
addOrEditTitle: "", addOrEditTitle: '',
// 是否显示弹出层 // 是否显示弹出层
centervisible: false, centervisible: false,
collectionList: [ collectionList: [
{value: 0,label: '否'}, { value: 0, label: '否' },
{value: 1,label: '是'} { value: 1, label: '是' },
], ],
showBtn: true showBtn: true,
} };
}, },
components: { EnergyPlcParamAdd }, components: { EnergyPlcParamAdd },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115) this.tableH = this.tableHeight(115);
}) });
}, },
methods: { methods: {
init(data,title) { init(data, title) {
this.visible = true this.visible = true;
this.queryParams.connectId = data.id this.queryParams.connectId = data.id;
this.plcTableName = data.plcTableName this.plcTableName = data.plcTableName;
this.objName = data.objName this.objName = data.objName;
this.getList() this.getList();
if (title === 'detail') { if (title === 'detail') {
this.drawerTitle = '查看参数' this.drawerTitle = '查看参数';
this.showBtn = false this.showBtn = false;
this.tableBtn = [] this.tableBtn = [];
} else { } else {
this.drawerTitle = '参数绑定' this.drawerTitle = '参数绑定';
this.showBtn = true this.showBtn = true;
this.tableBtn = [ this.tableBtn = [
{ {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
}, },
{ {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} },
] ];
} }
}, },
getList() { getList() {
getEnergyPlcParamPage({...this.queryParams}).then((res) => { getEnergyPlcParamPage({ ...this.queryParams }).then((res) => {
let arr = res.data.list || [] let arr = res.data.list || [];
arr&&arr.map(item => { arr &&
this.collectionList.map(i => { arr.map((item) => {
if (item.collection === i.value) { this.collectionList.map((i) => {
item.collection = i.label if (item.collection === i.value) {
} item.collection = i.label;
}) }
this.energyTypeList.map(j => { });
if (item.typeId === j.id) { this.energyTypeList.map((j) => {
item.typeId = j.name if (item.typeId === j.id) {
} item.typeId = j.name;
}) }
}) });
this.tableData = arr });
this.total = res.data.total; this.tableData = arr;
}) this.total = res.data.total;
}, });
// 新增 },
addNew() { // 新增
this.addOrEditTitle = '新增' addNew() {
this.centervisible = true this.addOrEditTitle = '新增';
this.$nextTick(() => { this.centervisible = true;
this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: ''}) this.$nextTick(() => {
}) this.$refs.energyPlcParam.init({
}, connectId: this.queryParams.connectId,
handleCancel() { id: '',
this.$refs.energyPlcParam.formClear() });
this.centervisible = false });
this.addOrEditTitle = '' },
}, handleCancel() {
handleConfirm() { this.$refs.energyPlcParam.formClear();
this.$refs.energyPlcParam.submitForm() this.centervisible = false;
}, this.addOrEditTitle = '';
successSubmit() { },
this.handleCancel() handleConfirm() {
this.getList() this.$refs.energyPlcParam.submitForm();
}, },
handleClick(val) { successSubmit() {
console.log(val) this.handleCancel();
switch (val.type) { this.getList();
case 'edit': },
this.addOrEditTitle = '编辑' handleClick(val) {
this.centervisible = true console.log(val);
this.$nextTick(() => { switch (val.type) {
this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: val.data.id}) case 'edit':
}) this.addOrEditTitle = '编辑';
break this.centervisible = true;
default: this.$nextTick(() => {
this.handleDelete(val.data) this.$refs.energyPlcParam.init({
} connectId: this.queryParams.connectId,
}, id: val.data.id,
/** 删除按钮操作 */ });
handleDelete(row) { });
this.$modal.confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?').then(function() { break;
return deleteEnergyPlcParam(row.id); default:
}).then(() => { this.handleDelete(val.data);
this.queryParams.pageNo = 1; }
this.getList(); },
this.$modal.msgSuccess("删除成功"); /** 删除按钮操作 */
}).catch(() => {}); handleDelete(row) {
}, this.$modal
closeD() { .confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?')
this.$emit('closeDrawer') .then(function () {
} return deleteEnergyPlcParam(row.id);
} })
} .then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@@ -57,14 +57,18 @@ import { getTree } from '@/api/analysis/energyAnalysis';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyPlcConnectAdd from './components/energyPlcConnectAdd'; import EnergyPlcConnectAdd from './components/energyPlcConnectAdd';
import EnergyPlcParam from './components/energyPlcParam'; import EnergyPlcParam from './components/energyPlcParam';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '对象', label: '对象',
minWidth: 130,
showOverflowtooltip: true,
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码',
minWidth: 150,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@@ -86,11 +90,13 @@ const tableProps = [
{ {
prop: 'varNum', prop: 'varNum',
label: '绑定参数数量', label: '绑定参数数量',
width: 110,
}, },
]; ];
export default { export default {
name: 'EnergyPlcConnect', name: 'EnergyPlcConnect',
components: { EnergyPlcConnectAdd, EnergyPlcParam }, components: { EnergyPlcConnectAdd, EnergyPlcParam },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -144,7 +150,6 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
@@ -165,9 +170,6 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
}, },
mounted() { mounted() {

View File

@@ -1,38 +0,0 @@
<template>
<div class="tableInner">
<!-- <el-input v-model="list[itemProp]" @blur="changeInput" /> -->
<el-input-number v-model="list[itemProp]" @change="changeInput" :min="0" :max="999999999" style='width: 100%;' :controls='false' :precision='2'></el-input-number>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeInput() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@@ -1,44 +0,0 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" placeholder="请选择" style="width: 100%;" @change="changeSelect">
<el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'SelectArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeSelect() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@@ -40,18 +40,10 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<add-table <add-table
:table-props="tableProps"
:table-data="tableData" :table-data="tableData"
:table-name-list="tableNameList" :table-name-list="tableNameList"
@emitFun="inputChange" @emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> @emitButtonClick="emitButtonClick" />
<!-- <base-table
border
:table-props="tableProps"
:table-data="tableData"
:add-button-show="addButtonShow"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@@ -64,21 +56,7 @@ import {
} from '@/api/base/energyQuantityManual'; } from '@/api/base/energyQuantityManual';
import moment from 'moment'; import moment from 'moment';
import AddTable from './AddTable'; import AddTable from './AddTable';
import InputArea from './InputArea';
import SelectArea from './SelectArea';
import { energyTableGet } from '@/api/base/energyQuantityManual'; import { energyTableGet } from '@/api/base/energyQuantityManual';
const tableProps = [
{
prop: 'tableName',
label: '表名*',
subcomponent: SelectArea,
},
{
prop: 'readingQuantity',
label: '抄表数*',
subcomponent: InputArea,
},
];
export default { export default {
name: 'EnergyQuantityManualAdd', name: 'EnergyQuantityManualAdd',
props: { props: {
@@ -92,7 +70,6 @@ export default {
}, },
data() { data() {
return { return {
tableProps,
tableData: [], tableData: [],
tableNameList: [], //表名list tableNameList: [], //表名list
addButtonShow: '新增', addButtonShow: '新增',
@@ -122,6 +99,7 @@ export default {
} else if (params.type === 'meterReading') { } else if (params.type === 'meterReading') {
this.isEdit = false; this.isEdit = false;
this.form.energyTypeId = params.energyTypeId; this.form.energyTypeId = params.energyTypeId;
this.selEnergyType(this.form.energyTypeId);
let obj = {}; let obj = {};
obj.tableName = params.tableName + ''; obj.tableName = params.tableName + '';
obj.readingQuantity = 0; obj.readingQuantity = 0;
@@ -133,6 +111,7 @@ export default {
energyQuantityManualGet({ id: this.form.id }).then((res) => { energyQuantityManualGet({ id: this.form.id }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId; this.form.energyTypeId = res.data.energyTypeId;
this.selEnergyType(this.form.energyTypeId);
this.form.recordTime = res.data.recordTime this.form.recordTime = res.data.recordTime
? res.data.recordTime ? res.data.recordTime
: null; : null;
@@ -164,6 +143,11 @@ export default {
this.tableNameList = []; this.tableNameList = [];
energyTableGet({ energyTypeId: id }).then((res) => { energyTableGet({ energyTypeId: id }).then((res) => {
this.tableNameList = res.data.tableObjs || []; this.tableNameList = res.data.tableObjs || [];
if (this.tableNameList.length === 0) {
this.$modal.msgWarning(
'当前能源类型暂无配置表名,请先到《表名配置》页面配置'
);
}
}); });
}, },
submitForm() { submitForm() {

View File

@@ -52,12 +52,12 @@ import { publicFormatter } from '@/utils/dict';
import { parseTimeTable } from '@/utils/ruoyi'; import { parseTimeTable } from '@/utils/ruoyi';
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'; import EnergyQuantityManualAdd from './components/energyQuantityManualAdd';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'energyType', prop: 'energyTypeLabel',
label: '能源类型', label: '能源类型',
minWidth: 110, minWidth: 110,
filter: publicFormatter('energy_type'),
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@@ -142,7 +142,6 @@ export default {
}, },
], ],
tableProps, tableProps,
tableH: this.tableHeight(260),
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
@@ -181,10 +180,8 @@ export default {
}; };
}, },
components: { EnergyQuantityManualAdd }, components: { EnergyQuantityManualAdd },
mixins: [tableHeightMixin],
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf(); let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment( let start = moment(
moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00') moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')
@@ -244,6 +241,11 @@ export default {
? item.amount.toFixed(2) ? item.amount.toFixed(2)
: '' : ''
: ''; : '';
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
}); });
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
@@ -305,7 +307,7 @@ export default {
handleDelete(row) { handleDelete(row) {
console.log(row.id); console.log(row.id);
this.$modal this.$modal
.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?') .confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
.then(function () { .then(function () {
return energyQuantityManualDelete({ id: row.id }); return energyQuantityManualDelete({ id: row.id });
}) })

View File

@@ -1,220 +1,254 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> :formConfigs="formConfig"
<!-- 列表 --> ref="searchBarForm"
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" @headBtnClick="buttonClick" />
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" /> <!-- 列表 -->
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" <base-table
@pagination="getList" /> :page="queryParams.pageNo"
</div> :limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:selectWidth="55"
:max-height="tableH"
@selection-change="selectChange" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template> </template>
<script> <script>
import { getEnergyQuantityRealtimePage } from "@/api/base/energyQuantityRealtime" import { getEnergyQuantityRealtimePage } from '@/api/base/energyQuantityRealtime';
import { getEnergyTypeListAll } from "@/api/base/energyType" import { getEnergyTypeListAll } from '@/api/base/energyType';
// import { publicFormatter } from '@/utils/dict' // import { publicFormatter } from '@/utils/dict';
import FileSaver from "file-saver" import FileSaver from 'file-saver';
import * as XLSX from 'xlsx/xlsx.mjs' import * as XLSX from 'xlsx/xlsx.mjs';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '统计对象', label: '统计对象',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'energyTypeName', prop: 'energyTypeLabel',
label: '能源类型', label: '能源类型',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'startValue', prop: 'startValue',
label: '初始值' label: '初始值',
}, },
{ {
prop: 'endValue', prop: 'endValue',
label: '当前值' label: '当前值',
}, },
{ {
prop: 'diffValue', prop: 'diffValue',
label: '差值' label: '差值',
}, },
{ {
prop: 'amount', prop: 'amount',
label: '金额' label: '金额',
} },
] ];
export default { export default {
name: "EnergyQuantityRealtime", name: 'EnergyQuantityRealtime',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '能源类型', type: 'select',
selectOptions: [], label: '能源类型',
param: 'energyTypeId', labelField: 'labelName',
filterable: true selectOptions: [],
}, param: 'energyTypeId',
{ filterable: true,
type: 'datePicker', },
label: '时间', {
dateType: 'datetimerange', type: 'datePicker',
format: 'yyyy-MM-dd HH:mm:ss', label: '时间',
valueFormat: "timestamp", dateType: 'datetimerange',
rangeSeparator: '-', format: 'yyyy-MM-dd HH:mm:ss',
startPlaceholder: '开始时间', valueFormat: 'timestamp',
endPlaceholder: '结束时间', rangeSeparator: '-',
param: 'timeVal', startPlaceholder: '开始时间',
defaultSelect: [], endPlaceholder: '结束时间',
width: 350 param: 'timeVal',
}, defaultSelect: [],
{ width: 350,
type: 'button', },
btnName: '查询', {
name: 'search', type: 'button',
color: 'primary' btnName: '查询',
}, name: 'search',
{ color: 'primary',
type: 'separate' },
}, {
{ type: 'separate',
type: this.$auth.hasPermi('base:energy-quantity-realtime:export') ? 'button' : '', },
btnName: '导出', {
name: 'export', type: this.$auth.hasPermi('base:energy-quantity-realtime:export')
color: 'primary', ? 'button'
plain: true : '',
} btnName: '导出',
], name: 'export',
tableProps, color: 'primary',
tableH: this.tableHeight(260), plain: true,
// 总条数 },
total: 0, ],
// 班次基础信息列表 tableProps,
list: [], // 总条数
// 查询参数 total: 0,
queryParams: { // 班次基础信息列表
pageNo: 1, list: [],
pageSize: 20, // 查询参数
energyTypeId: '', queryParams: {
startTime: null, pageNo: 1,
endTime: null pageSize: 20,
}, energyTypeId: '',
energyTypeList: [], startTime: null,
exportList: [] endTime: null,
}; },
}, energyTypeList: [],
created() { exportList: [],
window.addEventListener('resize', () => { };
this.tableH = this.tableHeight(260) },
}) created() {
if (location.href.indexOf('?') > 0) { if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&') let arr = location.href.split('?')[1].split('&');
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]] this.formConfig[1].defaultSelect = [
} else { arr[0].split('=')[1],
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()] arr[1].split('=')[1],
} ];
this.queryParams.startTime = this.formConfig[1].defaultSelect[0] } else {
this.queryParams.endTime = this.formConfig[1].defaultSelect[1] this.formConfig[1].defaultSelect = [
this.getList(); Date.now() - 7 * 24 * 3600000,
this.getTypeList() Date.now(),
}, ];
watch: { }
$route: 'initData' this.queryParams.startTime = this.formConfig[1].defaultSelect[0];
}, this.queryParams.endTime = this.formConfig[1].defaultSelect[1];
methods: { this.getList();
initData(to) { this.getTypeList();
if (to.name === 'EnergyQuantityRealtime') { },
if (location.href.indexOf('?') > 0) { watch: {
let arr = location.href.split('?')[1].split('&') $route: 'initData',
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]] },
} else { methods: {
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()] initData(to) {
} if (to.name === 'EnergyQuantityRealtime') {
this.queryParams.startTime = this.formConfig[1].defaultSelect[0] if (location.href.indexOf('?') > 0) {
this.queryParams.endTime = this.formConfig[1].defaultSelect[1] let arr = location.href.split('?')[1].split('&');
this.getList() this.formConfig[1].defaultSelect = [
} arr[0].split('=')[1],
}, arr[1].split('=')[1],
buttonClick(val) { ];
this.queryParams.pageNo = 1; } else {
this.queryParams.energyTypeId = val.energyTypeId this.formConfig[1].defaultSelect = [
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null Date.now() - 7 * 24 * 3600000,
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null Date.now(),
switch (val.btnName) { ];
case 'search': }
this.getList() this.queryParams.startTime = this.formConfig[1].defaultSelect[0];
break this.queryParams.endTime = this.formConfig[1].defaultSelect[1];
default: this.getList();
this.exportTable() }
} },
}, buttonClick(val) {
/** 查询列表 */ this.queryParams.pageNo = 1;
getList() { this.queryParams.energyTypeId = val.energyTypeId;
getEnergyQuantityRealtimePage(this.queryParams).then(response => { this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
let arr = response.data.list || [] this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
arr && arr.map(item => { switch (val.btnName) {
item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : '' case 'search':
}) this.getList();
this.list = arr break;
this.total = response.data.total; default:
this.exportList = [] this.exportTable();
}); }
}, },
getTypeList() { /** 查询列表 */
getEnergyTypeListAll().then((res) => { getList() {
this.formConfig[0].selectOptions = res.data || [] getEnergyQuantityRealtimePage(this.queryParams).then((response) => {
this.energyTypeList = res.data || [] let arr = response.data.list || [];
}) arr &&
}, arr.map((item) => {
selectChange(val) { item.amount = item.amount
console.log(val) ? !isNaN(parseFloat(item.amount)) && isFinite(item.amount)
this.exportList = val ? item.amount.toFixed(2)
}, : ''
// 勾选导出 : '';
exportTable() { this.getDictDatas('energy_type').map((subItem) => {
if (this.exportList.length > 0) { if (item.energyTypeName === subItem.value) {
let body = this.exportList.map((x) => [ item.energyTypeLabel = subItem.label;
x.objName, }
x.objCode, });
x.energyTypeName, });
x.startValue, this.list = arr;
x.endValue, this.total = response.data.total;
x.diffValue, this.exportList = [];
x.amount });
]) },
let header = [] getTypeList() {
this.tableProps.map((y) => { getEnergyTypeListAll().then((res) => {
header.push(y.label) this.formConfig[0].selectOptions = res.data || [];
}) this.energyTypeList = res.data || [];
body.unshift(header) });
console.log(body) },
const filename = '能源抄表.xlsx' selectChange(val) {
const ws_name = 'Sheet1' console.log(val);
const wb = XLSX.utils.book_new() this.exportList = val;
const ws = XLSX.utils.aoa_to_sheet(body) },
XLSX.utils.book_append_sheet(wb, ws, ws_name) // 勾选导出
let wbout = XLSX.write(wb, { exportTable() {
bookType: 'xlsx', if (this.exportList.length > 0) {
bookSST: false, let body = this.exportList.map((x) => [
type: 'array' x.objName,
}) x.objCode,
FileSaver.saveAs( x.energyTypeLabel,
new Blob([wbout], { x.startValue,
type: 'application/octet-stream' x.endValue,
}), x.diffValue,
filename x.amount,
) ]);
} else { let header = [];
this.$modal.msgWarning('请勾选需要导出的数据') this.tableProps.map((y) => {
} header.push(y.label);
} });
} body.unshift(header);
console.log(body);
const filename = '能源抄表.xlsx';
const ws_name = 'Sheet1';
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(body);
XLSX.utils.book_append_sheet(wb, ws, ws_name);
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'array',
});
FileSaver.saveAs(
new Blob([wbout], {
type: 'application/octet-stream',
}),
filename
);
} else {
this.$modal.msgWarning('请勾选需要导出的数据');
}
},
},
}; };
</script> </script>

View File

@@ -40,6 +40,7 @@ import { getEnergyTypePage, deleteEnergyType } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import InnerTable from './components/InnerTable'; import InnerTable from './components/InnerTable';
import EnergyTypeAdd from './components/energyTypeAdd'; import EnergyTypeAdd from './components/energyTypeAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'code', prop: 'code',
@@ -48,9 +49,8 @@ const tableProps = [
minWidth: 150, minWidth: 150,
}, },
{ {
prop: 'name', prop: 'energyTypeLabel',
label: '能源类型', label: '能源类型',
filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'unit', prop: 'unit',
@@ -70,6 +70,7 @@ const tableProps = [
export default { export default {
name: 'EnergyType', name: 'EnergyType',
components: { EnergyTypeAdd }, components: { EnergyTypeAdd },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -96,7 +97,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(220), heightNum: 220,
pricingMethodList: [ pricingMethodList: [
{ value: 0, label: '分时间段计价' }, { value: 0, label: '分时间段计价' },
{ value: 1, label: '分使用量计价' }, { value: 1, label: '分使用量计价' },
@@ -118,9 +119,6 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220);
});
this.getList(); this.getList();
}, },
methods: { methods: {
@@ -142,6 +140,11 @@ export default {
item.pricingMethod = i.label; item.pricingMethod = i.label;
} }
}); });
this.getDictDatas('energy_type').map((subItem) => {
if (item.name === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
}); });
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
@@ -174,8 +177,9 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
console.log(row);
this.$modal this.$modal
.confirm('是否确认删除能源类型为"' + row.name + '"的数据项?') .confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
.then(function () { .then(function () {
return deleteEnergyType(row.id); return deleteEnergyType(row.id);
}) })

View File

@@ -32,6 +32,7 @@
import { energyTablePage } from '@/api/base/energyQuantityManual'; import { energyTablePage } from '@/api/base/energyQuantityManual';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableNameConfigUpdate from './components/tableNameConfigUpdate.vue'; import tableNameConfigUpdate from './components/tableNameConfigUpdate.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'energyType', prop: 'energyType',
@@ -63,10 +64,11 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}, },
tableH: this.tableHeight(165), heightNum: 165,
centervisible: false, centervisible: false,
}; };
}, },
mixins: [tableHeightMixin],
created() { created() {
this.getList(); this.getList();
}, },

View File

@@ -182,6 +182,7 @@ export default {
limitType: '', limitType: '',
minValue: 0, minValue: 0,
maxValue: 0, maxValue: 0,
tableName: '',
}, },
objIds: [], // 回显数组 objIds: [], // 回显数组
isEdit: false, //是否是编辑 isEdit: false, //是否是编辑
@@ -214,6 +215,9 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data; this.form = res.data;
this.form.plcParamId = res.data.plcParamId || ''; this.form.plcParamId = res.data.plcParamId || '';
this.form.tableName = this.form.tableName
? this.form.tableName + ''
: '';
this.form.method = this.form.method ? this.form.method + '' : ''; this.form.method = this.form.method ? this.form.method + '' : '';
this.form.limitType = this.form.limitType this.form.limitType = this.form.limitType
? this.form.limitType + '' ? this.form.limitType + ''
@@ -294,7 +298,7 @@ export default {
}, },
selectObj(val) { selectObj(val) {
this.form.objectId = val[val.length - 1]; this.form.objectId = val[val.length - 1];
this.form.objectType = val.length - 1; this.form.objectType = val.length;
if (this.form.energyTypeId && this.form.type) { if (this.form.energyTypeId && this.form.type) {
this.getDetailList(); this.getDetailList();
this.form.plcParamId = ''; this.form.plcParamId = '';

View File

@@ -51,6 +51,7 @@ import { getEnergyTypeListAll } from '@/api/base/energyType';
import { getTree } from '@/api/analysis/energyAnalysis'; import { getTree } from '@/api/analysis/energyAnalysis';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import EnergyLimitAdd from './components/energyLimitAdd'; import EnergyLimitAdd from './components/energyLimitAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'method', prop: 'method',
@@ -104,6 +105,7 @@ const tableProps = [
export default { export default {
name: 'EnergyLimit', name: 'EnergyLimit',
components: { EnergyLimitAdd }, components: { EnergyLimitAdd },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -156,7 +158,6 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
@@ -181,9 +182,6 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
// 获取对象树形结构 // 获取对象树形结构

View File

@@ -45,6 +45,7 @@ import { getEnergyOverlimitLogPage } from '@/api/monitoring/energyOverlimitLog';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
@@ -123,6 +124,7 @@ const tableProps2 = [
]; ];
export default { export default {
name: 'EnergyOverlimitLog', name: 'EnergyOverlimitLog',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -151,10 +153,10 @@ export default {
activeName: 'auto', activeName: 'auto',
tableProps, tableProps,
tableProps2, tableProps2,
tableH: this.tableHeight(260),
total: 0, total: 0,
list: [], list: [],
list2: [], list2: [],
heightNum: 300,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@@ -170,9 +172,6 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
}, },

View File

@@ -72,7 +72,7 @@ const tableProps = [
}, },
]; ];
export default { export default {
name: 'EnergyLimit', name: 'EnergyReport',
data() { data() {
return { return {
isFold: false, isFold: false,
@@ -181,7 +181,7 @@ export default {
return energyReportPageExportAuto({ ...this.queryParams }); return energyReportPageExportAuto({ ...this.queryParams });
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '能统计报表.xls'); this.$download.excel(response, '能统计报表.xls');
}) })
.catch(() => {}); .catch(() => {});
} }

View File

@@ -1,161 +1,171 @@
<template> <template>
<div class="app-container" id='energyReportSearchBox'> <div
class="app-container"
<!-- 搜索工作栏 --> id="energyReportSearchBox">
<search-bar <!-- 搜索工作栏 -->
:formConfigs="formConfig" <search-bar
ref="searchBarForm" :formConfigs="formConfig"
:isFold="isFold" ref="searchBarForm"
@headBtnClick="buttonClick" :isFold="isFold"
/> @headBtnClick="buttonClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-props="tableProps" :table-props="tableProps"
:table-data="list" :table-data="list"
:max-height="tableH" :max-height="tableH" />
/> <pagination
<pagination :page.sync="queryParams.pageNo"
:page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
:limit.sync="queryParams.pageSize" :total="total"
:total="total" @pagination="getList" />
@pagination="getList" </div>
/>
</div>
</template> </template>
<script> <script>
import { energyReportPage, energyReportPageExport } from "@/api/monitoring/energyReport"; import {
import { getEnergyTypeListAll } from "@/api/base/energyType" energyReportPage,
energyReportPageExport,
} from '@/api/monitoring/energyReport';
import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType';
const tableProps = [ const tableProps = [
{ {
prop: 'statisticName', prop: 'statisticName',
label: '统计方案' label: '统计方案',
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型' label: '能源类型',
}, filter: publicFormatter('energy_type'),
{ },
prop: 'startValue', {
label: '抄表数(起始)' prop: 'startValue',
}, label: '抄表数(起始)',
{ },
prop: 'endValue', {
label: '抄表数(结束)' prop: 'endValue',
}, label: '抄表数(结束)',
{ },
prop: 'diffValue', {
label: '消耗量' prop: 'diffValue',
} label: '消耗量',
] },
];
export default { export default {
name: "EnergyReportSearch", name: 'EnergyReportSearch',
data() { data() {
return { return {
isFold: false, isFold: false,
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '统计方案', label: '统计方案',
param: 'statisticName' param: 'statisticName',
}, },
{ {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
selectOptions: [], labelField: 'labelName',
param: 'energyTypeId', selectOptions: [],
filterable: true param: 'energyTypeId',
}, filterable: true,
{ },
type: 'datePicker', {
label: '时间', type: 'datePicker',
dateType: 'datetimerange', label: '时间',
format: 'yyyy-MM-dd HH:mm:ss', dateType: 'datetimerange',
valueFormat: "timestamp", format: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', valueFormat: 'timestamp',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 350, defaultSelect: [],
clearable: false width: 350,
}, clearable: false,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('monitoring:energy-report-search:export') ? 'button' : '', {
btnName: '导出', type: this.$auth.hasPermi('monitoring:energy-report-search:export')
name: 'add', ? 'button'
color: 'primary', : '',
plain: true btnName: '导出',
} name: 'add',
], color: 'primary',
tableProps, plain: true,
tableH: this.tableHeight(260), },
// 总条数 ],
total: 0, tableProps,
// 班次基础信息列表 tableH: this.tableHeight(260),
list: [], // 总条数
// 查询参数 total: 0,
queryParams: { // 班次基础信息列表
pageNo: 1, list: [],
pageSize: 20, // 查询参数
statisticName: null, queryParams: {
startTime: null, pageNo: 1,
endTime: null pageSize: 20,
}, statisticName: null,
energyTypeList: [] startTime: null,
}; endTime: null,
}, },
mounted() { energyTypeList: [],
window.addEventListener('resize', () => { };
this.tableH = this.tableHeight(260) },
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180) mounted() {
}) window.addEventListener('resize', () => {
this.getList() this.tableH = this.tableHeight(260);
this.getTypeList() this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180) });
}, this.getList();
methods: { this.getTypeList();
getTypeList() { this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
getEnergyTypeListAll().then((res) => { },
this.formConfig[1].selectOptions = res.data || [] methods: {
}) getTypeList() {
}, getEnergyTypeListAll().then((res) => {
buttonClick(val) { this.formConfig[1].selectOptions = res.data || [];
switch (val.btnName) { });
case 'search': },
this.queryParams.pageNo = 1 buttonClick(val) {
this.queryParams.statisticName = val.statisticName switch (val.btnName) {
this.queryParams.energyTypeId = val.energyTypeId case 'search':
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null this.queryParams.pageNo = 1;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null this.queryParams.statisticName = val.statisticName;
this.getList() this.queryParams.energyTypeId = val.energyTypeId;
break this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
default: this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
this.$modal.confirm('是否确认导出').then(() => { this.getList();
return energyReportPageExport({...this.queryParams}); break;
}).then(response => { default:
this.$download.excel(response, '能源统计查询报表.xls'); this.$modal
}).catch(() => {}) .confirm('是否确认导出')
} .then(() => {
}, return energyReportPageExport({ ...this.queryParams });
/** 查询列表 */ })
getList() { .then((response) => {
energyReportPage({...this.queryParams}).then(response => { this.$download.excel(response, '能源统计查询报表.xls');
this.list = response.data.list || []; })
this.total = response.data.total; .catch(() => {});
}); }
} },
} /** 查询列表 */
getList() {
energyReportPage({ ...this.queryParams }).then((response) => {
this.list = response.data.list || [];
this.total = response.data.total;
});
},
},
}; };
</script> </script>

View File

@@ -1,230 +1,271 @@
<template> <template>
<div> <div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'> <el-drawer
<div class="box"> :title="drawerTitle"
<el-form :inline="true"> :visible.sync="visible"
<el-form-item label="方案名称"> size="70%"
<el-input v-model="name" size='small' readonly></el-input> @close="closeD"
</el-form-item> :show-close="false">
<el-form-item label="能源类型"> <div class="box">
<el-input v-model="energyType" size='small' readonly></el-input> <el-form :inline="true">
</el-form-item> <el-form-item label="方案名称">
<el-form-item> <el-input
<el-button type="success" size='small' v-if="showBtn" plain @click="addNew">新增</el-button> v-model="name"
<el-button type="danger" size='small' v-if="showBtn" plain @click="deleteAll">批量删除</el-button> size="small"
</el-form-item> readonly></el-input>
</el-form> </el-form-item>
<base-table <el-form-item label="能源类型">
:page="queryParams.pageNo" <el-input
:limit="queryParams.pageSize" v-model="energyTypeLabel"
:table-props="tableProps" size="small"
:table-data="tableData" readonly></el-input>
:max-height="tableH" </el-form-item>
:selectWidth="55" <el-form-item>
@selection-change="selectChange" <el-button
> type="success"
<method-btn size="small"
v-if="tableBtn.length" v-if="showBtn"
slot="handleBtn" plain
:width="80" @click="addNew">
label="操作" 新增
:method-list="tableBtn" </el-button>
@clickBtn="handleClick" <el-button
/> type="danger"
</base-table> size="small"
<pagination v-if="showBtn"
:page.sync="queryParams.pageNo" plain
:limit.sync="queryParams.pageSize" @click="deleteAll">
:total="total" 批量删除
@pagination="getList" </el-button>
/> </el-form-item>
</div> </el-form>
</el-drawer> <base-table
<!-- 新增 --> :page="queryParams.pageNo"
<energy-statistics-det-add ref="energyStatistics" @closeDet="closeDet" /> :limit="queryParams.pageSize"
</div> :table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<energy-statistics-det-add
ref="energyStatistics"
@closeDet="closeDet" />
</div>
</template> </template>
<script> <script>
import { getEnergyStatisticsDetPage, deleteEnergyStatisticsDet, deleteMany } from '@/api/monitoring/energyStatisticsDet' import {
import EnergyStatisticsDetAdd from './energyStatisticsDetAdd' getEnergyStatisticsDetPage,
import { publicFormatter } from '@/utils/dict' deleteEnergyStatisticsDet,
deleteMany,
} from '@/api/monitoring/energyStatisticsDet';
import EnergyStatisticsDetAdd from './energyStatisticsDetAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '所属对象' label: '所属对象',
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码' label: '对象编码',
}, },
{ {
prop: 'paramName', prop: 'paramName',
label: '参数名称' label: '参数名称',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('energy_unit') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'desc', prop: 'desc',
label: '描述' label: '描述',
} },
] ];
export default { export default {
name: 'EnergyStatisticsDet', name: 'EnergyStatisticsDet',
props: { props: {
energyTypeList: { energyTypeList: {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return [] return [];
} },
} },
}, },
data() { data() {
return { return {
visible: false, visible: false,
drawerTitle: '', drawerTitle: '',
tableProps, tableProps,
tableData: [], tableData: [],
tableBtn: [], tableBtn: [],
tableH: this.tableHeight(115), tableH: this.tableHeight(115),
total: 0, total: 0,
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 30, pageSize: 30,
statisticsId: null statisticsId: null,
}, },
name: '', name: '',
energyType: '', energyTypeLabel: '',
energyTypeId: '', energyTypeId: '',
// 弹出层标题 // 弹出层标题
addOrEditTitle: "", addOrEditTitle: '',
// 是否显示弹出层 // 是否显示弹出层
centervisible: false, centervisible: false,
collectionList: [ collectionList: [
{value: 0,label: '否'}, { value: 0, label: '否' },
{value: 1,label: '是'} { value: 1, label: '是' },
], ],
showBtn: true, showBtn: true,
selectedList: [] selectedList: [],
} };
}, },
components: { EnergyStatisticsDetAdd }, components: { EnergyStatisticsDetAdd },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115) this.tableH = this.tableHeight(115);
}) });
}, },
methods: { methods: {
init(data,title) { init(data, title) {
this.visible = true this.visible = true;
this.queryParams.statisticsId = data.id this.queryParams.statisticsId = data.id;
this.name = data.name this.name = data.name;
this.energyType = data.energyType this.energyTypeLabel = data.energyTypeLabel;
this.energyTypeId = data.energyTypeId this.energyTypeId = data.energyTypeId;
this.getList() this.getList();
if (title === 'detail') { if (title === 'detail') {
this.drawerTitle = '查看参数' this.drawerTitle = '查看参数';
this.showBtn = false this.showBtn = false;
this.tableBtn = [] this.tableBtn = [];
} else { } else {
this.drawerTitle = '参数绑定' this.drawerTitle = '参数绑定';
this.showBtn = true this.showBtn = true;
this.tableBtn = [ this.tableBtn = [
{ {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} },
] ];
} }
}, },
getList() { getList() {
console.log(this.queryParams) console.log(this.queryParams);
getEnergyStatisticsDetPage({...this.queryParams}).then((res) => { getEnergyStatisticsDetPage({ ...this.queryParams }).then((res) => {
let arr = res.data.list || [] let arr = res.data.list || [];
arr&&arr.map(item => { arr &&
this.collectionList.map(i => { arr.map((item) => {
if (item.collection === i.value) { this.collectionList.map((i) => {
item.collection = i.label if (item.collection === i.value) {
} item.collection = i.label;
}) }
this.energyTypeList.map(j => { });
if (item.typeId === j.id) { this.energyTypeList.map((j) => {
item.typeId = j.name if (item.typeId === j.id) {
} item.typeId = j.name;
}) }
}) });
this.tableData = arr });
this.total = res.data.total; this.tableData = arr;
}) this.total = res.data.total;
}, });
// 新增 },
addNew() { // 新增
this.$nextTick(() => { addNew() {
this.$refs.energyStatistics.init({'statisticsId': this.queryParams.statisticsId, energyTypeId:this.energyTypeId}) this.$nextTick(() => {
}) this.$refs.energyStatistics.init({
}, statisticsId: this.queryParams.statisticsId,
selectChange(val) { energyTypeId: this.energyTypeId,
console.log(val) });
this.selectedList = val });
}, },
// 批量删除 selectChange(val) {
deleteAll() { console.log(val);
let arr = [] this.selectedList = val;
if (this.selectedList.length === 0) { },
this.$modal.msgWarning("请选勾选数据") // 批量删除
return false deleteAll() {
} else { let arr = [];
this.selectedList.map((item) => { if (this.selectedList.length === 0) {
arr.push(item.id) this.$modal.msgWarning('请选勾选数据');
}) return false;
} } else {
this.$modal.confirm('是否确认删除所有勾选的数据项?').then(function() { this.selectedList.map((item) => {
return deleteMany(arr); arr.push(item.id);
}).then(() => { });
this.queryParams.pageNo = 1 }
this.getList() this.$modal
this.$modal.msgSuccess("删除成功") .confirm('是否确认删除所有勾选的数据项?')
}).catch(() => {}) .then(function () {
}, return deleteMany(arr);
handleCancel() { })
this.$refs.energyStatistics.formClear() .then(() => {
this.centervisible = false this.queryParams.pageNo = 1;
this.addOrEditTitle = '' this.getList();
}, this.$modal.msgSuccess('删除成功');
handleConfirm() { })
this.$refs.energyStatistics.submitForm() .catch(() => {});
}, },
successSubmit() { handleCancel() {
this.handleCancel() this.$refs.energyStatistics.formClear();
this.getList() this.centervisible = false;
}, this.addOrEditTitle = '';
handleClick(val) { },
this.handleDelete(val.data) handleConfirm() {
}, this.$refs.energyStatistics.submitForm();
/** 删除按钮操作 */ },
handleDelete(row) { successSubmit() {
this.$modal.confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?').then(function() { this.handleCancel();
return deleteEnergyStatisticsDet(row.id); this.getList();
}).then(() => { },
this.queryParams.pageNo = 1 handleClick(val) {
this.getList() this.handleDelete(val.data);
this.$modal.msgSuccess("删除成功") },
}).catch(() => {}) /** 删除按钮操作 */
}, handleDelete(row) {
closeD() { this.$modal
this.$emit('closeDrawer') .confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?')
}, .then(function () {
closeDet() { // 关闭新增框 return deleteEnergyStatisticsDet(row.id);
this.getList() })
} .then(() => {
} this.queryParams.pageNo = 1;
} this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
closeDet() {
// 关闭新增框
this.getList();
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@@ -1,179 +1,178 @@
<template> <template>
<el-drawer <el-drawer
title="新增" title="新增"
:visible.sync="centervisible" :visible.sync="centervisible"
size="60%" size="60%"
@close='closeA' @close="closeA"
:show-close='false'> :show-close="false">
<div class="box"> <div class="box">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
:removeBlue='true' :removeBlue="true"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH"
:max-height="tableH" :selectWidth="55"
:selectWidth="55" @selection-change="selectChange"></base-table>
@selection-change="selectChange" <pagination
> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" </div>
:total="total" </el-drawer>
@pagination="getList"
/>
</div>
</el-drawer>
</template> </template>
<script> <script>
import { addParamPage, createEnergyStatisticsDet } from '@/api/monitoring/energyStatisticsDet' import {
import { publicFormatter } from '@/utils/dict' addParamPage,
createEnergyStatisticsDet,
} from '@/api/monitoring/energyStatisticsDet';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '所属对象' label: '所属对象',
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码' label: '对象编码',
}, },
{ {
prop: 'paramName', prop: 'paramName',
label: '参数名称' label: '参数名称',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('energy_unit') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'desc', prop: 'desc',
label: '描述' label: '描述',
} },
] ];
export default { export default {
name: 'EnergyStatisticsDetAdd', name: 'EnergyStatisticsDetAdd',
data() { data() {
return { return {
centervisible: false, centervisible: false,
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '对象类型', label: '对象类型',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE), selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
param: 'objType' param: 'objType',
}, },
{ {
type: 'input', type: 'input',
label: '参数名称', label: '参数名称',
placeholder: '参数名称', placeholder: '参数名称',
param: 'paramName' param: 'paramName',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: 'separate' type: 'separate',
}, },
{ {
type: 'button', type: 'button',
btnName: '关联', btnName: '关联',
name: 'add', name: 'add',
color: 'primary', color: 'primary',
plain: true plain: true,
} },
], ],
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
energyTypeId: null, energyTypeId: null,
statisticId: null, statisticId: null,
paramName: '', paramName: '',
objType: '' objType: '',
}, },
tableProps, tableProps,
list: [], list: [],
total: 0, total: 0,
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
selectedList: [] selectedList: [],
} };
}, },
methods: { methods: {
init(param) { init(param) {
this.queryParams.statisticId = param.statisticsId this.queryParams.statisticId = param.statisticsId;
this.queryParams.energyTypeId = param.energyTypeId this.queryParams.energyTypeId = param.energyTypeId;
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260);
}) });
this.centervisible = true this.centervisible = true;
this.getList() this.getList();
}, },
getList() { getList() {
addParamPage({...this.queryParams}).then((res) => { addParamPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total this.total = res.data.total;
}) });
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.objType = val.objType this.queryParams.objType = val.objType;
this.queryParams.paramName = val.paramName this.queryParams.paramName = val.paramName;
this.getList() this.getList();
break break;
default: default:
// 关联 // 关联
this.connectParam() this.connectParam();
} }
}, },
// 选中数据 // 选中数据
selectChange(val) { selectChange(val) {
this.selectedList = val this.selectedList = val;
}, },
// 关联 // 关联
connectParam() { connectParam() {
let param = { let param = {
statisticsId: this.queryParams.statisticId, statisticsId: this.queryParams.statisticId,
plcParamIds: [] plcParamIds: [],
} };
if (this.selectedList.length === 0) { if (this.selectedList.length === 0) {
this.$modal.msgWarning("请选勾选数据") this.$modal.msgWarning('请选勾选数据');
return false return false;
} else { } else {
this.selectedList.map((item) => { this.selectedList.map((item) => {
param.plcParamIds.push(item.id) param.plcParamIds.push(item.id);
}) });
} }
createEnergyStatisticsDet({...param}).then((res) => { createEnergyStatisticsDet({ ...param }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess('操作成功');
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList() this.getList();
} }
}) });
}, },
closeA() { closeA() {
this.$emit('closeDet') this.$emit('closeDet');
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@@ -53,6 +53,7 @@ import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyStatisticsAdd from './components/energyStatisticsAdd'; import EnergyStatisticsAdd from './components/energyStatisticsAdd';
import EnergyStatisticsDet from './components/energyStatisticsDet'; import EnergyStatisticsDet from './components/energyStatisticsDet';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
@@ -70,9 +71,9 @@ const tableProps = [
filter: publicFormatter('statistic_type'), filter: publicFormatter('statistic_type'),
}, },
{ {
prop: 'energyType', prop: 'energyTypeLabel',
label: '能源类型', label: '能源类型',
filter: publicFormatter('energy_type'), showOverflowtooltip: true,
}, },
{ {
prop: 'paramNum', prop: 'paramNum',
@@ -86,6 +87,7 @@ const tableProps = [
export default { export default {
name: 'EnergyStatistics', name: 'EnergyStatistics',
components: { EnergyStatisticsAdd, EnergyStatisticsDet }, components: { EnergyStatisticsAdd, EnergyStatisticsDet },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -139,7 +141,6 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
@@ -158,9 +159,6 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
}, },
mounted() { mounted() {
@@ -187,6 +185,13 @@ export default {
getList() { getList() {
getEnergyStatisticsPage(this.queryParams).then((response) => { getEnergyStatisticsPage(this.queryParams).then((response) => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr.map((item) => {
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
}); });

View File

@@ -1,271 +1,289 @@
<template> <template>
<div class="orderEnergyContainer"> <div class="orderEnergyContainer">
<div class="box1"> <div class="box1">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> </div>
</div> <div class="box2">
<div class="box2"> <div class="boxTitle">
<div class="boxTitle"> <span class="blueTitle"></span>
<span class="blueTitle"></span> <span>工单信息</span>
<span>工单信息</span> </div>
</div> <el-row>
<el-row> <el-col :span="4">
<el-col :span='4'> <div class="blodTip">工单名称</div>
<div class="blodTip">工单名称</div> <div class="lightTip">{{ orderMsg.name }}</div>
<div class="lightTip">{{ orderMsg.name }}</div> </el-col>
</el-col> <el-col :span="4">
<el-col :span='4'> <div class="blodTip">产品名称</div>
<div class="blodTip">产品名称</div> <div class="lightTip">{{ orderMsg.productName }}</div>
<div class="lightTip">{{orderMsg.productName }}</div> </el-col>
</el-col> <el-col :span="4">
<el-col :span='4'> <div class="blodTip">计划完成数量</div>
<div class="blodTip">计划完成数量</div> <div class="lightTip">{{ orderMsg.planQuantity }}</div>
<div class="lightTip">{{orderMsg.planQuantity }}</div> </el-col>
</el-col> <el-col :span="4">
<el-col :span='4'> <div class="blodTip">实际开始时间</div>
<div class="blodTip">实际开始时间</div> <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div> </el-col>
</el-col> <el-col :span="4">
<el-col :span='4'> <div class="blodTip">实际完成时间</div>
<div class="blodTip">实际完成时间</div> <div class="lightTip">
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div> {{ parseTime(orderMsg.finishProduceTime) }}
</el-col> </div>
<el-col :span='4'> </el-col>
<div class="blodTip">实际加工数量</div> <el-col :span="4">
<div class="lightTip">{{orderMsg.actualQuantity }}</div> <div class="blodTip">实际加工数量</div>
</el-col> <div class="lightTip">{{ orderMsg.actualQuantity }}</div>
</el-row> </el-col>
</div> </el-row>
<div class="box3"> </div>
<div class="boxTitle"> <div class="box3">
<span class="blueTitle"></span> <div class="boxTitle">
<span>能耗信息</span> <span class="blueTitle"></span>
</div> <span>能耗信息</span>
<div class="toggleTabBox"> </div>
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div> <div class="toggleTabBox">
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div> <div
</div> :class="{ active: activeModule === 'dataList' }"
<div> @click="toggleTab('dataList')">
<div v-show="activeModule === 'dataList'"> 数据列表
<!-- 表格 --> </div>
<base-table <div
:page="queryParams.pageNo" :class="{ active: activeModule === 'barChart' }"
:limit="queryParams.pageSize" @click="toggleTab('barChart')">
:table-props="tableProps" 柱状图
:table-data="tableData" </div>
:max-height="tableH" </div>
/> <div>
</div> <div v-show="activeModule === 'dataList'">
<!-- 图形 --> <!-- 表格 -->
<div v-show="activeModule === 'barChart'"> <base-table
<bar-chart ref="orderEnergyChart" :chartData="chartData"/> :page="queryParams.pageNo"
</div> :limit="queryParams.pageSize"
</div> :table-props="tableProps"
</div> :table-data="tableData"
</div> :max-height="tableH" />
</div>
<!-- 图形 -->
<div v-show="activeModule === 'barChart'">
<bar-chart
ref="orderEnergyChart"
:chartData="chartData" />
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '对象名称' label: '对象名称',
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码' label: '对象编码',
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型' label: '能源类型',
}, },
{ {
prop: 'startNum', prop: 'startNum',
label: '工单开始值' label: '工单开始值',
}, },
{ {
prop: 'endNum', prop: 'endNum',
label: '工单结束值/当前值' label: '工单结束值/当前值',
}, },
{ {
prop: 'useNum', prop: 'useNum',
label: '使用量' label: '使用量',
} },
] ];
import { getEnergyTypeListAll } from '@/api/base/energyType' import { getEnergyTypeListAll } from '@/api/base/energyType';
import { workOrderList } from '@/api/base/orderManage' import { workOrderList } from '@/api/base/orderManage';
import { getWorkOrderMsg, getOrderEnergyData } from '@/api/monitoring/orderEnergy' import {
import BarChart from "./components/barChart" getWorkOrderMsg,
getOrderEnergyData,
} from '@/api/monitoring/orderEnergy';
import BarChart from './components/barChart';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'OrderEnergy', name: 'OrderEnergy',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '工单', type: 'select',
selectOptions: [], label: '工单',
param: 'workOrderId', selectOptions: [],
clearable: false param: 'workOrderId',
}, clearable: false,
{ },
type: 'select', {
label: '能源类型', type: 'select',
selectOptions: [], label: '能源类型',
param: 'energyTypeId', selectOptions: [],
filterable: true, param: 'energyTypeId',
width: 120, labelField: 'labelName',
clearable: false filterable: true,
}, width: 120,
{ clearable: false,
type: 'select', },
label: '对象维度', {
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE), type: 'select',
labelField: 'label', label: '对象维度',
valueField: 'value', selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
param: 'objType', labelField: 'label',
width: 100, valueField: 'value',
clearable: false param: 'objType',
}, width: 100,
{ clearable: false,
type: 'button', },
btnName: '查询', {
name: 'search', type: 'button',
color: 'primary' btnName: '查询',
} name: 'search',
], color: 'primary',
tableProps, },
tableData: [], ],
tableH: this.tableHeight(400), tableProps,
// 查询参数 tableData: [],
queryParams: { heightNum: 400,
workOrderId: '', // 查询参数
objType: '', queryParams: {
energyTypeId: '' workOrderId: '',
}, objType: '',
orderMsg: {}, energyTypeId: '',
chartData: [], },
activeModule: 'dataList' orderMsg: {},
} chartData: [],
}, activeModule: 'dataList',
components: { BarChart }, };
mounted() { },
window.addEventListener('resize', () => { components: { BarChart },
this.tableH = this.tableHeight(400) mounted() {
}) this.getListArr();
this.getListArr() },
}, methods: {
methods: { getListArr() {
getListArr() { workOrderList().then((res) => {
workOrderList().then(res => { this.formConfig[0].selectOptions = res.data || [];
this.formConfig[0].selectOptions = res.data || [] });
}) getEnergyTypeListAll().then((res) => {
getEnergyTypeListAll().then(res => { this.formConfig[1].selectOptions = res.data || [];
this.formConfig[1].selectOptions = res.data || [] });
}) },
}, buttonClick(val) {
buttonClick(val) { if (!val.workOrderId) {
if (!val.workOrderId) { this.$modal.msgWarning('工单不能为空');
this.$modal.msgWarning('工单不能为空') return false;
return false }
} if (!val.energyTypeId) {
if (!val.energyTypeId) { this.$modal.msgWarning('能源类型不能为空');
this.$modal.msgWarning('能源类型不能为空') return false;
return false }
} if (!val.objType) {
if (!val.objType) { this.$modal.msgWarning('对象维度不能为空');
this.$modal.msgWarning('对象维度不能为空') return false;
return false }
} this.queryParams.workOrderId = val.workOrderId;
this.queryParams.workOrderId = val.workOrderId this.queryParams.objType = val.objType;
this.queryParams.objType = val.objType this.queryParams.energyTypeId = val.energyTypeId;
this.queryParams.energyTypeId = val.energyTypeId getWorkOrderMsg({ ...this.queryParams }).then((res) => {
getWorkOrderMsg({ ...this.queryParams }).then(res => { this.orderMsg = res.data || {};
this.orderMsg = res.data || {} getOrderEnergyData({
getOrderEnergyData({ ...this.queryParams,
...this.queryParams, startProduceTime: res.data.startProduceTime || '',
startProduceTime: res.data.startProduceTime || '', finishProduceTime: res.data.finishProduceTime || '',
finishProduceTime: res.data.finishProduceTime || '' }).then((result) => {
}).then(result => { this.tableData = result.data || [];
this.tableData = result.data || [] this.chartData = result.data || [];
this.chartData = result.data || [] });
}) });
}) },
}, toggleTab(val) {
toggleTab(val) { this.activeModule = val;
this.activeModule = val if (this.activeModule === 'barChart') {
if (this.activeModule === 'barChart') { this.$nextTick((res) => {
this.$nextTick((res) => { this.$refs.orderEnergyChart.getChart();
this.$refs.orderEnergyChart.getChart() });
}) }
} },
}, headBtnClick() {},
headBtnClick() {} },
} };
}
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.orderEnergyContainer { .orderEnergyContainer {
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
.box1, .box2, .box3 { .box1,
background-color: #fff; .box2,
border-radius: 9px; .box3 {
} background-color: #fff;
.box1 { border-radius: 9px;
height: 64px; }
padding: 12px 16px 0; .box1 {
} height: 64px;
.box2 { padding: 12px 16px 0;
height: 122px; }
margin: 8px 0; .box2 {
padding: 16px; height: 122px;
.blodTip { margin: 8px 0;
font-weight: 600; padding: 16px;
color: rgba(0,0,0,0.85); .blodTip {
margin-bottom: 8px; font-weight: 600;
} color: rgba(0, 0, 0, 0.85);
.lightTip { margin-bottom: 8px;
font-weight: 400; }
color: rgba(102,102,102,0.75); .lightTip {
} font-weight: 400;
} color: rgba(102, 102, 102, 0.75);
.box3 { overflow: hidden;
padding: 16px; white-space: nowrap;
height: calc(100vh - 330px); text-overflow: ellipsis;
.toggleTabBox { }
display: inline-block; }
div { .box3 {
display: inline-block; padding: 16px;
padding:0 8px 4px; height: calc(100vh - 330px);
color: rgba(102, 102, 102, 0.5); .toggleTabBox {
border-bottom: 2px solid rgba(242, 244, 249, 1); display: inline-block;
cursor: pointer; div {
} display: inline-block;
.active { padding: 0 8px 4px;
color: rgba(0,0,0,0.85); color: rgba(102, 102, 102, 0.5);
border-bottom-color: #0B58FF; border-bottom: 2px solid rgba(242, 244, 249, 1);
} cursor: pointer;
} }
} .active {
.boxTitle { color: rgba(0, 0, 0, 0.85);
display: inline-block; border-bottom-color: #0b58ff;
font-size: 16px; }
font-weight: 400; }
color: #000000; }
margin:0 10px 20px 0; .boxTitle {
} display: inline-block;
.blueTitle { font-size: 16px;
content: ''; font-weight: 400;
display: inline-block; color: #000000;
width: 4px; margin: 0 10px 20px 0;
height: 18px; }
background-color: #0B58FF; .blueTitle {
border-radius: 1px; content: '';
margin-right: 8px; display: inline-block;
vertical-align: bottom; width: 4px;
} height: 18px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
} }
</style> </style>

View File

@@ -104,21 +104,27 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('equipment:inspection-confirm:create')
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
plain: true, plain: true,
color: 'success', color: 'success',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('equipment:inspection-confirm:confirm')
? 'button'
: '',
btnName: '批量确认', btnName: '批量确认',
name: 'batchConfirm', name: 'batchConfirm',
color: 'primary', color: 'primary',
plain: true, plain: true,
}, },
{ {
type: 'button', type: this.$auth.hasPermi('equipment:inspection-confirm:export')
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true, plain: true,

View File

@@ -160,21 +160,25 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('equipment:maintain-confirm:create')
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
plain: true, plain: true,
color: 'success', color: 'success',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('equipment:maintain-confirm:confirm')
? 'button'
: '',
btnName: '批量确认', btnName: '批量确认',
name: 'batchConfirm', name: 'batchConfirm',
color: 'primary', color: 'primary',
plain: true, plain: true,
}, },
{ {
type: this.$auth.hasPermi('equipment:maintain-record:export') type: this.$auth.hasPermi('equipment:maintain-confirm:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',

View File

@@ -193,7 +193,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-type:export') type: this.$auth.hasPermi('equipment:maintain-monitor:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',

View File

@@ -112,7 +112,7 @@ export default {
param: 'code', param: 'code',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:process-equ-material-bom:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -113,7 +113,7 @@ export default {
param: 'code', param: 'code',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('extend:process-equ-value-bom:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -1,244 +1,292 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> :formConfigs="formConfig"
<!-- 列表 --> ref="searchBarForm"
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" @headBtnClick="buttonClick" />
:max-height="tableH"> <!-- 列表 -->
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <base-table
@clickBtn="handleClick" /> :page="queryParams.pageNo"
</base-table> :limit="queryParams.pageSize"
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" :table-props="tableProps"
@pagination="getList" /> :table-data="list"
<!-- 新增 --> :max-height="tableH">
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel" <method-btn
@confirm="handleConfirm" :before-close="handleCancel" width='50%'> v-if="tableBtn.length"
<group-class-add ref="classList" @successSubmit="successSubmit" /> slot="handleBtn"
</base-dialog> :width="120"
</div> label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<group-class-add
ref="classList"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses"; import {
import GroupClassAdd from './components/groupClassAdd' getGroupClassesPage,
import { formatDate } from '@/utils' deleteGroupClasses,
import { publicFormatter } from '@/utils/dict' updateGroupClasses,
} from '@/api/base/groupClasses';
import GroupClassAdd from './components/groupClassAdd';
import { formatDate } from '@/utils';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'enableTimeStr', prop: 'enableTimeStr',
label: '生效时段', label: '生效时段',
minWidth: 300 minWidth: 300,
}, },
{ {
prop: 'roomNameDict', prop: 'roomNameDict',
label: '车间名称', label: '车间名称',
filter: publicFormatter('workshop'), filter: publicFormatter('workshop'),
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'name', prop: 'name',
label: '班次名称' label: '班次名称',
}, },
{ {
prop: 'timeStr', prop: 'timeStr',
label: '班次时间', label: '班次时间',
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'code', prop: 'code',
label: '班次编码', label: '班次编码',
minWidth: 200 minWidth: 200,
}, },
{ {
prop: 'status', prop: 'status',
label: '班次状态' label: '班次状态',
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注' label: '备注',
} },
] ];
export default { export default {
name: "GroupClasses", name: 'GroupClasses',
components: { GroupClassAdd }, components: { GroupClassAdd },
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '班次名称', type: 'input',
placeholder: '班次名称', label: '班次名称',
param: 'name' placeholder: '班次名称',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:group-classes:create')
name: 'add', ? 'button'
color: 'success', : '',
plain: true btnName: '新增',
} name: 'add',
], color: 'success',
tableProps, plain: true,
tableBtn: [ },
this.$auth.hasPermi('base:group-classes:cancel') ],
? { tableProps,
type: 'cancel', tableBtn: [
btnName: '作废', this.$auth.hasPermi('base:group-classes:cancel')
showParam: { ? {
type: '&', type: 'cancel',
data: [ btnName: '作废',
{ showParam: {
type: 'unequal', type: '&',
name: 'status', data: [
value: '不可用' {
} type: 'unequal',
] name: 'status',
} value: '不可用',
} },
: undefined, ],
this.$auth.hasPermi('base:group-classes:update') },
? { }
type: 'edit', : undefined,
btnName: '编辑' this.$auth.hasPermi('base:group-classes:update')
} ? {
: undefined, type: 'edit',
this.$auth.hasPermi('base:group-classes:delete') btnName: '编辑',
? { }
type: 'delete', : undefined,
btnName: '删除' this.$auth.hasPermi('base:group-classes:delete')
} ? {
: undefined type: 'delete',
].filter((v) => v), btnName: '删除',
tableH: this.tableHeight(260), }
// 总条数 : undefined,
total: 0, ].filter((v) => v),
// 班次基础信息列表 // 总条数
list: [], total: 0,
// 弹出层标题 // 班次基础信息列表
addOrEditTitle: "", list: [],
// 是否显示弹出层 // 弹出层标题
centervisible: false, addOrEditTitle: '',
// 查询参数 // 是否显示弹出层
queryParams: { centervisible: false,
pageNo: 1, // 查询参数
pageSize: 20, queryParams: {
name: null pageNo: 1,
} pageSize: 20,
}; name: null,
}, },
created() { };
window.addEventListener('resize', () => { },
this.tableH = this.tableHeight(260) created() {
}) this.getList();
this.getList() },
}, methods: {
methods: { buttonClick(val) {
buttonClick(val) { switch (val.btnName) {
switch (val.btnName) { case 'search':
case 'search': this.queryParams.pageNo = 1;
this.queryParams.pageNo = 1; this.queryParams.name = val.name;
this.queryParams.name = val.name this.getList();
this.getList() break;
break default:
default: this.addOrEditTitle = '新增';
this.addOrEditTitle = '新增' this.centervisible = true;
this.centervisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.classList.init();
this.$refs.classList.init() });
}) }
} },
}, /** 查询列表 */
/** 查询列表 */ getList() {
getList() { getGroupClassesPage(this.queryParams).then((res) => {
getGroupClassesPage(this.queryParams).then(res => { if (res.code === 0 && res.data.list.length > 0) {
if (res.code === 0 && res.data.list.length > 0) { res.data.list.map((item) => {
res.data.list.map(item => { item.enableTimeStr =
item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久') formatDate(item.enableTime) +
item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5) '' +
item.status = item.status === true ? '可用' : '不可用' (item.disableTime ? formatDate(item.disableTime) : '永久');
}) item.timeStr =
this.list = res.data.list; item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
this.total = res.data.total; item.status = item.status === true ? '可用' : '不可用';
} else { });
this.list = [] this.list = res.data.list;
this.total = 0 this.total = res.data.total;
} } else {
}); this.list = [];
}, this.total = 0;
handleClick(val) { }
switch (val.type) { });
case 'edit': },
this.addOrEditTitle = '编辑' handleClick(val) {
this.$nextTick(() => { switch (val.type) {
this.$refs.classList.init(val.data.id) case 'edit':
}) this.addOrEditTitle = '编辑';
this.centervisible = true this.$nextTick(() => {
break this.$refs.classList.init(val.data.id);
case 'cancel': });
this.discard(val.data) this.centervisible = true;
break break;
default: case 'cancel':
this.handleDelete(val.data) this.discard(val.data);
} break;
}, default:
handleCancel() { this.handleDelete(val.data);
this.$refs.classList.formClear() }
this.centervisible = false },
this.addOrEditTitle = '' handleCancel() {
}, this.$refs.classList.formClear();
handleConfirm() { this.centervisible = false;
this.$refs.classList.submitForm() this.addOrEditTitle = '';
}, },
successSubmit() { handleConfirm() {
this.handleCancel() this.$refs.classList.submitForm();
this.getList() },
}, successSubmit() {
discard(row) { this.handleCancel();
let obj = {} this.getList();
obj.id = row.id },
obj.startTime = row.startTime discard(row) {
obj.endTime = row.endTime let obj = {};
obj.enableTime = row.enableTime obj.id = row.id;
obj.disableTime = Date.parse(new Date()) obj.startTime = row.startTime;
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () { obj.endTime = row.endTime;
return updateGroupClasses({ ...obj }) obj.enableTime = row.enableTime;
}).then(() => { obj.disableTime = Date.parse(new Date());
this.getList(); this.$modal
this.$modal.msgSuccess("操作成功"); .confirm('是否确认作废班次名称为"' + row.name + '"的数据项?')
}).catch(() => { }); .then(function () {
}, return updateGroupClasses({ ...obj });
/** 删除按钮操作 */ })
handleDelete(row) { .then(() => {
console.log(row) this.getList();
let _this = this this.$modal.msgSuccess('操作成功');
if (row.status === '可用') {// 可用 })
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function () { .catch(() => {});
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () { },
return deleteGroupClasses(row.id); /** 删除按钮操作 */
}).then(() => { handleDelete(row) {
_this.getList(); console.log(row);
_this.$modal.msgSuccess("删除成功"); let _this = this;
}).catch(() => { }); if (row.status === '可用') {
}) // 可用
} else { _this.$modal
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () { .confirm(
return deleteGroupClasses(row.id); '删除的班次"' +
}).then(() => { row.name +
_this.getList(); '"可能会影响交接班计划,请点取消再次确认!'
_this.$modal.msgSuccess("删除成功"); )
}).catch(() => { }); .then(function () {
} return _this.$modal
} .confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
} .then(function () {
return deleteGroupClasses(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
});
} else {
_this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
},
},
}; };
</script> </script>

View File

@@ -1,253 +1,260 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig"
:formConfigs="formConfig" ref="searchBarForm"
ref="searchBarForm" @headBtnClick="buttonClick" />
@headBtnClick="buttonClick" <!-- 列表 -->
/> <base-table
<!-- 列表 --> :page="queryParams.pageNo"
<base-table :limit="queryParams.pageSize"
:page="queryParams.pageNo" :table-props="tableProps"
:limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" :max-height="tableH"
:table-data="list" @emitFun="handleTableEvents">
:max-height="tableH" <method-btn
@emitFun="handleTableEvents" v-if="tableBtn.length"
> slot="handleBtn"
<method-btn :width="80"
v-if="tableBtn.length" label="操作"
slot="handleBtn" :method-list="tableBtn"
:width="80" @clickBtn="handleClick" />
label="操作" </base-table>
:method-list="tableBtn" <pagination
@clickBtn="handleClick" :page.sync="queryParams.pageNo"
/> :limit.sync="queryParams.pageSize"
</base-table> :total="total"
<pagination @pagination="getList" />
:page.sync="queryParams.pageNo" <!-- 新增 -->
:limit.sync="queryParams.pageSize" <base-dialog
:total="total" :dialogTitle="addOrEditTitle"
@pagination="getList" :dialogVisible="centervisible"
/> @cancel="handleCancel"
<!-- 新增 --> @confirm="handleConfirm"
<base-dialog :before-close="handleCancel"
:dialogTitle="addOrEditTitle" width="40%">
:dialogVisible="centervisible" <group-team-add
@cancel="handleCancel" ref="groupList"
@confirm="handleConfirm" @successSubmit="successSubmit" />
:before-close="handleCancel" </base-dialog>
width='40%' <!-- 组员编辑 -->
> <worker-edit
<group-team-add ref="groupList" @successSubmit="successSubmit" /> v-if="paramVisible"
</base-dialog> ref="workerEditParam"
<!-- 组员编辑 --> @closeDrawer="closeDrawer"></worker-edit>
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit> </div>
</div>
</template> </template>
<script> <script>
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam"; import {
import { parseTime } from '@/utils/ruoyi' getGroupTeamPage,
import GroupTeamAdd from './components/groupTeamAdd' deleteGroupTeam,
import StatusBtn from './components/statusBtn' updateGroupTeam,
import WorkerOperate from './components/workerOperate' } from '@/api/base/groupTeam';
import WorkerEdit from './components/workerEdit' import { parseTime } from '@/utils/ruoyi';
import { publicFormatter } from '@/utils/dict' import GroupTeamAdd from './components/groupTeamAdd';
import StatusBtn from './components/statusBtn';
import WorkerOperate from './components/workerOperate';
import WorkerEdit from './components/workerEdit';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'roomNameDict', prop: 'roomNameDict',
label: '车间名称', label: '车间名称',
filter: publicFormatter('workshop') filter: publicFormatter('workshop'),
}, },
{ {
prop: 'name', prop: 'name',
label: '班组名称' label: '班组名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '编码',
minWidth: 220 minWidth: 220,
}, },
{ {
prop: 'num', prop: 'num',
label: '班组人数' label: '班组人数',
}, },
{ {
prop: 'leaderName', prop: 'leaderName',
label: '组长' label: '组长',
}, },
{ {
prop: 'enabled', prop: 'enabled',
label: '班组状态', label: '班组状态',
subcomponent: StatusBtn subcomponent: StatusBtn,
}, },
{ {
prop: 'workerName', prop: 'workerName',
label: '组员', label: '组员',
subcomponent: WorkerOperate subcomponent: WorkerOperate,
}, },
] ];
export default { export default {
name: "GroupTeam", name: 'GroupTeam',
components: { GroupTeamAdd, WorkerEdit }, components: { GroupTeamAdd, WorkerEdit },
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '班组名称', type: 'input',
placeholder: '班组名称', label: '班组名称',
param: 'name' placeholder: '班组名称',
}, param: 'name',
{ },
type: 'input', {
label: '组长', type: 'input',
placeholder: '组长', label: '组长',
param: 'leaderName' placeholder: '组长',
}, param: 'leaderName',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
tableProps, ],
tableBtn: [ tableProps,
this.$auth.hasPermi('base:group-team:update') tableBtn: [
? { this.$auth.hasPermi('base:group-team:update')
type: 'edit', ? {
btnName: '编辑' type: 'edit',
} btnName: '编辑',
: undefined, }
this.$auth.hasPermi('base:group-team:delete') : undefined,
? { this.$auth.hasPermi('base:group-team:delete')
type: 'delete', ? {
btnName: '删除' type: 'delete',
} btnName: '删除',
: undefined }
].filter((v) => v), : undefined,
tableH: this.tableHeight(260), ].filter((v) => v),
// 总条数 // 总条数
total: 0, total: 0,
// 班次基础信息列表 // 班次基础信息列表
list: [], list: [],
// 弹出层标题 // 弹出层标题
addOrEditTitle: "", addOrEditTitle: '',
// 是否显示弹出层 // 是否显示弹出层
centervisible: false, centervisible: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null, name: null,
code: null code: null,
}, },
paramVisible: false paramVisible: false,
}; };
}, },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList(); buttonClick(val) {
}, switch (val.btnName) {
methods: { case 'search':
buttonClick(val) { this.queryParams.pageNo = 1;
switch (val.btnName) { this.queryParams.leaderName = val.leaderName;
case 'search': this.queryParams.name = val.name;
this.queryParams.pageNo = 1; this.getList();
this.queryParams.leaderName = val.leaderName break;
this.queryParams.name = val.name default:
this.getList() this.addOrEditTitle = '新增';
break this.centervisible = true;
default: this.$nextTick(() => {
this.addOrEditTitle = '新增' this.$refs.groupList.init();
this.centervisible = true });
this.$nextTick(() => { }
this.$refs.groupList.init() },
}) /** 查询列表 */
} getList() {
}, getGroupTeamPage(this.queryParams).then((response) => {
/** 查询列表 */ this.list = response.data.list;
getList() { this.total = response.data.total;
getGroupTeamPage(this.queryParams).then(response => { });
this.list = response.data.list; },
this.total = response.data.total; handleClick(val) {
}); switch (val.type) {
}, case 'edit':
handleClick(val) { this.addOrEditTitle = '编辑';
switch (val.type) { this.$nextTick(() => {
case 'edit': this.$refs.groupList.init(val.data.id);
this.addOrEditTitle = '编辑' });
this.$nextTick(() => { this.centervisible = true;
this.$refs.groupList.init(val.data.id) break;
}) default:
this.centervisible = true this.handleDelete(val.data);
break }
default: },
this.handleDelete(val.data) // 班组状态
} handleTableEvents(params) {
}, console.log(params);
// 班组状态 if (params.name === 'state') {
handleTableEvents(params) { // 班组状态
console.log(params) updateGroupTeam({ ...params.payload }).then((res) => {
if (params.name === 'state') {// 班组状态 if (res.code === 0) {
updateGroupTeam({ ...params.payload }).then((res) => { this.$modal.msgSuccess('操作成功');
if (res.code === 0) { }
this.$modal.msgSuccess("操作成功"); });
} } else {
}) // 编辑&查看
}else {// 编辑&查看 this.paramVisible = true;
this.paramVisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.workerEditParam.init(params);
this.$refs.workerEditParam.init(params) });
}) }
} },
}, handleCancel() {
handleCancel() { this.$refs.groupList.formClear();
this.$refs.groupList.formClear() this.centervisible = false;
this.centervisible = false this.addOrEditTitle = '';
this.addOrEditTitle = '' },
}, handleConfirm() {
handleConfirm() { this.$refs.groupList.submitForm();
this.$refs.groupList.submitForm() },
}, successSubmit() {
successSubmit() { this.handleCancel();
this.handleCancel() this.getList();
this.getList() },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { this.$modal
this.$modal.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?').then(function() { .confirm('是否确认删除班组名称为"' + row.name + '"的数据项?')
return deleteGroupTeam(row.id); .then(function () {
}).then(() => { return deleteGroupTeam(row.id);
this.queryParams.pageNo = 1; })
this.getList(); .then(() => {
this.$modal.msgSuccess("删除成功"); this.queryParams.pageNo = 1;
}).catch(() => {}); this.getList();
}, this.$modal.msgSuccess('删除成功');
closeDrawer() { })
this.getList() .catch(() => {});
} },
} closeDrawer() {
this.getList();
},
},
}; };
</script> </script>

View File

@@ -1,152 +1,150 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="160"
slot="handleBtn" label="操作"
:width="160" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <!-- 查看详情 -->
/> <group-team-view-detail
</base-table> v-if="paramVisible"
<!-- 查看详情 --> ref="groupTeamViewDetail" />
<group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/> </div>
</div>
</template> </template>
<script> <script>
import { getByWorkOrder } from '@/api/monitoring/groupTeamView' import { getByWorkOrder } from '@/api/monitoring/groupTeamView';
import { workOrderList } from '@/api/base/workOrder' import { workOrderList } from '@/api/base/workOrder';
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue' import GroupTeamViewDetail from './components/groupTeamViewDetail.vue';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'roomNameDict', prop: 'roomNameDict',
label: '车间名称', label: '车间名称',
filter: publicFormatter('workshop'), filter: publicFormatter('workshop'),
showOverflowtooltip: true, showOverflowtooltip: true,
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'name', prop: 'name',
label: '班组名称' label: '班组名称',
}, },
{ {
prop: 'leaderName', prop: 'leaderName',
label: '班组长' label: '班组长',
}, },
{ {
prop: 'num', prop: 'num',
label: '人数' label: '人数',
}, },
{ {
prop: 'workCount', prop: 'workCount',
label: '上班次数' label: '上班次数',
} },
] ];
export default { export default {
name: 'GroupTeamView', name: 'GroupTeamView',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '工单', type: 'select',
selectOptions: [], label: '工单',
param: 'workOrderId', selectOptions: [],
clearable: false, param: 'workOrderId',
filterable: true clearable: false,
}, filterable: true,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
} color: 'primary',
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 1000, pageNo: 1,
workOrderId: '' pageSize: 1000,
}, workOrderId: '',
workOrderList: [], },
workOrderName: '', heightNum: 220,
tableBtn: [ workOrderList: [],
this.$auth.hasPermi('base:group-team-view:detail') workOrderName: '',
? { tableBtn: [
type: 'detail', this.$auth.hasPermi('base:group-team-view:detail')
btnName: '详情' ? {
} type: 'detail',
: undefined btnName: '详情',
].filter((v) => v), }
tableProps, : undefined,
tableH: this.tableHeight(220), ].filter((v) => v),
list: [], tableProps,
paramVisible: false list: [],
} paramVisible: false,
}, };
components: { GroupTeamViewDetail }, },
mounted() { components: { GroupTeamViewDetail },
window.addEventListener('resize', () => { mounted() {
this.tableH = this.tableHeight(220) this.getOrderList();
}) },
this.getOrderList() methods: {
}, // 获取工单list
methods: { getOrderList() {
// 获取工单list workOrderList().then((res) => {
getOrderList() { console.log(res);
workOrderList().then(res => { this.formConfig[0].selectOptions = res.data || [];
console.log(res) this.workOrderList = res.data || [];
this.formConfig[0].selectOptions = res.data || [] });
this.workOrderList = res.data || [] },
}) // 查询
}, buttonClick(val) {
// 查询 if (!val.workOrderId) {
buttonClick(val) { this.$modal.msgWarning('工单不能为空');
if (!val.workOrderId) { return false;
this.$modal.msgWarning('工单不能为空') }
return false this.queryParams.workOrderId = val.workOrderId;
} this.getList();
this.queryParams.workOrderId = val.workOrderId },
this.getList() // 获取table数据
}, getList() {
// 获取table数据 getByWorkOrder({ id: this.queryParams.workOrderId }).then((res) => {
getList() { this.list = res.data || [];
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => { });
this.list = res.data || [] },
}) handleClick(val) {
}, this.paramVisible = true;
handleClick(val) { let params = {};
this.paramVisible = true params.teamId = val.data.id;
let params = {} params.teamName = val.data.name;
params.teamId = val.data.id this.workOrderList.map((item) => {
params.teamName = val.data.name if (val.data.workOrderId === item.id) {
this.workOrderList.map(item => { this.workOrderName = item.name;
if (val.data.workOrderId === item.id) { }
this.workOrderName = item.name });
} params.workOrderId = val.data.workOrderId;
}) params.workOrderName = this.workOrderName;
params.workOrderId = val.data.workOrderId params.roomNameDict = val.data.roomNameDict;
params.workOrderName = this.workOrderName this.$nextTick(() => {
params.roomNameDict = val.data.roomNameDict this.$refs.groupTeamViewDetail.init(params);
this.$nextTick(() => { });
this.$refs.groupTeamViewDetail.init(params) },
}) },
} };
}
}
</script> </script>

View File

@@ -1,130 +1,146 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area @submit="buttonClick" /> <search-area @submit="buttonClick" />
<!-- <search-bar <!-- <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick"
/> --> /> -->
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" <base-table
:max-height="tableH"> :page="queryParams.pageNo"
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" :limit="queryParams.pageSize"
@clickBtn="handleClick" /> :table-props="tableProps"
</base-table> :table-data="list"
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" :max-height="tableH">
@pagination="getList" /> <method-btn
<!-- 查看生产情况 --> v-if="tableBtn.length"
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' /> slot="handleBtn"
</div> :width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 查看生产情况 -->
<team-production-detail
v-if="paramVisible"
ref="schedulingMonitoringDetail" />
</div>
</template> </template>
<script> <script>
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction' import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import TeamProductionDetail from './components/teamProductionDetail' import TeamProductionDetail from './components/teamProductionDetail';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import SearchArea from './components/searchArea' import SearchArea from './components/searchArea';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'roomNameDict', prop: 'roomNameDict',
label: '车间名称', label: '车间名称',
filter: publicFormatter('workshop'), filter: publicFormatter('workshop'),
showOverflowtooltip: true, showOverflowtooltip: true,
minWidth: 100 minWidth: 100,
}, },
// { // {
// prop: 'createTime', // prop: 'createTime',
// label: '排班创建时间', // label: '排班创建时间',
// filter: parseTime, // filter: parseTime,
// minWidth: 160 // minWidth: 160
// }, // },
{ {
prop: 'startDay', prop: 'startDay',
label: '上班日期', label: '上班日期',
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'startTime', prop: 'startTime',
label: '上班时间', label: '上班时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '下班时间', label: '下班时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'classesName', prop: 'classesName',
label: '班次名称', label: '班次名称',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'teamName', prop: 'teamName',
label: '班组名称', label: '班组名称',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: 'GroupTeamScheduling', name: 'GroupTeamScheduling',
data() { mixins: [tableHeightMixin],
return { data() {
// 查询参数 return {
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
classesId: '', pageSize: 20,
teamName: '', classesId: '',
startDay: [] teamName: '',
}, startDay: [],
tableProps, },
tableBtn: [ tableProps,
this.$auth.hasPermi('base:team-production:detail') tableBtn: [
? { this.$auth.hasPermi('base:team-production:detail')
type: 'productionDetail', ? {
btnName: '查看', type: 'productionDetail',
showTip: '生产情况' btnName: '查看',
} showTip: '生产情况',
: undefined }
].filter((v) => v), : undefined,
list: [], ].filter((v) => v),
tableH: this.tableHeight(260), list: [],
total: 0, total: 0,
paramVisible: false paramVisible: false,
} };
}, },
components: { TeamProductionDetail, SearchArea }, components: { TeamProductionDetail, SearchArea },
mounted() { mounted() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList() buttonClick(val) {
}, this.queryParams.pageNo = 1;
methods: { this.queryParams.classesId = val.classesId;
buttonClick(val) { this.queryParams.teamName = val.teamName;
this.queryParams.pageNo = 1; this.queryParams.startDay[0] = val.tiemStr
this.queryParams.classesId = val.classesId ? val.tiemStr[0] + ' 00:00:00'
this.queryParams.teamName = val.teamName : '';
this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : '' this.queryParams.startDay[1] = val.tiemStr
this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : '' ? val.tiemStr[1] + ' 23:59:59'
this.getList() : '';
}, this.getList();
getList() { },
groupTeamSchedulingPage({ ...this.queryParams }).then(res => { getList() {
console.log(res) groupTeamSchedulingPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] console.log(res);
this.total = res.data.total || 0 this.list = res.data.list || [];
}) this.total = res.data.total || 0;
}, });
handleClick(val) { },
console.log(val) handleClick(val) {
this.paramVisible = true console.log(val);
this.$nextTick(() => { this.paramVisible = true;
this.$refs.schedulingMonitoringDetail.init(val.data) this.$nextTick(() => {
}) this.$refs.schedulingMonitoringDetail.init(val.data);
} });
} },
} },
};
</script> </script>

View File

@@ -1,440 +1,465 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="240"
slot="handleBtn" label="操作"
:width="240" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增&编辑 -->
:total="total" <base-dialog
@pagination="getList" :dialogTitle="addOrEditTitle"
/> :dialogVisible="centervisible"
<!-- 新增&编辑 --> @cancel="handleCancel"
<base-dialog @confirm="handleConfirm"
:dialogTitle="addOrEditTitle" :before-close="handleCancel"
:dialogVisible="centervisible" width="60%">
@cancel="handleCancel" <order-group-add
@confirm="handleConfirm" ref="orderGroupAdd"
:before-close="handleCancel" @successSubmit="successSubmit" />
width='60%' </base-dialog>
> <!-- 查看详情 -->
<order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" /> <!-- 新增工单 -->
</base-dialog> <base-dialog
<!-- 查看详情 --> dialogTitle="绑定厂务订单"
<!-- 新增工单 --> :dialogVisible="bindOrderVisible"
<base-dialog @cancel="bindOrderCancel"
dialogTitle="绑定厂务订单" @confirm="bindOrderConfirm"
:dialogVisible="bindOrderVisible" :before-close="bindOrderCancel"
@cancel="bindOrderCancel" width="60%">
@confirm="bindOrderConfirm" <bind-order
:before-close="bindOrderCancel" ref="bindOrder"
width='60%' @bindOrderSubmit="bindOrderSubmit" />
> </base-dialog>
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" /> </div>
</base-dialog>
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup' import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup';
import { customerList } from '@/api/base/orderManage' import { customerList } from '@/api/base/orderManage';
import OrderGroupAdd from './components/orderGroupAdd' import OrderGroupAdd from './components/orderGroupAdd';
import BindOrder from './components/bindOrder' import BindOrder from './components/bindOrder';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'name', prop: 'name',
label: '订单名称', label: '订单名称',
minWidth: 140, minWidth: 140,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '订单编码', label: '订单编码',
minWidth: 150 minWidth: 150,
}, },
{ {
prop: 'customerId', prop: 'customerId',
label: '客户', label: '客户',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'status', prop: 'status',
label: '订单状态', label: '订单状态',
filter: publicFormatter('order_status') filter: publicFormatter('order_status'),
}, },
{ {
prop: 'productName', prop: 'productName',
label: '产品名称', label: '产品名称',
minWidth: 200, minWidth: 200,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'specifications', prop: 'specifications',
label: '产品规格', label: '产品规格',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划加工量', label: '计划加工量',
width: 100 width: 100,
}, },
{ {
prop: 'actualquantity', prop: 'actualquantity',
label: '实际加工量', label: '实际加工量',
width: 100 width: 100,
}, },
{ {
prop: 'deliveTime', prop: 'deliveTime',
label: '交货时间', label: '交货时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'packReq', prop: 'packReq',
label: '包装要求', label: '包装要求',
// filter: publicFormatter('pack_spec'), // filter: publicFormatter('pack_spec'),
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'orderIdNum', prop: 'orderIdNum',
label: '订单数量' label: '订单数量',
} },
] ];
export default { export default {
name: 'OrderGroup', name: 'OrderGroup',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '订单名称', type: 'input',
placeholder: '订单名称', label: '订单名称',
param: 'name' placeholder: '订单名称',
}, param: 'name',
{ },
type: 'select', {
label: '状态', type: 'select',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS), label: '状态',
labelField: 'label', selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
valueField: 'value', labelField: 'label',
param: 'status' valueField: 'value',
}, param: 'status',
{ },
type: 'datePicker', {
label: '时间段', type: 'datePicker',
dateType: 'daterange', label: '时间段',
format: 'yyyy-MM-dd', dateType: 'daterange',
valueFormat: "yyyy-MM-dd", format: 'yyyy-MM-dd',
rangeSeparator: '-', valueFormat: 'yyyy-MM-dd',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 250 defaultSelect: [],
}, width: 250,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:order-group:create')
{ ? 'separate'
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '', : '',
btnName: '新增', },
name: 'add', {
color: 'success', type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
plain: true btnName: '新增',
} name: 'add',
], color: 'success',
// 查询参数 plain: true,
queryParams: { },
pageNo: 1, ],
pageSize: 20, // 查询参数
name: null, queryParams: {
status: null, pageNo: 1,
planFinishTime: [] pageSize: 20,
}, name: null,
total: 0, status: null,
tableProps, planFinishTime: [],
list: [], },
tableH: this.tableHeight(260), total: 0,
tableBtn: [ tableProps,
this.$auth.hasPermi('base:order-group:bind') list: [],
? { tableBtn: [
type: 'bind', this.$auth.hasPermi('base:order-group:bind')
btnName: '绑定', ? {
showTip: '厂务订单', type: 'bind',
showParam: { btnName: '绑定',
type: '&', showTip: '厂务订单',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 3 type: 'less',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-group:complete') }
? { : undefined,
type: 'complete', this.$auth.hasPermi('base:order-group:complete')
btnName: '完成', ? {
showTip: '完成订单', type: 'complete',
showParam: { btnName: '完成',
type: '&', showTip: '完成订单',
data: [ showParam: {
{ type: '&',
type: 'equal', data: [
name: 'status', {
value: 3 type: 'equal',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-group:termination') }
? { : undefined,
type: 'termination', this.$auth.hasPermi('base:order-group:termination')
btnName: '终止', ? {
showTip: '终止', type: 'termination',
showParam: { btnName: '终止',
type: '&', showTip: '终止',
data: [ showParam: {
{ type: '&',
type: 'equal', data: [
name: 'status', {
value: 3 type: 'equal',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-group:cancel') }
? { : undefined,
type: 'cancel', this.$auth.hasPermi('base:order-group:cancel')
btnName: '作废', ? {
showTip: '作废', type: 'cancel',
showParam: { btnName: '作废',
type: '&', showTip: '作废',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 2 type: 'less',
} name: 'status',
] value: 2,
} },
} ],
: undefined, },
{ }
type: 'detail', : undefined,
btnName: '详情' {
}, type: 'detail',
this.$auth.hasPermi('base:order-group:edit') btnName: '详情',
? { },
type: 'edit', this.$auth.hasPermi('base:order-group:edit')
btnName: '编辑', ? {
showParam: { type: 'edit',
type: '&', btnName: '编辑',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 2 type: 'less',
} name: 'status',
] value: 2,
} },
} ],
: undefined },
].filter((v) => v), }
addOrEditTitle: '', : undefined,
centervisible: false, ].filter((v) => v),
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY), addOrEditTitle: '',
workIssueTitle: '', centervisible: false,
bindOrderVisible: false, priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
orderDetailVisible: false workIssueTitle: '',
} bindOrderVisible: false,
}, orderDetailVisible: false,
components: { OrderGroupAdd, BindOrder }, };
created() { },
window.addEventListener('resize', () => { components: { OrderGroupAdd, BindOrder },
this.tableH = this.tableHeight(260) created() {
}) this.getList();
this.getList() },
}, methods: {
methods: { getList() {
getList() { getOrderGroupPage({ ...this.queryParams }).then((res) => {
getOrderGroupPage({...this.queryParams}).then(res => { let arr = res.data.records || [];
let arr = res.data.records || [] this.total = res.data.total || 0;
this.total = res.data.total || 0 if (arr.length > 0) {
if (arr.length > 0) { customerList().then((result) => {
customerList().then(result => { let tempData = result.data || [];
let tempData = result.data || [] if (tempData.length > 0) {
if (tempData.length > 0) { arr.map((item) => {
arr.map(item => { for (let i of tempData) {
for (let i of tempData) { if (item.customerId === i.id) {
if (item.customerId === i.id) { item.customerId = i.name;
item.customerId = i.name }
} }
} });
}) this.list = arr;
this.list = arr }
} });
}) } else {
}else { this.list = arr;
this.list = arr }
} });
}) },
}, buttonClick(val) {
buttonClick(val) { console.log(val);
console.log(val) if (val.btnName === 'search') {
if (val.btnName === 'search') { this.queryParams.name = val.name;
this.queryParams.name = val.name this.queryParams.status = val.status;
this.queryParams.status = val.status if (val.timeVal && val.timeVal.length > 0) {
if (val.timeVal && val.timeVal.length > 0) { this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00';
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00' this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59';
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59' } else {
} else { this.queryParams.planFinishTime = [];
this.queryParams.planFinishTime = [] }
} this.getList();
this.getList() } else {
} else { this.addOrEditTitle = '新增';
this.addOrEditTitle = '新增' this.centervisible = true;
this.centervisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.orderGroupAdd.init();
this.$refs.orderGroupAdd.init() });
}) }
} },
}, handleClick(val) {
handleClick(val) { console.log(val);
console.log(val) switch (val.type) {
switch (val.type) { case 'edit':
case 'edit': this.addOrEditTitle = '编辑';
this.addOrEditTitle = '编辑' this.centervisible = true;
this.centervisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.orderGroupAdd.init(val.data.id);
this.$refs.orderGroupAdd.init(val.data.id) });
}) break;
break case 'cancel':
case 'cancel': this.handleEditStatus(val.data, '作废', '6');
this.handleEditStatus(val.data, '作废', '6') break;
break case 'detail':
case 'detail': this.$router.push({
this.$router.push({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id}) path:
break '/order/base/order-group/order-group-detail-data?orderGroupId=' +
case 'termination': val.data.id,
this.handleEditStatus(val.data, '终止', '5') });
break break;
case 'bind': case 'termination':
this.workIssueTitle = '绑定工单' this.handleEditStatus(val.data, '终止', '5');
this.bindOrderVisible = true break;
this.$nextTick(() => { case 'bind':
this.$refs.bindOrder.init(val.data) this.workIssueTitle = '绑定工单';
}) this.bindOrderVisible = true;
break this.$nextTick(() => {
case 'complete': this.$refs.bindOrder.init(val.data);
this.handleEditStatus(val.data, '完成', '4') });
break break;
default: case 'complete':
} this.handleEditStatus(val.data, '完成', '4');
}, break;
// 完成,终止,作废 default:
handleEditStatus(val, tip, status) { }
let _this = this },
if (val.orderIdNum > 0) {// 有下级订单 // 完成,终止,作废
_this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', { handleEditStatus(val, tip, status) {
type: 'warning', let _this = this;
distinguishCancelAndClose: true, if (val.orderIdNum > 0) {
confirmButtonText: '同步', // 有下级订单
cancelButtonText: '不同步' _this
}).then(function() { .$confirm(
console.log('同步') '是否将"' + tip + '"操作同步至下级订单和工单?',
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => { '确认信息',
_this.getList(); {
_this.$modal.msgSuccess("操作成功"); type: 'warning',
}) distinguishCancelAndClose: true,
}).catch(action => { confirmButtonText: '同步',
if (action === 'cancel') { cancelButtonText: '不同步',
console.log('不同步') }
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => { )
_this.getList(); .then(function () {
_this.$modal.msgSuccess("操作成功"); console.log('同步');
}) groupOrderStatusSet({
}else { id: val.id,
return console.log('关闭') status: status,
} isSync: true,
}) }).then(() => {
}else{// 无下级订单 _this.getList();
_this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() { _this.$modal.msgSuccess('操作成功');
return groupOrderStatusSet({ id: val.id, status: status}) });
}).then(() => { })
_this.getList(); .catch((action) => {
_this.$modal.msgSuccess("操作成功"); if (action === 'cancel') {
}).catch(() => {}); console.log('不同步');
} groupOrderStatusSet({
}, id: val.id,
handleCancel() { status: status,
this.$refs.orderGroupAdd.formClear() isSync: false,
this.centervisible = false }).then(() => {
this.addOrEditTitle = '' _this.getList();
}, _this.$modal.msgSuccess('操作成功');
handleConfirm() { });
this.$refs.orderGroupAdd.submitForm() } else {
}, return console.log('关闭');
successSubmit() { }
this.handleCancel() });
this.getList() } else {
}, // 无下级订单
// 下发新增 _this.$modal
bindOrderCancel() { .confirm(
this.$refs.bindOrder.formClear() '是否确认"' + tip + '"集团订单名称为"' + val.name + '"的数据项?'
this.bindOrderVisible = false )
}, .then(function () {
bindOrderConfirm() { return groupOrderStatusSet({ id: val.id, status: status });
this.$refs.bindOrder.bindOrderSubmit() })
}, .then(() => {
bindOrderSubmit() { _this.getList();
this.bindOrderCancel() _this.$modal.msgSuccess('操作成功');
this.getList() })
} .catch(() => {});
} }
} },
handleCancel() {
this.$refs.orderGroupAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.orderGroupAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
// 下发新增
bindOrderCancel() {
this.$refs.bindOrder.formClear();
this.bindOrderVisible = false;
},
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit();
},
bindOrderSubmit() {
this.bindOrderCancel();
this.getList();
},
},
};
</script> </script>

View File

@@ -1,470 +1,494 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="290"
slot="handleBtn" label="操作"
:width="290" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增&编辑 -->
:total="total" <base-dialog
@pagination="getList" :dialogTitle="addOrEditTitle"
/> :dialogVisible="centervisible"
<!-- 新增&编辑 --> @cancel="handleCancel"
<base-dialog @confirm="handleConfirm"
:dialogTitle="addOrEditTitle" :before-close="handleCancel"
:dialogVisible="centervisible" width="60%">
@cancel="handleCancel" <order-add
@confirm="handleConfirm" ref="orderAdd"
:before-close="handleCancel" @successSubmit="successSubmit" />
width='60%' </base-dialog>
> <!-- 查看详情 -->
<order-add ref="orderAdd" @successSubmit="successSubmit" /> <!-- 新增工单 -->
</base-dialog> <base-dialog
<!-- 查看详情 --> :dialogTitle="workIssueTitle"
<!-- 新增工单 --> :dialogVisible="addWorkOrdervisible"
<base-dialog @cancel="addWorkOrderCancel"
:dialogTitle="workIssueTitle" @confirm="addWorkOrderConfirm"
:dialogVisible="addWorkOrdervisible" :before-close="addWorkOrderCancel"
@cancel="addWorkOrderCancel" width="70%">
@confirm="addWorkOrderConfirm" <add-work-order
:before-close="addWorkOrderCancel" ref="addWorkOrder"
width='70%' @addWorkOrderSubmit="addWorkOrderSubmit" />
> </base-dialog>
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" /> </div>
</base-dialog>
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage' import {
import OrderAdd from './components/orderAdd' getOrderPage,
import AddWorkOrder from './components/addWorkOrder' orderStatusSet,
import { publicFormatter } from '@/utils/dict' customerList,
orderFinish,
} from '@/api/base/orderManage';
import OrderAdd from './components/orderAdd';
import AddWorkOrder from './components/addWorkOrder';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'name', prop: 'name',
label: '订单名称', label: '订单名称',
minWidth: 140, minWidth: 140,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '订单编码', label: '订单编码',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'triggerOrigin', prop: 'triggerOrigin',
label: '来源', label: '来源',
filter: publicFormatter('order_Origin') filter: publicFormatter('order_Origin'),
}, },
{ {
prop: 'priority', prop: 'priority',
label: '优先级', label: '优先级',
filter: publicFormatter('order_priority') filter: publicFormatter('order_priority'),
}, },
{ {
prop: 'status', prop: 'status',
label: '订单状态', label: '订单状态',
filter: publicFormatter('order_status') filter: publicFormatter('order_status'),
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划加工量', label: '计划加工量',
width: 100 width: 100,
}, },
{ {
prop: 'actualQuantity', prop: 'actualQuantity',
label: '实际加工量', label: '实际加工量',
width: 100 width: 100,
}, },
{ {
prop: 'productName', prop: 'productName',
label: '产品', label: '产品',
width: 200, width: 200,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'price', prop: 'price',
label: '单价(元)', label: '单价(元)',
align: 'right' align: 'right',
}, },
{ {
prop: 'workOrderNum', prop: 'workOrderNum',
label: '工单数量' label: '工单数量',
} },
] ];
export default { export default {
name: 'OrderManage', name: 'OrderManage',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '订单名称', type: 'input',
placeholder: '订单名称', label: '订单名称',
param: 'name' placeholder: '订单名称',
}, param: 'name',
{ },
type: 'select', {
label: '状态', type: 'select',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS), label: '状态',
labelField: 'label', selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
valueField: 'value', labelField: 'label',
param: 'status' valueField: 'value',
}, param: 'status',
{ },
type: 'datePicker', {
label: '时间段', type: 'datePicker',
dateType: 'daterange', label: '时间段',
format: 'yyyy-MM-dd', dateType: 'daterange',
valueFormat: "yyyy-MM-dd", format: 'yyyy-MM-dd',
rangeSeparator: '-', valueFormat: 'yyyy-MM-dd',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 250 defaultSelect: [],
}, width: 250,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:order-manage:create')
{ ? 'separate'
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '', : '',
btnName: '新增', },
name: 'add', {
color: 'success', type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
plain: true btnName: '新增',
} name: 'add',
], color: 'success',
// 查询参数 plain: true,
queryParams: { },
pageNo: 1, ],
pageSize: 20, // 查询参数
name: null, queryParams: {
status: null, pageNo: 1,
lastIssuedTime: [] pageSize: 20,
}, name: null,
total: 0, status: null,
tableProps, lastIssuedTime: [],
list: [], },
tableH: this.tableHeight(260), total: 0,
tableBtn: [ tableProps,
this.$auth.hasPermi('base:order-manage:addWorkOrder') list: [],
? { tableBtn: [
type: 'add', this.$auth.hasPermi('base:order-manage:addWorkOrder')
btnName: '新增', ? {
showTip: '新增工单', type: 'add',
showParam: { btnName: '新增',
type: '&', showTip: '新增工单',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 3 type: 'less',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-manage:bindWorkOrder') }
? { : undefined,
type: 'bind', this.$auth.hasPermi('base:order-manage:bindWorkOrder')
btnName: '绑定', ? {
showTip: '绑定工单', type: 'bind',
showParam: { btnName: '绑定',
type: '&', showTip: '绑定工单',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 3 type: 'less',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-manage:complete') }
? { : undefined,
type: 'complete', this.$auth.hasPermi('base:order-manage:complete')
btnName: '完成', ? {
showTip: '完成订单', type: 'complete',
showParam: { btnName: '完成',
type: '&', showTip: '完成订单',
data: [ showParam: {
{ type: '&',
type: 'equal', data: [
name: 'status', {
value: 3 type: 'equal',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-manage:termination') }
? { : undefined,
type: 'termination', this.$auth.hasPermi('base:order-manage:termination')
btnName: '终止', ? {
showTip: '终止', type: 'termination',
showParam: { btnName: '终止',
type: '&', showTip: '终止',
data: [ showParam: {
{ type: '&',
type: 'equal', data: [
name: 'status', {
value: 3 type: 'equal',
} name: 'status',
] value: 3,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-manage:cancel') }
? { : undefined,
type: 'cancel', this.$auth.hasPermi('base:order-manage:cancel')
btnName: '作废', ? {
showTip: '作废', type: 'cancel',
showParam: { btnName: '作废',
type: '&', showTip: '作废',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 2 type: 'less',
} name: 'status',
] value: 2,
} },
} ],
: undefined, },
this.$auth.hasPermi('base:order-manage:detail') }
? { : undefined,
type: 'detail', this.$auth.hasPermi('base:order-manage:detail')
btnName: '详情' ? {
} type: 'detail',
: undefined, btnName: '详情',
this.$auth.hasPermi('base:order-manage:edit') }
? { : undefined,
type: 'edit', this.$auth.hasPermi('base:order-manage:edit')
btnName: '编辑', ? {
showParam: { type: 'edit',
type: '&', btnName: '编辑',
data: [ showParam: {
{ type: '&',
type: 'less', data: [
name: 'status', {
value: 2 type: 'less',
} name: 'status',
] value: 2,
} },
} ],
: undefined },
].filter((v) => v), }
addOrEditTitle: '', : undefined,
centervisible: false, ].filter((v) => v),
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY), addOrEditTitle: '',
workIssueTitle: '', centervisible: false,
addWorkOrdervisible: false, priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
orderDetailVisible: false workIssueTitle: '',
} addWorkOrdervisible: false,
}, orderDetailVisible: false,
components: { OrderAdd, AddWorkOrder }, };
created() { },
window.addEventListener('resize', () => { components: { OrderAdd, AddWorkOrder },
this.tableH = this.tableHeight(260) created() {
}) this.getList();
this.getList() },
}, methods: {
methods: { getList() {
getList() { getOrderPage({ ...this.queryParams }).then((res) => {
getOrderPage({...this.queryParams}).then(res => { let arr = res.data.records || [];
let arr = res.data.records || [] this.total = res.data.total || 0;
this.total = res.data.total || 0 if (arr.length > 0) {
if (arr.length > 0) { customerList().then((result) => {
customerList().then(result => { let tempData = result.data || [];
let tempData = result.data || [] if (tempData.length > 0) {
if (tempData.length > 0) { arr.map((item) => {
arr.map(item => { for (let i of tempData) {
for (let i of tempData) { if (item.customerId === i.id) {
if (item.customerId === i.id) { item.customerId = i.name;
item.customerId = i.name }
} }
} item.price = item.price ? item.price.toFixed(2) : '0.00';
item.price = item.price ? item.price.toFixed(2) : '0.00' });
}) this.list = arr;
this.list = arr }
} });
}) } else {
}else { this.list = arr;
this.list = arr }
} });
}) },
}, buttonClick(val) {
buttonClick(val) { console.log(val);
console.log(val) if (val.btnName === 'search') {
if (val.btnName === 'search') { this.queryParams.name = val.name;
this.queryParams.name = val.name this.queryParams.status = val.status;
this.queryParams.status = val.status if (val.timeVal && val.timeVal.length > 0) {
if (val.timeVal && val.timeVal.length > 0) { this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00';
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00' this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59';
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59' } else {
} else { this.queryParams.lastIssuedTime = [];
this.queryParams.lastIssuedTime = [] }
} this.getList();
this.getList() } else {
} else { this.addOrEditTitle = '新增';
this.addOrEditTitle = '新增' this.centervisible = true;
this.centervisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.orderAdd.init();
this.$refs.orderAdd.init() });
}) }
} },
}, handleClick(val) {
handleClick(val) { console.log(val);
console.log(val) switch (val.type) {
switch (val.type) { case 'edit':
case 'edit': this.addOrEditTitle = '编辑';
this.addOrEditTitle = '编辑' this.centervisible = true;
this.centervisible = true this.$nextTick(() => {
this.$nextTick(() => { this.$refs.orderAdd.init(val.data.id);
this.$refs.orderAdd.init(val.data.id) });
}) break;
break case 'cancel':
case 'cancel': this.handleEditStatus(val.data, '作废', '6');
this.handleEditStatus(val.data, '作废', '6') break;
break case 'termination':
case 'termination': this.handleEditStatus(val.data, '终止', '5');
this.handleEditStatus(val.data, '终止', '5') break;
break case 'detail':
case 'detail': this.$router.push({
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id}) path:
break '/order/base/order-manage/order-detail-data?orderId=' +
case 'add': val.data.id,
this.workIssueTitle = '新增工单' });
this.addWorkOrdervisible = true break;
this.$nextTick(() => { case 'add':
this.$refs.addWorkOrder.init(val.data, 'add') this.workIssueTitle = '新增工单';
}) this.addWorkOrdervisible = true;
break this.$nextTick(() => {
case 'bind': this.$refs.addWorkOrder.init(val.data, 'add');
this.workIssueTitle = '绑定工单' });
this.addWorkOrdervisible = true break;
this.$nextTick(() => { case 'bind':
this.$refs.addWorkOrder.init(val.data, 'bind') this.workIssueTitle = '绑定工单';
}) this.addWorkOrdervisible = true;
break this.$nextTick(() => {
case 'complete': this.$refs.addWorkOrder.init(val.data, 'bind');
this.handleEditStatus(val.data, '完成', '4') });
break break;
default: case 'complete':
} this.handleEditStatus(val.data, '完成', '4');
}, break;
// 完成,终止,作废 default:
handleEditStatus(val, tip, status) { }
let _this = this },
if (val.workOrderNum > 0) {//有下级工单 // 完成,终止,作废
_this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', { handleEditStatus(val, tip, status) {
type: 'warning', let _this = this;
distinguishCancelAndClose: true, if (val.workOrderNum > 0) {
confirmButtonText: '同步', //有下级工单
cancelButtonText: '不同步' _this
}).then(function() { .$confirm('是否将"' + tip + '"操作同步至下级工单?', '确认信息', {
console.log('同步') type: 'warning',
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => { distinguishCancelAndClose: true,
_this.getList(); confirmButtonText: '同步',
_this.$modal.msgSuccess("操作成功"); cancelButtonText: '不同步',
}) })
}).catch(action => { .then(function () {
if (action === 'cancel') { console.log('同步');
console.log('不同步') orderStatusSet({ id: val.id, status: status, isSync: true }).then(
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => { () => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess('操作成功');
}) }
}else { );
return console.log('关闭') })
} .catch((action) => {
}) if (action === 'cancel') {
}else{// 无下级工单 console.log('不同步');
_this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() { orderStatusSet({
return orderStatusSet({ id: val.id, status: status}) id: val.id,
}).then(() => { status: status,
_this.getList(); isSync: false,
_this.$modal.msgSuccess("操作成功"); }).then(() => {
}).catch(() => {}); _this.getList();
} _this.$modal.msgSuccess('操作成功');
}, });
// 新增 } else {
handleCancel() { return console.log('关闭');
this.$refs.orderAdd.formClear() }
this.centervisible = false });
this.addOrEditTitle = '' } else {
}, // 无下级工单
handleConfirm() { _this.$modal
this.$refs.orderAdd.submitForm() .confirm(
}, '是否确认"' + tip + '"厂务订单名称为"' + val.name + '"的数据项?'
successSubmit() { )
this.handleCancel() .then(function () {
this.getList() return orderStatusSet({ id: val.id, status: status });
}, })
// 下发新增 .then(() => {
addWorkOrderCancel() { _this.getList();
this.$refs.addWorkOrder.formClear() _this.$modal.msgSuccess('操作成功');
this.addWorkOrdervisible = false })
}, .catch(() => {});
addWorkOrderConfirm() { }
this.$refs.addWorkOrder.addWorkOrderSubmit() },
}, // 新增
addWorkOrderSubmit() { handleCancel() {
this.addWorkOrderCancel() this.$refs.orderAdd.formClear();
this.getList() this.centervisible = false;
} this.addOrEditTitle = '';
// bindWorkOrderCancel() { },
// this.$refs.bindWorkOrder.formClear() handleConfirm() {
// this.bindWorkOrdervisible = false this.$refs.orderAdd.submitForm();
// }, },
// bindWorkOrderConfirm() { successSubmit() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit() this.handleCancel();
// }, this.getList();
// bindWorkOrderSubmit() { },
// this.bindWorkOrderCancel() // 下发新增
// this.getList() addWorkOrderCancel() {
// } this.$refs.addWorkOrder.formClear();
} this.addWorkOrdervisible = false;
} },
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit();
},
addWorkOrderSubmit() {
this.addWorkOrderCancel();
this.getList();
},
// bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false
// },
// bindWorkOrderConfirm() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit()
// },
// bindWorkOrderSubmit() {
// this.bindWorkOrderCancel()
// this.getList()
// }
},
};
</script> </script>

View File

@@ -56,6 +56,7 @@ import { publicFormatter } from '@/utils/dict';
import { orderGroupMonitor } from '@/api/base/orderGroup'; import { orderGroupMonitor } from '@/api/base/orderGroup';
import MonitoringRingCharts from './../components/monitoringRingCharts'; import MonitoringRingCharts from './../components/monitoringRingCharts';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
@@ -141,6 +142,7 @@ const tableProps = [
]; ];
export default { export default {
name: 'OrderCompletionMonitoring', name: 'OrderCompletionMonitoring',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@@ -177,7 +179,6 @@ export default {
}, },
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet') this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
@@ -242,9 +243,6 @@ export default {
}, },
components: { MonitoringRingCharts }, components: { MonitoringRingCharts },
mounted() { mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
let start = moment().subtract(30, 'days').format('yyyy-MM-DD'); let start = moment().subtract(30, 'days').format('yyyy-MM-DD');
let end = moment().format('yyyy-MM-DD'); let end = moment().format('yyyy-MM-DD');
this.formConfig[1].defaultSelect = [start, end]; this.formConfig[1].defaultSelect = [start, end];
@@ -290,6 +288,7 @@ export default {
sunNum += item.orderMonitorVOS[i].actualquantity || 0; sunNum += item.orderMonitorVOS[i].actualquantity || 0;
arr3.push(subObj); arr3.push(subObj);
} }
woIdString = woIdString.slice(0, -1);
} }
item.woIdString = woIdString; item.woIdString = woIdString;
arr3.push({ arr3.push({

View File

@@ -54,7 +54,9 @@ export default {
param: 'inspectionDetContent', param: 'inspectionDetContent',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-inspection-box-btn:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -66,7 +66,9 @@ export default {
param: 'nickName', param: 'nickName',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-inspection-box-permissions:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -135,7 +135,7 @@ export default {
width: 250 width: 250
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@@ -144,7 +144,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '', type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',

View File

@@ -92,7 +92,9 @@ export default {
// width: 350, // width: 350,
// }, // },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-inspection-det:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -134,7 +134,9 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-inspection-type:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -131,7 +131,7 @@ export default {
// width: 350, // width: 350,
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-isra-statistics:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@@ -207,15 +207,16 @@ export default {
}).then((res) => { }).then((res) => {
let mapArr= [] let mapArr= []
let mapLegendData = [] let mapLegendData = []
let obj = {
name: '',
type: 'line',
// stack: 'Total',
data: [],
mapXAxisData: [],
}
// let mapXAxisData = [] // let mapXAxisData = []
for (let i in res.data) { for (let i in res.data) {
let obj = {
name: '',
type: 'line',
// stack: 'Total',
data: [],
mapXAxisData:[],
}
// console.log(i) // console.log(i)
let dataArr = [] let dataArr = []
res.data[i].forEach(ele => { res.data[i].forEach(ele => {
@@ -227,6 +228,7 @@ export default {
mapLegendData.push(i) mapLegendData.push(i)
mapArr.push(obj) mapArr.push(obj)
} }
console.log(mapArr);
// console.log(res.data[res]); // console.log(res.data[res]);
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain') var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
@@ -267,6 +269,7 @@ export default {
}, },
series: mapArr series: mapArr
} }
myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
}) })
this.$axios({ this.$axios({
@@ -374,6 +377,7 @@ export default {
} }
] ]
} }
myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
}) })
}, },

View File

@@ -92,7 +92,7 @@ export default {
filterable: true filterable: true
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -119,7 +119,7 @@ export default {
// filterable: true // filterable: true
// }, // },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -82,7 +82,7 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:quality-scrap-type:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -218,7 +218,11 @@ export default {
width: 350, width: 350,
}, },
{ {
type: 'button', type: this.$auth.hasPermi(
'monitoring:device-parameters:query'
)
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -260,17 +260,24 @@ export default {
// ], // ],
// }, // },
{ {
type: 'button', type: this.$auth.hasPermi(
'monitoring:equipment-traceability:query'
)
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'button', type: this.$auth.hasPermi(
'monitoring:equipment-traceability:export'
)
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'warning', color: 'warning',
}, },
// { // {
// type: 'separate', // type: 'separate',

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-03-29 14:08:18 * @LastEditTime: 2024-04-07 16:19:18
* @Description: * @Description:
--> -->
<template> <template>
@@ -84,21 +84,21 @@ export default {
// }, // },
tableProps, tableProps,
// tableH: this.tableHeight(260), // tableH: this.tableHeight(260),
tableBtn: [ // tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) // this.$auth.hasPermi(`base:packaging-print-log:update`)
? { // ? {
type: 'edit', // type: 'edit',
btnName: '编辑', // btnName: '编辑',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`) // this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { // ? {
type: 'delete', // type: 'delete',
btnName: '删除', // btnName: '删除',
} // }
: undefined, // : undefined,
].filter((v) => v), // ].filter((v) => v),
list: [], list: [],
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
@@ -131,7 +131,7 @@ export default {
width: 250 width: 250
}, },
{ {
type: 'button', type: this.$auth.hasPermi('monitoring:materiel-date-from:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-03-29 14:08:30 * @LastEditTime: 2024-04-07 16:25:19
* @Description: * @Description:
--> -->
<template> <template>
@@ -147,7 +147,8 @@ export default {
// width: 250 // width: 250
// }, // },
{ {
type: 'button',
type: this.$auth.hasPermi('monitoring:rawMaterial-traceability:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-03-29 15:32:33 * @LastEditTime: 2024-04-07 16:26:56
* @Description: * @Description:
--> -->
<template> <template>
@@ -135,7 +135,12 @@ export default {
width: 250 width: 250
}, },
{ {
type: 'button',
type: this.$auth.hasPermi(
'monitoring:process-traceability:query'
)
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -159,7 +159,11 @@ export default {
// width: 350, // width: 350,
}, },
{ {
type: 'button', type: this.$auth.hasPermi(
'base:quality-inspection-record:query'
)
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-24 15:15:24 * @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-03-27 09:27:23 * @LastEditTime: 2024-04-08 11:47:39
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -18,8 +18,8 @@
<el-form-item> <el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button> @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-day:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
@click="handleExport">导出</el-button> plain @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -9,8 +9,8 @@
<el-form-item> <el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button> @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
@click="handleExport">导出</el-button> plain @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -16,8 +16,8 @@
<el-form-item> <el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button> @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
@click="handleExport">导出</el-button> plain @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -11,8 +11,8 @@
<el-form-item> <el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button> @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
@click="handleExport">导出</el-button> plain @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:32 * @LastEditTime: 2024-04-08 11:45:52
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -12,8 +12,9 @@
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain </el-button>
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
@@ -28,122 +29,122 @@
<el-table-column :label="'许昌安彩月成品生产汇总' + '(' + timeTips + ')'" align="center"> <el-table-column :label="'许昌安彩月成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center"> <el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span> <span v-else>{{ scope.row.lineName }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="投入数㎡" align="center"> <el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本月" align="center"> <el-table-column prop="inputNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span> <span v-else>{{ scope.row.inputNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputHis" label="上月" align="center"> <el-table-column prop="inputHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span> <span v-else>{{ scope.row.inputHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ? <span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 : parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="完成良品产量" align="center"> <el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本月" align="center"> <el-table-column prop="goodProductNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductNow }} </span> <span v-else>{{ scope.row.goodProductNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductHis" label="上月" align="center"> <el-table-column prop="goodProductHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductHis }} </span> <span v-else>{{ scope.row.goodProductHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ? <span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 : parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本月" align="center"> <el-table-column prop="missCheckNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="上月" align="center"> <el-table-column prop="missCheckHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ? <span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本月" align="center"> <el-table-column prop="goodProductPassNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="上月" align="center"> <el-table-column prop="goodProductPassHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ? <span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend == parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>

View File

@@ -14,9 +14,9 @@
style="width: 350px" placeholder="选择周"> style="width: 350px" placeholder="选择周">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
<!-- <el-button type="primary" @click="getDataList()">查询</el-button> --> </el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
@@ -31,126 +31,126 @@
<el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center"> <el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center"> <el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span> <span v-else>{{ scope.row.lineName }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="投入数㎡" align="center"> <el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本周" align="center"> <el-table-column prop="inputNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span> <span v-else>{{ scope.row.inputNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputHis" label="上周" align="center"> <el-table-column prop="inputHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span> <span v-else>{{ scope.row.inputHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ? <span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="完成良品产量" align="center"> <el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本周" align="center"> <el-table-column prop="goodProductNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductNow }} </span> <span v-else>{{ scope.row.goodProductNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductHis" label="上周" align="center"> <el-table-column prop="goodProductHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductHis }} </span> <span v-else>{{ scope.row.goodProductHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ? <span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本周" align="center"> <el-table-column prop="missCheckNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="上周" align="center"> <el-table-column prop="missCheckHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ? <span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本周" align="center"> <el-table-column prop="goodProductPassNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="上周" align="center"> <el-table-column prop="goodProductPassHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ? <span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend == parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:49 * @LastEditTime: 2024-04-08 11:46:49
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -14,8 +14,9 @@
style="width: 350px" placeholder="选择年"> style="width: 350px" placeholder="选择年">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain </el-button>
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button> <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> --> <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
@@ -33,126 +34,126 @@
<el-table-column :label="'许昌安彩年成品生产汇总' + '(' + timeTips + ')'" align="center"> <el-table-column :label="'许昌安彩年成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center"> <el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span> <span v-else>{{ scope.row.lineName }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="投入数㎡" align="center"> <el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="今年" align="center"> <el-table-column prop="inputNow" label="今年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span> <span v-else>{{ scope.row.inputNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputHis" label="去年" align="center"> <el-table-column prop="inputHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span> <span v-else>{{ scope.row.inputHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ? <span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="完成良品产量" align="center"> <el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="今年" align="center"> <el-table-column prop="goodProductNow" label="今年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductNow }} </span> <span v-else>{{ scope.row.goodProductNow }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductHis" label="去年" align="center"> <el-table-column prop="goodProductHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductHis }} </span> <span v-else>{{ scope.row.goodProductHis }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ? <span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今年" align="center"> <el-table-column prop="missCheckNow" label="今年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="去年" align="center"> <el-table-column prop="missCheckHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ? <span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今年" align="center"> <el-table-column prop="goodProductPassNow" label="今年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="去年" align="center"> <el-table-column prop="goodProductPassHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) + 100).toFixed(2)) +
'%' : null }} '%' : null }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ? <span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend == parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ? 0 ?
0 : 0 :
null null
}} </span> }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>

View File

@@ -1,185 +1,188 @@
<template> <template>
<div class="app-container vocHis"> <div class="app-container vocHis">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH"
:max-height="tableH" :row-class-name="tableRowClassName" />
:row-class-name="tableRowClassName" <pagination
/> :page.sync="queryParams.pageNo"
<pagination :limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNo" :total="total"
:limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total" </div>
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental' import {
import moment from 'moment' environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'checkName', prop: 'checkName',
label: '指标名称' label: '指标名称',
}, },
{ {
prop: 'checkValue', prop: 'checkValue',
label: '检测数值' label: '检测数值',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'checkTime', prop: 'checkTime',
label: '检测时间', label: '检测时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'origin', prop: 'origin',
label: '来源', label: '来源',
filter: (val) => ['手动', '自动'][val] filter: (val) => ['手动', '自动'][val],
}, },
{ {
prop: 'recordPerson', prop: 'recordPerson',
label: '录入人' label: '录入人',
}, },
{ {
prop: 'recordTime', prop: 'recordTime',
label: '录入时间', label: '录入时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'VocDetectionHistory', name: 'VocDetectionHistory',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '指标名称', type: 'select',
selectOptions: [], label: '指标名称',
param: 'checkId', selectOptions: [],
filterable: true param: 'checkId',
}, filterable: true,
{ },
type: 'datePicker', {
label: '时间', type: 'datePicker',
dateType: 'datetimerange', label: '时间',
format: 'yyyy-MM-dd HH:mm:ss', dateType: 'datetimerange',
valueFormat: "timestamp", format: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', valueFormat: 'timestamp',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 350 defaultSelect: [],
}, width: 350,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
{ },
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '', {
btnName: '导出', type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
name: 'export', btnName: '导出',
color: 'primary', name: 'export',
plain: true color: 'primary',
} plain: true,
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
checkId: null, pageSize: 20,
checkType: 3, checkId: null,
startTime: null, checkType: 3,
endTime: null startTime: null,
}, endTime: null,
tableProps, },
list: [], tableProps,
total: 0, list: [],
tableH: this.tableHeight(260) total: 0,
} };
}, },
created() { created() {
window.addEventListener('resize', () => { let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
this.tableH = this.tableHeight(260) let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
}) this.formConfig[1].defaultSelect = [start, end];
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf() this.queryParams.startTime = start;
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf() this.queryParams.endTime = end;
this.formConfig[1].defaultSelect = [start, end] this.getSelectList();
this.queryParams.startTime = start this.getList();
this.queryParams.endTime = end },
this.getSelectList() methods: {
this.getList() buttonClick(val) {
}, this.queryParams.pageNo = 1;
methods: { this.queryParams.checkId = val.checkId;
buttonClick(val) { this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.pageNo = 1; this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
this.queryParams.checkId = val.checkId if (val.btnName === 'search') {
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null this.getList();
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null } else {
if (val.btnName === 'search') { this.$modal
this.getList() .confirm('是否确认导出')
} else { .then(() => {
this.$modal.confirm('是否确认导出').then(() => { return environmentalCheckRecordExport({ ...this.queryParams });
return environmentalCheckRecordExport({...this.queryParams}); })
}).then(response => { .then((response) => {
this.$download.excel(response, '废水检测历史记录.xls'); this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {}) })
} .catch(() => {});
}, }
getList() { },
environmentalCheckRecordPage({...this.queryParams}).then(res => { getList() {
this.list = res.data.list || [] environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.total = res.data.total || 0 this.list = res.data.list || [];
}) this.total = res.data.total || 0;
}, });
getSelectList() { },
environmentalCheckPage({ getSelectList() {
pageNo: 1, environmentalCheckPage({
pageSize: 100, pageNo: 1,
checkType: 3 pageSize: 100,
}).then(res => { checkType: 3,
console.log(res) }).then((res) => {
this.formConfig[0].selectOptions = res.data.list || [] console.log(res);
}) this.formConfig[0].selectOptions = res.data.list || [];
}, });
tableRowClassName({row, rowIndex}) { },
console.log(row) tableRowClassName({ row, rowIndex }) {
if (row.markRed) { console.log(row);
return 'warning-row' if (row.markRed) {
}else { return 'warning-row';
return '' } else {
} return '';
} }
} },
} },
};
</script> </script>
<style lang='scss'> <style lang='scss'>
.vocHis { .vocHis {
.el-table .warning-row { .el-table .warning-row {
background: #fee1e1; background: #fee1e1;
} }
} }
</style> </style>

View File

@@ -1,205 +1,210 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="80"
slot="handleBtn" label="操作"
:width="80" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增&编辑 -->
:total="total" <base-dialog
@pagination="getList" :dialogTitle="addOrEditTitle"
/> :dialogVisible="centervisible"
<!-- 新增&编辑 --> @cancel="handleCancel"
<base-dialog @confirm="handleConfirm"
:dialogTitle="addOrEditTitle" :before-close="handleCancel"
:dialogVisible="centervisible" width="60%">
@cancel="handleCancel" <voc-add
@confirm="handleConfirm" ref="vocAdd"
:before-close="handleCancel" @successSubmit="successSubmit" />
width='60%' </base-dialog>
> </div>
<voc-add ref="vocAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import VocAdd from './components/vocAdd' import VocAdd from './components/vocAdd';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental' import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '指标名称', label: '指标名称',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '指标编码', label: '指标编码',
minWidth: 120 minWidth: 120,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'minValue', prop: 'minValue',
label: '最小值' label: '最小值',
}, },
{ {
prop: 'maxValue', prop: 'maxValue',
label: '最大值' label: '最大值',
}, },
{ {
prop: 'creator', prop: 'creator',
label: '创建人' label: '创建人',
}, },
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'VocDetectionIndication', name: 'VocDetectionIndication',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '指标名称', type: 'input',
placeholder: '指标名称', label: '指标名称',
param: 'name' placeholder: '指标名称',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
{ },
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
checkType: 3, pageSize: 20,
name: null checkType: 3,
}, name: null,
total: 0, },
tableProps, total: 0,
list: [], tableProps,
tableH: this.tableHeight(260), list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:voc:update') this.$auth.hasPermi('base:voc:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:voc:delete') this.$auth.hasPermi('base:voc:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v)=>v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false centervisible: false,
} };
}, },
components: { VocAdd }, components: { VocAdd },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
environmentalCheckPage({...this.queryParams}).then(res => { environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams.name = val.name this.queryParams.name = val.name;
this.getList() this.getList();
} else { } else {
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vocAdd.init() this.$refs.vocAdd.init();
}) });
} }
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vocAdd.init(val.data.id) this.$refs.vocAdd.init(val.data.id);
}) });
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
// 删除 // 删除
handleDelete(val) { handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { this.$modal
return environmentalCheckDelete({ id: val.id }) .confirm('是否确认删除"' + val.name + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return environmentalCheckDelete({ id: val.id });
this.$modal.msgSuccess("操作成功"); })
}).catch(() => {}); .then(() => {
}, this.getList();
// 新增 this.$modal.msgSuccess('操作成功');
handleCancel() { })
this.$refs.vocAdd.formClear() .catch(() => {});
this.centervisible = false },
this.addOrEditTitle = '' // 新增
}, handleCancel() {
handleConfirm() { this.$refs.vocAdd.formClear();
this.$refs.vocAdd.submitForm() this.centervisible = false;
}, this.addOrEditTitle = '';
successSubmit() { },
this.handleCancel() handleConfirm() {
this.getList() this.$refs.vocAdd.submitForm();
} },
} successSubmit() {
} this.handleCancel();
this.getList();
},
},
};
</script> </script>

View File

@@ -1,185 +1,188 @@
<template> <template>
<div class="app-container wasteGasHis"> <div class="app-container wasteGasHis">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH"
:max-height="tableH" :row-class-name="tableRowClassName" />
:row-class-name="tableRowClassName" <pagination
/> :page.sync="queryParams.pageNo"
<pagination :limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNo" :total="total"
:limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total" </div>
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental' import {
import moment from 'moment' environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'checkName', prop: 'checkName',
label: '指标名称' label: '指标名称',
}, },
{ {
prop: 'checkValue', prop: 'checkValue',
label: '检测数值' label: '检测数值',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'checkTime', prop: 'checkTime',
label: '检测时间', label: '检测时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'origin', prop: 'origin',
label: '来源', label: '来源',
filter: (val) => ['手动', '自动'][val] filter: (val) => ['手动', '自动'][val],
}, },
{ {
prop: 'recordPerson', prop: 'recordPerson',
label: '录入人' label: '录入人',
}, },
{ {
prop: 'recordTime', prop: 'recordTime',
label: '录入时间', label: '录入时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'WasteGasDetectionHistory', name: 'WasteGasDetectionHistory',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '指标名称', type: 'select',
selectOptions: [], label: '指标名称',
param: 'checkId', selectOptions: [],
filterable: true param: 'checkId',
}, filterable: true,
{ },
type: 'datePicker', {
label: '时间', type: 'datePicker',
dateType: 'datetimerange', label: '时间',
format: 'yyyy-MM-dd HH:mm:ss', dateType: 'datetimerange',
valueFormat: "timestamp", format: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', valueFormat: 'timestamp',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 350 defaultSelect: [],
}, width: 350,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
{ },
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '', {
btnName: '导出', type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
name: 'export', btnName: '导出',
color: 'primary', name: 'export',
plain: true color: 'primary',
} plain: true,
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
checkId: null, pageSize: 20,
checkType: 2, checkId: null,
startTime: null, checkType: 2,
endTime: null startTime: null,
}, endTime: null,
tableProps, },
list: [], tableProps,
total: 0, list: [],
tableH: this.tableHeight(260) total: 0,
} };
}, },
created() { created() {
window.addEventListener('resize', () => { let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
this.tableH = this.tableHeight(260) let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
}) this.formConfig[1].defaultSelect = [start, end];
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf() this.queryParams.startTime = start;
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf() this.queryParams.endTime = end;
this.formConfig[1].defaultSelect = [start, end] this.getSelectList();
this.queryParams.startTime = start this.getList();
this.queryParams.endTime = end },
this.getSelectList() methods: {
this.getList() buttonClick(val) {
}, this.queryParams.pageNo = 1;
methods: { this.queryParams.checkId = val.checkId;
buttonClick(val) { this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.pageNo = 1; this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
this.queryParams.checkId = val.checkId if (val.btnName === 'search') {
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null this.getList();
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null } else {
if (val.btnName === 'search') { this.$modal
this.getList() .confirm('是否确认导出')
} else { .then(() => {
this.$modal.confirm('是否确认导出').then(() => { return environmentalCheckRecordExport({ ...this.queryParams });
return environmentalCheckRecordExport({...this.queryParams}); })
}).then(response => { .then((response) => {
this.$download.excel(response, '废气检测历史记录.xls'); this.$download.excel(response, '废气检测历史记录.xls');
}).catch(() => {}) })
} .catch(() => {});
}, }
getList() { },
environmentalCheckRecordPage({...this.queryParams}).then(res => { getList() {
this.list = res.data.list || [] environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.total = res.data.total || 0 this.list = res.data.list || [];
}) this.total = res.data.total || 0;
}, });
getSelectList() { },
environmentalCheckPage({ getSelectList() {
pageNo: 1, environmentalCheckPage({
pageSize: 100, pageNo: 1,
checkType: 2 pageSize: 100,
}).then(res => { checkType: 2,
console.log(res) }).then((res) => {
this.formConfig[0].selectOptions = res.data.list || [] console.log(res);
}) this.formConfig[0].selectOptions = res.data.list || [];
}, });
tableRowClassName({row, rowIndex}) { },
console.log(row) tableRowClassName({ row, rowIndex }) {
if (row.markRed) { console.log(row);
return 'warning-row' if (row.markRed) {
}else { return 'warning-row';
return '' } else {
} return '';
} }
} },
} },
};
</script> </script>
<style lang='scss'> <style lang='scss'>
.wasteGasHis { .wasteGasHis {
.el-table .warning-row { .el-table .warning-row {
background: #fee1e1; background: #fee1e1;
} }
} }
</style> </style>

View File

@@ -1,205 +1,210 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="80"
slot="handleBtn" label="操作"
:width="80" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增&编辑 -->
:total="total" <base-dialog
@pagination="getList" :dialogTitle="addOrEditTitle"
/> :dialogVisible="centervisible"
<!-- 新增&编辑 --> @cancel="handleCancel"
<base-dialog @confirm="handleConfirm"
:dialogTitle="addOrEditTitle" :before-close="handleCancel"
:dialogVisible="centervisible" width="60%">
@cancel="handleCancel" <waste-gas-add
@confirm="handleConfirm" ref="wasteGasAdd"
:before-close="handleCancel" @successSubmit="successSubmit" />
width='60%' </base-dialog>
> </div>
<waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import WasteGasAdd from './components/wasteGasAdd' import WasteGasAdd from './components/wasteGasAdd';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental' import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '指标名称', label: '指标名称',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '指标编码', label: '指标编码',
minWidth: 120 minWidth: 120,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'minValue', prop: 'minValue',
label: '最小值' label: '最小值',
}, },
{ {
prop: 'maxValue', prop: 'maxValue',
label: '最大值' label: '最大值',
}, },
{ {
prop: 'creator', prop: 'creator',
label: '创建人' label: '创建人',
}, },
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'WasteGasDetectionIndication', name: 'WasteGasDetectionIndication',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '指标名称', type: 'input',
placeholder: '指标名称', label: '指标名称',
param: 'name' placeholder: '指标名称',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
{ },
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
// 查询参数 ],
queryParams: { // 查询参数
pageNo: 1, queryParams: {
pageSize: 20, pageNo: 1,
checkType: 2, pageSize: 20,
name: null checkType: 2,
}, name: null,
total: 0, },
tableProps, total: 0,
list: [], tableProps,
tableH: this.tableHeight(260), list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:waste-gas:update') this.$auth.hasPermi('base:waste-gas:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:waste-gas:delete') this.$auth.hasPermi('base:waste-gas:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v)=>v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false centervisible: false,
} };
}, },
components: { WasteGasAdd }, components: { WasteGasAdd },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
environmentalCheckPage({...this.queryParams}).then(res => { environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams.name = val.name this.queryParams.name = val.name;
this.getList() this.getList();
} else { } else {
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.wasteGasAdd.init() this.$refs.wasteGasAdd.init();
}) });
} }
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.wasteGasAdd.init(val.data.id) this.$refs.wasteGasAdd.init(val.data.id);
}) });
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
// 删除 // 删除
handleDelete(val) { handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { this.$modal
return environmentalCheckDelete({ id: val.id }) .confirm('是否确认删除"' + val.name + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return environmentalCheckDelete({ id: val.id });
this.$modal.msgSuccess("操作成功"); })
}).catch(() => {}); .then(() => {
}, this.getList();
// 新增 this.$modal.msgSuccess('操作成功');
handleCancel() { })
this.$refs.wasteGasAdd.formClear() .catch(() => {});
this.centervisible = false },
this.addOrEditTitle = '' // 新增
}, handleCancel() {
handleConfirm() { this.$refs.wasteGasAdd.formClear();
this.$refs.wasteGasAdd.submitForm() this.centervisible = false;
}, this.addOrEditTitle = '';
successSubmit() { },
this.handleCancel() handleConfirm() {
this.getList() this.$refs.wasteGasAdd.submitForm();
} },
} successSubmit() {
} this.handleCancel();
this.getList();
},
},
};
</script> </script>

View File

@@ -1,185 +1,190 @@
<template> <template>
<div class="app-container wasteWaterHis"> <div class="app-container wasteWaterHis">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH"
:max-height="tableH" :row-class-name="tableRowClassName" />
:row-class-name="tableRowClassName" <pagination
/> :page.sync="queryParams.pageNo"
<pagination :limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNo" :total="total"
:limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total" </div>
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental' import {
import moment from 'moment' environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'checkName', prop: 'checkName',
label: '指标名称' label: '指标名称',
}, },
{ {
prop: 'checkValue', prop: 'checkValue',
label: '检测数值' label: '检测数值',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'checkTime', prop: 'checkTime',
label: '检测时间', label: '检测时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'origin', prop: 'origin',
label: '来源', label: '来源',
filter: (val) => ['手动', '自动'][val] filter: (val) => ['手动', '自动'][val],
}, },
{ {
prop: 'recordPerson', prop: 'recordPerson',
label: '录入人' label: '录入人',
}, },
{ {
prop: 'recordTime', prop: 'recordTime',
label: '录入时间', label: '录入时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'WasteWaterDetectionHistory', name: 'WasteWaterDetectionHistory',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'select', {
label: '指标名称', type: 'select',
selectOptions: [], label: '指标名称',
param: 'checkId', selectOptions: [],
filterable: true param: 'checkId',
}, filterable: true,
{ },
type: 'datePicker', {
label: '检测时间', type: 'datePicker',
dateType: 'datetimerange', label: '检测时间',
format: 'yyyy-MM-dd HH:mm:ss', dateType: 'datetimerange',
valueFormat: "timestamp", format: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', valueFormat: 'timestamp',
startPlaceholder: '开始时间', rangeSeparator: '-',
endPlaceholder: '结束时间', startPlaceholder: '开始时间',
param: 'timeVal', endPlaceholder: '结束时间',
defaultSelect: [], param: 'timeVal',
width: 350 defaultSelect: [],
}, width: 350,
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:waste-water:export')
{ ? 'separate'
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '', : '',
btnName: '导出', },
name: 'export', {
color: 'primary', type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
plain: true btnName: '导出',
} name: 'export',
], color: 'primary',
// 查询参数 plain: true,
queryParams: { },
pageNo: 1, ],
pageSize: 20, // 查询参数
checkId: null, queryParams: {
checkType: 1, pageNo: 1,
startTime: null, pageSize: 20,
endTime: null checkId: null,
}, checkType: 1,
tableProps, startTime: null,
list: [], endTime: null,
total: 0, },
tableH: this.tableHeight(260) tableProps,
} list: [],
}, total: 0,
created() { };
window.addEventListener('resize', () => { },
this.tableH = this.tableHeight(260) created() {
}) let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf() let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf() this.formConfig[1].defaultSelect = [start, end];
this.formConfig[1].defaultSelect = [start, end] this.queryParams.startTime = start;
this.queryParams.startTime = start this.queryParams.endTime = end;
this.queryParams.endTime = end this.getSelectList();
this.getSelectList() this.getList();
this.getList() },
}, methods: {
methods: { buttonClick(val) {
buttonClick(val) { this.queryParams.pageNo = 1;
this.queryParams.pageNo = 1; this.queryParams.checkId = val.checkId;
this.queryParams.checkId = val.checkId this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null if (val.btnName === 'search') {
if (val.btnName === 'search') { this.getList();
this.getList() } else {
} else { this.$modal
this.$modal.confirm('是否确认导出').then(() => { .confirm('是否确认导出')
return environmentalCheckRecordExport({...this.queryParams}); .then(() => {
}).then(response => { return environmentalCheckRecordExport({ ...this.queryParams });
this.$download.excel(response, '废水检测历史记录.xls'); })
}).catch(() => {}) .then((response) => {
} this.$download.excel(response, '废水检测历史记录.xls');
}, })
getList() { .catch(() => {});
environmentalCheckRecordPage({...this.queryParams}).then(res => { }
this.list = res.data.list || [] },
this.total = res.data.total || 0 getList() {
}) environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
}, this.list = res.data.list || [];
getSelectList() { this.total = res.data.total || 0;
environmentalCheckPage({ });
pageNo: 1, },
pageSize: 100, getSelectList() {
checkType: 1 environmentalCheckPage({
}).then(res => { pageNo: 1,
console.log(res) pageSize: 100,
this.formConfig[0].selectOptions = res.data.list || [] checkType: 1,
}) }).then((res) => {
}, console.log(res);
tableRowClassName({row, rowIndex}) { this.formConfig[0].selectOptions = res.data.list || [];
console.log(row) });
if (row.markRed) { },
return 'warning-row' tableRowClassName({ row, rowIndex }) {
}else { console.log(row);
return '' if (row.markRed) {
} return 'warning-row';
} } else {
} return '';
} }
},
},
};
</script> </script>
<style lang='scss'> <style lang='scss'>
.wasteWaterHis { .wasteWaterHis {
.el-table .warning-row { .el-table .warning-row {
background: #fee1e1; background: #fee1e1;
} }
} }
</style> </style>

View File

@@ -1,205 +1,212 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
/> <!-- 列表 -->
<!-- 列表 --> <base-table
<base-table :page="queryParams.pageNo"
:page="queryParams.pageNo" :limit="queryParams.pageSize"
:limit="queryParams.pageSize" :table-props="tableProps"
:table-props="tableProps" :table-data="list"
:table-data="list" :max-height="tableH">
:max-height="tableH" <method-btn
> v-if="tableBtn.length"
<method-btn slot="handleBtn"
v-if="tableBtn.length" :width="80"
slot="handleBtn" label="操作"
:width="80" :method-list="tableBtn"
label="操作" @clickBtn="handleClick" />
:method-list="tableBtn" </base-table>
@clickBtn="handleClick" <pagination
/> :page.sync="queryParams.pageNo"
</base-table> :limit.sync="queryParams.pageSize"
<pagination :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize" <!-- 新增&编辑 -->
:total="total" <base-dialog
@pagination="getList" :dialogTitle="addOrEditTitle"
/> :dialogVisible="centervisible"
<!-- 新增&编辑 --> @cancel="handleCancel"
<base-dialog @confirm="handleConfirm"
:dialogTitle="addOrEditTitle" :before-close="handleCancel"
:dialogVisible="centervisible" width="60%">
@cancel="handleCancel" <waste-water-add
@confirm="handleConfirm" ref="wasteWaterAdd"
:before-close="handleCancel" @successSubmit="successSubmit" />
width='60%' </base-dialog>
> </div>
<waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import WasteWaterAdd from './components/wasteWaterAdd' import WasteWaterAdd from './components/wasteWaterAdd';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental' import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '指标名称', label: '指标名称',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '指标编码', label: '指标编码',
minWidth: 120 minWidth: 120,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('environment_check_unit') filter: publicFormatter('environment_check_unit'),
}, },
{ {
prop: 'minValue', prop: 'minValue',
label: '最小值' label: '最小值',
}, },
{ {
prop: 'maxValue', prop: 'maxValue',
label: '最大值' label: '最大值',
}, },
{ {
prop: 'creator', prop: 'creator',
label: '创建人' label: '创建人',
}, },
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
} },
] ];
export default { export default {
name: 'WasteWaterDetectionIndication', name: 'WasteWaterDetectionIndication',
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '指标名称', type: 'input',
placeholder: '指标名称', label: '指标名称',
param: 'name' placeholder: '指标名称',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '', {
}, type: this.$auth.hasPermi('base:waste-water:create')
{ ? 'separate'
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '', : '',
btnName: '新增', },
name: 'add', {
color: 'success', type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
plain: true btnName: '新增',
} name: 'add',
], color: 'success',
// 查询参数 plain: true,
queryParams: { },
pageNo: 1, ],
pageSize: 20, // 查询参数
checkType: 1, queryParams: {
name: null pageNo: 1,
}, pageSize: 20,
total: 0, checkType: 1,
tableProps, name: null,
list: [], },
tableH: this.tableHeight(260), total: 0,
tableBtn: [ tableProps,
this.$auth.hasPermi('base:waste-water:update') list: [],
? { tableBtn: [
type: 'edit', this.$auth.hasPermi('base:waste-water:update')
btnName: '编辑' ? {
} type: 'edit',
: undefined, btnName: '编辑',
this.$auth.hasPermi('base:waste-water:delete') }
? { : undefined,
type: 'delete', this.$auth.hasPermi('base:waste-water:delete')
btnName: '删除' ? {
} type: 'delete',
: undefined btnName: '删除',
].filter((v)=>v), }
addOrEditTitle: '', : undefined,
centervisible: false ].filter((v) => v),
} addOrEditTitle: '',
}, centervisible: false,
components: { WasteWaterAdd }, };
mounted() { },
this.getList() components: { WasteWaterAdd },
}, mounted() {
methods: { this.getList();
getList() { },
environmentalCheckPage({...this.queryParams}).then(res => { methods: {
this.list = res.data.list || [] getList() {
this.total = res.data.total || 0 environmentalCheckPage({ ...this.queryParams }).then((res) => {
}) this.list = res.data.list || [];
}, this.total = res.data.total || 0;
buttonClick(val) { });
console.log(val) },
if (val.btnName === 'search') { buttonClick(val) {
this.queryParams.name = val.name console.log(val);
this.getList() if (val.btnName === 'search') {
} else { this.queryParams.name = val.name;
this.addOrEditTitle = '新增' this.getList();
this.centervisible = true } else {
this.$nextTick(() => { this.addOrEditTitle = '新增';
this.$refs.wasteWaterAdd.init() this.centervisible = true;
}) this.$nextTick(() => {
} this.$refs.wasteWaterAdd.init();
}, });
handleClick(val) { }
console.log(val) },
switch (val.type) { handleClick(val) {
case 'edit': console.log(val);
this.addOrEditTitle = '编辑' switch (val.type) {
this.centervisible = true case 'edit':
this.$nextTick(() => { this.addOrEditTitle = '编辑';
this.$refs.wasteWaterAdd.init(val.data.id) this.centervisible = true;
}) this.$nextTick(() => {
break this.$refs.wasteWaterAdd.init(val.data.id);
default: });
this.handleDelete(val.data) break;
} default:
}, this.handleDelete(val.data);
// 删除 }
handleDelete(val) { },
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { // 删除
return environmentalCheckDelete({ id: val.id }) handleDelete(val) {
}).then(() => { this.$modal
this.getList(); .confirm('是否确认删除"' + val.name + '"的数据项?')
this.$modal.msgSuccess("操作成功"); .then(function () {
}).catch(() => {}); return environmentalCheckDelete({ id: val.id });
}, })
// 新增 .then(() => {
handleCancel() { this.getList();
this.$refs.wasteWaterAdd.formClear() this.$modal.msgSuccess('操作成功');
this.centervisible = false })
this.addOrEditTitle = '' .catch(() => {});
}, },
handleConfirm() { // 新增
this.$refs.wasteWaterAdd.submitForm() handleCancel() {
}, this.$refs.wasteWaterAdd.formClear();
successSubmit() { this.centervisible = false;
this.handleCancel() this.addOrEditTitle = '';
this.getList() },
} handleConfirm() {
} this.$refs.wasteWaterAdd.submitForm();
} },
successSubmit() {
this.handleCancel();
this.getList();
},
},
};
</script> </script>

View File

@@ -1,82 +1,194 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" /> <!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" />
<doc-alert title="菜单路由" url="https://doc.iocoder.cn/vue2/route/" /> --> <doc-alert title="菜单路由" url="https://doc.iocoder.cn/vue2/route/" /> -->
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form
<el-form-item label="菜单名称" prop="name"> :model="queryParams"
<el-input v-model="queryParams.name" placeholder="请输入菜单名称" clearable @keyup.enter.native="handleQuery"/> ref="queryForm"
</el-form-item> size="small"
<el-form-item label="状态" prop="status"> :inline="true"
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable> v-show="showSearch">
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/> <el-form-item
</el-select> label="菜单名称"
</el-form-item> prop="name">
<el-form-item> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> v-model="queryParams.name"
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> placeholder="请输入菜单名称"
</el-form-item> clearable
</el-form> @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item
label="状态"
prop="status">
<el-select
v-model="queryParams.status"
placeholder="菜单状态"
clearable>
<el-option
v-for="dict in statusDictDatas"
:key="parseInt(dict.value)"
:label="dict.label"
:value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery">
搜索
</el-button>
<el-button
icon="el-icon-refresh"
@click="resetQuery">
重置
</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8"> <el-row
<el-col :span="1.5"> :gutter="10"
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" class="mb8">
v-hasPermi="['system:menu:create']">新增</el-button> <el-col :span="1.5">
</el-col> <el-button
<el-col :span="1.5"> type="primary"
<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button> plain
</el-col> icon="el-icon-plus"
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> size="mini"
</el-row> @click="handleAdd"
v-hasPermi="['system:menu:create']">
新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll">
展开/折叠
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"></right-toolbar>
</el-row>
<el-table v-if="refreshTable" v-loading="loading" :data="menuList" row-key="id" :default-expand-all="isExpandAll" <el-table
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> v-if="refreshTable"
<el-table-column prop="name" label="菜单名称" :show-overflow-tooltip="true" width="250"></el-table-column> v-loading="loading"
<!-- <el-table-column prop="icon" label="图标" align="center" width="100"> :data="menuList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column
prop="name"
label="菜单名称"
:show-overflow-tooltip="true"
width="250"></el-table-column>
<!-- <el-table-column prop="icon" label="图标" align="center" width="100">
<template v-slot="scope"> <template v-slot="scope">
<svg-icon :icon-class="scope.row.icon" /> <svg-icon :icon-class="scope.row.icon" />
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="sort" label="排序" width="60"></el-table-column> <el-table-column
<el-table-column prop="permission" label="权限标识" :show-overflow-tooltip="true" /> prop="sort"
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true" /> label="排序"
<el-table-column prop="componentName" label="组件名称" :show-overflow-tooltip="true" /> width="60"></el-table-column>
<el-table-column prop="status" label="状态" width="80"> <el-table-column
<template v-slot="scope"> prop="permission"
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/> label="权限标识"
</template> :show-overflow-tooltip="true" />
</el-table-column> <el-table-column
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> prop="component"
<template v-slot="scope"> label="组件路径"
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" :show-overflow-tooltip="true" />
v-hasPermi="['system:menu:update']">修改</el-button> <el-table-column
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" prop="componentName"
v-hasPermi="['system:menu:create']">新增</el-button> label="组件名称"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" :show-overflow-tooltip="true" />
v-hasPermi="['system:menu:delete']">删除</el-button> <el-table-column
</template> prop="status"
</el-table-column> label="状态"
</el-table> width="80">
<template v-slot="scope">
<dict-tag
:type="DICT_TYPE.COMMON_STATUS"
:value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:update']">
修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:create']">
新增
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:menu:delete']">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改菜单对话框 --> <!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> :title="title"
<el-row> :visible.sync="open"
<el-col :span="24"> width="800px"
<el-form-item label="上级菜单"> append-to-body>
<treeselect v-model="form.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" <el-form
placeholder="选择上级菜单"/> ref="form"
</el-form-item> :model="form"
</el-col> :rules="rules"
<el-col :span="24"> label-width="100px">
<el-form-item label="菜单类型" prop="type"> <el-row>
<el-radio-group v-model="form.type"> <el-col :span="24">
<el-radio v-for="dict in menuTypeDictDatas" :key="parseInt(dict.value)" :label="parseInt(dict.value)"> <el-form-item label="上级菜单">
{{dict.label}}</el-radio> <treeselect
</el-radio-group> v-model="form.parentId"
</el-form-item> :options="menuOptions"
</el-col> :normalizer="normalizer"
<!-- <el-col :span="24"> :show-count="true"
placeholder="选择上级菜单" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="菜单类型"
prop="type">
<el-radio-group v-model="form.type">
<el-radio
v-for="dict in menuTypeDictDatas"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)">
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="24">
<el-form-item v-if="form.type !== 3" label="菜单图标"> <el-form-item v-if="form.type !== 3" label="菜单图标">
<el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()"> <el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()">
<IconSelect ref="iconSelect" @selected="selected" /> <IconSelect ref="iconSelect" @selected="selected" />
@@ -88,319 +200,414 @@
</el-popover> </el-popover>
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :span="12">
<el-form-item label="菜单名称" prop="name">
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="显示排序" prop="sort">
<el-input-number v-model="form.sort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.type !== 3" label="路由地址" prop="path">
<span slot="label">
<el-tooltip content="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头" placement="top">
<i class="el-icon-question" />
</el-tooltip>
路由地址
</span>
<el-input v-model="form.path" placeholder="请输入路由地址" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-if="form.type !== 1" label="权限标识"> <el-form-item
<span slot="label"> label="菜单名称"
<el-tooltip content="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)" placement="top"> prop="name">
<i class="el-icon-question" /> <el-input
</el-tooltip> v-model="form.name"
权限字符 placeholder="请输入菜单名称" />
</span>
<el-input v-model="form.permission" placeholder="请权限标识" maxlength="50" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="form.type === 2"> <el-col :span="12">
<el-form-item label="组件路径" prop="component"> <el-form-item
<el-input v-model="form.component" placeholder="例如说system/user/index" /> label="显示排序"
</el-form-item> prop="sort">
</el-col> <el-input-number
<el-col :span="12" v-if="form.type === 2"> v-model="form.sort"
<el-form-item label="组件名称" prop="componentName"> controls-position="right"
<el-input v-model="form.componentName" placeholder="例如说SystemUser" /> :min="0" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="菜单状态" prop="status">
<span slot="label">
<el-tooltip content="选择停用时,路由将不会出现在侧边栏,也不能被访问" placement="top">
<i class="el-icon-question" />
</el-tooltip>
菜单状态
</span>
<el-radio-group v-model="form.status">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.type !== 3" label="显示状态">
<span slot="label">
<el-tooltip content="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问" placement="top">
<i class="el-icon-question" />
</el-tooltip>
是否显示
</span>
<el-radio-group v-model="form.visible">
<el-radio :key="true" :label="true">显示</el-radio>
<el-radio :key="false" :label="false">隐藏</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.type !== 3" label="总是显示">
<span slot="label">
<el-tooltip content="选择不是时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单" placement="top">
<i class="el-icon-question" />
</el-tooltip>
总是显示
</span>
<el-radio-group v-model="form.alwaysShow">
<el-radio :key="true" :label="true">总是</el-radio>
<el-radio :key="false" :label="false">不是</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-if="form.type === 2" label="是否缓存"> <el-form-item
<span slot="label"> v-if="form.type !== 3"
<el-tooltip content="选择缓存时,则会被 `keep-alive` 缓存,必须填写「组件名称」字段" placement="top"> label="路由地址"
<i class="el-icon-question" /> prop="path">
</el-tooltip> <span slot="label">
是否缓存 <el-tooltip
</span> content="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头"
<el-radio-group v-model="form.keepAlive"> placement="top">
<el-radio :key="true" :label="true">缓存</el-radio> <i class="el-icon-question" />
<el-radio :key="false" :label="false">不缓存</el-radio> </el-tooltip>
路由地址
</span>
<el-input
v-model="form.path"
placeholder="请输入路由地址" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-if="form.type !== 1"
label="权限标识">
<span slot="label">
<el-tooltip
content="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)"
placement="top">
<i class="el-icon-question" />
</el-tooltip>
权限字符
</span>
<el-input
v-model="form.permission"
placeholder="请权限标识"
maxlength="200" />
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="form.type === 2">
<el-form-item
label="组件路径"
prop="component">
<el-input
v-model="form.component"
placeholder="例如说system/user/index" />
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="form.type === 2">
<el-form-item
label="组件名称"
prop="componentName">
<el-input
v-model="form.componentName"
placeholder="例如说SystemUser" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="菜单状态"
prop="status">
<span slot="label">
<el-tooltip
content="选择停用时,路由将不会出现在侧边栏,也不能被访问"
placement="top">
<i class="el-icon-question" />
</el-tooltip>
菜单状态
</span>
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value"
:label="parseInt(dict.value)">
{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
</el-form> <el-form-item
<div slot="footer" class="dialog-footer"> v-if="form.type !== 3"
<el-button type="primary" @click="submitForm"> </el-button> label="显示状态">
<el-button @click="cancel"> </el-button> <span slot="label">
</div> <el-tooltip
</el-dialog> content="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问"
</div> placement="top">
<i class="el-icon-question" />
</el-tooltip>
是否显示
</span>
<el-radio-group v-model="form.visible">
<el-radio
:key="true"
:label="true">
显示
</el-radio>
<el-radio
:key="false"
:label="false">
隐藏
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-if="form.type !== 3"
label="总是显示">
<span slot="label">
<el-tooltip
content="选择不是时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单"
placement="top">
<i class="el-icon-question" />
</el-tooltip>
总是显示
</span>
<el-radio-group v-model="form.alwaysShow">
<el-radio
:key="true"
:label="true">
总是
</el-radio>
<el-radio
:key="false"
:label="false">
不是
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-if="form.type === 2"
label="是否缓存">
<span slot="label">
<el-tooltip
content="选择缓存时,则会被 `keep-alive` 缓存,必须填写「组件名称」字段"
placement="top">
<i class="el-icon-question" />
</el-tooltip>
是否缓存
</span>
<el-radio-group v-model="form.keepAlive">
<el-radio
:key="true"
:label="true">
缓存
</el-radio>
<el-radio
:key="false"
:label="false">
不缓存
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot="footer"
class="dialog-footer">
<el-button
type="primary"
@click="submitForm">
</el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu"; import {
import Treeselect from "@riophae/vue-treeselect"; listMenu,
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; getMenu,
import IconSelect from "@/components/IconSelect"; delMenu,
addMenu,
updateMenu,
} from '@/api/system/menu';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import IconSelect from '@/components/IconSelect';
import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants' import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants';
import { getDictDatas, DICT_TYPE } from '@/utils/dict' import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {isExternal} from "@/utils/validate"; import { isExternal } from '@/utils/validate';
export default { export default {
name: "SystemMenu", name: 'SystemMenu',
components: { Treeselect, IconSelect }, components: { Treeselect, IconSelect },
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 菜单表格树数据 // 菜单表格树数据
menuList: [], menuList: [],
// 菜单树选项 // 菜单树选项
menuOptions: [], menuOptions: [],
// 弹出层标题 // 弹出层标题
title: "", title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 是否展开,默认全部折叠 // 是否展开,默认全部折叠
isExpandAll: false, isExpandAll: false,
// 重新渲染表格状态 // 重新渲染表格状态
refreshTable: true, refreshTable: true,
// 查询参数 // 查询参数
queryParams: { queryParams: {
name: undefined, name: undefined,
visible: undefined visible: undefined,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
name: [ name: [
{ required: true, message: "菜单名称不能为空", trigger: "blur" } { required: true, message: '菜单名称不能为空', trigger: 'blur' },
], ],
sort: [ sort: [
{ required: true, message: "菜单顺序不能为空", trigger: "blur" } { required: true, message: '菜单顺序不能为空', trigger: 'blur' },
], ],
path: [ path: [
{ required: true, message: "路由地址不能为空", trigger: "blur" } { required: true, message: '路由地址不能为空', trigger: 'blur' },
], ],
status: [ status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
{ required: true, message: "状态不能为空", trigger: "blur" } },
]
},
// 枚举 // 枚举
MenuTypeEnum: SystemMenuTypeEnum, MenuTypeEnum: SystemMenuTypeEnum,
CommonStatusEnum: CommonStatusEnum, CommonStatusEnum: CommonStatusEnum,
// 数据字典 // 数据字典
menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE), menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE),
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS) statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
// 选择图标 // 选择图标
// selected(name) { // selected(name) {
// this.form.icon = name; // this.form.icon = name;
// }, // },
/** 查询菜单列表 */ /** 查询菜单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listMenu(this.queryParams).then(response => { listMenu(this.queryParams).then((response) => {
this.menuList = this.handleTree(response.data, "id"); this.menuList = this.handleTree(response.data, 'id');
this.loading = false; this.loading = false;
}); });
}, },
/** 转换菜单数据结构 */ /** 转换菜单数据结构 */
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children;
} }
return { return {
id: node.id, id: node.id,
label: node.name, label: node.name,
children: node.children children: node.children,
}; };
}, },
/** 查询菜单下拉树结构 */ /** 查询菜单下拉树结构 */
getTreeselect() { getTreeselect() {
listMenu().then(response => { listMenu().then((response) => {
this.menuOptions = []; this.menuOptions = [];
const menu = { id: 0, name: '主类目', children: [] }; const menu = { id: 0, name: '主类目', children: [] };
menu.children = this.handleTree(response.data, "id"); menu.children = this.handleTree(response.data, 'id');
this.menuOptions.push(menu); this.menuOptions.push(menu);
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
id: undefined, id: undefined,
parentId: 0, parentId: 0,
name: undefined, name: undefined,
// icon: undefined, // icon: undefined,
type: SystemMenuTypeEnum.DIR, type: SystemMenuTypeEnum.DIR,
sort: undefined, sort: undefined,
status: CommonStatusEnum.ENABLE, status: CommonStatusEnum.ENABLE,
visible: true, visible: true,
keepAlive: true, keepAlive: true,
alwaysShow: true, alwaysShow: true,
}; };
this.resetForm("form"); this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */
toggleExpandAll() { toggleExpandAll() {
this.refreshTable = false; this.refreshTable = false;
this.isExpandAll = !this.isExpandAll; this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => { this.$nextTick(() => {
this.refreshTable = true; this.refreshTable = true;
}); });
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd(row) { handleAdd(row) {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
if (row != null && row.id) { if (row != null && row.id) {
this.form.parentId = row.id; this.form.parentId = row.id;
} else { } else {
this.form.parentId = 0; this.form.parentId = 0;
} }
this.open = true; this.open = true;
this.title = "添加菜单"; this.title = '添加菜单';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
getMenu(row.id).then(response => { getMenu(row.id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改菜单"; this.title = '修改菜单';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
// 若权限类型为目录或者菜单时,进行 path 的校验,避免后续拼接出来的路由无法跳转 // 若权限类型为目录或者菜单时,进行 path 的校验,避免后续拼接出来的路由无法跳转
if (this.form.type === SystemMenuTypeEnum.DIR if (
|| this.form.type === SystemMenuTypeEnum.MENU) { this.form.type === SystemMenuTypeEnum.DIR ||
// 如果是外链,则不进行校验 this.form.type === SystemMenuTypeEnum.MENU
const path = this.form.path ) {
if (!isExternal(path)) { // 如果是外链,则不进行校验
// 父权限为根节点path 必须以 / 开头 const path = this.form.path;
if (this.form.parentId === 0 && path.charAt(0) !== '/') { if (!isExternal(path)) {
this.$modal.msgSuccess('前端必须以 / 开头') // 父权限为根节点path 必须以 / 开头
return if (this.form.parentId === 0 && path.charAt(0) !== '/') {
} else if (this.form.parentId !== 0 && path.charAt(0) === '/') { this.$modal.msgSuccess('前端必须以 / 开头');
this.$modal.msgSuccess('前端不能以 / 开头') return;
return } else if (this.form.parentId !== 0 && path.charAt(0) === '/') {
} this.$modal.msgSuccess('前端不能以 / 开头');
} return;
} }
}
}
// 提交 // 提交
if (this.form.id !== undefined) { if (this.form.id !== undefined) {
updateMenu(this.form).then(response => { updateMenu(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess('修改成功');
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addMenu(this.form).then(response => { addMenu(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} }
} }
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项?').then(function() { this.$modal
return delMenu(row.id); .confirm('是否确认删除名称为"' + row.name + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delMenu(row.id);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
} this.getList();
} this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
},
}; };
</script> </script>