1 #313

Merged
juzi merged 1 commits from projects/mesxc-zjl into projects/mesxc-test 2024-04-08 12:26:35 +08:00
16 changed files with 3340 additions and 3191 deletions
Showing only changes of commit cbc7cbc574 - Show all commits

View File

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

View File

@ -4,127 +4,121 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<delivery-log-det-detail ref='deliveryLogDetail'/> <delivery-log-det-detail ref="deliveryLogDetail" />
</div> </div>
</template> </template>
<script> <script>
import { deliveryProgressPage } from '@/api/base/delivery' import { deliveryProgressPage } from '@/api/base/delivery';
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue' import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'orderName', prop: 'orderName',
label: '订单名', label: '订单名',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'customerName', prop: 'customerName',
label: '客户名称', label: '客户名称',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位' label: '单位',
}, },
{ {
prop: 'orderNum', prop: 'orderNum',
label: '订单数量' label: '订单数量',
}, },
{ {
prop: 'num', prop: 'num',
label: '发货数量' label: '发货数量',
}, },
{ {
prop: 'rate', prop: 'rate',
label: '累计发货比例(%)' label: '累计发货比例(%)',
} },
] ];
export default { export default {
name: "DeliveryLogDet", name: 'DeliveryLogDet',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '订单名', label: '订单名',
param: 'orderName' param: 'orderName',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
} },
], ],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
orderName: '' orderName: '',
}, },
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('extend:delivery-log-det:detail') this.$auth.hasPermi('extend:delivery-log-det:detail')
? { ? {
type: 'detail', type: 'detail',
btnName: '详情' btnName: '详情',
}
: undefined
].filter((v) => v)
} }
: undefined,
].filter((v) => v),
};
}, },
components: { DeliveryLogDetDetail }, components: { DeliveryLogDetDetail },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList(); this.getList();
}, },
methods: { methods: {
getList() { getList() {
deliveryProgressPage({...this.queryParams}).then(res => { deliveryProgressPage({ ...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) {
this.queryParams.orderName = val.orderName this.queryParams.orderName = val.orderName;
this.getList() this.getList();
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data) 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,67 +1,94 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" <base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"> :max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" <pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" /> @pagination="getList" />
<!-- 新增 --> <!-- 新增 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel" <base-dialog
@confirm="handleConfirm" :before-close="handleCancel" width='50%'> :dialogTitle="addOrEditTitle"
<group-class-add ref="classList" @successSubmit="successSubmit" /> :dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<group-class-add
ref="classList"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </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 },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -69,24 +96,26 @@ export default {
type: 'input', type: 'input',
label: '班次名称', label: '班次名称',
placeholder: '班次名称', placeholder: '班次名称',
param: 'name' param: 'name',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: 'separate' type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '', type: this.$auth.hasPermi('base:group-classes:create')
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
@ -100,145 +129,164 @@ export default {
{ {
type: 'unequal', type: 'unequal',
name: 'status', name: 'status',
value: '不可用' value: '不可用',
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:group-classes:update') this.$auth.hasPermi('base:group-classes:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:group-classes:delete') this.$auth.hasPermi('base:group-classes:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: "", addOrEditTitle: '',
// //
centervisible: false, centervisible: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null name: null,
} },
}; };
}, },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260)
})
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 = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久') item.enableTimeStr =
item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5) formatDate(item.enableTime) +
item.status = item.status === true ? '可用' : '不可用' '至' +
}) (item.disableTime ? formatDate(item.disableTime) : '永久');
item.timeStr =
item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
item.status = item.status === true ? '可用' : '不可用';
});
this.list = res.data.list; this.list = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
this.list = [] this.list = [];
this.total = 0 this.total = 0;
} }
}); });
}, },
handleClick(val) { handleClick(val) {
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.classList.init(val.data.id) this.$refs.classList.init(val.data.id);
}) });
this.centervisible = true this.centervisible = true;
break break;
case 'cancel': case 'cancel':
this.discard(val.data) this.discard(val.data);
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
handleCancel() { handleCancel() {
this.$refs.classList.formClear() this.$refs.classList.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.classList.submitForm() this.$refs.classList.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
}, },
discard(row) { discard(row) {
let obj = {} let obj = {};
obj.id = row.id obj.id = row.id;
obj.startTime = row.startTime obj.startTime = row.startTime;
obj.endTime = row.endTime obj.endTime = row.endTime;
obj.enableTime = row.enableTime obj.enableTime = row.enableTime;
obj.disableTime = Date.parse(new Date()) obj.disableTime = Date.parse(new Date());
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () { this.$modal
return updateGroupClasses({ ...obj }) .confirm('是否确认作废班次名称为"' + row.name + '"的数据项?')
}).then(() => { .then(function () {
return updateGroupClasses({ ...obj });
})
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess('操作成功');
}).catch(() => { }); })
.catch(() => {});
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
console.log(row) console.log(row);
let _this = this let _this = this;
if (row.status === '可用') {// if (row.status === '可用') {
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function () { //
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () { _this.$modal
.confirm(
'删除的班次"' +
row.name +
'"可能会影响交接班计划,请点取消再次确认!'
)
.then(function () {
return _this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id); return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => { });
}) })
} else { .then(() => {
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess("删除成功"); _this.$modal.msgSuccess('删除成功');
}).catch(() => { }); })
} .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,12 +1,10 @@
<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"
@ -14,23 +12,20 @@
:table-props="tableProps" :table-props="tableProps"
:table-data="list" :table-data="list"
:max-height="tableH" :max-height="tableH"
@emitFun="handleTableEvents" @emitFun="handleTableEvents">
>
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -38,66 +33,76 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='40%' width="40%">
> <group-team-add
<group-team-add ref="groupList" @successSubmit="successSubmit" /> ref="groupList"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 组员编辑 --> <!-- 组员编辑 -->
<worker-edit v-if='paramVisible' 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 },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -105,53 +110,52 @@ export default {
type: 'input', type: 'input',
label: '班组名称', label: '班组名称',
placeholder: '班组名称', placeholder: '班组名称',
param: 'name' param: 'name',
}, },
{ {
type: 'input', type: 'input',
label: '组长', label: '组长',
placeholder: '组长', placeholder: '组长',
param: 'leaderName' param: 'leaderName',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: 'separate' type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '', type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:group-team:update') this.$auth.hasPermi('base:group-team:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:group-team:delete') this.$auth.hasPermi('base:group-team:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: "", addOrEditTitle: '',
// //
centervisible: false, centervisible: false,
// //
@ -159,15 +163,12 @@ export default {
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.tableH = this.tableHeight(260)
})
this.getList(); this.getList();
}, },
methods: { methods: {
@ -175,21 +176,21 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.leaderName = val.leaderName this.queryParams.leaderName = val.leaderName;
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.groupList.init() this.$refs.groupList.init();
}) });
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
getGroupTeamPage(this.queryParams).then(response => { getGroupTeamPage(this.queryParams).then((response) => {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
}); });
@ -197,57 +198,63 @@ export default {
handleClick(val) { handleClick(val) {
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.groupList.init(val.data.id) this.$refs.groupList.init(val.data.id);
}) });
this.centervisible = true this.centervisible = true;
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
// //
handleTableEvents(params) { handleTableEvents(params) {
console.log(params) console.log(params);
if (params.name === 'state') {// if (params.name === 'state') {
//
updateGroupTeam({ ...params.payload }).then((res) => { updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功"); 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.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?').then(function() { this.$modal
.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupTeam(row.id); return deleteGroupTeam(row.id);
}).then(() => { })
.then(() => {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功');
}).catch(() => {}); })
.catch(() => {});
}, },
closeDrawer() { closeDrawer() {
this.getList() this.getList();
} },
} },
}; };
</script> </script>

View File

@ -4,61 +4,62 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="160" :width="160"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<!-- 查看详情 --> <!-- 查看详情 -->
<group-team-view-detail 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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -68,85 +69,82 @@ export default {
selectOptions: [], selectOptions: [],
param: 'workOrderId', param: 'workOrderId',
clearable: false, clearable: false,
filterable: true filterable: true,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
} },
], ],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 1000, pageSize: 1000,
workOrderId: '' workOrderId: '',
}, },
heightNum: 220,
workOrderList: [], workOrderList: [],
workOrderName: '', workOrderName: '',
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:group-team-view:detail') this.$auth.hasPermi('base:group-team-view:detail')
? { ? {
type: 'detail', type: 'detail',
btnName: '详情' btnName: '详情',
} }
: undefined : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps, tableProps,
tableH: this.tableHeight(220),
list: [], list: [],
paramVisible: false paramVisible: false,
} };
}, },
components: { GroupTeamViewDetail }, components: { GroupTeamViewDetail },
mounted() { mounted() {
window.addEventListener('resize', () => { this.getOrderList();
this.tableH = this.tableHeight(220)
})
this.getOrderList()
}, },
methods: { methods: {
// list // list
getOrderList() { getOrderList() {
workOrderList().then(res => { workOrderList().then((res) => {
console.log(res) console.log(res);
this.formConfig[0].selectOptions = res.data || [] this.formConfig[0].selectOptions = res.data || [];
this.workOrderList = res.data || [] this.workOrderList = res.data || [];
}) });
}, },
// //
buttonClick(val) { buttonClick(val) {
if (!val.workOrderId) { if (!val.workOrderId) {
this.$modal.msgWarning('工单不能为空') this.$modal.msgWarning('工单不能为空');
return false return false;
} }
this.queryParams.workOrderId = val.workOrderId this.queryParams.workOrderId = val.workOrderId;
this.getList() this.getList();
}, },
// table // table
getList() { getList() {
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => { getByWorkOrder({ id: this.queryParams.workOrderId }).then((res) => {
this.list = res.data || [] this.list = res.data || [];
}) });
}, },
handleClick(val) { handleClick(val) {
this.paramVisible = true this.paramVisible = true;
let params = {} let params = {};
params.teamId = val.data.id params.teamId = val.data.id;
params.teamName = val.data.name params.teamName = val.data.name;
this.workOrderList.map(item => { this.workOrderList.map((item) => {
if (val.data.workOrderId === item.id) { if (val.data.workOrderId === item.id) {
this.workOrderName = item.name this.workOrderName = item.name;
} }
}) });
params.workOrderId = val.data.workOrderId params.workOrderId = val.data.workOrderId;
params.workOrderName = this.workOrderName params.workOrderName = this.workOrderName;
params.roomNameDict = val.data.roomNameDict params.roomNameDict = val.data.roomNameDict;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.groupTeamViewDetail.init(params) this.$refs.groupTeamViewDetail.init(params);
}) });
} },
} },
} };
</script> </script>

View File

@ -8,30 +8,45 @@
@headBtnClick="buttonClick" @headBtnClick="buttonClick"
/> --> /> -->
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" <base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"> :max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" <method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" <pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" /> @pagination="getList" />
<!-- 查看生产情况 --> <!-- 查看生产情况 -->
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' /> <team-production-detail
v-if="paramVisible"
ref="schedulingMonitoringDetail" />
</div> </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',
@ -42,33 +57,34 @@ const tableProps = [
{ {
prop: 'startDay', prop: 'startDay',
label: '上班日期', label: '上班日期',
minWidth: 100 minWidth: 100,
}, },
{ {
prop: 'startTime', prop: 'startTime',
label: '上班时间', label: '上班时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '下班时间', label: '下班时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'classesName', prop: 'classesName',
label: '班次名称', label: '班次名称',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'teamName', prop: 'teamName',
label: '班组名称', label: '班组名称',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: 'GroupTeamScheduling', name: 'GroupTeamScheduling',
mixins: [tableHeightMixin],
data() { data() {
return { return {
// //
@ -77,7 +93,7 @@ export default {
pageSize: 20, pageSize: 20,
classesId: '', classesId: '',
teamName: '', teamName: '',
startDay: [] startDay: [],
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
@ -85,46 +101,46 @@ export default {
? { ? {
type: 'productionDetail', type: 'productionDetail',
btnName: '查看', btnName: '查看',
showTip: '生产情况' showTip: '生产情况',
} }
: undefined : undefined,
].filter((v) => v), ].filter((v) => v),
list: [], list: [],
tableH: this.tableHeight(260),
total: 0, total: 0,
paramVisible: false paramVisible: false,
} };
}, },
components: { TeamProductionDetail, SearchArea }, components: { TeamProductionDetail, SearchArea },
mounted() { mounted() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260)
})
this.getList()
}, },
methods: { methods: {
buttonClick(val) { buttonClick(val) {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.classesId = val.classesId this.queryParams.classesId = val.classesId;
this.queryParams.teamName = val.teamName this.queryParams.teamName = val.teamName;
this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : '' this.queryParams.startDay[0] = val.tiemStr
this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : '' ? val.tiemStr[0] + ' 00:00:00'
this.getList() : '';
this.queryParams.startDay[1] = val.tiemStr
? val.tiemStr[1] + ' 23:59:59'
: '';
this.getList();
}, },
getList() { getList() {
groupTeamSchedulingPage({ ...this.queryParams }).then(res => { groupTeamSchedulingPage({ ...this.queryParams }).then((res) => {
console.log(res) console.log(res);
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
this.paramVisible = true this.paramVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.schedulingMonitoringDetail.init(val.data) this.$refs.schedulingMonitoringDetail.init(val.data);
}) });
} },
} },
} };
</script> </script>

View File

@ -4,31 +4,27 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="240" :width="240"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -36,9 +32,10 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width="60%">
> <order-group-add
<order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" /> ref="orderGroupAdd"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 查看详情 --> <!-- 查看详情 -->
<!-- 新增工单 --> <!-- 新增工单 -->
@ -48,94 +45,97 @@
@cancel="bindOrderCancel" @cancel="bindOrderCancel"
@confirm="bindOrderConfirm" @confirm="bindOrderConfirm"
:before-close="bindOrderCancel" :before-close="bindOrderCancel"
width='60%' width="60%">
> <bind-order
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" /> ref="bindOrder"
@bindOrderSubmit="bindOrderSubmit" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup' import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup';
import { customerList } from '@/api/base/orderManage' import { customerList } from '@/api/base/orderManage';
import OrderGroupAdd from './components/orderGroupAdd' import OrderGroupAdd from './components/orderGroupAdd';
import BindOrder from './components/bindOrder' import BindOrder from './components/bindOrder';
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'name', prop: 'name',
label: '订单名称', label: '订单名称',
minWidth: 140, minWidth: 140,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
label: '订单编码', label: '订单编码',
minWidth: 150 minWidth: 150,
}, },
{ {
prop: 'customerId', prop: 'customerId',
label: '客户', label: '客户',
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'status', prop: 'status',
label: '订单状态', label: '订单状态',
filter: publicFormatter('order_status') filter: publicFormatter('order_status'),
}, },
{ {
prop: 'productName', prop: 'productName',
label: '产品名称', label: '产品名称',
minWidth: 200, minWidth: 200,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'specifications', prop: 'specifications',
label: '产品规格', label: '产品规格',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划加工量', label: '计划加工量',
width: 100 width: 100,
}, },
{ {
prop: 'actualquantity', prop: 'actualquantity',
label: '实际加工量', label: '实际加工量',
width: 100 width: 100,
}, },
{ {
prop: 'deliveTime', prop: 'deliveTime',
label: '交货时间', label: '交货时间',
filter: parseTime, filter: parseTime,
minWidth: 160 minWidth: 160,
}, },
{ {
prop: 'packReq', prop: 'packReq',
label: '包装要求', label: '包装要求',
// filter: publicFormatter('pack_spec'), // filter: publicFormatter('pack_spec'),
minWidth: 120, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'orderIdNum', prop: 'orderIdNum',
label: '订单数量' label: '订单数量',
} },
] ];
export default { export default {
name: 'OrderGroup', name: 'OrderGroup',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -143,7 +143,7 @@ export default {
type: 'input', type: 'input',
label: '订单名称', label: '订单名称',
placeholder: '订单名称', placeholder: '订单名称',
param: 'name' param: 'name',
}, },
{ {
type: 'select', type: 'select',
@ -151,37 +151,39 @@ export default {
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS), selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
param: 'status' param: 'status',
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd", valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 250 width: 250,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '', type: this.$auth.hasPermi('base:order-group:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '', type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
@ -189,12 +191,11 @@ export default {
pageSize: 20, pageSize: 20,
name: null, name: null,
status: null, status: null,
planFinishTime: [] planFinishTime: [],
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-group:bind') this.$auth.hasPermi('base:order-group:bind')
? { ? {
@ -207,10 +208,10 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:complete') this.$auth.hasPermi('base:order-group:complete')
@ -224,10 +225,10 @@ export default {
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:termination') this.$auth.hasPermi('base:order-group:termination')
@ -241,10 +242,10 @@ export default {
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:cancel') this.$auth.hasPermi('base:order-group:cancel')
@ -258,15 +259,15 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 2 value: 2,
} },
] ],
} },
} }
: undefined, : undefined,
{ {
type: 'detail', type: 'detail',
btnName: '详情' btnName: '详情',
}, },
this.$auth.hasPermi('base:order-group:edit') this.$auth.hasPermi('base:order-group:edit')
? { ? {
@ -278,163 +279,187 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 2 value: 2,
},
],
},
} }
] : undefined,
}
}
: undefined
].filter((v) => v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false, centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY), priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '', workIssueTitle: '',
bindOrderVisible: false, bindOrderVisible: false,
orderDetailVisible: false orderDetailVisible: false,
} };
}, },
components: { OrderGroupAdd, BindOrder }, components: { OrderGroupAdd, BindOrder },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260)
})
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({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id}) this.$router.push({
break path:
'/order/base/order-group/order-group-detail-data?orderGroupId=' +
val.data.id,
});
break;
case 'termination': case 'termination':
this.handleEditStatus(val.data, '终止', '5') this.handleEditStatus(val.data, '终止', '5');
break break;
case 'bind': case 'bind':
this.workIssueTitle = '绑定工单' this.workIssueTitle = '绑定工单';
this.bindOrderVisible = true this.bindOrderVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.bindOrder.init(val.data) this.$refs.bindOrder.init(val.data);
}) });
break break;
case 'complete': case 'complete':
this.handleEditStatus(val.data, '完成', '4') this.handleEditStatus(val.data, '完成', '4');
break break;
default: default:
} }
}, },
// , // ,
handleEditStatus(val, tip, status) { handleEditStatus(val, tip, status) {
let _this = this let _this = this;
if (val.orderIdNum > 0) {// if (val.orderIdNum > 0) {
_this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', { //
_this
.$confirm(
'是否将"' + tip + '"操作同步至下级订单和工单?',
'确认信息',
{
type: 'warning', type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
confirmButtonText: '同步', confirmButtonText: '同步',
cancelButtonText: '不同步' cancelButtonText: '不同步',
}).then(function() {
console.log('同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
} }
}) )
}else{// .then(function () {
_this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() { console.log('同步');
return groupOrderStatusSet({ id: val.id, status: status}) groupOrderStatusSet({
id: val.id,
status: status,
isSync: true,
}).then(() => { }).then(() => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess('操作成功');
}).catch(() => {}); });
})
.catch((action) => {
if (action === 'cancel') {
console.log('不同步');
groupOrderStatusSet({
id: val.id,
status: status,
isSync: false,
}).then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
});
} else {
return console.log('关闭');
}
});
} else {
//
_this.$modal
.confirm(
'是否确认"' + tip + '"集团订单名称为"' + val.name + '"的数据项?'
)
.then(function () {
return groupOrderStatusSet({ id: val.id, status: status });
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
} }
}, },
handleCancel() { handleCancel() {
this.$refs.orderGroupAdd.formClear() this.$refs.orderGroupAdd.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.orderGroupAdd.submitForm() this.$refs.orderGroupAdd.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
}, },
// //
bindOrderCancel() { bindOrderCancel() {
this.$refs.bindOrder.formClear() this.$refs.bindOrder.formClear();
this.bindOrderVisible = false this.bindOrderVisible = false;
}, },
bindOrderConfirm() { bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit() this.$refs.bindOrder.bindOrderSubmit();
}, },
bindOrderSubmit() { bindOrderSubmit() {
this.bindOrderCancel() this.bindOrderCancel();
this.getList() this.getList();
} },
} },
} };
</script> </script>

View File

@ -4,31 +4,27 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="290" :width="290"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -36,9 +32,10 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width="60%">
> <order-add
<order-add ref="orderAdd" @successSubmit="successSubmit" /> ref="orderAdd"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 查看详情 --> <!-- 查看详情 -->
<!-- 新增工单 --> <!-- 新增工单 -->
@ -48,85 +45,93 @@
@cancel="addWorkOrderCancel" @cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm" @confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel" :before-close="addWorkOrderCancel"
width='70%' width="70%">
> <add-work-order
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" /> ref="addWorkOrder"
@addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog> </base-dialog>
</div> </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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -134,7 +139,7 @@ export default {
type: 'input', type: 'input',
label: '订单名称', label: '订单名称',
placeholder: '订单名称', placeholder: '订单名称',
param: 'name' param: 'name',
}, },
{ {
type: 'select', type: 'select',
@ -142,37 +147,39 @@ export default {
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS), selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
param: 'status' param: 'status',
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd", valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 250 width: 250,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '', type: this.$auth.hasPermi('base:order-manage:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '', type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
@ -180,12 +187,11 @@ export default {
pageSize: 20, pageSize: 20,
name: null, name: null,
status: null, status: null,
lastIssuedTime: [] lastIssuedTime: [],
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder') this.$auth.hasPermi('base:order-manage:addWorkOrder')
? { ? {
@ -198,10 +204,10 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder') this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@ -215,10 +221,10 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:complete') this.$auth.hasPermi('base:order-manage:complete')
@ -232,10 +238,10 @@ export default {
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:termination') this.$auth.hasPermi('base:order-manage:termination')
@ -249,10 +255,10 @@ export default {
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 3 value: 3,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:cancel') this.$auth.hasPermi('base:order-manage:cancel')
@ -266,16 +272,16 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 2 value: 2,
} },
] ],
} },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:detail') this.$auth.hasPermi('base:order-manage:detail')
? { ? {
type: 'detail', type: 'detail',
btnName: '详情' btnName: '详情',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:edit') this.$auth.hasPermi('base:order-manage:edit')
@ -288,172 +294,190 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 2 value: 2,
},
],
},
} }
] : undefined,
}
}
: undefined
].filter((v) => v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false, centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY), priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '', workIssueTitle: '',
addWorkOrdervisible: false, addWorkOrdervisible: false,
orderDetailVisible: false orderDetailVisible: false,
} };
}, },
components: { OrderAdd, AddWorkOrder }, components: { OrderAdd, AddWorkOrder },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260)
})
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({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id}) this.$router.push({
break path:
'/order/base/order-manage/order-detail-data?orderId=' +
val.data.id,
});
break;
case 'add': case 'add':
this.workIssueTitle = '新增工单' this.workIssueTitle = '新增工单';
this.addWorkOrdervisible = true this.addWorkOrdervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'add') this.$refs.addWorkOrder.init(val.data, 'add');
}) });
break break;
case 'bind': case 'bind':
this.workIssueTitle = '绑定工单' this.workIssueTitle = '绑定工单';
this.addWorkOrdervisible = true this.addWorkOrdervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'bind') this.$refs.addWorkOrder.init(val.data, 'bind');
}) });
break break;
case 'complete': case 'complete':
this.handleEditStatus(val.data, '完成', '4') this.handleEditStatus(val.data, '完成', '4');
break break;
default: default:
} }
}, },
// , // ,
handleEditStatus(val, tip, status) { handleEditStatus(val, tip, status) {
let _this = this let _this = this;
if (val.workOrderNum > 0) {// if (val.workOrderNum > 0) {
_this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', { //
_this
.$confirm('是否将"' + tip + '"操作同步至下级工单?', '确认信息', {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
confirmButtonText: '同步', confirmButtonText: '同步',
cancelButtonText: '不同步' cancelButtonText: '不同步',
}).then(function() {
console.log('同步')
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
}) })
}).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('关闭')
} }
);
}) })
}else{// .catch((action) => {
_this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() { if (action === 'cancel') {
return orderStatusSet({ id: val.id, status: status}) console.log('不同步');
orderStatusSet({
id: val.id,
status: status,
isSync: false,
}).then(() => { }).then(() => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess('操作成功');
}).catch(() => {}); });
} else {
return console.log('关闭');
}
});
} else {
//
_this.$modal
.confirm(
'是否确认"' + tip + '"厂务订单名称为"' + val.name + '"的数据项?'
)
.then(function () {
return orderStatusSet({ id: val.id, status: status });
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
} }
}, },
// //
handleCancel() { handleCancel() {
this.$refs.orderAdd.formClear() this.$refs.orderAdd.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.orderAdd.submitForm() this.$refs.orderAdd.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
}, },
// //
addWorkOrderCancel() { addWorkOrderCancel() {
this.$refs.addWorkOrder.formClear() this.$refs.addWorkOrder.formClear();
this.addWorkOrdervisible = false this.addWorkOrdervisible = false;
}, },
addWorkOrderConfirm() { addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit() this.$refs.addWorkOrder.addWorkOrderSubmit();
}, },
addWorkOrderSubmit() { addWorkOrderSubmit() {
this.addWorkOrderCancel() this.addWorkOrderCancel();
this.getList() this.getList();
} },
// bindWorkOrderCancel() { // bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear() // this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false // this.bindWorkOrdervisible = false
@ -465,6 +489,6 @@ export default {
// this.bindWorkOrderCancel() // this.bindWorkOrderCancel()
// this.getList() // 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

@ -4,8 +4,7 @@
<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"
@ -13,59 +12,63 @@
: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 <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
</div> </div>
</template> </template>
<script> <script>
import { 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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -74,26 +77,26 @@ export default {
label: '指标名称', label: '指标名称',
selectOptions: [], selectOptions: [],
param: 'checkId', param: 'checkId',
filterable: true filterable: true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'datetimerange', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 350 width: 350,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '', type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
@ -103,8 +106,8 @@ export default {
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
@ -113,68 +116,68 @@ export default {
checkId: null, checkId: null,
checkType: 3, checkType: 3,
startTime: null, startTime: null,
endTime: null endTime: null,
}, },
tableProps, tableProps,
list: [], list: [],
total: 0, total: 0,
tableH: this.tableHeight(260) };
}
}, },
created() { created() {
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()
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.confirm('是否确认导出').then(() => { this.$modal
return environmentalCheckRecordExport({...this.queryParams}); .confirm('是否确认导出')
}).then(response => { .then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废水检测历史记录.xls'); this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {}) })
.catch(() => {});
} }
}, },
getList() { getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => { environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
getSelectList() { getSelectList() {
environmentalCheckPage({ environmentalCheckPage({
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
checkType: 3 checkType: 3,
}).then(res => { }).then((res) => {
console.log(res) console.log(res);
this.formConfig[0].selectOptions = res.data.list || [] this.formConfig[0].selectOptions = res.data.list || [];
}) });
}, },
tableRowClassName({row, rowIndex}) { tableRowClassName({ row, rowIndex }) {
console.log(row) console.log(row);
if (row.markRed) { if (row.markRed) {
return 'warning-row' return 'warning-row';
}else { } else {
return '' return '';
} }
} },
} },
} };
</script> </script>
<style lang='scss'> <style lang='scss'>
.vocHis { .vocHis {

View File

@ -4,31 +4,27 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -36,55 +32,61 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width="60%">
> <voc-add
<voc-add ref="vocAdd" @successSubmit="successSubmit" /> ref="vocAdd"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -92,13 +94,13 @@ export default {
type: 'input', type: 'input',
label: '指标名称', label: '指标名称',
placeholder: '指标名称', placeholder: '指标名称',
param: 'name' param: 'name',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '', type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
@ -108,98 +110,101 @@ export default {
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
checkType: 3, checkType: 3,
name: null name: null,
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:voc:update') this.$auth.hasPermi('base:voc:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:voc:delete') this.$auth.hasPermi('base:voc:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v)=>v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false centervisible: false,
} };
}, },
components: { VocAdd }, components: { VocAdd },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
environmentalCheckPage({...this.queryParams}).then(res => { environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams.name = val.name this.queryParams.name = val.name;
this.getList() this.getList();
} else { } else {
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vocAdd.init() this.$refs.vocAdd.init();
}) });
} }
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vocAdd.init(val.data.id) this.$refs.vocAdd.init(val.data.id);
}) });
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
// //
handleDelete(val) { handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { this.$modal
return environmentalCheckDelete({ id: val.id }) .confirm('是否确认删除"' + val.name + '"的数据项?')
}).then(() => { .then(function () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess('操作成功');
}).catch(() => {}); })
.catch(() => {});
}, },
// //
handleCancel() { handleCancel() {
this.$refs.vocAdd.formClear() this.$refs.vocAdd.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.vocAdd.submitForm() this.$refs.vocAdd.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
} },
} },
} };
</script> </script>

View File

@ -4,8 +4,7 @@
<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"
@ -13,59 +12,63 @@
: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 <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
</div> </div>
</template> </template>
<script> <script>
import { 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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -74,26 +77,26 @@ export default {
label: '指标名称', label: '指标名称',
selectOptions: [], selectOptions: [],
param: 'checkId', param: 'checkId',
filterable: true filterable: true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'datetimerange', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 350 width: 350,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '', type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
@ -103,8 +106,8 @@ export default {
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
@ -113,68 +116,68 @@ export default {
checkId: null, checkId: null,
checkType: 2, checkType: 2,
startTime: null, startTime: null,
endTime: null endTime: null,
}, },
tableProps, tableProps,
list: [], list: [],
total: 0, total: 0,
tableH: this.tableHeight(260) };
}
}, },
created() { created() {
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()
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.confirm('是否确认导出').then(() => { this.$modal
return environmentalCheckRecordExport({...this.queryParams}); .confirm('是否确认导出')
}).then(response => { .then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废气检测历史记录.xls'); this.$download.excel(response, '废气检测历史记录.xls');
}).catch(() => {}) })
.catch(() => {});
} }
}, },
getList() { getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => { environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
getSelectList() { getSelectList() {
environmentalCheckPage({ environmentalCheckPage({
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
checkType: 2 checkType: 2,
}).then(res => { }).then((res) => {
console.log(res) console.log(res);
this.formConfig[0].selectOptions = res.data.list || [] this.formConfig[0].selectOptions = res.data.list || [];
}) });
}, },
tableRowClassName({row, rowIndex}) { tableRowClassName({ row, rowIndex }) {
console.log(row) console.log(row);
if (row.markRed) { if (row.markRed) {
return 'warning-row' return 'warning-row';
}else { } else {
return '' return '';
} }
} },
} },
} };
</script> </script>
<style lang='scss'> <style lang='scss'>
.wasteGasHis { .wasteGasHis {

View File

@ -4,31 +4,27 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -36,55 +32,61 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width="60%">
> <waste-gas-add
<waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" /> ref="wasteGasAdd"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -92,13 +94,13 @@ export default {
type: 'input', type: 'input',
label: '指标名称', label: '指标名称',
placeholder: '指标名称', placeholder: '指标名称',
param: 'name' param: 'name',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '', type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
@ -108,98 +110,101 @@ export default {
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
checkType: 2, checkType: 2,
name: null name: null,
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:waste-gas:update') this.$auth.hasPermi('base:waste-gas:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:waste-gas:delete') this.$auth.hasPermi('base:waste-gas:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v)=>v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false centervisible: false,
} };
}, },
components: { WasteGasAdd }, components: { WasteGasAdd },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
environmentalCheckPage({...this.queryParams}).then(res => { environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val);
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams.name = val.name this.queryParams.name = val.name;
this.getList() this.getList();
} else { } else {
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.wasteGasAdd.init() this.$refs.wasteGasAdd.init();
}) });
} }
}, },
handleClick(val) { handleClick(val) {
console.log(val) console.log(val);
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑' this.addOrEditTitle = '编辑';
this.centervisible = true this.centervisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.wasteGasAdd.init(val.data.id) this.$refs.wasteGasAdd.init(val.data.id);
}) });
break break;
default: default:
this.handleDelete(val.data) this.handleDelete(val.data);
} }
}, },
// //
handleDelete(val) { handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { this.$modal
return environmentalCheckDelete({ id: val.id }) .confirm('是否确认删除"' + val.name + '"的数据项?')
}).then(() => { .then(function () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess('操作成功');
}).catch(() => {}); })
.catch(() => {});
}, },
// //
handleCancel() { handleCancel() {
this.$refs.wasteGasAdd.formClear() this.$refs.wasteGasAdd.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.wasteGasAdd.submitForm() this.$refs.wasteGasAdd.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
} },
} },
} };
</script> </script>

View File

@ -4,8 +4,7 @@
<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"
@ -13,59 +12,63 @@
: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 <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
</div> </div>
</template> </template>
<script> <script>
import { 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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -74,37 +77,39 @@ export default {
label: '指标名称', label: '指标名称',
selectOptions: [], selectOptions: [],
param: 'checkId', param: 'checkId',
filterable: true filterable: true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '检测时间', label: '检测时间',
dateType: 'datetimerange', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 350 width: 350,
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '', type: this.$auth.hasPermi('base:waste-water:export')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '', type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
@ -113,68 +118,68 @@ export default {
checkId: null, checkId: null,
checkType: 1, checkType: 1,
startTime: null, startTime: null,
endTime: null endTime: null,
}, },
tableProps, tableProps,
list: [], list: [],
total: 0, total: 0,
tableH: this.tableHeight(260) };
}
}, },
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()
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.confirm('是否确认导出').then(() => { this.$modal
return environmentalCheckRecordExport({...this.queryParams}); .confirm('是否确认导出')
}).then(response => { .then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废水检测历史记录.xls'); this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {}) })
.catch(() => {});
} }
}, },
getList() { getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => { environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [] this.list = res.data.list || [];
this.total = res.data.total || 0 this.total = res.data.total || 0;
}) });
}, },
getSelectList() { getSelectList() {
environmentalCheckPage({ environmentalCheckPage({
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
checkType: 1 checkType: 1,
}).then(res => { }).then((res) => {
console.log(res) console.log(res);
this.formConfig[0].selectOptions = res.data.list || [] this.formConfig[0].selectOptions = res.data.list || [];
}) });
}, },
tableRowClassName({row, rowIndex}) { tableRowClassName({ row, rowIndex }) {
console.log(row) console.log(row);
if (row.markRed) { if (row.markRed) {
return 'warning-row' return 'warning-row';
}else { } else {
return '' return '';
} }
} },
} },
} };
</script> </script>
<style lang='scss'> <style lang='scss'>
.wasteWaterHis { .wasteWaterHis {

View File

@ -4,31 +4,27 @@
<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 <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick" />
/>
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getList" @pagination="getList" />
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
@ -36,55 +32,61 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width="60%">
> <waste-water-add
<waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" /> ref="wasteWaterAdd"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </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',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -92,114 +94,119 @@ export default {
type: 'input', type: 'input',
label: '指标名称', label: '指标名称',
placeholder: '指标名称', placeholder: '指标名称',
param: 'name' param: 'name',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary' color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '', type: this.$auth.hasPermi('base:waste-water:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '', type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true,
} },
], ],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
checkType: 1, checkType: 1,
name: null name: null,
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:waste-water:update') this.$auth.hasPermi('base:waste-water:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:waste-water:delete') this.$auth.hasPermi('base:waste-water:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除',
} }
: undefined : undefined,
].filter((v)=>v), ].filter((v) => v),
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false centervisible: false,
} };
}, },
components: { WasteWaterAdd }, components: { WasteWaterAdd },
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.wasteWaterAdd.init() this.$refs.wasteWaterAdd.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.wasteWaterAdd.init(val.data.id) this.$refs.wasteWaterAdd.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 () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess('操作成功');
}).catch(() => {}); })
.catch(() => {});
}, },
// //
handleCancel() { handleCancel() {
this.$refs.wasteWaterAdd.formClear() this.$refs.wasteWaterAdd.formClear();
this.centervisible = false this.centervisible = false;
this.addOrEditTitle = '' this.addOrEditTitle = '';
}, },
handleConfirm() { handleConfirm() {
this.$refs.wasteWaterAdd.submitForm() this.$refs.wasteWaterAdd.submitForm();
}, },
successSubmit() { successSubmit() {
this.handleCancel() this.handleCancel();
this.getList() this.getList();
} },
} },
} };
</script> </script>