Browse Source

热轧108延伸机

master
songguoqiang 1 year ago
parent
commit
f07811a84d
  1. 24
      src/api/pszc/hrelongatordata108/index.ts
  2. 135
      src/views/pszc/hrelongatordata108/operationtimedata108/hrelongator108data.ts
  3. 238
      src/views/pszc/hrelongatordata108/operationtimedata108/index.vue
  4. 135
      src/views/pszc/hrelongatordata108/rollcountdata108/hrelongator108data.ts
  5. 228
      src/views/pszc/hrelongatordata108/rollcountdata108/index.vue
  6. 140
      src/views/pszc/hrelongatordata108/rolltimedata108/hrelongator108data.ts
  7. 238
      src/views/pszc/hrelongatordata108/rolltimedata108/index.vue

24
src/api/pszc/hrelongatordata108/index.ts

@ -9,7 +9,7 @@ export interface HrElongatordata108VO {
mname: string mname: string
} }
// 查询热轧108-延伸机列表 // 查询热轧108-延伸机钢针支数列表
export const getHrElongatordata108Page = async (params) => { export const getHrElongatordata108Page = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
@ -20,6 +20,28 @@ export const getHrElongatordata108Page = async (params) => {
} }
} }
// 查询热轧108-延伸机运行时间列表
export const getHrElongatordata108Page1 = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/pszc/hrelongatordata108/senior', data })
} else {
return await request.get({ url: `/pszc/hrelongatordata108/page1`, params })
}
}
// 查询热轧108-延伸机轧制时间列表
export const getHrElongatordata108Page2 = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/pszc/hrelongatordata108/senior', data })
} else {
return await request.get({ url: `/pszc/hrelongatordata108/page2`, params })
}
}
// 查询热轧108-延伸机详情 // 查询热轧108-延伸机详情
export const getHrElongatordata108 = async (id: number) => { export const getHrElongatordata108 = async (id: number) => {
return await request.get({ url: `/pszc/hrelongatordata108/get?id=` + id }) return await request.get({ url: `/pszc/hrelongatordata108/get?id=` + id })

135
src/views/pszc/hrelongatordata108/operationtimedata108/hrelongator108data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
import * as DictApi from '@/utils/dict'
// 数据点
//const sjdList = await PszcCommonApi.selectHr108Pros({flag: '3' , type: '1',module:'2'})
const sjdList1 = DictApi.getStrDictOptions(DICT_TYPE.pszc_hr_puncherdata108);
const sjdList = DictApi.getStrDictOptions(DICT_TYPE.pszc_hr_puncherdata108_operation);
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr108Pros({flag: '4' , type: '2'})//延伸机
// 表单校验
export const HrPuncherdata108Rules = reactive({
})
export const HrPuncherdata108 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList1.find((obj) => obj.value === cellValue)?.label
// },
// dictType: DICT_TYPE.pszc_hr_puncherdata108,
search: {
show: true,
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
},
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
// formatter: (row,column, cellValue) => {
// const hourTime = parseInt(time.slice(0,2));
// const minuteTime = parseInt(time.slice(3,5));
// const secondTime = parseInt(time.slice(6,8));
// return hourTime*3600+minuteTime*60+secondTime;
// },
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '结束时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
}
// ,
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

238
src/views/pszc/hrelongatordata108/operationtimedata108/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata108.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata108.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #iname="{row}">
<el-button :type="row.icode == 'Down_Roller_runtime' || row.icode == 'Up_Roller_runtime' ? 'success' : 'warning'" link>
<span>{{ row.iname}}</span>
</el-button>
</template>
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="HrPuncherdata108Rules"
:formAllSchemas="HrPuncherdata108.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrElongatorData108Api.updateHrPuncherdata108"
:apiCreate="HrElongatorData108Api.createHrPuncherdata108"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata108,HrPuncherdata108Rules } from './hrelongator108data.ts'
import * as HrElongatorData108Api from '@/api/pszc/hrelongatordata108'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'YnShenJiOperaData108' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata108.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: HrElongatorData108Api.getHrElongatordata108Page1 //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrElongatorData108Api.deleteHrElongatordata108(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await HrElongatorData108Api.exportHrElongatordata108(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>

135
src/views/pszc/hrelongatordata108/rollcountdata108/hrelongator108data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
// 数据点
const sjdList = await PszcCommonApi.selectHr108Pros({flag: '4' , type: '1'})
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr108Pros({flag: '4' , type: '2'})
// 表单校验
export const HrPuncherdata108Rules = reactive({
})
export const HrPuncherdata108 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList.find((obj) => obj.code === cellValue)?.label
// },
// search: {
// show: true,
// component: 'Select',
// api: () => sjdList,
// componentProps: {
// optionsAlias: {
// labelField: 'label',
// valueField: 'code'
// }
// }
// },
form: {
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '结束时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
}
// ,
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

228
src/views/pszc/hrelongatordata108/rollcountdata108/index.vue

@ -0,0 +1,228 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata108.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata108.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="HrPuncherdata108Rules"
:formAllSchemas="HrPuncherdata108.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrElongatorData108Api.updateHrPuncherdata108"
:apiCreate="HrElongatorData108Api.createHrPuncherdata108"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata108,HrPuncherdata108Rules } from './hrelongator108data.ts'
import * as HrElongatorData108Api from '@/api/pszc/hrelongatordata108'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'YnShenJiCountData108' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata108.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: HrElongatorData108Api.getHrElongatordata108Page //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrElongatorData108Api.deleteHrElongatordata108(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await HrElongatorData108Api.exportHrElongatordata108(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>

140
src/views/pszc/hrelongatordata108/rolltimedata108/hrelongator108data.ts

@ -0,0 +1,140 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
import * as DictApi from '@/utils/dict'
import { number } from 'echarts'
// 数据点
// const sjdList = await PszcCommonApi.selectHr108Pros({flag: '3' , type: '1',module:'2'})
const sjdList = DictApi.getStrDictOptions(DICT_TYPE.pszc_hr_puncherdata108_roll);
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr108Pros({flag: '3' , type: '2'})
// 表单校验
export const HrPuncherdata108Rules = reactive({
})
export const HrPuncherdata108 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList.find((obj) => obj.value === cellValue)?.label
// },
search: {
show: true,
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
},
form: {
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
formatter: (row,column,cellValue) => {
return cellValue+"秒"
},
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '结束时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
}
// ,
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

238
src/views/pszc/hrelongatordata108/rolltimedata108/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata108.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata108.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<!-- <template #iname="{row}">
<el-button :type="row.icode == 'Down_Roller_runtime' || row.icode == 'Up_Roller_runtime' ? 'success' : 'warning'" link>
<span>{{ row.iname}}</span>
</el-button>
</template>
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template> -->
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="HrPuncherdata108Rules"
:formAllSchemas="HrPuncherdata108.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrElongatorData108Api.updateHrPuncherdata108"
:apiCreate="HrElongatorData108Api.createHrPuncherdata108"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata108,HrPuncherdata108Rules } from './hrelongator108data.ts'
import * as HrElongatorData108Api from '@/api/pszc/hrelongatordata108'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'YnShenJiRollData108' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata108.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: HrElongatorData108Api.getHrElongatordata108Page2 //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrElongatorData108Api.deleteHrElongatordata108(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await HrElongatorData108Api.exportHrElongatordata108(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>
Loading…
Cancel
Save