Commit cb492464 by linjinhong

fix:修改问题

parent eceda477
...@@ -54,6 +54,7 @@ declare module 'vue' { ...@@ -54,6 +54,7 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
......
<template> <template>
<div class="user-page flex-column card h-100 overflow-hidden"> <div class="user-page flex-column card h-100 overflow-hidden">
<div class="header-filter-form"> <div class="header-filter-form">
<el-button type="success" @click="addDialog"> <el-button type="success" @click="addDialog" :disabled="tableData.length">
{{ '新增' }} {{ '新增' }}
</el-button> </el-button>
</div> </div>
...@@ -15,7 +15,13 @@ ...@@ -15,7 +15,13 @@
所有生产单按{{ getLabels(item.groupField) }}进行自动排单 所有生产单按{{ getLabels(item.groupField) }}进行自动排单
</div> </div>
<div class="box">批次数量:{{ item.arrangeMax }}</div> <div class="box">批次数量:{{ item.arrangeMax }}</div>
<div class="box">每天{{ item.hour }}时开始自动排单</div> <div class="box">
每天{{
`${item.hour || '00'}:${item.minute || '00'}:${
item.second || '00'
}`
}}开始自动排单
</div>
</div> </div>
<div class="action"> <div class="action">
...@@ -100,7 +106,7 @@ ...@@ -100,7 +106,7 @@
</div> </div>
<el-form-item <el-form-item
label="在每天" label="在每天"
prop="hour" prop="time"
:rules="[ :rules="[
{ {
required: true, required: true,
...@@ -110,7 +116,7 @@ ...@@ -110,7 +116,7 @@
]" ]"
> >
<div style="display: flex"> <div style="display: flex">
<el-select <!-- <el-select
v-model="editForm.hour" v-model="editForm.hour"
placeholder="请选择时" placeholder="请选择时"
style="width: 200px" style="width: 200px"
...@@ -121,7 +127,13 @@ ...@@ -121,7 +127,13 @@
:label="index" :label="index"
:value="index" :value="index"
/> />
</el-select> </el-select> -->
<el-time-picker
v-model="editForm.time"
value-format="HH:mm:ss"
placeholder="任意时间点"
>
</el-time-picker>
<div <div
style="white-space: nowrap; margin-left: 10px; color: #606266" style="white-space: nowrap; margin-left: 10px; color: #606266"
> >
...@@ -141,6 +153,11 @@ ...@@ -141,6 +153,11 @@
message: '请输入数量', message: '请输入数量',
trigger: ['blur'], trigger: ['blur'],
}, },
{
pattern: /^\d+$/,
message: '请输入整数',
trigger: ['blur', 'change'],
},
]" ]"
> >
<el-input <el-input
...@@ -268,6 +285,9 @@ async function editAddress(item: rowData) { ...@@ -268,6 +285,9 @@ async function editAddress(item: rowData) {
paramsList.value = item.groupField paramsList.value = item.groupField
.split(';') .split(';')
.filter((value) => value.trim() !== '') .filter((value) => value.trim() !== '')
editForm.value.time = `${item.hour || '00'}:${item.minute || '00'}:${
item.second || '00'
}`
console.log(372, editForm.value) console.log(372, editForm.value)
if (editForm.value.templateWidth) { if (editForm.value.templateWidth) {
editForm.value.isAuto = true editForm.value.isAuto = true
...@@ -287,13 +307,16 @@ interface rowData extends BaseForm { ...@@ -287,13 +307,16 @@ interface rowData extends BaseForm {
} }
interface BaseForm { interface BaseForm {
id?: number id?: number
hour?: number time?: string
arrangeMax?: number arrangeMax?: number
isAuto?: boolean isAuto?: boolean
factoryNo?: number factoryNo?: number
type?: string type?: string
templateWidth?: string templateWidth?: string
jobId?: string jobId?: string
hour?: string | number
minute?: string | number
second?: string | number
} }
type ParamKey = `param${number}` type ParamKey = `param${number}`
type ParamValue = string | number | boolean | null | undefined type ParamValue = string | number | boolean | null | undefined
...@@ -317,6 +340,14 @@ async function checkData() { ...@@ -317,6 +340,14 @@ async function checkData() {
// 表单校验通过后,再处理数据 // 表单校验通过后,再处理数据
const postData: PostData = { ...editForm.value } const postData: PostData = { ...editForm.value }
console.log()
const timeArr = editForm.value.time?.split(':')
if (timeArr?.length) {
postData.hour = timeArr[0]
postData.minute = timeArr[1]
postData.second = timeArr[2]
}
paramsList.value.forEach((el: ParamValue, index: number) => { paramsList.value.forEach((el: ParamValue, index: number) => {
const key: ParamKey = `param${index + 1}` const key: ParamKey = `param${index + 1}`
if (el) { if (el) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment