|
|
|
|
@ -4,21 +4,21 @@
|
|
|
|
|
:leave-active-class='proxy?.animate.searchAnimate.leave'>
|
|
|
|
|
<div v-show='showSearch' class='mb-[10px]'>
|
|
|
|
|
<el-card shadow='hover'>
|
|
|
|
|
<el-form ref='queryFormRef' :model='queryParams' :inline='true'>
|
|
|
|
|
<el-form-item label='工厂编号' prop='factoryCode'>
|
|
|
|
|
<el-input v-model='queryParams.factoryCode' placeholder='请输入工厂编号' clearable @keyup.enter='handleQuery' />
|
|
|
|
|
<el-form ref='queryFormRef' :model='queryParams' :inline='true' label-width='120px'>
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryCode')" prop='factoryCode'>
|
|
|
|
|
<el-input v-model='queryParams.factoryCode' :placeholder="$t('baseFactoryInfo.placeholder.factoryCode')" clearable @keyup.enter='handleQuery' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工厂名称' prop='factoryName'>
|
|
|
|
|
<el-input v-model='queryParams.factoryName' placeholder='请输入工厂名称' clearable @keyup.enter='handleQuery' />
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryName')" prop='factoryName'>
|
|
|
|
|
<el-input v-model='queryParams.factoryName' :placeholder="$t('baseFactoryInfo.placeholder.factoryName')" clearable @keyup.enter='handleQuery' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工厂状态' prop='factoryStatus'>
|
|
|
|
|
<el-select v-model='queryParams.factoryStatus' placeholder='请选择工厂状态' clearable>
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryStatus')" prop='factoryStatus'>
|
|
|
|
|
<el-select v-model='queryParams.factoryStatus' :placeholder="$t('baseFactoryInfo.placeholder.factoryStatus')" clearable>
|
|
|
|
|
<el-option v-for='dict in enable_status' :key='dict.value' :label='dict.label' :value='dict.value' />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type='primary' icon='Search' @click='handleQuery'>搜索</el-button>
|
|
|
|
|
<el-button icon='Refresh' @click='resetQuery'>重置</el-button>
|
|
|
|
|
<el-button type='primary' icon='Search' @click='handleQuery'>{{ $t('baseFactoryInfo.search') }}</el-button>
|
|
|
|
|
<el-button icon='Refresh' @click='resetQuery'>{{ $t('baseFactoryInfo.reset') }}</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
@ -29,22 +29,22 @@
|
|
|
|
|
<template #header>
|
|
|
|
|
<el-row :gutter='10' class='mb8'>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='primary' plain icon='Plus' @click='handleAdd' v-hasPermi="['mes:baseFactoryInfo:add']">新增
|
|
|
|
|
<el-button type='primary' plain icon='Plus' @click='handleAdd' v-hasPermi="['mes:baseFactoryInfo:add']">{{ $t('baseFactoryInfo.add') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='success' plain icon='Edit' :disabled='single' @click='handleUpdate()'
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:edit']">修改
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:edit']">{{ $t('baseFactoryInfo.edit') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='danger' plain icon='Delete' :disabled='multiple' @click='handleDelete()'
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:remove']">删除
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:remove']">{{ $t('baseFactoryInfo.delete') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='warning' plain icon='Download' @click='handleExport'
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:export']">导出
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:export']">{{ $t('baseFactoryInfo.export') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar v-model:showSearch='showSearch' :columns='columns' :search='true'
|
|
|
|
|
@ -54,37 +54,37 @@
|
|
|
|
|
|
|
|
|
|
<el-table v-loading='loading' :data='baseFactoryInfoList' @selection-change='handleSelectionChange'>
|
|
|
|
|
<el-table-column type='selection' width='55' align='center' />
|
|
|
|
|
<el-table-column label='主键标识' align='center' prop='factoryId' v-if='columns[0].visible' />
|
|
|
|
|
<el-table-column label='租户编号' align='center' prop='tenantId' v-if='columns[1].visible' />
|
|
|
|
|
<el-table-column label='公司名称' align='center' prop='companyName' v-if='columns[2].visible' />
|
|
|
|
|
<el-table-column label='工厂编号' align='center' prop='factoryCode' v-if='columns[3].visible' />
|
|
|
|
|
<el-table-column label='工厂名称' align='center' prop='factoryName' v-if='columns[4].visible' />
|
|
|
|
|
<el-table-column label='时区' align='center' prop='timeZone' v-if='columns[5].visible' />
|
|
|
|
|
<el-table-column label='工厂状态' align='center' prop='factoryStatus' v-if='columns[6].visible'>
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.factoryId')" align='center' prop='factoryId' v-if='columns[0].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.tenantId')" align='center' prop='tenantId' v-if='columns[1].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.companyName')" align='center' prop='companyName' v-if='columns[2].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.factoryCode')" align='center' prop='factoryCode' v-if='columns[3].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.factoryName')" align='center' prop='factoryName' v-if='columns[4].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.timeZone')" align='center' prop='timeZone' v-if='columns[5].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.factoryStatus')" align='center' prop='factoryStatus' v-if='columns[6].visible'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='enable_status' :value='scope.row.factoryStatus' />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='备注' align='center' prop='remark' v-if='columns[7].visible' />
|
|
|
|
|
<el-table-column label='创建人' align='center' prop='createBy' v-if='columns[8].visible' />
|
|
|
|
|
<el-table-column label='创建时间' align='center' prop='createTime' width='180' v-if='columns[9].visible'>
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.remark')" align='center' prop='remark' v-if='columns[7].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.createBy')" align='center' prop='createBy' v-if='columns[8].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.createTime')" align='center' prop='createTime' width='180' v-if='columns[9].visible'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='更新人' align='center' prop='updateBy' v-if='columns[10].visible' />
|
|
|
|
|
<el-table-column label='更新时间' align='center' prop='updateTime' width='180' v-if='columns[11].visible'>
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.updateBy')" align='center' prop='updateBy' v-if='columns[10].visible' />
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.updateTime')" align='center' prop='updateTime' width='180' v-if='columns[11].visible'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='操作' align='center' class-name='small-padding fixed-width'>
|
|
|
|
|
<el-table-column :label="$t('baseFactoryInfo.operation')" align='center' class-name='small-padding fixed-width'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<el-tooltip content='修改' placement='top'>
|
|
|
|
|
<el-tooltip :content="$t('baseFactoryInfo.edit')" placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Edit' @click='handleUpdate(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content='删除' placement='top'>
|
|
|
|
|
<el-tooltip :content="$t('baseFactoryInfo.delete')" placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseFactoryInfo:remove']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
@ -98,17 +98,17 @@
|
|
|
|
|
<!-- 添加或修改工厂信息对话框 -->
|
|
|
|
|
<el-dialog :title='dialog.title' v-model='dialog.visible' width='500px' append-to-body>
|
|
|
|
|
<el-form ref='baseFactoryInfoFormRef' :model='form' :rules='rules' label-width='80px'>
|
|
|
|
|
<el-form-item label='公司名称' prop='companyName'>
|
|
|
|
|
<el-input v-model='form.companyName' placeholder='请输入公司名称' />
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.companyName')" prop='companyName'>
|
|
|
|
|
<el-input v-model='form.companyName' :placeholder="$t('baseFactoryInfo.placeholder.companyName')" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工厂编号' prop='factoryCode'>
|
|
|
|
|
<el-input v-model='form.factoryCode' placeholder='请输入工厂编号' />
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryCode')" prop='factoryCode'>
|
|
|
|
|
<el-input v-model='form.factoryCode' :placeholder="$t('baseFactoryInfo.placeholder.factoryCode')" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工厂名称' prop='factoryName'>
|
|
|
|
|
<el-input v-model='form.factoryName' placeholder='请输入工厂名称' />
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryName')" prop='factoryName'>
|
|
|
|
|
<el-input v-model='form.factoryName' :placeholder="$t('baseFactoryInfo.placeholder.factoryName')" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='时区' prop='timeZone'>
|
|
|
|
|
<el-select v-model='form.timeZone' placeholder='请选择时区'>
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.timeZone')" prop='timeZone'>
|
|
|
|
|
<el-select v-model='form.timeZone' :placeholder="$t('baseFactoryInfo.placeholder.timeZone')">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='(timeZone, index) in timeZones'
|
|
|
|
|
:key='index'
|
|
|
|
|
@ -117,7 +117,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工厂状态' prop='factoryStatus'>
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.factoryStatus')" prop='factoryStatus'>
|
|
|
|
|
<el-radio-group v-model='form.factoryStatus'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in enable_status'
|
|
|
|
|
@ -127,14 +127,14 @@
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='备注' prop='remark'>
|
|
|
|
|
<el-input v-model='form.remark' placeholder='请输入备注' />
|
|
|
|
|
<el-form-item :label="$t('baseFactoryInfo.remark')" prop='remark'>
|
|
|
|
|
<el-input v-model='form.remark' :placeholder="$t('baseFactoryInfo.placeholder.remark')" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class='dialog-footer'>
|
|
|
|
|
<el-button :loading='buttonLoading' type='primary' @click='submitForm'>确 定</el-button>
|
|
|
|
|
<el-button @click='cancel'>取 消</el-button>
|
|
|
|
|
<el-button :loading='buttonLoading' type='primary' @click='submitForm'>{{ $t('baseFactoryInfo.confirm') }}</el-button>
|
|
|
|
|
<el-button @click='cancel'>{{ $t('baseFactoryInfo.cancel') }}</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
@ -150,9 +150,11 @@ import {
|
|
|
|
|
updateBaseFactoryInfo
|
|
|
|
|
} from '@/api/mes/baseFactoryInfo';
|
|
|
|
|
import { BaseFactoryInfoVO, BaseFactoryInfoQuery, BaseFactoryInfoForm } from '@/api/mes/baseFactoryInfo/types';
|
|
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { enable_status } = toRefs<any>(proxy?.useDict('enable_status'));
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
|
|
const baseFactoryInfoList = ref<BaseFactoryInfoVO[]>([]);
|
|
|
|
|
const buttonLoading = ref(false);
|
|
|
|
|
@ -172,19 +174,19 @@ const dialog = reactive<DialogOption>({
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 列显隐信息
|
|
|
|
|
const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 0, label: `主键标识`, visible: false },
|
|
|
|
|
{ key: 1, label: `租户编号`, visible: false },
|
|
|
|
|
{ key: 2, label: `公司名称`, visible: true },
|
|
|
|
|
{ key: 3, label: `工厂编号`, visible: true },
|
|
|
|
|
{ key: 4, label: `工厂名称`, visible: true },
|
|
|
|
|
{ key: 5, label: `时区`, visible: true },
|
|
|
|
|
{ key: 6, label: `工厂状态`, visible: true },
|
|
|
|
|
{ key: 7, label: `备注`, visible: true },
|
|
|
|
|
{ key: 8, label: `创建人`, visible: false },
|
|
|
|
|
{ key: 9, label: `创建时间`, visible: true },
|
|
|
|
|
{ key: 10, label: `更新人`, visible: false },
|
|
|
|
|
{ key: 11, label: `更新时间`, visible: false }
|
|
|
|
|
const columns = computed<FieldOption[]>(() => [
|
|
|
|
|
{ key: 0, label: t('baseFactoryInfo.factoryId'), visible: false },
|
|
|
|
|
{ key: 1, label: t('baseFactoryInfo.tenantId'), visible: false },
|
|
|
|
|
{ key: 2, label: t('baseFactoryInfo.companyName'), visible: true },
|
|
|
|
|
{ key: 3, label: t('baseFactoryInfo.factoryCode'), visible: true },
|
|
|
|
|
{ key: 4, label: t('baseFactoryInfo.factoryName'), visible: true },
|
|
|
|
|
{ key: 5, label: t('baseFactoryInfo.timeZone'), visible: true },
|
|
|
|
|
{ key: 6, label: t('baseFactoryInfo.factoryStatus'), visible: true },
|
|
|
|
|
{ key: 7, label: t('baseFactoryInfo.remark'), visible: true },
|
|
|
|
|
{ key: 8, label: t('baseFactoryInfo.createBy'), visible: false },
|
|
|
|
|
{ key: 9, label: t('baseFactoryInfo.createTime'), visible: true },
|
|
|
|
|
{ key: 10, label: t('baseFactoryInfo.updateBy'), visible: false },
|
|
|
|
|
{ key: 11, label: t('baseFactoryInfo.updateTime'), visible: false }
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const initFormData: BaseFactoryInfoForm = {
|
|
|
|
|
@ -212,6 +214,27 @@ const timeZones = [
|
|
|
|
|
'Europe/Berlin'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const getRules = () => ({
|
|
|
|
|
factoryId: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.factoryIdRequired'), trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
companyName: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.companyNameRequired'), trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryCode: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.factoryCodeRequired'), trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryName: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.factoryNameRequired'), trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
timeZone: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.timeZoneRequired'), trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryStatus: [
|
|
|
|
|
{ required: true, message: t('baseFactoryInfo.validation.factoryStatusRequired'), trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const data = reactive<PageData<BaseFactoryInfoForm, BaseFactoryInfoQuery>>({
|
|
|
|
|
form: { ...initFormData },
|
|
|
|
|
queryParams: {
|
|
|
|
|
@ -231,29 +254,12 @@ const data = reactive<PageData<BaseFactoryInfoForm, BaseFactoryInfoQuery>>({
|
|
|
|
|
updateTime: undefined,
|
|
|
|
|
params: {}
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
factoryId: [
|
|
|
|
|
{ required: true, message: '主键标识不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
companyName: [
|
|
|
|
|
{ required: true, message: '公司名称不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryCode: [
|
|
|
|
|
{ required: true, message: '工厂编号不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryName: [
|
|
|
|
|
{ required: true, message: '工厂名称不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
timeZone: [
|
|
|
|
|
{ required: true, message: '时区不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
factoryStatus: [
|
|
|
|
|
{ required: true, message: '工厂状态不能为空', trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
rules: getRules()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
const rules = computed(() => getRules());
|
|
|
|
|
|
|
|
|
|
const { queryParams, form } = toRefs(data);
|
|
|
|
|
|
|
|
|
|
/** 查询工厂信息列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -299,7 +305,7 @@ const handleSelectionChange = (selection: BaseFactoryInfoVO[]) => {
|
|
|
|
|
const handleAdd = () => {
|
|
|
|
|
reset();
|
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = '添加工厂信息';
|
|
|
|
|
dialog.title = t('baseFactoryInfo.dialog.add');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
@ -309,7 +315,7 @@ const handleUpdate = async (row?: BaseFactoryInfoVO) => {
|
|
|
|
|
const res = await getBaseFactoryInfo(_factoryId);
|
|
|
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = '修改工厂信息';
|
|
|
|
|
dialog.title = t('baseFactoryInfo.dialog.edit');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
@ -322,7 +328,7 @@ const submitForm = () => {
|
|
|
|
|
} else {
|
|
|
|
|
await addBaseFactoryInfo(form.value).finally(() => buttonLoading.value = false);
|
|
|
|
|
}
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
proxy?.$modal.msgSuccess(t('baseFactoryInfo.message.success'));
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
await getList();
|
|
|
|
|
}
|
|
|
|
|
@ -332,9 +338,9 @@ const submitForm = () => {
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = async (row?: BaseFactoryInfoVO) => {
|
|
|
|
|
const _factoryIds = row?.factoryId || ids.value;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除工厂信息编号为"' + _factoryIds + '"的数据项?').finally(() => loading.value = false);
|
|
|
|
|
await proxy?.$modal.confirm(t('baseFactoryInfo.message.deleteConfirm', { ids: _factoryIds })).finally(() => loading.value = false);
|
|
|
|
|
await delBaseFactoryInfo(_factoryIds);
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
proxy?.$modal.msgSuccess(t('baseFactoryInfo.message.deleteSuccess'));
|
|
|
|
|
await getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|