Compare commits
23 Commits
b5b952e1cc
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| d3d93acd0f | |||
| a4fceeb981 | |||
| 84468cc883 | |||
| ea04d55fc1 | |||
| ef1078360a | |||
| 60f6c3a8fe | |||
| a4b340ac5d | |||
|
|
2592551e66 | ||
|
|
1fde96e677 | ||
| 0b16e1fe0d | |||
| abcec3bcdc | |||
| bdd14eec70 | |||
| 44e7e219a4 | |||
|
|
ec51beb8ea | ||
|
|
433618e71d | ||
| 812b72f10d | |||
|
|
05f10ab51d | ||
|
|
e7828fd277 | ||
| 58457487d1 | |||
|
|
6c54c223c5 | ||
|
|
b2cc509f8e | ||
| b6236e89b1 | |||
| cbc7cbc574 |
8
.env.dev
8
.env.dev
@@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-04-03 11:22:19
|
||||
# @LastEditTime: 2024-04-08 16:46:49
|
||||
# @LastEditors: DY
|
||||
# @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.47:48082'
|
||||
# socket地址
|
||||
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
# 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'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-22 08:53:20
|
||||
* @LastEditTime: 2024-04-08 10:21:46
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -214,7 +214,9 @@ export default {
|
||||
actualQuantity: this.dataForm.actualQuantity
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
|
||||
this.saveData(tempList)
|
||||
if (tempList.length > 0) {
|
||||
this.saveData(tempList)
|
||||
}
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-21 16:52:46
|
||||
* @LastEditTime: 2024-04-08 14:27:29
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -182,7 +182,8 @@
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="orderList">
|
||||
:table-data="orderList"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
@@ -209,7 +210,8 @@
|
||||
:table-props="tableProps1"
|
||||
:page="listQuery1.pageNo"
|
||||
:limit="listQuery1.pageSize"
|
||||
:table-data="materialList" />
|
||||
:table-data="materialList"
|
||||
:max-height="tableH" />
|
||||
<!-- <pagination
|
||||
v-show="listQuery1.total > 0"
|
||||
:total="listQuery1.total"
|
||||
@@ -235,6 +237,7 @@ import SmallTitle from './SmallTitle';
|
||||
import { publicFormatter } from "@/utils/dict";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import topTabVue from '../../order/base/orderManage/components/topTab.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@@ -292,9 +295,11 @@ const tableProps1 = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [tableHeightMixin],
|
||||
components: { SmallTitle, topTabVue },
|
||||
data() {
|
||||
return {
|
||||
heightNum: 380,
|
||||
tableBtn,
|
||||
tableProps,
|
||||
tableProps1,
|
||||
@@ -455,7 +460,7 @@ export default {
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
// 获取预使用原料列表
|
||||
console.log()
|
||||
console.log('111我看看', this.dataForm.materialMethod)
|
||||
if (this.dataForm.id) {
|
||||
if (this.dataForm.materialMethod === 1) {
|
||||
// 产品
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -62,7 +63,7 @@ import {
|
||||
getCoreWOList
|
||||
} from '@/api/base/coreWorkOrder';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -132,7 +133,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
components: {
|
||||
AddWorkOrder,
|
||||
AddOrUpdate,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-02-28 10:38:34
|
||||
* @LastEditTime: 2024-04-08 11:49:33
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -61,7 +62,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage,tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -70,7 +71,6 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCost:query')
|
||||
type: this.$auth.hasPermi('extend:cost-energy-search:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCost:export')
|
||||
type: this.$auth.hasPermi('extend:cost-energy-search:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -113,9 +113,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getEnergyTypeListAll().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -71,7 +72,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage,tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -80,7 +81,6 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCostHis:query')
|
||||
type: this.$auth.hasPermi('extend:cost-enery-auto-report:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCostHis:export')
|
||||
type: this.$auth.hasPermi('extend:cost-enery-auto-report:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -137,9 +137,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:max-height="tableH"
|
||||
:max-height="tableH"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
@@ -53,6 +53,7 @@ import {
|
||||
} from '@/api/cost/costMaterialSet';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -91,7 +92,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage,tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -99,15 +100,14 @@ export default {
|
||||
deleteURL: deleteCostMaterialSet,
|
||||
},
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
|
||||
this.$auth.hasPermi(`extend:cost-material-set:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
|
||||
this.$auth.hasPermi(`extend:cost-material-set:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialConfig:query')
|
||||
type: this.$auth.hasPermi('extend:cost-material-set:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
@@ -132,10 +132,14 @@ export default {
|
||||
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'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
@@ -150,9 +154,6 @@ export default {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -66,7 +67,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage,tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -75,7 +76,6 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCost:query')
|
||||
type: this.$auth.hasPermi('extend:cost-material-search:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCost:export')
|
||||
type: this.$auth.hasPermi('extend:cost-material-search:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -118,9 +118,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -70,7 +71,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage,tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -79,7 +80,6 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCostHis:query')
|
||||
type: this.$auth.hasPermi('extend:cost-material-auto-report:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
|
||||
type: this.$auth.hasPermi('extend:cost-material-auto-report:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -136,9 +136,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
|
||||
@@ -1,234 +1,258 @@
|
||||
<template>
|
||||
<div style="height: 370px;">
|
||||
<NotMsg v-show="notMsg"/>
|
||||
<div id="numRateChart" class="num-rate-chart" style="width:900px;height:420px;" v-show='!notMsg'></div>
|
||||
</div>
|
||||
<div style="height: 370px">
|
||||
<NotMsg v-show="notMsg" />
|
||||
<div
|
||||
id="numRateChart"
|
||||
class="num-rate-chart"
|
||||
style="width: 900px; height: 420px"
|
||||
v-show="!notMsg"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
import resize from './../mixins/resize'
|
||||
import NotMsg from './../components/NotMsg'
|
||||
import resize from './../mixins/resize';
|
||||
import NotMsg from './../components/NotMsg';
|
||||
export default {
|
||||
name: 'NumRateChart',
|
||||
mixins: [resize],
|
||||
components:{ NotMsg },
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
notMsg:true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
productline() {
|
||||
return this.$store.state.websocket.productline
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
productline: {
|
||||
name: 'NumRateChart',
|
||||
mixins: [resize],
|
||||
components: { NotMsg },
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
notMsg: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
productline() {
|
||||
return this.$store.state.websocket.productline;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
productline: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal === oldVal) {
|
||||
return false
|
||||
}
|
||||
this.updateChart()
|
||||
this.$emit('emitFun')
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (newVal === oldVal) {
|
||||
return false;
|
||||
}
|
||||
this.updateChart();
|
||||
this.$emit('emitFun');
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$el.addEventListener('resize', () => {
|
||||
console.log('resziing.....');
|
||||
});
|
||||
this.updateChart()
|
||||
this.updateChart();
|
||||
},
|
||||
methods: {
|
||||
updateChart() {
|
||||
if (this.productline && this.productline.length > 0) {
|
||||
this.notMsg = false
|
||||
} else {
|
||||
this.notMsg = true
|
||||
return
|
||||
}
|
||||
let xData = []
|
||||
let outputNum = []
|
||||
let passRate = []
|
||||
this.productline && this.productline.length > 0 && this.productline.map(item => {
|
||||
if ((item.lineName).includes('D')) {
|
||||
xData.push(item.lineName)
|
||||
outputNum.push(item.outputNum)
|
||||
passRate.push(item.passRate?item.passRate*100:null)
|
||||
}
|
||||
})
|
||||
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%',
|
||||
methods: {
|
||||
updateChart() {
|
||||
if (this.productline && this.productline.length > 0) {
|
||||
this.notMsg = false;
|
||||
} else {
|
||||
this.notMsg = true;
|
||||
return;
|
||||
}
|
||||
let xData = [];
|
||||
let outputNum = [];
|
||||
let passRate = [];
|
||||
for (let i = 0; i < this.productline.length - 1; i++) {
|
||||
// 二次循环,注意:再减去外层的循环次数,向后依次两两相互比较转换;
|
||||
for (let j = 0; j < this.productline.length - i - 1; j++) {
|
||||
// 当前一个值大于后一个值
|
||||
if (
|
||||
this.productline[j].lineName.substr(
|
||||
this.productline[j].lineName.length - 1,
|
||||
1
|
||||
) >
|
||||
this.productline[j + 1].lineName.substr(
|
||||
this.productline[j + 1].lineName.length - 1,
|
||||
1
|
||||
)
|
||||
) {
|
||||
// 定义变量,以赋值的形式前后交换,直到换到最小的在前面,左右再无比较,则循环结束形成排序结果
|
||||
let temp = this.productline[j];
|
||||
this.productline[j] = this.productline[j + 1];
|
||||
this.productline[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.productline &&
|
||||
this.productline.length > 0 &&
|
||||
this.productline.map((item) => {
|
||||
if (item.lineName.includes('D')) {
|
||||
xData.push(item.lineName);
|
||||
outputNum.push(item.outputNum);
|
||||
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',
|
||||
icon: 'rect',
|
||||
data: [
|
||||
{name:'产线产量',itemStyle:{color:'#364BFE'}},
|
||||
{name:'良品率',itemStyle:{color:'#FFCB59'}}
|
||||
],
|
||||
textStyle: {
|
||||
color: "#DFF1FE",
|
||||
fontSize: 12,
|
||||
}
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: xData,
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
axisTick: { show: false },
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: "#213259",
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '产量/片',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
align: 'right',
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
formatter: '{value}'
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#213259",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#213259a0",
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '良品率',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
align: 'LEFT',
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
formatter: () =>{
|
||||
return value ? '{value} %': '-'
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#213259",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#213259a0",
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '产线产量',
|
||||
type: 'bar',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
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: {
|
||||
icon: 'rect',
|
||||
data: [
|
||||
{ name: '产线产量', itemStyle: { color: '#364BFE' } },
|
||||
{ name: '良品率', itemStyle: { color: '#FFCB59' } },
|
||||
],
|
||||
textStyle: {
|
||||
color: '#DFF1FE',
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: xData,
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
},
|
||||
axisTick: { show: false },
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: '#213259',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '产量/片',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
align: 'right',
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#213259',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259a0',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '良品率',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
align: 'LEFT',
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
formatter: '{value}%',
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#213259',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259a0',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '产线产量',
|
||||
type: 'bar',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value;
|
||||
},
|
||||
},
|
||||
barWidth: 20,
|
||||
itemStyle: {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
{ 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, [
|
||||
{ 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>
|
||||
<style scoped lang="scss">
|
||||
.num-rate-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: -50px;
|
||||
top: -50px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.num-rate-chart-tooltip {
|
||||
background: #0a2b4f77 !important;
|
||||
border: none !important;
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
.num-rate-chart-tooltip * {
|
||||
color: #fff !important;
|
||||
}
|
||||
.num-rate-chart-tooltip {
|
||||
background: #0a2b4f77 !important;
|
||||
border: none !important;
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
.num-rate-chart-tooltip * {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,66 +1,83 @@
|
||||
<template>
|
||||
<div style="flex: 1;">
|
||||
<Container name="各工序缺陷汇总" size="middle" style="">
|
||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
||||
<div style="padding: 5px 10px;">
|
||||
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='defectScrollBoard'/>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
<div style="flex: 1">
|
||||
<Container
|
||||
name="各工序缺陷汇总"
|
||||
size="middle"
|
||||
style="">
|
||||
<TimePrompt
|
||||
class="timeShow"
|
||||
:timestr="timestr" />
|
||||
<div style="padding: 5px 10px">
|
||||
<dv-scroll-board
|
||||
:config="config"
|
||||
style="width: 575px; height: 380px"
|
||||
ref="defectScrollBoard" />
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import TimePrompt from '../components/TimePrompt';
|
||||
import { switchShowTime } from '../utils'
|
||||
import { switchShowTime } from '../utils';
|
||||
export default {
|
||||
name: 'DefectSum',
|
||||
components: { Container, TimePrompt },
|
||||
computed: {
|
||||
defectSum() {
|
||||
return this.$store.state.websocket.defectSum
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timestr: '',
|
||||
config: {
|
||||
header: ['序号', '产线', '工序','损耗片数','缺陷类型'],
|
||||
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
||||
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
||||
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
||||
columnWidth: [60],
|
||||
align: ['center'],
|
||||
data: [],
|
||||
// data: [[1, 'Y61', '破损','10','气泡']],
|
||||
rowNum: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.timestr = switchShowTime('日')
|
||||
},
|
||||
watch:{
|
||||
defectSum: {
|
||||
name: 'DefectSum',
|
||||
components: { Container, TimePrompt },
|
||||
computed: {
|
||||
defectSum() {
|
||||
return this.$store.state.websocket.defectSum;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timestr: '',
|
||||
config: {
|
||||
header: ['序号', '产线', '工序', '损耗片数', '缺陷类型'],
|
||||
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
||||
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
||||
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
||||
columnWidth: [60],
|
||||
align: ['center'],
|
||||
data: [
|
||||
//假数据
|
||||
[1, 'D61', '成型', '3片', '细长泡'],
|
||||
[2, 'D62', '组合落板', '4片', '细长泡'],
|
||||
[3, 'D61', '磨边', '6片', '开口泡'],
|
||||
[4, 'D63', '清洗', '5片', '结石'],
|
||||
[5, 'D64', '打孔', '2片', '结石'],
|
||||
[6, 'D63', '成型', '7片', '开口泡'],
|
||||
[7, 'D61', '上片', '8片', '结石'],
|
||||
],
|
||||
// data: [],
|
||||
rowNum: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.timestr = switchShowTime('日');
|
||||
},
|
||||
watch: {
|
||||
defectSum: {
|
||||
handler(newVal, oldVal) {
|
||||
let outArr = this.defectSum.map((item, index) => [
|
||||
index+1,
|
||||
item.productionLineName,
|
||||
item.sectionName,
|
||||
item.count,
|
||||
item.inspectionTypeName
|
||||
]);
|
||||
this.config.data = outArr
|
||||
this.$refs['defectScrollBoard'].updateRows(outArr)
|
||||
this.timestr = switchShowTime('日')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let outArr = this.defectSum.map((item, index) => [
|
||||
index + 1,
|
||||
item.productionLineName,
|
||||
item.sectionName,
|
||||
item.count,
|
||||
item.inspectionTypeName,
|
||||
]);
|
||||
this.config.data = outArr;
|
||||
this.$refs['defectScrollBoard'].updateRows(outArr);
|
||||
this.timestr = switchShowTime('日');
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.timeShow {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 240px;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 240px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,24 +1,23 @@
|
||||
<!--
|
||||
filename: MaterialCost.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:09:27
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="原料用量统计" size="middle" style="">
|
||||
<div style="flex: 1; display: flex; gap: 8px;flex-direction: column;">
|
||||
<Container
|
||||
name="原料用量统计"
|
||||
size="middle"
|
||||
style="">
|
||||
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
|
||||
<div
|
||||
class="absolute"
|
||||
style="
|
||||
flex:3;
|
||||
flex: 2;
|
||||
padding: 12px 12px 0 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-auto-rows: repeat(4, 1fr);
|
||||
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
|
||||
class="material"
|
||||
style="
|
||||
@@ -30,43 +29,24 @@
|
||||
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
|
||||
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>
|
||||
</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-
|
||||
- {{ item.materialName }}/kg-
|
||||
</span>
|
||||
</div>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
@@ -81,12 +61,9 @@ export default {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
materialMsg1() {
|
||||
return this.$store.state.websocket.material.slice(0,9)
|
||||
materialMsg() {
|
||||
return this.$store.state.websocket.material;
|
||||
},
|
||||
materialMsg2() {
|
||||
return this.$store.state.websocket.material.slice(9)
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
|
||||
@@ -1,313 +1,324 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="160"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="160"
|
||||
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%"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 装车 -->
|
||||
<base-dialog
|
||||
<!-- 装车 -->
|
||||
<base-dialog
|
||||
dialogTitle="装车"
|
||||
:dialogVisible="centervisible2"
|
||||
@cancel="handleCancel2"
|
||||
@confirm="handleConfirm2"
|
||||
:before-close="handleCancel2"
|
||||
width="50%"
|
||||
>
|
||||
<loaded-page ref="loadedPage" @successSubmit="successSubmit2" />
|
||||
width="50%">
|
||||
<loaded-page
|
||||
ref="loadedPage"
|
||||
@successSubmit="successSubmit2" />
|
||||
</base-dialog>
|
||||
<!-- 发货详情 -->
|
||||
<delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' />
|
||||
</div>
|
||||
<!-- 发货详情 -->
|
||||
<delivery-log-detail
|
||||
ref="deliveryLogDetail"
|
||||
v-if="showDetail" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery'
|
||||
import AddOrUpdate from './components/addOrUpdate'
|
||||
import LoadedPage from './components/loadedPage'
|
||||
import DeliveryLogDetail from './components/deliveryLogDetail.vue'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery';
|
||||
import AddOrUpdate from './components/addOrUpdate';
|
||||
import LoadedPage from './components/loadedPage';
|
||||
import DeliveryLogDetail from './components/deliveryLogDetail.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'orderName',
|
||||
label: '订单名',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '发货单名称',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'deliveryTime',
|
||||
label: '发货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '发货单号',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'deliverPerName',
|
||||
label: '发货负责人',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'principal',
|
||||
label: '运输负责人',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'principalCall',
|
||||
label: '运输联系方式',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'principalCost',
|
||||
label: '运输费用',
|
||||
align: 'right'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'orderName',
|
||||
label: '订单名',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '发货单名称',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'deliveryTime',
|
||||
label: '发货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '发货单号',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'deliverPerName',
|
||||
label: '发货负责人',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'principal',
|
||||
label: '运输负责人',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'principalCall',
|
||||
label: '运输联系方式',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'principalCost',
|
||||
label: '运输费用',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "DeliveryLog",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名',
|
||||
param: 'orderName',
|
||||
defaultSelect: ''
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '发货单名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '发货单号',
|
||||
param: 'code'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
orderName: '',
|
||||
code: '',
|
||||
name: ''
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('extend:delivery-log:loaded')
|
||||
? {
|
||||
type: 'loaded',
|
||||
btnName: '装车'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
centervisible2: false,
|
||||
showDetail: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1]
|
||||
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
|
||||
} else {
|
||||
this.formConfig[0].defaultSelect = ''
|
||||
}
|
||||
this.queryParams.orderName = this.formConfig[0].defaultSelect
|
||||
this.getList();
|
||||
},
|
||||
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'DeliveryLog') {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1]
|
||||
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
|
||||
} else {
|
||||
this.formConfig[0].defaultSelect = ''
|
||||
}
|
||||
this.queryParams.orderName = this.formConfig[0].defaultSelect
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
deliveryLogPage({...this.queryParams}).then(res => {
|
||||
let arr = res.data.list || []
|
||||
arr && arr.map(item => {
|
||||
item.principalCost = item.principalCost.toFixed(2)
|
||||
})
|
||||
this.list = arr
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name
|
||||
this.queryParams.orderName = val.orderName
|
||||
this.queryParams.code = val.code
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id)
|
||||
})
|
||||
break
|
||||
case 'delete':
|
||||
this.handleDelete(val.data)
|
||||
break
|
||||
case 'loaded':
|
||||
this.centervisible2 = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.showDetail = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deliveryLogDetail.init(val.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.addOrUpdate.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.addOrUpdate.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() {
|
||||
return deliveryLogDelete({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 装车
|
||||
handleCancel2() {
|
||||
this.$refs.loadedPage.formClear()
|
||||
this.centervisible2 = false
|
||||
},
|
||||
handleConfirm2() {
|
||||
this.$refs.loadedPage.submitForm()
|
||||
},
|
||||
successSubmit2() {
|
||||
this.handleCancel2()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'DeliveryLog',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名',
|
||||
param: 'orderName',
|
||||
defaultSelect: '',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '发货单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '发货单号',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('extend:delivery-log:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('extend:delivery-log:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
orderName: '',
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('extend:delivery-log:loaded')
|
||||
? {
|
||||
type: 'loaded',
|
||||
btnName: '装车',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('extend:delivery-log:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
centervisible2: false,
|
||||
showDetail: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1];
|
||||
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
|
||||
} else {
|
||||
this.formConfig[0].defaultSelect = '';
|
||||
}
|
||||
this.queryParams.orderName = this.formConfig[0].defaultSelect;
|
||||
this.getList();
|
||||
},
|
||||
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
|
||||
watch: {
|
||||
$route: 'initData',
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'DeliveryLog') {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1];
|
||||
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
|
||||
} else {
|
||||
this.formConfig[0].defaultSelect = '';
|
||||
}
|
||||
this.queryParams.orderName = this.formConfig[0].defaultSelect;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
deliveryLogPage({ ...this.queryParams }).then((res) => {
|
||||
let arr = res.data.list || [];
|
||||
arr &&
|
||||
arr.map((item) => {
|
||||
item.principalCost = item.principalCost.toFixed(2);
|
||||
});
|
||||
this.list = arr;
|
||||
this.total = res.data.total || 0;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name;
|
||||
this.queryParams.orderName = val.orderName;
|
||||
this.queryParams.code = val.code;
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(val.data);
|
||||
break;
|
||||
case 'loaded':
|
||||
this.centervisible2 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadedPage.init(
|
||||
val.data.id,
|
||||
val.data.code,
|
||||
val.data.orderId
|
||||
);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.showDetail = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deliveryLogDetail.init(val.data);
|
||||
});
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.addOrUpdate.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.addOrUpdate.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deliveryLogDelete({ id: val.id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 装车
|
||||
handleCancel2() {
|
||||
this.$refs.loadedPage.formClear();
|
||||
this.centervisible2 = false;
|
||||
},
|
||||
handleConfirm2() {
|
||||
this.$refs.loadedPage.submitForm();
|
||||
},
|
||||
successSubmit2() {
|
||||
this.handleCancel2();
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,130 +1,124 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<!-- 详情抽屉 -->
|
||||
<delivery-log-det-detail ref='deliveryLogDetail'/>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 详情抽屉 -->
|
||||
<delivery-log-det-detail ref="deliveryLogDetail" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { deliveryProgressPage } from '@/api/base/delivery'
|
||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
|
||||
import { deliveryProgressPage } from '@/api/base/delivery';
|
||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'orderName',
|
||||
label: '订单名',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
label: '客户名称',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位'
|
||||
},
|
||||
{
|
||||
prop: 'orderNum',
|
||||
label: '订单数量'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '发货数量'
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '累计发货比例(%)'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'orderName',
|
||||
label: '订单名',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
label: '客户名称',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
},
|
||||
{
|
||||
prop: 'orderNum',
|
||||
label: '订单数量',
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '发货数量',
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '累计发货比例(%)',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "DeliveryLogDet",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名',
|
||||
param: 'orderName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
orderName: ''
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('extend:delivery-log-det:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v)
|
||||
}
|
||||
},
|
||||
components: { DeliveryLogDetDetail },
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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()
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deliveryLogDetail.init(val.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'DeliveryLogDet',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名',
|
||||
param: 'orderName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
orderName: '',
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('extend:delivery-log-det:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
};
|
||||
},
|
||||
components: { DeliveryLogDetDetail },
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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();
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deliveryLogDetail.init(val.data);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -298,7 +298,7 @@ export default {
|
||||
},
|
||||
selectObj(val) {
|
||||
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) {
|
||||
this.getDetailList();
|
||||
this.form.plcParamId = '';
|
||||
|
||||
@@ -104,21 +104,27 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('equipment:inspection-confirm:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('equipment:inspection-confirm:confirm')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '批量确认',
|
||||
name: 'batchConfirm',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('equipment:inspection-confirm:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
|
||||
@@ -160,21 +160,25 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('equipment:maintain-confirm:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('equipment:maintain-confirm:confirm')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '批量确认',
|
||||
name: 'batchConfirm',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:export')
|
||||
type: this.$auth.hasPermi('equipment:maintain-confirm:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
|
||||
@@ -193,7 +193,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||
type: this.$auth.hasPermi('equipment:maintain-monitor:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:process-equ-material-bom:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -113,7 +113,7 @@ export default {
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:process-equ-value-bom:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -1,244 +1,292 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" 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>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
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>
|
||||
|
||||
<script>
|
||||
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
|
||||
import GroupClassAdd from './components/groupClassAdd'
|
||||
import { formatDate } from '@/utils'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import {
|
||||
getGroupClassesPage,
|
||||
deleteGroupClasses,
|
||||
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 = [
|
||||
{
|
||||
prop: 'enableTimeStr',
|
||||
label: '生效时段',
|
||||
minWidth: 300
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班次名称'
|
||||
},
|
||||
{
|
||||
prop: 'timeStr',
|
||||
label: '班次时间',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班次编码',
|
||||
minWidth: 200
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '班次状态'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'enableTimeStr',
|
||||
label: '生效时段',
|
||||
minWidth: 300,
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班次名称',
|
||||
},
|
||||
{
|
||||
prop: 'timeStr',
|
||||
label: '班次时间',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班次编码',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '班次状态',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "GroupClasses",
|
||||
components: { GroupClassAdd },
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '班次名称',
|
||||
placeholder: '班次名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-classes:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'status',
|
||||
value: '不可用'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-classes:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-classes:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: "",
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.classList.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getGroupClassesPage(this.queryParams).then(res => {
|
||||
if (res.code === 0 && res.data.list.length > 0) {
|
||||
res.data.list.map(item => {
|
||||
item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久')
|
||||
item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5)
|
||||
item.status = item.status === true ? '可用' : '不可用'
|
||||
})
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
this.list = []
|
||||
this.total = 0
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.classList.init(val.data.id)
|
||||
})
|
||||
this.centervisible = true
|
||||
break
|
||||
case 'cancel':
|
||||
this.discard(val.data)
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.classList.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.classList.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
discard(row) {
|
||||
let obj = {}
|
||||
obj.id = row.id
|
||||
obj.startTime = row.startTime
|
||||
obj.endTime = row.endTime
|
||||
obj.enableTime = row.enableTime
|
||||
obj.disableTime = Date.parse(new Date())
|
||||
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () {
|
||||
return updateGroupClasses({ ...obj })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row)
|
||||
let _this = this
|
||||
if (row.status === '可用') {// 可用
|
||||
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').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(() => { });
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'GroupClasses',
|
||||
components: { GroupClassAdd },
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '班次名称',
|
||||
placeholder: '班次名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-classes:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-classes:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'status',
|
||||
value: '不可用',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-classes:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-classes:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: '',
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
break;
|
||||
default:
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.classList.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getGroupClassesPage(this.queryParams).then((res) => {
|
||||
if (res.code === 0 && res.data.list.length > 0) {
|
||||
res.data.list.map((item) => {
|
||||
item.enableTimeStr =
|
||||
formatDate(item.enableTime) +
|
||||
'至' +
|
||||
(item.disableTime ? formatDate(item.disableTime) : '永久');
|
||||
item.timeStr =
|
||||
item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
|
||||
item.status = item.status === true ? '可用' : '不可用';
|
||||
});
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.classList.init(val.data.id);
|
||||
});
|
||||
this.centervisible = true;
|
||||
break;
|
||||
case 'cancel':
|
||||
this.discard(val.data);
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.classList.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.classList.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
discard(row) {
|
||||
let obj = {};
|
||||
obj.id = row.id;
|
||||
obj.startTime = row.startTime;
|
||||
obj.endTime = row.endTime;
|
||||
obj.enableTime = row.enableTime;
|
||||
obj.disableTime = Date.parse(new Date());
|
||||
this.$modal
|
||||
.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return updateGroupClasses({ ...obj });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row);
|
||||
let _this = this;
|
||||
if (row.status === '可用') {
|
||||
// 可用
|
||||
_this.$modal
|
||||
.confirm(
|
||||
'删除的班次"' +
|
||||
row.name +
|
||||
'"可能会影响交接班计划,请点取消再次确认!'
|
||||
)
|
||||
.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>
|
||||
|
||||
@@ -1,253 +1,260 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
@emitFun="handleTableEvents"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='40%'
|
||||
>
|
||||
<group-team-add ref="groupList" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 组员编辑 -->
|
||||
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
@emitFun="handleTableEvents">
|
||||
<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" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="40%">
|
||||
<group-team-add
|
||||
ref="groupList"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 组员编辑 -->
|
||||
<worker-edit
|
||||
v-if="paramVisible"
|
||||
ref="workerEditParam"
|
||||
@closeDrawer="closeDrawer"></worker-edit>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
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 {
|
||||
getGroupTeamPage,
|
||||
deleteGroupTeam,
|
||||
updateGroupTeam,
|
||||
} from '@/api/base/groupTeam';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
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 = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称'
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '编码',
|
||||
minWidth: 220
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '班组人数'
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
label: '组长'
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '班组状态',
|
||||
subcomponent: StatusBtn
|
||||
},
|
||||
{
|
||||
prop: 'workerName',
|
||||
label: '组员',
|
||||
subcomponent: WorkerOperate
|
||||
},
|
||||
]
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '编码',
|
||||
minWidth: 220,
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '班组人数',
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
label: '组长',
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '班组状态',
|
||||
subcomponent: StatusBtn,
|
||||
},
|
||||
{
|
||||
prop: 'workerName',
|
||||
label: '组员',
|
||||
subcomponent: WorkerOperate,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "GroupTeam",
|
||||
components: { GroupTeamAdd, WorkerEdit },
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '班组名称',
|
||||
placeholder: '班组名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '组长',
|
||||
placeholder: '组长',
|
||||
param: 'leaderName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-team:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: "",
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
code: null
|
||||
},
|
||||
paramVisible: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.leaderName = val.leaderName
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupList.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getGroupTeamPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupList.init(val.data.id)
|
||||
})
|
||||
this.centervisible = true
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 班组状态
|
||||
handleTableEvents(params) {
|
||||
console.log(params)
|
||||
if (params.name === 'state') {// 班组状态
|
||||
updateGroupTeam({ ...params.payload }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}
|
||||
})
|
||||
}else {// 编辑&查看
|
||||
this.paramVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.workerEditParam.init(params)
|
||||
})
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.groupList.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.groupList.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?').then(function() {
|
||||
return deleteGroupTeam(row.id);
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
closeDrawer() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
name: 'GroupTeam',
|
||||
components: { GroupTeamAdd, WorkerEdit },
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '班组名称',
|
||||
placeholder: '班组名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '组长',
|
||||
placeholder: '组长',
|
||||
param: 'leaderName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:group-team:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: '',
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
code: null,
|
||||
},
|
||||
paramVisible: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.leaderName = val.leaderName;
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
break;
|
||||
default:
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupList.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getGroupTeamPage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupList.init(val.data.id);
|
||||
});
|
||||
this.centervisible = true;
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
// 班组状态
|
||||
handleTableEvents(params) {
|
||||
console.log(params);
|
||||
if (params.name === 'state') {
|
||||
// 班组状态
|
||||
updateGroupTeam({ ...params.payload }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑&查看
|
||||
this.paramVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.workerEditParam.init(params);
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.groupList.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.groupList.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteGroupTeam(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
closeDrawer() {
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,152 +1,150 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="160"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<!-- 查看详情 -->
|
||||
<group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="160"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<!-- 查看详情 -->
|
||||
<group-team-view-detail
|
||||
v-if="paramVisible"
|
||||
ref="groupTeamViewDetail" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
|
||||
import { workOrderList } from '@/api/base/workOrder'
|
||||
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { getByWorkOrder } from '@/api/monitoring/groupTeamView';
|
||||
import { workOrderList } from '@/api/base/workOrder';
|
||||
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true,
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称'
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
label: '班组长'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '人数'
|
||||
},
|
||||
{
|
||||
prop: 'workCount',
|
||||
label: '上班次数'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true,
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
label: '班组长',
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '人数',
|
||||
},
|
||||
{
|
||||
prop: 'workCount',
|
||||
label: '上班次数',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'GroupTeamView',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
param: 'workOrderId',
|
||||
clearable: false,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
workOrderId: ''
|
||||
},
|
||||
workOrderList: [],
|
||||
workOrderName: '',
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team-view:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
tableProps,
|
||||
tableH: this.tableHeight(220),
|
||||
list: [],
|
||||
paramVisible: false
|
||||
}
|
||||
},
|
||||
components: { GroupTeamViewDetail },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(220)
|
||||
})
|
||||
this.getOrderList()
|
||||
},
|
||||
methods: {
|
||||
// 获取工单list
|
||||
getOrderList() {
|
||||
workOrderList().then(res => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
if (!val.workOrderId) {
|
||||
this.$modal.msgWarning('工单不能为空')
|
||||
return false
|
||||
}
|
||||
this.queryParams.workOrderId = val.workOrderId
|
||||
this.getList()
|
||||
},
|
||||
// 获取table数据
|
||||
getList() {
|
||||
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
|
||||
this.list = res.data || []
|
||||
})
|
||||
},
|
||||
handleClick(val) {
|
||||
this.paramVisible = true
|
||||
let params = {}
|
||||
params.teamId = val.data.id
|
||||
params.teamName = val.data.name
|
||||
this.workOrderList.map(item => {
|
||||
if (val.data.workOrderId === item.id) {
|
||||
this.workOrderName = item.name
|
||||
}
|
||||
})
|
||||
params.workOrderId = val.data.workOrderId
|
||||
params.workOrderName = this.workOrderName
|
||||
params.roomNameDict = val.data.roomNameDict
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupTeamViewDetail.init(params)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'GroupTeamView',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
param: 'workOrderId',
|
||||
clearable: false,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
workOrderId: '',
|
||||
},
|
||||
heightNum: 220,
|
||||
workOrderList: [],
|
||||
workOrderName: '',
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team-view:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps,
|
||||
list: [],
|
||||
paramVisible: false,
|
||||
};
|
||||
},
|
||||
components: { GroupTeamViewDetail },
|
||||
mounted() {
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
// 获取工单list
|
||||
getOrderList() {
|
||||
workOrderList().then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data || [];
|
||||
this.workOrderList = res.data || [];
|
||||
});
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
if (!val.workOrderId) {
|
||||
this.$modal.msgWarning('工单不能为空');
|
||||
return false;
|
||||
}
|
||||
this.queryParams.workOrderId = val.workOrderId;
|
||||
this.getList();
|
||||
},
|
||||
// 获取table数据
|
||||
getList() {
|
||||
getByWorkOrder({ id: this.queryParams.workOrderId }).then((res) => {
|
||||
this.list = res.data || [];
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
this.paramVisible = true;
|
||||
let params = {};
|
||||
params.teamId = val.data.id;
|
||||
params.teamName = val.data.name;
|
||||
this.workOrderList.map((item) => {
|
||||
if (val.data.workOrderId === item.id) {
|
||||
this.workOrderName = item.name;
|
||||
}
|
||||
});
|
||||
params.workOrderId = val.data.workOrderId;
|
||||
params.workOrderName = this.workOrderName;
|
||||
params.roomNameDict = val.data.roomNameDict;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.groupTeamViewDetail.init(params);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,130 +1,146 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area @submit="buttonClick" />
|
||||
<!-- <search-bar
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area @submit="buttonClick" />
|
||||
<!-- <search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/> -->
|
||||
<!-- 列表 -->
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 查看生产情况 -->
|
||||
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' />
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 查看生产情况 -->
|
||||
<team-production-detail
|
||||
v-if="paramVisible"
|
||||
ref="schedulingMonitoringDetail" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import TeamProductionDetail from './components/teamProductionDetail'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import SearchArea from './components/searchArea'
|
||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import TeamProductionDetail from './components/teamProductionDetail';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import SearchArea from './components/searchArea';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true,
|
||||
minWidth: 100
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '排班创建时间',
|
||||
// filter: parseTime,
|
||||
// minWidth: 160
|
||||
// },
|
||||
{
|
||||
prop: 'startDay',
|
||||
label: '上班日期',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '上班时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '下班时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'classesName',
|
||||
label: '班次名称',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'teamName',
|
||||
label: '班组名称',
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true,
|
||||
minWidth: 100,
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '排班创建时间',
|
||||
// filter: parseTime,
|
||||
// minWidth: 160
|
||||
// },
|
||||
{
|
||||
prop: 'startDay',
|
||||
label: '上班日期',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '上班时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '下班时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'classesName',
|
||||
label: '班次名称',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'teamName',
|
||||
label: '班组名称',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'GroupTeamScheduling',
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
classesId: '',
|
||||
teamName: '',
|
||||
startDay: []
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:team-production:detail')
|
||||
? {
|
||||
type: 'productionDetail',
|
||||
btnName: '查看',
|
||||
showTip: '生产情况'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
total: 0,
|
||||
paramVisible: false
|
||||
}
|
||||
},
|
||||
components: { TeamProductionDetail, SearchArea },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.classesId = val.classesId
|
||||
this.queryParams.teamName = val.teamName
|
||||
this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : ''
|
||||
this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : ''
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
groupTeamSchedulingPage({ ...this.queryParams }).then(res => {
|
||||
console.log(res)
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
this.paramVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.schedulingMonitoringDetail.init(val.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'GroupTeamScheduling',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
classesId: '',
|
||||
teamName: '',
|
||||
startDay: [],
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:team-production:detail')
|
||||
? {
|
||||
type: 'productionDetail',
|
||||
btnName: '查看',
|
||||
showTip: '生产情况',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
list: [],
|
||||
total: 0,
|
||||
paramVisible: false,
|
||||
};
|
||||
},
|
||||
components: { TeamProductionDetail, SearchArea },
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.classesId = val.classesId;
|
||||
this.queryParams.teamName = val.teamName;
|
||||
this.queryParams.startDay[0] = val.tiemStr
|
||||
? val.tiemStr[0] + ' 00:00:00'
|
||||
: '';
|
||||
this.queryParams.startDay[1] = val.tiemStr
|
||||
? val.tiemStr[1] + ' 23:59:59'
|
||||
: '';
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
groupTeamSchedulingPage({ ...this.queryParams }).then((res) => {
|
||||
console.log(res);
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
this.paramVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.schedulingMonitoringDetail.init(val.data);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,440 +1,465 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="240"
|
||||
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='60%'
|
||||
>
|
||||
<order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 查看详情 -->
|
||||
<!-- 新增工单 -->
|
||||
<base-dialog
|
||||
dialogTitle="绑定厂务订单"
|
||||
:dialogVisible="bindOrderVisible"
|
||||
@cancel="bindOrderCancel"
|
||||
@confirm="bindOrderConfirm"
|
||||
:before-close="bindOrderCancel"
|
||||
width='60%'
|
||||
>
|
||||
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="240"
|
||||
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="60%">
|
||||
<order-group-add
|
||||
ref="orderGroupAdd"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 查看详情 -->
|
||||
<!-- 新增工单 -->
|
||||
<base-dialog
|
||||
dialogTitle="绑定厂务订单"
|
||||
:dialogVisible="bindOrderVisible"
|
||||
@cancel="bindOrderCancel"
|
||||
@confirm="bindOrderConfirm"
|
||||
:before-close="bindOrderCancel"
|
||||
width="60%">
|
||||
<bind-order
|
||||
ref="bindOrder"
|
||||
@bindOrderSubmit="bindOrderSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
|
||||
import { customerList } from '@/api/base/orderManage'
|
||||
import OrderGroupAdd from './components/orderGroupAdd'
|
||||
import BindOrder from './components/bindOrder'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup';
|
||||
import { customerList } from '@/api/base/orderManage';
|
||||
import OrderGroupAdd from './components/orderGroupAdd';
|
||||
import BindOrder from './components/bindOrder';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'customerId',
|
||||
label: '客户',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '订单状态',
|
||||
filter: publicFormatter('order_status')
|
||||
},
|
||||
{
|
||||
prop: 'productName',
|
||||
label: '产品名称',
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '产品规格',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'actualquantity',
|
||||
label: '实际加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'deliveTime',
|
||||
label: '交货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'packReq',
|
||||
label: '包装要求',
|
||||
// filter: publicFormatter('pack_spec'),
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'orderIdNum',
|
||||
label: '订单数量'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'customerId',
|
||||
label: '客户',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '订单状态',
|
||||
filter: publicFormatter('order_status'),
|
||||
},
|
||||
{
|
||||
prop: 'productName',
|
||||
label: '产品名称',
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '产品规格',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'actualquantity',
|
||||
label: '实际加工量',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'deliveTime',
|
||||
label: '交货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'packReq',
|
||||
label: '包装要求',
|
||||
// filter: publicFormatter('pack_spec'),
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'orderIdNum',
|
||||
label: '订单数量',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'OrderGroup',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名称',
|
||||
placeholder: '订单名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'status'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
status: null,
|
||||
planFinishTime: []
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-group:bind')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '厂务订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:complete')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:termination')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
showTip: '终止',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
},
|
||||
this.$auth.hasPermi('base:order-group:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||
workIssueTitle: '',
|
||||
bindOrderVisible: false,
|
||||
orderDetailVisible: false
|
||||
}
|
||||
},
|
||||
components: { OrderGroupAdd, BindOrder },
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getOrderGroupPage({...this.queryParams}).then(res => {
|
||||
let arr = res.data.records || []
|
||||
this.total = res.data.total || 0
|
||||
if (arr.length > 0) {
|
||||
customerList().then(result => {
|
||||
let tempData = result.data || []
|
||||
if (tempData.length > 0) {
|
||||
arr.map(item => {
|
||||
for (let i of tempData) {
|
||||
if (item.customerId === i.id) {
|
||||
item.customerId = i.name
|
||||
}
|
||||
}
|
||||
})
|
||||
this.list = arr
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.list = arr
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name
|
||||
this.queryParams.status = val.status
|
||||
if (val.timeVal && val.timeVal.length > 0) {
|
||||
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
|
||||
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
|
||||
} else {
|
||||
this.queryParams.planFinishTime = []
|
||||
}
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderGroupAdd.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderGroupAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
case 'cancel':
|
||||
this.handleEditStatus(val.data, '作废', '6')
|
||||
break
|
||||
case 'detail':
|
||||
this.$router.push({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id})
|
||||
break
|
||||
case 'termination':
|
||||
this.handleEditStatus(val.data, '终止', '5')
|
||||
break
|
||||
case 'bind':
|
||||
this.workIssueTitle = '绑定工单'
|
||||
this.bindOrderVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindOrder.init(val.data)
|
||||
})
|
||||
break
|
||||
case 'complete':
|
||||
this.handleEditStatus(val.data, '完成', '4')
|
||||
break
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
let _this = this
|
||||
if (val.orderIdNum > 0) {// 有下级订单
|
||||
_this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
cancelButtonText: '不同步'
|
||||
}).then(function() {
|
||||
console.log('同步')
|
||||
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}).catch(action => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步')
|
||||
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}else {
|
||||
return console.log('关闭')
|
||||
}
|
||||
})
|
||||
}else{// 无下级订单
|
||||
_this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() {
|
||||
return groupOrderStatusSet({ id: val.id, status: status})
|
||||
}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
}).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()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'OrderGroup',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名称',
|
||||
placeholder: '订单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'status',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 250,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
status: null,
|
||||
planFinishTime: [],
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-group:bind')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '厂务订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:complete')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:termination')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
showTip: '终止',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
this.$auth.hasPermi('base:order-group:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||
workIssueTitle: '',
|
||||
bindOrderVisible: false,
|
||||
orderDetailVisible: false,
|
||||
};
|
||||
},
|
||||
components: { OrderGroupAdd, BindOrder },
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getOrderGroupPage({ ...this.queryParams }).then((res) => {
|
||||
let arr = res.data.records || [];
|
||||
this.total = res.data.total || 0;
|
||||
if (arr.length > 0) {
|
||||
customerList().then((result) => {
|
||||
let tempData = result.data || [];
|
||||
if (tempData.length > 0) {
|
||||
arr.map((item) => {
|
||||
for (let i of tempData) {
|
||||
if (item.customerId === i.id) {
|
||||
item.customerId = i.name;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.list = arr;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.list = arr;
|
||||
}
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val);
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name;
|
||||
this.queryParams.status = val.status;
|
||||
if (val.timeVal && val.timeVal.length > 0) {
|
||||
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00';
|
||||
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59';
|
||||
} else {
|
||||
this.queryParams.planFinishTime = [];
|
||||
}
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderGroupAdd.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderGroupAdd.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
case 'cancel':
|
||||
this.handleEditStatus(val.data, '作废', '6');
|
||||
break;
|
||||
case 'detail':
|
||||
this.$router.push({
|
||||
path:
|
||||
'/order/base/order-group/order-group-detail-data?orderGroupId=' +
|
||||
val.data.id,
|
||||
});
|
||||
break;
|
||||
case 'termination':
|
||||
this.handleEditStatus(val.data, '终止', '5');
|
||||
break;
|
||||
case 'bind':
|
||||
this.workIssueTitle = '绑定工单';
|
||||
this.bindOrderVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindOrder.init(val.data);
|
||||
});
|
||||
break;
|
||||
case 'complete':
|
||||
this.handleEditStatus(val.data, '完成', '4');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
let _this = this;
|
||||
if (val.orderIdNum > 0) {
|
||||
// 有下级订单
|
||||
_this
|
||||
.$confirm(
|
||||
'是否将"' + tip + '"操作同步至下级订单和工单?',
|
||||
'确认信息',
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
cancelButtonText: '不同步',
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
console.log('同步');
|
||||
groupOrderStatusSet({
|
||||
id: val.id,
|
||||
status: status,
|
||||
isSync: true,
|
||||
}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
})
|
||||
.catch((action) => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步');
|
||||
groupOrderStatusSet({
|
||||
id: val.id,
|
||||
status: status,
|
||||
isSync: false,
|
||||
}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
} else {
|
||||
return console.log('关闭');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 无下级订单
|
||||
_this.$modal
|
||||
.confirm(
|
||||
'是否确认"' + tip + '"集团订单名称为"' + val.name + '"的数据项?'
|
||||
)
|
||||
.then(function () {
|
||||
return groupOrderStatusSet({ id: val.id, status: status });
|
||||
})
|
||||
.then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.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>
|
||||
@@ -1,470 +1,494 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="290"
|
||||
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='60%'
|
||||
>
|
||||
<order-add ref="orderAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 查看详情 -->
|
||||
<!-- 新增工单 -->
|
||||
<base-dialog
|
||||
:dialogTitle="workIssueTitle"
|
||||
:dialogVisible="addWorkOrdervisible"
|
||||
@cancel="addWorkOrderCancel"
|
||||
@confirm="addWorkOrderConfirm"
|
||||
:before-close="addWorkOrderCancel"
|
||||
width='70%'
|
||||
>
|
||||
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="290"
|
||||
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="60%">
|
||||
<order-add
|
||||
ref="orderAdd"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 查看详情 -->
|
||||
<!-- 新增工单 -->
|
||||
<base-dialog
|
||||
:dialogTitle="workIssueTitle"
|
||||
:dialogVisible="addWorkOrdervisible"
|
||||
@cancel="addWorkOrderCancel"
|
||||
@confirm="addWorkOrderConfirm"
|
||||
:before-close="addWorkOrderCancel"
|
||||
width="70%">
|
||||
<add-work-order
|
||||
ref="addWorkOrder"
|
||||
@addWorkOrderSubmit="addWorkOrderSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage'
|
||||
import OrderAdd from './components/orderAdd'
|
||||
import AddWorkOrder from './components/addWorkOrder'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
getOrderPage,
|
||||
orderStatusSet,
|
||||
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 = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'triggerOrigin',
|
||||
label: '来源',
|
||||
filter: publicFormatter('order_Origin')
|
||||
},
|
||||
{
|
||||
prop: 'priority',
|
||||
label: '优先级',
|
||||
filter: publicFormatter('order_priority')
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '订单状态',
|
||||
filter: publicFormatter('order_status')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'actualQuantity',
|
||||
label: '实际加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'productName',
|
||||
label: '产品',
|
||||
width: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元)',
|
||||
align: 'right'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNum',
|
||||
label: '工单数量'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'triggerOrigin',
|
||||
label: '来源',
|
||||
filter: publicFormatter('order_Origin'),
|
||||
},
|
||||
{
|
||||
prop: 'priority',
|
||||
label: '优先级',
|
||||
filter: publicFormatter('order_priority'),
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '订单状态',
|
||||
filter: publicFormatter('order_status'),
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'actualQuantity',
|
||||
label: '实际加工量',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'productName',
|
||||
label: '产品',
|
||||
width: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元)',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNum',
|
||||
label: '工单数量',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'OrderManage',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名称',
|
||||
placeholder: '订单名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'status'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
status: null,
|
||||
lastIssuedTime: []
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-manage:addWorkOrder')
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '新增',
|
||||
showTip: '新增工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:complete')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:termination')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
showTip: '终止',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||
workIssueTitle: '',
|
||||
addWorkOrdervisible: false,
|
||||
orderDetailVisible: false
|
||||
}
|
||||
},
|
||||
components: { OrderAdd, AddWorkOrder },
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getOrderPage({...this.queryParams}).then(res => {
|
||||
let arr = res.data.records || []
|
||||
this.total = res.data.total || 0
|
||||
if (arr.length > 0) {
|
||||
customerList().then(result => {
|
||||
let tempData = result.data || []
|
||||
if (tempData.length > 0) {
|
||||
arr.map(item => {
|
||||
for (let i of tempData) {
|
||||
if (item.customerId === i.id) {
|
||||
item.customerId = i.name
|
||||
}
|
||||
}
|
||||
item.price = item.price ? item.price.toFixed(2) : '0.00'
|
||||
})
|
||||
this.list = arr
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.list = arr
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name
|
||||
this.queryParams.status = val.status
|
||||
if (val.timeVal && val.timeVal.length > 0) {
|
||||
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
|
||||
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
|
||||
} else {
|
||||
this.queryParams.lastIssuedTime = []
|
||||
}
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderAdd.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
case 'cancel':
|
||||
this.handleEditStatus(val.data, '作废', '6')
|
||||
break
|
||||
case 'termination':
|
||||
this.handleEditStatus(val.data, '终止', '5')
|
||||
break
|
||||
case 'detail':
|
||||
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
|
||||
break
|
||||
case 'add':
|
||||
this.workIssueTitle = '新增工单'
|
||||
this.addWorkOrdervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addWorkOrder.init(val.data, 'add')
|
||||
})
|
||||
break
|
||||
case 'bind':
|
||||
this.workIssueTitle = '绑定工单'
|
||||
this.addWorkOrdervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addWorkOrder.init(val.data, 'bind')
|
||||
})
|
||||
break
|
||||
case 'complete':
|
||||
this.handleEditStatus(val.data, '完成', '4')
|
||||
break
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
let _this = this
|
||||
if (val.workOrderNum > 0) {//有下级工单
|
||||
_this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
cancelButtonText: '不同步'
|
||||
}).then(function() {
|
||||
console.log('同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}).catch(action => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}else {
|
||||
return console.log('关闭')
|
||||
}
|
||||
})
|
||||
}else{// 无下级工单
|
||||
_this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
|
||||
return orderStatusSet({ id: val.id, status: status})
|
||||
}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.orderAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.orderAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
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()
|
||||
// }
|
||||
}
|
||||
}
|
||||
name: 'OrderManage',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名称',
|
||||
placeholder: '订单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'status',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 250,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
status: null,
|
||||
lastIssuedTime: [],
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-manage:addWorkOrder')
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '新增',
|
||||
showTip: '新增工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:complete')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:termination')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
showTip: '终止',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||
workIssueTitle: '',
|
||||
addWorkOrdervisible: false,
|
||||
orderDetailVisible: false,
|
||||
};
|
||||
},
|
||||
components: { OrderAdd, AddWorkOrder },
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getOrderPage({ ...this.queryParams }).then((res) => {
|
||||
let arr = res.data.records || [];
|
||||
this.total = res.data.total || 0;
|
||||
if (arr.length > 0) {
|
||||
customerList().then((result) => {
|
||||
let tempData = result.data || [];
|
||||
if (tempData.length > 0) {
|
||||
arr.map((item) => {
|
||||
for (let i of tempData) {
|
||||
if (item.customerId === i.id) {
|
||||
item.customerId = i.name;
|
||||
}
|
||||
}
|
||||
item.price = item.price ? item.price.toFixed(2) : '0.00';
|
||||
});
|
||||
this.list = arr;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.list = arr;
|
||||
}
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val);
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.name = val.name;
|
||||
this.queryParams.status = val.status;
|
||||
if (val.timeVal && val.timeVal.length > 0) {
|
||||
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00';
|
||||
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59';
|
||||
} else {
|
||||
this.queryParams.lastIssuedTime = [];
|
||||
}
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderAdd.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderAdd.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
case 'cancel':
|
||||
this.handleEditStatus(val.data, '作废', '6');
|
||||
break;
|
||||
case 'termination':
|
||||
this.handleEditStatus(val.data, '终止', '5');
|
||||
break;
|
||||
case 'detail':
|
||||
this.$router.push({
|
||||
path:
|
||||
'/order/base/order-manage/order-detail-data?orderId=' +
|
||||
val.data.id,
|
||||
});
|
||||
break;
|
||||
case 'add':
|
||||
this.workIssueTitle = '新增工单';
|
||||
this.addWorkOrdervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addWorkOrder.init(val.data, 'add');
|
||||
});
|
||||
break;
|
||||
case 'bind':
|
||||
this.workIssueTitle = '绑定工单';
|
||||
this.addWorkOrdervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addWorkOrder.init(val.data, 'bind');
|
||||
});
|
||||
break;
|
||||
case 'complete':
|
||||
this.handleEditStatus(val.data, '完成', '4');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
let _this = this;
|
||||
if (val.workOrderNum > 0) {
|
||||
//有下级工单
|
||||
_this
|
||||
.$confirm('是否将"' + tip + '"操作同步至下级工单?', '确认信息', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
cancelButtonText: '不同步',
|
||||
})
|
||||
.then(function () {
|
||||
console.log('同步');
|
||||
orderStatusSet({ id: val.id, status: status, isSync: true }).then(
|
||||
() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch((action) => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步');
|
||||
orderStatusSet({
|
||||
id: val.id,
|
||||
status: status,
|
||||
isSync: false,
|
||||
}).then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
} else {
|
||||
return console.log('关闭');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 无下级工单
|
||||
_this.$modal
|
||||
.confirm(
|
||||
'是否确认"' + tip + '"厂务订单名称为"' + val.name + '"的数据项?'
|
||||
)
|
||||
.then(function () {
|
||||
return orderStatusSet({ id: val.id, status: status });
|
||||
})
|
||||
.then(() => {
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.orderAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.orderAdd.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
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>
|
||||
@@ -56,6 +56,7 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import { orderGroupMonitor } from '@/api/base/orderGroup';
|
||||
import MonitoringRingCharts from './../components/monitoringRingCharts';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
@@ -141,6 +142,7 @@ const tableProps = [
|
||||
];
|
||||
export default {
|
||||
name: 'OrderCompletionMonitoring',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
@@ -177,7 +179,6 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
|
||||
@@ -242,9 +243,6 @@ export default {
|
||||
},
|
||||
components: { MonitoringRingCharts },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260);
|
||||
});
|
||||
let start = moment().subtract(30, 'days').format('yyyy-MM-DD');
|
||||
let end = moment().format('yyyy-MM-DD');
|
||||
this.formConfig[1].defaultSelect = [start, end];
|
||||
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi(' base: quality - isra - statistics: query') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:quality-isra-statistics:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
@@ -207,15 +207,16 @@ export default {
|
||||
}).then((res) => {
|
||||
let mapArr= []
|
||||
let mapLegendData = []
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
data: [],
|
||||
mapXAxisData: [],
|
||||
}
|
||||
// let mapXAxisData = []
|
||||
for (let i in res.data) {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
data: [],
|
||||
mapXAxisData:[],
|
||||
}
|
||||
|
||||
// console.log(i)
|
||||
let dataArr = []
|
||||
res.data[i].forEach(ele => {
|
||||
@@ -227,6 +228,7 @@ export default {
|
||||
mapLegendData.push(i)
|
||||
mapArr.push(obj)
|
||||
}
|
||||
console.log(mapArr);
|
||||
// console.log(res.data[res]);
|
||||
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
|
||||
var myChart = echarts.init(chartDom);
|
||||
@@ -267,6 +269,7 @@ export default {
|
||||
},
|
||||
series: mapArr
|
||||
}
|
||||
myChart.clear()
|
||||
option && myChart.setOption(option);
|
||||
})
|
||||
this.$axios({
|
||||
@@ -374,6 +377,7 @@ export default {
|
||||
}
|
||||
]
|
||||
}
|
||||
myChart.clear()
|
||||
option && myChart.setOption(option);
|
||||
})
|
||||
},
|
||||
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
// filterable: true
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -218,7 +218,11 @@ export default {
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi(
|
||||
'monitoring:device-parameters:query'
|
||||
)
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -260,17 +260,24 @@ export default {
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi(
|
||||
'monitoring:equipment-traceability:query'
|
||||
)
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi(
|
||||
'monitoring:equipment-traceability:export'
|
||||
)
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-29 14:08:18
|
||||
* @LastEditTime: 2024-04-07 16:19:18
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -84,21 +84,21 @@ export default {
|
||||
// },
|
||||
tableProps,
|
||||
// tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
// tableBtn: [
|
||||
// this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '编辑',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
|
||||
].filter((v) => v),
|
||||
// ].filter((v) => v),
|
||||
list: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('monitoring:materiel-date-from:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-29 14:08:30
|
||||
* @LastEditTime: 2024-04-07 16:25:19
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -147,7 +147,8 @@ export default {
|
||||
// width: 250
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
|
||||
type: this.$auth.hasPermi('monitoring:rawMaterial-traceability:query') ? 'button' : '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-29 15:32:33
|
||||
* @LastEditTime: 2024-04-07 16:26:56
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -135,7 +135,12 @@ export default {
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
|
||||
type: this.$auth.hasPermi(
|
||||
'monitoring:process-traceability:query'
|
||||
)
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -159,7 +159,11 @@ export default {
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi(
|
||||
'base:quality-inspection-record:query'
|
||||
)
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-24 15:15:24
|
||||
* @LastEditTime: 2024-03-27 09:27:23
|
||||
* @LastEditTime: 2024-04-08 11:47:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -18,8 +18,8 @@
|
||||
<el-form-item>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||
@click="getDataList">查询</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:glass-day:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
|
||||
plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<el-form-item>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||
@click="getDataList">查询</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
|
||||
plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<el-form-item>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||
@click="getDataList">查询</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
|
||||
plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<el-form-item>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
|
||||
@click="getDataList">查询</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
|
||||
plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-29 09:48:32
|
||||
* @LastEditTime: 2024-04-08 11:45:52
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -12,8 +12,9 @@
|
||||
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @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('report:auto-production:query')" type="primary" @click="getDataList()">查询
|
||||
</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
@@ -28,122 +29,122 @@
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + '(' + timeTips + ')'" align="center">
|
||||
<el-table-column prop="lineId" label="生产线" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡" align="center">
|
||||
<el-table-column prop="inputNow" label="本月" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上月" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<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 ?
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成良品产量" align="center">
|
||||
<el-table-column prop="goodProductNow" label="本月" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上月" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本月" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上月" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本月" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上月" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
style="width: 350px" placeholder="选择周">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
<!-- <el-button type="primary" @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('report:auto-production:query')" type="primary" @click="getDataList()">查询
|
||||
</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
@@ -31,126 +31,126 @@
|
||||
<el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center">
|
||||
<el-table-column prop="lineId" label="生产线" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡" align="center">
|
||||
<el-table-column prop="inputNow" label="本周" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<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 ?
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成良品产量" align="center">
|
||||
<el-table-column prop="goodProductNow" label="本周" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本周" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本周" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-29 09:48:49
|
||||
* @LastEditTime: 2024-04-08 11:46:49
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -14,8 +14,9 @@
|
||||
style="width: 350px" placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @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('report:auto-production:query')" type="primary" @click="getDataList()">查询
|
||||
</el-button>
|
||||
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
|
||||
@click="handleExport">导出</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> -->
|
||||
@@ -33,126 +34,126 @@
|
||||
<el-table-column :label="'许昌安彩年成品生产汇总' + '(' + timeTips + ')'" align="center">
|
||||
<el-table-column prop="lineId" label="生产线" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投入数㎡" align="center">
|
||||
<el-table-column prop="inputNow" label="今年" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="去年" align="center">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<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 ?
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成良品产量" align="center">
|
||||
<el-table-column prop="goodProductNow" label="今年" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="去年" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今年" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="去年" align="center">
|
||||
<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 *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今年" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="去年" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
100).toFixed(2)) +
|
||||
'%' : null }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<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>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
|
||||
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
0 ?
|
||||
0 :
|
||||
null
|
||||
}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
@@ -1,185 +1,188 @@
|
||||
<template>
|
||||
<div class="app-container vocHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<div class="app-container vocHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName" />
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
||||
import moment from 'moment'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称'
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val]
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人'
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称',
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值',
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val],
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人',
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'VocDetectionHistory',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 3,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
tableH: this.tableHeight(260)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.startTime = start
|
||||
this.queryParams.endTime = end
|
||||
this.getSelectList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
||||
if (val.btnName === 'search') {
|
||||
this.getList()
|
||||
} else {
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return environmentalCheckRecordExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '废水检测历史记录.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 3
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data.list || []
|
||||
})
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
console.log(row)
|
||||
if (row.markRed) {
|
||||
return 'warning-row'
|
||||
}else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'VocDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 3,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
|
||||
this.formConfig[1].defaultSelect = [start, end];
|
||||
this.queryParams.startTime = start;
|
||||
this.queryParams.endTime = end;
|
||||
this.getSelectList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId;
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
|
||||
if (val.btnName === 'search') {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$modal
|
||||
.confirm('是否确认导出')
|
||||
.then(() => {
|
||||
return environmentalCheckRecordExport({ ...this.queryParams });
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '废水检测历史记录.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
});
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 3,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
console.log(row);
|
||||
if (row.markRed) {
|
||||
return 'warning-row';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.vocHis {
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,210 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='60%'
|
||||
>
|
||||
<voc-add ref="vocAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="60%">
|
||||
<voc-add
|
||||
ref="vocAdd"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import VocAdd from './components/vocAdd'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import VocAdd from './components/vocAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值'
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值'
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人'
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值',
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值',
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'VocDetectionIndication',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 3,
|
||||
name: null
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:voc:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:voc:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false
|
||||
}
|
||||
},
|
||||
components: { VocAdd },
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.vocAdd.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.vocAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
||||
return environmentalCheckDelete({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.vocAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.vocAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'VocDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 3,
|
||||
name: null,
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:voc:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:voc:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
};
|
||||
},
|
||||
components: { VocAdd },
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.vocAdd.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.vocAdd.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除"' + val.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return environmentalCheckDelete({ id: val.id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.vocAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.vocAdd.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,185 +1,188 @@
|
||||
<template>
|
||||
<div class="app-container wasteGasHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<div class="app-container wasteGasHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName" />
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
||||
import moment from 'moment'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称'
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val]
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人'
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称',
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值',
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val],
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人',
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'WasteGasDetectionHistory',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 2,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
tableH: this.tableHeight(260)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.startTime = start
|
||||
this.queryParams.endTime = end
|
||||
this.getSelectList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
||||
if (val.btnName === 'search') {
|
||||
this.getList()
|
||||
} else {
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return environmentalCheckRecordExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '废气检测历史记录.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 2
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data.list || []
|
||||
})
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
console.log(row)
|
||||
if (row.markRed) {
|
||||
return 'warning-row'
|
||||
}else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteGasDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 2,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
|
||||
this.formConfig[1].defaultSelect = [start, end];
|
||||
this.queryParams.startTime = start;
|
||||
this.queryParams.endTime = end;
|
||||
this.getSelectList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId;
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
|
||||
if (val.btnName === 'search') {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$modal
|
||||
.confirm('是否确认导出')
|
||||
.then(() => {
|
||||
return environmentalCheckRecordExport({ ...this.queryParams });
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '废气检测历史记录.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
});
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 2,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
console.log(row);
|
||||
if (row.markRed) {
|
||||
return 'warning-row';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.wasteGasHis {
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,210 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='60%'
|
||||
>
|
||||
<waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="60%">
|
||||
<waste-gas-add
|
||||
ref="wasteGasAdd"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import WasteGasAdd from './components/wasteGasAdd'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import WasteGasAdd from './components/wasteGasAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值'
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值'
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人'
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值',
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值',
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'WasteGasDetectionIndication',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 2,
|
||||
name: null
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-gas:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-gas:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false
|
||||
}
|
||||
},
|
||||
components: { WasteGasAdd },
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteGasAdd.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteGasAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
||||
return environmentalCheckDelete({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.wasteGasAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.wasteGasAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteGasDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 2,
|
||||
name: null,
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-gas:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-gas:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
};
|
||||
},
|
||||
components: { WasteGasAdd },
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteGasAdd.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteGasAdd.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除"' + val.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return environmentalCheckDelete({ id: val.id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.wasteGasAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.wasteGasAdd.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,185 +1,190 @@
|
||||
<template>
|
||||
<div class="app-container wasteWaterHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<div class="app-container wasteWaterHis">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
:row-class-name="tableRowClassName" />
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
||||
import moment from 'moment'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称'
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val]
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人'
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'checkName',
|
||||
label: '指标名称',
|
||||
},
|
||||
{
|
||||
prop: 'checkValue',
|
||||
label: '检测数值',
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '来源',
|
||||
filter: (val) => ['手动', '自动'][val],
|
||||
},
|
||||
{
|
||||
prop: 'recordPerson',
|
||||
label: '录入人',
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '录入时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'WasteWaterDetectionHistory',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '检测时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 1,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
tableH: this.tableHeight(260)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.startTime = start
|
||||
this.queryParams.endTime = end
|
||||
this.getSelectList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
||||
if (val.btnName === 'search') {
|
||||
this.getList()
|
||||
} else {
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return environmentalCheckRecordExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '废水检测历史记录.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 1
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data.list || []
|
||||
})
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
console.log(row)
|
||||
if (row.markRed) {
|
||||
return 'warning-row'
|
||||
}else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteWaterDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标名称',
|
||||
selectOptions: [],
|
||||
param: 'checkId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '检测时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkId: null,
|
||||
checkType: 1,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
|
||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
|
||||
this.formConfig[1].defaultSelect = [start, end];
|
||||
this.queryParams.startTime = start;
|
||||
this.queryParams.endTime = end;
|
||||
this.getSelectList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.checkId = val.checkId;
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
|
||||
if (val.btnName === 'search') {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$modal
|
||||
.confirm('是否确认导出')
|
||||
.then(() => {
|
||||
return environmentalCheckRecordExport({ ...this.queryParams });
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '废水检测历史记录.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
});
|
||||
},
|
||||
getSelectList() {
|
||||
environmentalCheckPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
checkType: 1,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
console.log(row);
|
||||
if (row.markRed) {
|
||||
return 'warning-row';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.wasteWaterHis {
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,212 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='60%'
|
||||
>
|
||||
<waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<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" />
|
||||
<!-- 新增&编辑 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="60%">
|
||||
<waste-water-add
|
||||
ref="wasteWaterAdd"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import WasteWaterAdd from './components/wasteWaterAdd'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import WasteWaterAdd from './components/wasteWaterAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit')
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值'
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值'
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人'
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'name',
|
||||
label: '指标名称',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指标编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('environment_check_unit'),
|
||||
},
|
||||
{
|
||||
prop: 'minValue',
|
||||
label: '最小值',
|
||||
},
|
||||
{
|
||||
prop: 'maxValue',
|
||||
label: '最大值',
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
label: '创建人',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'WasteWaterDetectionIndication',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 1,
|
||||
name: null
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-water:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-water:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false
|
||||
}
|
||||
},
|
||||
components: { WasteWaterAdd },
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
} else {
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteWaterAdd.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteWaterAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
||||
return environmentalCheckDelete({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.wasteWaterAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.wasteWaterAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteWaterDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '指标名称',
|
||||
placeholder: '指标名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
checkType: 1,
|
||||
name: null,
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-water:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-water:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
};
|
||||
},
|
||||
components: { WasteWaterAdd },
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
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') {
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
} else {
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteWaterAdd.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wasteWaterAdd.init(val.data.id);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除"' + val.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return environmentalCheckDelete({ id: val.id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.wasteWaterAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.wasteWaterAdd.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,82 +1,194 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" />
|
||||
<div class="app-container">
|
||||
<!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" />
|
||||
<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-item label="菜单名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入菜单名称" clearable @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-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch">
|
||||
<el-form-item
|
||||
label="菜单名称"
|
||||
prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入菜单名称"
|
||||
clearable
|
||||
@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-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @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-row
|
||||
:gutter="10"
|
||||
class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@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"
|
||||
: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">
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
: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">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="sort" label="排序" width="60"></el-table-column>
|
||||
<el-table-column prop="permission" label="权限标识" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="componentName" label="组件名称" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="status" label="状态" 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-table-column
|
||||
prop="sort"
|
||||
label="排序"
|
||||
width="60"></el-table-column>
|
||||
<el-table-column
|
||||
prop="permission"
|
||||
label="权限标识"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column
|
||||
prop="component"
|
||||
label="组件路径"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column
|
||||
prop="componentName"
|
||||
label="组件名称"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
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-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级菜单">
|
||||
<treeselect v-model="form.parentId" :options="menuOptions" :normalizer="normalizer" :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-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="800px"
|
||||
append-to-body>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级菜单">
|
||||
<treeselect
|
||||
v-model="form.parentId"
|
||||
:options="menuOptions"
|
||||
:normalizer="normalizer"
|
||||
: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-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()">
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
@@ -88,319 +200,414 @@
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
</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-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="50" />
|
||||
<el-form-item
|
||||
label="菜单名称"
|
||||
prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入菜单名称" />
|
||||
</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-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 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-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-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-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-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>
|
||||
<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-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>
|
||||
|
||||
<script>
|
||||
import { listMenu, getMenu, 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 {
|
||||
listMenu,
|
||||
getMenu,
|
||||
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 { getDictDatas, DICT_TYPE } from '@/utils/dict'
|
||||
import {isExternal} from "@/utils/validate";
|
||||
import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants';
|
||||
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
|
||||
import { isExternal } from '@/utils/validate';
|
||||
|
||||
export default {
|
||||
name: "SystemMenu",
|
||||
components: { Treeselect, IconSelect },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 菜单表格树数据
|
||||
menuList: [],
|
||||
// 菜单树选项
|
||||
menuOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否展开,默认全部折叠
|
||||
isExpandAll: false,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
visible: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "菜单名称不能为空", trigger: "blur" }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: "路由地址不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
name: 'SystemMenu',
|
||||
components: { Treeselect, IconSelect },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 菜单表格树数据
|
||||
menuList: [],
|
||||
// 菜单树选项
|
||||
menuOptions: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否展开,默认全部折叠
|
||||
isExpandAll: false,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
visible: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '菜单名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: '菜单顺序不能为空', trigger: 'blur' },
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '路由地址不能为空', trigger: 'blur' },
|
||||
],
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||
},
|
||||
|
||||
// 枚举
|
||||
MenuTypeEnum: SystemMenuTypeEnum,
|
||||
CommonStatusEnum: CommonStatusEnum,
|
||||
// 数据字典
|
||||
menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE),
|
||||
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS)
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 选择图标
|
||||
// selected(name) {
|
||||
// this.form.icon = name;
|
||||
// },
|
||||
/** 查询菜单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMenu(this.queryParams).then(response => {
|
||||
this.menuList = this.handleTree(response.data, "id");
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/** 查询菜单下拉树结构 */
|
||||
getTreeselect() {
|
||||
listMenu().then(response => {
|
||||
this.menuOptions = [];
|
||||
const menu = { id: 0, name: '主类目', children: [] };
|
||||
menu.children = this.handleTree(response.data, "id");
|
||||
this.menuOptions.push(menu);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
parentId: 0,
|
||||
name: undefined,
|
||||
// icon: undefined,
|
||||
type: SystemMenuTypeEnum.DIR,
|
||||
sort: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
visible: true,
|
||||
keepAlive: true,
|
||||
alwaysShow: true,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 展开/折叠操作 */
|
||||
toggleExpandAll() {
|
||||
this.refreshTable = false;
|
||||
this.isExpandAll = !this.isExpandAll;
|
||||
this.$nextTick(() => {
|
||||
this.refreshTable = true;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
if (row != null && row.id) {
|
||||
this.form.parentId = row.id;
|
||||
} else {
|
||||
this.form.parentId = 0;
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加菜单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
getMenu(row.id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改菜单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 若权限类型为目录或者菜单时,进行 path 的校验,避免后续拼接出来的路由无法跳转
|
||||
if (this.form.type === SystemMenuTypeEnum.DIR
|
||||
|| this.form.type === SystemMenuTypeEnum.MENU) {
|
||||
// 如果是外链,则不进行校验
|
||||
const path = this.form.path
|
||||
if (!isExternal(path)) {
|
||||
// 父权限为根节点,path 必须以 / 开头
|
||||
if (this.form.parentId === 0 && path.charAt(0) !== '/') {
|
||||
this.$modal.msgSuccess('前端必须以 / 开头')
|
||||
return
|
||||
} else if (this.form.parentId !== 0 && path.charAt(0) === '/') {
|
||||
this.$modal.msgSuccess('前端不能以 / 开头')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
// 枚举
|
||||
MenuTypeEnum: SystemMenuTypeEnum,
|
||||
CommonStatusEnum: CommonStatusEnum,
|
||||
// 数据字典
|
||||
menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE),
|
||||
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 选择图标
|
||||
// selected(name) {
|
||||
// this.form.icon = name;
|
||||
// },
|
||||
/** 查询菜单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMenu(this.queryParams).then((response) => {
|
||||
this.menuList = this.handleTree(response.data, 'id');
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
/** 查询菜单下拉树结构 */
|
||||
getTreeselect() {
|
||||
listMenu().then((response) => {
|
||||
this.menuOptions = [];
|
||||
const menu = { id: 0, name: '主类目', children: [] };
|
||||
menu.children = this.handleTree(response.data, 'id');
|
||||
this.menuOptions.push(menu);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
parentId: 0,
|
||||
name: undefined,
|
||||
// icon: undefined,
|
||||
type: SystemMenuTypeEnum.DIR,
|
||||
sort: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
visible: true,
|
||||
keepAlive: true,
|
||||
alwaysShow: true,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 展开/折叠操作 */
|
||||
toggleExpandAll() {
|
||||
this.refreshTable = false;
|
||||
this.isExpandAll = !this.isExpandAll;
|
||||
this.$nextTick(() => {
|
||||
this.refreshTable = true;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
if (row != null && row.id) {
|
||||
this.form.parentId = row.id;
|
||||
} else {
|
||||
this.form.parentId = 0;
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '添加菜单';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
getMenu(row.id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改菜单';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 若权限类型为目录或者菜单时,进行 path 的校验,避免后续拼接出来的路由无法跳转
|
||||
if (
|
||||
this.form.type === SystemMenuTypeEnum.DIR ||
|
||||
this.form.type === SystemMenuTypeEnum.MENU
|
||||
) {
|
||||
// 如果是外链,则不进行校验
|
||||
const path = this.form.path;
|
||||
if (!isExternal(path)) {
|
||||
// 父权限为根节点,path 必须以 / 开头
|
||||
if (this.form.parentId === 0 && path.charAt(0) !== '/') {
|
||||
this.$modal.msgSuccess('前端必须以 / 开头');
|
||||
return;
|
||||
} else if (this.form.parentId !== 0 && path.charAt(0) === '/') {
|
||||
this.$modal.msgSuccess('前端不能以 / 开头');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
if (this.form.id !== undefined) {
|
||||
updateMenu(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMenu(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项?').then(function() {
|
||||
return delMenu(row.id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
// 提交
|
||||
if (this.form.id !== undefined) {
|
||||
updateMenu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMenu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMenu(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user