ljlong_2630 9 months ago
parent
commit
1240d7f1f0
  1. 6
      src/utils/dict.ts
  2. 13
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  3. 1
      src/views/eam/basic/deviceMaintenance/index.vue
  4. 14
      src/views/eam/basic/inspection/inspection.data.ts
  5. 59
      src/views/eam/basic/item/item.data.ts
  6. 188
      src/views/eam/basic/location/index.vue
  7. 6
      src/views/eam/basic/location/location.data.ts
  8. 12
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  9. 6
      src/views/eam/basic/supplier/supplier.data.ts

6
src/utils/dict.ts

@ -189,7 +189,8 @@ export enum DICT_TYPE {
ABC_CLASS = 'abc_class', // ABC类 ABC_CLASS = 'abc_class', // ABC类
TRUE_FALSE = 'true_false', // 是否 TRUE_FALSE = 'true_false', // 是否
ITEM_GROUP = 'item_group', // 物品分组 ITEM_GROUP = 'item_group', // 物品分组
ITEM_CATEGORY = 'Item_category', // 物品种类 ITEM_CATEGORY = 'item_category', // 物品种类
ITEM_REGION = 'item_region', // 物品区域
ITEM_COLOR = 'item_color', // 物品颜色 ITEM_COLOR = 'item_color', // 物品颜色
ITEM_CONFIGURATION = 'item_configuration', // 物品配置 ITEM_CONFIGURATION = 'item_configuration', // 物品配置
EQ_LEVEL = 'eq_level', // 质量等级 EQ_LEVEL = 'eq_level', // 质量等级
@ -298,7 +299,6 @@ export enum DICT_TYPE {
POWER_RANGE = 'power_range', //功率范围 POWER_RANGE = 'power_range', //功率范围
ADJUST_STATUS = 'adjust_status', //盘点调整状态 ADJUST_STATUS = 'adjust_status', //盘点调整状态
APP_DEVICE_MOLD_TYPE = 'app_device_mold_type', //设备/模具/工艺:类型 APP_DEVICE_MOLD_TYPE = 'app_device_mold_type', //设备/模具/工艺:类型
ITEM_SUBJECT = 'item_subject', //备件的科目
} }

13
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -21,6 +21,7 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
width: 180, width: 180,
fixed: 'left' fixed: 'left'
}, },
}, },
{ {
label: '名称', label: '名称',
@ -41,6 +42,11 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
componentProps: {
type: 'textarea',
}
}
}, },
{ {
label: '类型', label: '类型',
@ -84,6 +90,13 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: false,
isForm: false,
},
{ {
label: '项类型', label: '项类型',
field: 'status', field: 'status',

1
src/views/eam/basic/deviceMaintenance/index.vue

@ -42,6 +42,7 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:isCol="true"
:rules="DeviceMaintenanceRules" :rules="DeviceMaintenanceRules"
:formAllSchemas="DeviceMaintenance.allSchemas" :formAllSchemas="DeviceMaintenance.allSchemas"
:apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems" :apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems"

14
src/views/eam/basic/inspection/inspection.data.ts

@ -37,10 +37,15 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '保养内容', label: '巡检点检项',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
componentProps: {
type: 'textarea',
}
}
}, },
{ {
label: '类型', label: '类型',
@ -84,6 +89,13 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: false,
isForm: false,
},
{ {
label: '项类型', label: '项类型',
field: 'status', field: 'status',

59
src/views/eam/basic/item/item.data.ts

@ -35,7 +35,7 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
}, },
{ {
label: '是否储', label: '是否储',
field: 'isConstant', field: 'isConstant',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
@ -64,6 +64,12 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'subject', field: 'subject',
sort: 'custom', sort: 'custom',
}, },
{
label: '科目代码',
field: 'subjectCode',
sort: 'custom',
isTable: true,
},
{ {
label: '单位', label: '单位',
field: 'uom', field: 'uom',
@ -76,6 +82,18 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select' type: 'Select'
} }
}, },
{
label: '类别',
field: 'category',
sort: 'custom',
dictType: DICT_TYPE.ITEM_CATEGORY,
dictClass: 'string',
isSearch: false,
isTable: true,
tableForm: {
type: 'Select'
}
},
{ {
label: '备件分类', label: '备件分类',
field: 'classification', field: 'classification',
@ -88,13 +106,25 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select' type: 'Select'
} }
}, },
{
label: '区域',
field: 'region',
sort: 'custom',
dictType: DICT_TYPE.ITEM_REGION,
dictClass: 'string',
isSearch: false,
isTable: true,
tableForm: {
type: 'Select'
}
},
{ {
label: '单价', label: '单价',
field: 'singlePrice', field: 'singlePrice',
sort: 'custom', sort: 'custom',
}, },
{ {
label: '重点采购', label: '重采购',
field: 'reprocurement', field: 'reprocurement',
sort: 'custom', sort: 'custom',
table: { table: {
@ -163,6 +193,31 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '是否框架协议',
field: 'isFramework',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 140
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',

188
src/views/eam/basic/location/index.vue

@ -5,28 +5,15 @@
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
:HeadButttondata="HeadButttondata" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="Location.allSchemas" />
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Location.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total total: tableObject.total
}" }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:pageSize="tableObject.pageSize" v-model:sort="tableObject.sort">
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}"> <template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
@ -39,66 +26,68 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="basicFormRef" @success="formsSuccess" :rules="LocationRules" :formAllSchemas="Location.allSchemas"
ref="basicFormRef" :apiUpdate="LocationApi.updateLocation" :apiCreate="LocationApi.createLocation"
@success="formsSuccess" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
:rules="LocationRules"
:formAllSchemas="Location.allSchemas"
:apiUpdate="LocationApi.updateLocation"
:apiCreate="LocationApi.createLocation"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Location.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Location.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/location/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/eam/location/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Location,LocationRules } from './location.data' import { Location, LocationRules } from './location.data'
import * as LocationApi from '@/api/eam/basic/location' import * as LocationApi from '@/api/eam/basic/location'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Location' }) defineOptions({ name: 'Location' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(Location.allSchemas.tableColumns) const tableColumns = ref(Location.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
if (formField == 'areaNumber') {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['areaNumber'] = val[0]['number']
setV['type'] = val[0]['type']
formRef.setValues(setV) formRef.setValues(setV)
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
}) })
} }
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: LocationApi.getLocationPage // getListApi: LocationApi.getLocationPage //
}) })
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
@ -112,10 +101,10 @@ const HeadButttondata = [
// icon: 'Select', // icon: 'Select',
// color: '' // color: ''
// }, // },
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'export') { // } else if (val == 'export') { //
@ -126,42 +115,42 @@ const buttonBaseClick = (val, item) => {
} else { // } else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), // defaultButtons.mainListDeleteBtn(null), //
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =Location.allSchemas.formSchema.some(function (item) { var isHave = Location.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return;
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await LocationApi.createLocation(data) await LocationApi.createLocation(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -171,16 +160,16 @@ const formsSuccess = async (formType,data) => {
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicLocation') detailRef.value.openDetail(row, titleName, titleValue, 'basicLocation')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id : number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
@ -189,12 +178,12 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } catch { }
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) // const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
@ -206,20 +195,19 @@ const handleExport = async () => {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
} }
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
} }
getList() // getList() //
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
}) })
</script> </script>

6
src/views/eam/basic/location/location.data.ts

@ -5,6 +5,10 @@ import { LocationArea } from '../locationArea/locationArea.data'
// 表单校验 // 表单校验
export const LocationRules = reactive({ export const LocationRules = reactive({
number: [
{ required: true, message: '请输入库位编号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [ name: [
{ required: true, message: '请输入库位名称', trigger: 'blur' }, { required: true, message: '请输入库位名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
@ -21,7 +25,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: true,
table: { table: {
width: 180, width: 180,
fixed: 'left' fixed: 'left'

12
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -41,6 +41,11 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
componentProps: {
type: 'textarea',
}
}
}, },
{ {
label: '类型', label: '类型',
@ -84,6 +89,13 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '模具名称',
field: 'deviceName',
sort: 'custom',
isSearch: false,
isForm: false,
},
{ {
label: '项类型', label: '项类型',
field: 'status', field: 'status',

6
src/views/eam/basic/supplier/supplier.data.ts

@ -3,6 +3,10 @@ import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/va
// 表单校验 // 表单校验
export const SupplierRules = reactive({ export const SupplierRules = reactive({
number: [
{ required: true, message: '请输入供应商编号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [ name: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }, { required: true, message: '请输入供应商名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
@ -19,7 +23,7 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: true,
table: { table: {
width: 180, width: 180,
fixed: 'left' fixed: 'left'

Loading…
Cancel
Save