This commit is contained in:
朱菊兰 2024-04-08 12:25:44 +08:00
parent 33ed9f15fa
commit cbc7cbc574
16 changed files with 3340 additions and 3191 deletions

View File

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

View File

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

View File

@ -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 - 1; this.form.objectType = val.length;
if (this.form.energyTypeId && this.form.type) { if (this.form.energyTypeId && this.form.type) {
this.getDetailList(); this.getDetailList();
this.form.plcParamId = ''; this.form.plcParamId = '';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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