Compare commits

..

No commits in common. "b6236e89b1114d582dd12502350a04ec37c10381" and "b5b952e1cc87511efa2d7e04273cb195a6dc17cb" have entirely different histories.

16 changed files with 3191 additions and 3340 deletions

View File

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

View File

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

View File

@ -298,7 +298,7 @@ export default {
}, },
selectObj(val) { selectObj(val) {
this.form.objectId = val[val.length - 1]; this.form.objectId = val[val.length - 1];
this.form.objectType = val.length; this.form.objectType = val.length - 1;
if (this.form.energyTypeId && this.form.type) { if (this.form.energyTypeId && this.form.type) {
this.getDetailList(); this.getDetailList();
this.form.plcParamId = ''; this.form.plcParamId = '';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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