Commit cb492464 by linjinhong

fix:修改问题

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