Browse Source

模次同步代码

master
ljlong_2630 1 month ago
parent
commit
ecd50f2260
  1. 53
      src/api/eam/basic/applicantInfoConfig/index.ts
  2. 63
      src/api/eam/basic/infoPushRecordDetail/index.ts
  3. 55
      src/api/eam/basic/infoPushRecordMain/index.ts
  4. 59
      src/api/eam/mold/cycleDataSync/index.ts
  5. 2
      src/config/axios/config.ts
  6. 3
      src/locales/en-US.ts
  7. 3
      src/locales/zh-CN.ts
  8. 2
      src/utils/dict.ts
  9. 13
      src/utils/disposition/defaultButtons.ts
  10. 74
      src/views/eam/basic/applicantInfoConfig/applicantInfoConfig.data.ts
  11. 244
      src/views/eam/basic/applicantInfoConfig/index.vue
  12. 244
      src/views/eam/basic/infoPushRecordDetail/index.vue
  13. 137
      src/views/eam/basic/infoPushRecordDetail/infoPushRecordDetail.data.ts
  14. 244
      src/views/eam/basic/infoPushRecordMain/index.vue
  15. 66
      src/views/eam/basic/infoPushRecordMain/infoPushRecordMain.data.ts
  16. 145
      src/views/eam/mold/cycleDataSync/cycleDataSync.data.ts
  17. 253
      src/views/eam/mold/cycleDataSync/index.vue
  18. 13
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts

53
src/api/eam/basic/applicantInfoConfig/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface ApplicantInfoConfigVO {
id: number
applicant: string
employeeNumber: string
phone: string
describes: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询申请人信息配置列表
export const getApplicantInfoConfigPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basic/applicant-info-config/senior', data })
} else {
return await request.get({ url: `/basic/applicant-info-config/page`, params })
}
}
// 查询申请人信息配置详情
export const getApplicantInfoConfig = async (id: number) => {
return await request.get({ url: `/basic/applicant-info-config/get?id=` + id })
}
// 新增申请人信息配置
export const createApplicantInfoConfig = async (data: ApplicantInfoConfigVO) => {
return await request.post({ url: `/basic/applicant-info-config/create`, data })
}
// 修改申请人信息配置
export const updateApplicantInfoConfig = async (data: ApplicantInfoConfigVO) => {
return await request.put({ url: `/basic/applicant-info-config/update`, data })
}
// 删除申请人信息配置
export const deleteApplicantInfoConfig = async (id: number) => {
return await request.delete({ url: `/basic/applicant-info-config/delete?id=` + id })
}
// 导出申请人信息配置 Excel
export const exportApplicantInfoConfig = async (params) => {
return await request.download({ url: `/basic/applicant-info-config/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/basic/applicant-info-config/get-import-template' })
}

63
src/api/eam/basic/infoPushRecordDetail/index.ts

@ -0,0 +1,63 @@
import request from '@/config/axios'
export interface InfoPushRecordDetailVO {
id: number
masterId: number
mc: string
wlh: string
ggxh: string
sl: number
dw: string
ckdj: number
zj: number
kcs: number
financer: string
subjectCode: string
purchaser: string
costCenter: string
purpose: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询物料信息推送记录子列表
export const getInfoPushRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basic/info-push-record-detail/senior', data })
} else {
return await request.get({ url: `/basic/info-push-record-detail/page`, params })
}
}
// 查询物料信息推送记录子详情
export const getInfoPushRecordDetail = async (id: number) => {
return await request.get({ url: `/basic/info-push-record-detail/get?id=` + id })
}
// 新增物料信息推送记录子
export const createInfoPushRecordDetail = async (data: InfoPushRecordDetailVO) => {
return await request.post({ url: `/basic/info-push-record-detail/create`, data })
}
// 修改物料信息推送记录子
export const updateInfoPushRecordDetail = async (data: InfoPushRecordDetailVO) => {
return await request.put({ url: `/basic/info-push-record-detail/update`, data })
}
// 删除物料信息推送记录子
export const deleteInfoPushRecordDetail = async (id: number) => {
return await request.delete({ url: `/basic/info-push-record-detail/delete?id=` + id })
}
// 导出物料信息推送记录子 Excel
export const exportInfoPushRecordDetail = async (params) => {
return await request.download({ url: `/basic/info-push-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/basic/info-push-record-detail/get-import-template' })
}

55
src/api/eam/basic/infoPushRecordMain/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface InfoPushRecordMainVO {
id: number
sqr: string
shdd: string
yqdhsj: string
lxdh: string
hjje: number
describes: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询物料信息推送记录主列表
export const getInfoPushRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basic/info-push-record-main/senior', data })
} else {
return await request.get({ url: `/basic/info-push-record-main/page`, params })
}
}
// 查询物料信息推送记录主详情
export const getInfoPushRecordMain = async (id: number) => {
return await request.get({ url: `/basic/info-push-record-main/get?id=` + id })
}
// 新增物料信息推送记录主
export const createInfoPushRecordMain = async (data: InfoPushRecordMainVO) => {
return await request.post({ url: `/basic/info-push-record-main/create`, data })
}
// 修改物料信息推送记录主
export const updateInfoPushRecordMain = async (data: InfoPushRecordMainVO) => {
return await request.put({ url: `/basic/info-push-record-main/update`, data })
}
// 删除物料信息推送记录主
export const deleteInfoPushRecordMain = async (id: number) => {
return await request.delete({ url: `/basic/info-push-record-main/delete?id=` + id })
}
// 导出物料信息推送记录主 Excel
export const exportInfoPushRecordMain = async (params) => {
return await request.download({ url: `/basic/info-push-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/basic/info-push-record-main/get-import-template' })
}

59
src/api/eam/mold/cycleDataSync/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface CycleDataSyncVO {
id: number
planCode: string
planDate: localdate
seq: number
planQty: number
configure: string
siteId: string
available: string
concurrencyStamp: number
deptId: number
}
// 查询模次数据同步列表
export const getCycleDataSyncPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/cycle-data-sync/senior', data })
} else {
return await request.get({ url: `/eam/cycle-data-sync/page`, params })
}
}
// 查询模次数据同步详情
export const getCycleDataSync = async (id: number) => {
return await request.get({ url: `/eam/cycle-data-sync/get?id=` + id })
}
// 新增模次数据同步
export const createCycleDataSync = async (data: CycleDataSyncVO) => {
return await request.post({ url: `/eam/cycle-data-sync/create`, data })
}
// 修改模次数据同步
export const updateCycleDataSync = async (data: CycleDataSyncVO) => {
return await request.put({ url: `/eam/cycle-data-sync/update`, data })
}
// 删除模次数据同步
export const deleteCycleDataSync = async (id: number) => {
return await request.delete({ url: `/eam/cycle-data-sync/delete?id=` + id })
}
// 导出模次数据同步 Excel
export const exportCycleDataSync = async (params) => {
return await request.download({ url: `/eam/cycle-data-sync/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/cycle-data-sync/get-import-template' })
}
export const retryCycleDataSync = () => {
return request.post({ url: '/eam/mold-accounts/retryCycleDataSync'})
}

2
src/config/axios/config.ts

@ -16,7 +16,7 @@ const config: {
/** /**
* *
*/ */
request_timeout: 30000, request_timeout: 300000,
/** /**
* *

3
src/locales/en-US.ts

@ -67,7 +67,8 @@ export default {
confirmRefused: 'Confirm Refused?', confirmRefused: 'Confirm Refused?',
confirmHandle: 'Confirm Handle?', confirmHandle: 'Confirm Handle?',
confirmSubmit: 'Confirm Submit?', confirmSubmit: 'Confirm Submit?',
finishSuccess:'success' finishSuccess: 'success',
retrySuccess: 'retry success',
}, },
error: { error: {
noPermission: `Sorry, you don't have permission to access this page.`, noPermission: `Sorry, you don't have permission to access this page.`,

3
src/locales/zh-CN.ts

@ -68,7 +68,8 @@ export default {
confirmHandle: '确认处理吗?', confirmHandle: '确认处理吗?',
confirmSubmit: '确认提交吗?', confirmSubmit: '确认提交吗?',
finishSuccess: '操作成功', finishSuccess: '操作成功',
verifySuccess: '验证成功' verifySuccess: '验证成功',
retrySuccess: '重试成功',
}, },
error: { error: {
noPermission: `抱歉,您无权访问此页面。`, noPermission: `抱歉,您无权访问此页面。`,

2
src/utils/dict.ts

@ -311,5 +311,7 @@ export enum DICT_TYPE {
ORDER_SOURCE_TYPE = 'order_source_type', //工单来源类型 ORDER_SOURCE_TYPE = 'order_source_type', //工单来源类型
CENTER_SUBJECT_MAP_DEPT = 'center_subject_map_dept',//成本中心科目对照部门 CENTER_SUBJECT_MAP_DEPT = 'center_subject_map_dept',//成本中心科目对照部门
ITEM_OUT_IN_TYPE = 'item_out_in_type',//备件出入库类型 ITEM_OUT_IN_TYPE = 'item_out_in_type',//备件出入库类型
PUSH_STATUS = 'push_status',//推送状态
MOLD_TIME_SYNC_STATUS = 'mold_time_sync_status',//模具时间同步状态
} }

13
src/utils/disposition/defaultButtons.ts

@ -1078,6 +1078,19 @@ export function orderPrintBtn(option:any) {
}) })
} }
// 工单-打印
export function retryBtn(option:any) {
return __defaultBtnOption(option,{
label: '批量重试',
name: 'retry',
hide: false,
type: 'primary',
color: '',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){

74
src/views/eam/basic/applicantInfoConfig/applicantInfoConfig.data.ts

@ -0,0 +1,74 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ApplicantInfoConfigRules = reactive({
applicant: [required],
employeeNumber: [required],
phone: [required],
concurrencyStamp: [required]
})
export const ApplicantInfoConfig = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请人',
field: 'applicant',
sort: 'custom',
isSearch: true
},
{
label: '工号',
field: 'employeeNumber',
sort: 'custom',
isSearch: true
},
{
label: '电话',
field: 'phone',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'describes',
sort: 'custom',
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
// {
// 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: 'available',
// sort: 'custom',
// isForm: true,
// isSearch: true
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/basic/applicantInfoConfig/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ApplicantInfoConfig.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ApplicantInfoConfig.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="formsSuccess"
:rules="ApplicantInfoConfigRules"
:formAllSchemas="ApplicantInfoConfig.allSchemas"
:apiUpdate="ApplicantInfoConfigApi.updateApplicantInfoConfig"
:apiCreate="ApplicantInfoConfigApi.createApplicantInfoConfig"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApplicantInfoConfig.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/applicant-info-config/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ApplicantInfoConfig,ApplicantInfoConfigRules } from './applicantInfoConfig.data'
import * as ApplicantInfoConfigApi from '@/api/eam/basic/applicantInfoConfig'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ApplicantInfoConfig' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ApplicantInfoConfig.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ApplicantInfoConfigApi.getApplicantInfoConfigPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:applicant-info-config:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'basic:applicant-info-config:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'basic:applicant-info-config:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'basic:applicant-info-config:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'basic:applicant-info-config: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)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ApplicantInfoConfig.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await ApplicantInfoConfigApi.createApplicantInfoConfig(data)
message.success(t('common.createSuccess'))
} else {
await ApplicantInfoConfigApi.updateApplicantInfoConfig(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicantInfoConfig')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ApplicantInfoConfigApi.deleteApplicantInfoConfig(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 ApplicantInfoConfigApi.exportApplicantInfoConfig(tableObject.params)
download.excel(data, '申请人信息配置.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '申请人信息配置导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ApplicantInfoConfigApi.importTemplate()
})
</script>

244
src/views/eam/basic/infoPushRecordDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InfoPushRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InfoPushRecordDetail.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="formsSuccess"
:rules="InfoPushRecordDetailRules"
:formAllSchemas="InfoPushRecordDetail.allSchemas"
:apiUpdate="InfoPushRecordDetailApi.updateInfoPushRecordDetail"
:apiCreate="InfoPushRecordDetailApi.createInfoPushRecordDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InfoPushRecordDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/info-push-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InfoPushRecordDetail,InfoPushRecordDetailRules } from './infoPushRecordDetail.data'
import * as InfoPushRecordDetailApi from '@/api/eam/basic/infoPushRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'InfoPushRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InfoPushRecordDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: InfoPushRecordDetailApi.getInfoPushRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:info-push-record-detail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'basic:info-push-record-detail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'basic:info-push-record-detail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'basic:info-push-record-detail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'basic:info-push-record-detail: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)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =InfoPushRecordDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await InfoPushRecordDetailApi.createInfoPushRecordDetail(data)
message.success(t('common.createSuccess'))
} else {
await InfoPushRecordDetailApi.updateInfoPushRecordDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInfoPushRecordDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await InfoPushRecordDetailApi.deleteInfoPushRecordDetail(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 InfoPushRecordDetailApi.exportInfoPushRecordDetail(tableObject.params)
download.excel(data, '物料信息推送记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '物料信息推送记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await InfoPushRecordDetailApi.importTemplate()
})
</script>

137
src/views/eam/basic/infoPushRecordDetail/infoPushRecordDetail.data.ts

@ -0,0 +1,137 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InfoPushRecordDetailRules = reactive({
masterId: [required],
mc: [required],
wlh: [required],
concurrencyStamp: [required]
})
export const InfoPushRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '名称',
field: 'mc',
sort: 'custom',
table: {
width:150
},
isSearch: true
},
{
label: '物料号',
field: 'wlh',
sort: 'custom',
table: {
width:150
},
isSearch: true
},
{
label: '规格型号',
field: 'ggxh',
sort: 'custom',
table: {
width:150
},
isSearch: true
},
{
label: '数量',
field: 'sl',
sort: 'custom',
isSearch: false
},
{
label: '单位',
field: 'dw',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '申请单价',
field: 'ckdj',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '行总价',
field: 'zj',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '库存数',
field: 'kcs',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '财务控制员',
field: 'financer',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '科目代码',
field: 'subjectCode',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '采购员',
field: 'purchaser',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '成本中心',
field: 'costCenter',
sort: 'custom',
table: {
width:150
},
isSearch: true
},
{
label: '用途',
field: 'purpose',
sort: 'custom',
table: {
width:150
},
isSearch: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/basic/infoPushRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InfoPushRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InfoPushRecordMain.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="formsSuccess"
:rules="InfoPushRecordMainRules"
:formAllSchemas="InfoPushRecordMain.allSchemas"
:apiUpdate="InfoPushRecordMainApi.updateInfoPushRecordMain"
:apiCreate="InfoPushRecordMainApi.createInfoPushRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InfoPushRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/info-push-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InfoPushRecordMain,InfoPushRecordMainRules } from './infoPushRecordMain.data'
import * as InfoPushRecordMainApi from '@/api/eam/basic/infoPushRecordMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'InfoPushRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InfoPushRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: InfoPushRecordMainApi.getInfoPushRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:info-push-record-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'basic:info-push-record-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'basic:info-push-record-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'basic:info-push-record-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'basic:info-push-record-main: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)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =InfoPushRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await InfoPushRecordMainApi.createInfoPushRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await InfoPushRecordMainApi.updateInfoPushRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInfoPushRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await InfoPushRecordMainApi.deleteInfoPushRecordMain(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 InfoPushRecordMainApi.exportInfoPushRecordMain(tableObject.params)
download.excel(data, '物料信息推送记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '物料信息推送记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await InfoPushRecordMainApi.importTemplate()
})
</script>

66
src/views/eam/basic/infoPushRecordMain/infoPushRecordMain.data.ts

@ -0,0 +1,66 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InfoPushRecordMainRules = reactive({
sqr: [required],
lxdh: [required],
concurrencyStamp: [required]
})
export const InfoPushRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请人',
field: 'sqr',
sort: 'custom',
isSearch: true
},
{
label: '收货地点',
field: 'shdd',
sort: 'custom',
isSearch: true
},
{
label: '要求到货时间',
field: 'yqdhsj',
sort: 'custom',
isSearch: true
},
{
label: '联系电话',
field: 'lxdh',
sort: 'custom',
isSearch: false
},
{
label: '合计金额',
field: 'hjje',
sort: 'custom',
isSearch: false
},
{
label: '推送状态',
field: 'pushStatus',
dictType: DICT_TYPE.PUSH_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: false
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

145
src/views/eam/mold/cycleDataSync/cycleDataSync.data.ts

@ -0,0 +1,145 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CycleDataSyncRules = reactive({
concurrencyStamp: [required]
})
export const CycleDataSync = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主键ID',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '计划号',
field: 'planCode',
sort: 'custom',
isSearch: true
},
{
label: '计划日期',
field: 'planDate',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '圈数',
field: 'seq',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '零件号',
field: 'configure',
sort: 'custom',
isSearch: true
},
{
label: '执行状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.MOLD_TIME_SYNC_STATUS,
dictClass: 'string',
isSearch: true
},
// {
// 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: '地点ID',
// field: 'siteId',
// sort: 'custom',
// isSearch: true
// },
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// {
// label: '并发乐观锁',
// field: 'concurrencyStamp',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '部门id',
// field: 'deptId',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

253
src/views/eam/mold/cycleDataSync/index.vue

@ -0,0 +1,253 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CycleDataSync.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CycleDataSync.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="formsSuccess"
:rules="CycleDataSyncRules"
:formAllSchemas="CycleDataSync.allSchemas"
:apiUpdate="CycleDataSyncApi.updateCycleDataSync"
:apiCreate="CycleDataSyncApi.createCycleDataSync"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CycleDataSync.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mold/cycle-data-sync/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CycleDataSync,CycleDataSyncRules } from './cycleDataSync.data'
import * as CycleDataSyncApi from '@/api/eam/mold/cycleDataSync'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'MoldCycleDataSync' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CycleDataSync.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: CycleDataSyncApi.getCycleDataSyncPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.retryBtn(null), //
// defaultButtons.defaultAddBtn({hasPermi:'eam:cycleDataSync:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:cycleDataSync:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:cycleDataSync:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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 if (val == 'retry') { //
retry()
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:cycleDataSync:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:cycleDataSync: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)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =CycleDataSync.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await CycleDataSyncApi.createCycleDataSync(data)
message.success(t('common.createSuccess'))
} else {
await CycleDataSyncApi.updateCycleDataSync(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCycleDataSync')
}
const retry = async () => {
await CycleDataSyncApi.retryCycleDataSync()
message.success(t('common.retrySuccess'))
getList()
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CycleDataSyncApi.deleteCycleDataSync(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 CycleDataSyncApi.exportCycleDataSync(tableObject.params)
download.excel(data, '模次数据同步.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '模次数据同步导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CycleDataSyncApi.importTemplate()
})
</script>

13
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -30,6 +30,9 @@ export const MoldAccountsRules = reactive({
], ],
beat:[ beat:[
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} { validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
mesItemNumber: [
{ message: '请输入对应mes计划零件号:多个按逗号分隔'}
] ]
}) })
@ -245,6 +248,16 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '对应mes计划零件号',
field: 'mesItemNumber',
sort: 'custom',
isForm: true,
isSearch: true,
form: {
component: 'Input',
}
},
{ {
label: '模次', label: '模次',
field: 'frequency', field: 'frequency',

Loading…
Cancel
Save