|
|
@@ -1,47 +1,50 @@
|
|
|
<template>
|
|
|
<ContentWrap>
|
|
|
- <el-tabs
|
|
|
- v-model="activeTab"
|
|
|
- type="border-card"
|
|
|
- tab-position="left"
|
|
|
- v-loading="loading"
|
|
|
- style="height: 84vh"
|
|
|
- >
|
|
|
- <el-tab-pane style="height: 100%" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-tabs type="border-card" tab-position="left" v-loading="loading" style="height: 84vh">
|
|
|
+ <el-tab-pane
|
|
|
+ style="height: 100%"
|
|
|
+ v-for="(deviceItem, deviceIndex) in list"
|
|
|
+ :key="deviceIndex"
|
|
|
+ >
|
|
|
<template #label>
|
|
|
<span
|
|
|
- :class="['custom-label', { 'has-border': item.deviceName === '生产日报' }]"
|
|
|
- v-if="item.isFill === 1"
|
|
|
+ :class="['custom-label', { 'has-border': deviceItem.deviceName === '生产日报' }]"
|
|
|
+ v-if="deviceItem.isFill === 1"
|
|
|
@click="
|
|
|
openFill(
|
|
|
- item.deviceCategoryId,
|
|
|
- item.deviceId,
|
|
|
- item.deptId,
|
|
|
- item.deviceName,
|
|
|
- item.deviceCode
|
|
|
+ deviceItem.deviceCategoryId,
|
|
|
+ deviceItem.deviceId,
|
|
|
+ deviceItem.deptId,
|
|
|
+ deviceItem.deviceName,
|
|
|
+ deviceItem.deviceCode
|
|
|
)
|
|
|
"
|
|
|
>
|
|
|
- {{ item.deviceCode }} ({{ item.deviceName }})
|
|
|
+ {{ deviceItem.deviceCode }} ({{ deviceItem.deviceName }})
|
|
|
</span>
|
|
|
<span
|
|
|
- :class="['custom-label1', { 'has-border': item.deviceName === '生产日报' }]"
|
|
|
+ :class="['custom-label1', { 'has-border': deviceItem.deviceName === '生产日报' }]"
|
|
|
v-else
|
|
|
@click="
|
|
|
openFill(
|
|
|
- item.deviceCategoryId,
|
|
|
- item.deviceId,
|
|
|
- item.deptId,
|
|
|
- item.deviceName,
|
|
|
- item.deviceCode
|
|
|
+ deviceItem.deviceCategoryId,
|
|
|
+ deviceItem.deviceId,
|
|
|
+ deviceItem.deptId,
|
|
|
+ deviceItem.deviceName,
|
|
|
+ deviceItem.deviceCode
|
|
|
)
|
|
|
"
|
|
|
>
|
|
|
- {{ item.deviceCode }} ({{ item.deviceName }})
|
|
|
+ {{ deviceItem.deviceCode }} ({{ deviceItem.deviceName }})
|
|
|
</span>
|
|
|
</template>
|
|
|
- <div class="form-wrapper">
|
|
|
- <el-form label-width="120px" class="scrollable-form">
|
|
|
+ <div class="form-wrapper h-full">
|
|
|
+ <el-form
|
|
|
+ size="default"
|
|
|
+ label-width="120px"
|
|
|
+ class="scrollable-form"
|
|
|
+ :model="{ attrList: attrList }"
|
|
|
+ >
|
|
|
<div style="margin-left: 24px">
|
|
|
<el-form class="demo-form-inline" :inline="true">
|
|
|
<el-form-item :label="t('common.createTime')" class="custom-label1">
|
|
|
@@ -51,14 +54,18 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('operationFillForm.team')" class="custom-label1">
|
|
|
<span style="text-decoration: underline">
|
|
|
- {{ item.orgName }}
|
|
|
+ {{ deviceItem.orgName }}
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col v-for="(item, index) in attrList1" :key="index" :span="24">
|
|
|
- <el-form-item :label="item.name" class="custom-label1">
|
|
|
+ <el-col
|
|
|
+ v-for="(summaryItem, summaryIndex) in attrList1"
|
|
|
+ :key="summaryIndex"
|
|
|
+ :span="24"
|
|
|
+ >
|
|
|
+ <el-form-item :label="summaryItem.name" class="custom-label1">
|
|
|
<span style="text-decoration: underline">
|
|
|
- {{ item.totalRunTime }}
|
|
|
+ {{ summaryItem.totalRunTime }}
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -71,9 +78,15 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
|
|
|
- <div v-for="(item, index) in attrList" :key="index" style="margin-left: 24px">
|
|
|
+ <div
|
|
|
+ v-for="(attrItem, attrIndex) in attrList.filter(
|
|
|
+ (item) => !keys.includes(item.description)
|
|
|
+ )"
|
|
|
+ :key="attrIndex"
|
|
|
+ style="margin-left: 24px"
|
|
|
+ >
|
|
|
<!-- 添加提示文字 -->
|
|
|
- <div v-if="item.isCollection === 1" class="plc-tip">
|
|
|
+ <div v-if="attrItem.isCollection === 1" class="plc-tip">
|
|
|
<el-alert
|
|
|
:title="t('operationFillForm.alert')"
|
|
|
type="warning"
|
|
|
@@ -83,28 +96,28 @@
|
|
|
style="width: 320px"
|
|
|
/>
|
|
|
</div>
|
|
|
- <el-form-item :label="item.name" prop="deviceId" label-position="top">
|
|
|
+ <el-form-item :label="attrItem.name" prop="deviceId" label-position="top">
|
|
|
<div v-if="fillStatus === '1'">
|
|
|
<el-select
|
|
|
disabled
|
|
|
- v-model="item.fillContent"
|
|
|
- v-if="item.type === 'enum' && item.description !== null"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
+ v-if="attrItem.type === 'enum' && attrItem.description !== null"
|
|
|
style="width: 200px"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in item.name === '非生产原因'
|
|
|
- ? getIntDictOptions(item.description)
|
|
|
- : getStrDictOptions(item.description)"
|
|
|
+ v-for="dict in attrItem.name === '非生产原因'
|
|
|
+ ? getIntDictOptions(attrItem.description)
|
|
|
+ : getStrDictOptions(attrItem.description)"
|
|
|
:key="dict.label"
|
|
|
:label="dict.label"
|
|
|
:value="
|
|
|
- item.name === '非生产原因' ? Number(dict.value) : dict.value.toString()
|
|
|
+ attrItem.name === '非生产原因' ? Number(dict.value) : dict.value.toString()
|
|
|
"
|
|
|
/>
|
|
|
</el-select>
|
|
|
<el-input
|
|
|
v-else
|
|
|
- v-model="item.fillContent"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
clearable
|
|
|
style="width: 200px; margin-right: 10px"
|
|
|
disabled
|
|
|
@@ -112,40 +125,85 @@
|
|
|
</div>
|
|
|
|
|
|
<el-input
|
|
|
- v-else-if="item.type === 'textarea'"
|
|
|
- v-model="item.fillContent"
|
|
|
+ v-else-if="attrItem.type === 'textarea'"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
type="textarea"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
/>
|
|
|
<el-select
|
|
|
- v-model="item.fillContent"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
clearable
|
|
|
- v-else-if="item.type === 'enum' && item.description !== null"
|
|
|
+ v-else-if="attrItem.type === 'enum' && attrItem.description !== null"
|
|
|
style="width: 200px"
|
|
|
filterable
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in item.name === '非生产原因'
|
|
|
- ? getIntDictOptions(item.description)
|
|
|
- : getStrDictOptions(item.description)"
|
|
|
+ v-for="dict in attrItem.name === '非生产原因'
|
|
|
+ ? getIntDictOptions(attrItem.description)
|
|
|
+ : getStrDictOptions(attrItem.description)"
|
|
|
:key="dict.label"
|
|
|
:label="dict.label"
|
|
|
- :value="item.name === '非生产原因' ? Number(dict.value) : dict.value.toString()"
|
|
|
+ :value="
|
|
|
+ attrItem.name === '非生产原因' ? Number(dict.value) : dict.value.toString()
|
|
|
+ "
|
|
|
/>
|
|
|
</el-select>
|
|
|
<el-input
|
|
|
v-else
|
|
|
- v-model="item.fillContent"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
:placeholder="
|
|
|
- item.type === 'double'
|
|
|
+ attrItem.type === 'double'
|
|
|
? t('operationFillForm.enterNumber')
|
|
|
: t('operationFillForm.enterContent')
|
|
|
"
|
|
|
- @input="handleInput(item)"
|
|
|
- :maxlength="item.type === 'double' ? calculateMaxLength(item) : undefined"
|
|
|
+ @input="handleInput(attrItem)"
|
|
|
+ :maxlength="attrItem.type === 'double' ? calculateMaxLength(attrItem) : undefined"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-for="(attrItem, attrIndex) in attrList"
|
|
|
+ :key="attrIndex"
|
|
|
+ style="margin-left: 24px"
|
|
|
+ >
|
|
|
+ <el-divider v-if="attrItem.description === 'repairTime'" content-position="left"
|
|
|
+ >非生产时间</el-divider
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ v-if="
|
|
|
+ keys.includes(attrItem.description) && attrItem.description !== 'otherNptReason'
|
|
|
+ "
|
|
|
+ label-position="top"
|
|
|
+ :label="attrItem.name"
|
|
|
+ :prop="'attrList.' + attrIndex + '.fillContent'"
|
|
|
+ :rules="rules[attrItem.description]"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ class="w-80!"
|
|
|
+ :min="0"
|
|
|
+ :max="24"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
+ :controls="false"
|
|
|
+ align="left"
|
|
|
+ placeholder="请输入数字"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ v-else-if="attrItem.description === 'otherNptReason'"
|
|
|
+ label-position="top"
|
|
|
+ :label="attrItem.name"
|
|
|
+ :prop="'attrList.' + attrIndex + '.fillContent'"
|
|
|
+ :rules="rules[attrItem.description]"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ class="w-80!"
|
|
|
+ v-model="attrItem.fillContent"
|
|
|
+ placeholder="请输入其他非生产原因"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
@@ -165,17 +223,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { dateFormatter2 } from '@/utils/formatTime'
|
|
|
-import download from '@/utils/download'
|
|
|
import { IotOpeationFillApi, IotOpeationFillVO } from '@/api/pms/iotopeationfill'
|
|
|
-import IotOpeationFillForm from './IotOpeationFillForm.vue'
|
|
|
-import Vue from '@vitejs/plugin-vue'
|
|
|
-import { useUserStore } from '@/store/modules/user'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
+import { ElMessage, FormRules } from 'element-plus'
|
|
|
import moment from 'moment'
|
|
|
-import { format } from 'date-fns'
|
|
|
-import { cx } from '@fullcalendar/core/internal-common'
|
|
|
-import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
+import { getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
/** 运行记录填报 列表 */
|
|
|
@@ -188,18 +239,18 @@ const { t } = useI18n() // 国际化
|
|
|
/** 提交表单 */
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
-const { params, name } = useRoute() // 查询参数
|
|
|
-const deptId = params.id
|
|
|
+const { params } = useRoute() // 查询参数
|
|
|
+const deptId = params.id as string
|
|
|
const list = ref<IotOpeationFillVO[]>([]) // 列表的数据
|
|
|
const attrList = ref<IotOpeationFillVO[]>([]) // 非累计属性集合
|
|
|
const attrList1 = ref<IotOpeationFillVO[]>([]) // 累计属性集合
|
|
|
const attrList2 = ref<IotOpeationFillVO[]>([]) // 属性集合
|
|
|
let companyName = ref('')
|
|
|
|
|
|
-let fillStatus = params.id.split(',')[4]
|
|
|
+let fillStatus = deptId.split(',')[4]
|
|
|
let createTime = formatTimestamp(JSON.parse(deptId.split(',')[2].substring(0, 10)))
|
|
|
let showStatus = true
|
|
|
-const queryParams = reactive({
|
|
|
+const queryParams = reactive<any>({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
deviceCode: undefined,
|
|
|
@@ -223,6 +274,170 @@ const queryParams = reactive({
|
|
|
isSum: undefined
|
|
|
})
|
|
|
|
|
|
+const NON_KEYS = [
|
|
|
+ 'repairTime',
|
|
|
+ 'selfStopTime',
|
|
|
+ 'accidentTime',
|
|
|
+ 'complexityTime',
|
|
|
+ 'rectificationTime',
|
|
|
+ 'waitingStopTime',
|
|
|
+ 'partyaDesign',
|
|
|
+ 'partyaPrepare',
|
|
|
+ 'partyaResource',
|
|
|
+ 'relocationTime',
|
|
|
+ 'winterBreakTime',
|
|
|
+ 'otherNptTime'
|
|
|
+]
|
|
|
+
|
|
|
+const keys = [
|
|
|
+ 'repairTime',
|
|
|
+ 'selfStopTime',
|
|
|
+ 'accidentTime',
|
|
|
+ 'complexityTime',
|
|
|
+ 'rectificationTime',
|
|
|
+ 'waitingStopTime',
|
|
|
+ 'partyaDesign',
|
|
|
+ 'partyaPrepare',
|
|
|
+ 'partyaResource',
|
|
|
+ 'relocationTime',
|
|
|
+ 'winterBreakTime',
|
|
|
+ 'otherNptTime',
|
|
|
+ 'drillingWorkingTime',
|
|
|
+ 'otherProductionTime',
|
|
|
+ 'ratedProductionTime',
|
|
|
+ 'productionTime',
|
|
|
+ 'dailyInjectGasTime',
|
|
|
+ 'otherNptReason'
|
|
|
+]
|
|
|
+
|
|
|
+const sumNonProdTimes = () => {
|
|
|
+ let sum = 0
|
|
|
+ NON_KEYS.forEach((field) => {
|
|
|
+ sum += attrList.value.find((item) => item.description === field)?.fillContent || 0
|
|
|
+ })
|
|
|
+ return sum
|
|
|
+}
|
|
|
+
|
|
|
+const rhValidateTotalTime =
|
|
|
+ (isNon: boolean = false) =>
|
|
|
+ (_rule: any, _value: any, callback: any) => {
|
|
|
+ console.log('11 :>> ', 11)
|
|
|
+ const gasTime =
|
|
|
+ attrList.value.find((item) => item.description === 'dailyInjectGasTime')?.fillContent || 0
|
|
|
+ const nonProdSum = sumNonProdTimes()
|
|
|
+
|
|
|
+ let total = 0
|
|
|
+ let msg = ''
|
|
|
+
|
|
|
+ total = parseFloat((gasTime + nonProdSum).toFixed(2))
|
|
|
+ msg = `运转(${gasTime})+非生产(${nonProdSum})=${total}H,必须为24H`
|
|
|
+
|
|
|
+ if (Math.abs(total - 24) > 0.01) {
|
|
|
+ if (!isNon) callback(new Error(msg))
|
|
|
+ else callback(new Error())
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// const ryXjValidateTotalTime =
|
|
|
+// (isNon: boolean = false) =>
|
|
|
+// (_rule: any, _value: any, callback: any) => {
|
|
|
+// const rateTime =
|
|
|
+// attrList.value.find((item) => item.description === 'ratedProductionTime')?.fillContent || 0
|
|
|
+// const time =
|
|
|
+// attrList.value.find((item) => item.description === 'productionTime')?.fillContent || 0
|
|
|
+
|
|
|
+// const nonProdSum = sumNonProdTimes()
|
|
|
+
|
|
|
+// let total = 0
|
|
|
+// let msg = ''
|
|
|
+
|
|
|
+// total = parseFloat((time + nonProdSum).toFixed(2))
|
|
|
+// msg = `生产(${time})+非生产(${nonProdSum})=${total}H,必须等于额定${rateTime}H`
|
|
|
+
|
|
|
+// if (Math.abs(total - rateTime) > 0.01) {
|
|
|
+// if (!isNon) callback(new Error(msg))
|
|
|
+// else callback(new Error())
|
|
|
+// } else {
|
|
|
+// callback()
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+const ryValidateTotalTime =
|
|
|
+ (isNon: boolean = false) =>
|
|
|
+ (_rule: any, _value: any, callback: any) => {
|
|
|
+ const drillingTime =
|
|
|
+ attrList.value.find((item) => item.description === 'drillingWorkingTime')?.fillContent || 0
|
|
|
+ const otherTime =
|
|
|
+ attrList.value.find((item) => item.description === 'otherProductionTime')?.fillContent || 0
|
|
|
+
|
|
|
+ const nonProdSum = sumNonProdTimes()
|
|
|
+
|
|
|
+ let total = 0
|
|
|
+ let msg = ''
|
|
|
+
|
|
|
+ total = parseFloat((drillingTime + otherTime + nonProdSum).toFixed(2))
|
|
|
+ msg = `进尺(${drillingTime})+其他(${otherTime})+非生产(${nonProdSum})=${total}H,必须为24H`
|
|
|
+
|
|
|
+ if (Math.abs(total - 24) > 0.01) {
|
|
|
+ if (!isNon) callback(new Error(msg))
|
|
|
+ else callback(new Error())
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+const validateOtherReason = (_rule: any, value: any, callback: any) => {
|
|
|
+ const time = attrList.value.find((item) => item.description === 'otherNptTime')?.fillContent || 0
|
|
|
+ if (time > 0 && !value) {
|
|
|
+ callback(new Error('填写了其他时间,必须说明原因'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const rules = reactive<FormRules>({
|
|
|
+ dailyInjectGasTime: [
|
|
|
+ { required: true, message: '请输入当日运转时间', trigger: 'blur' },
|
|
|
+ { validator: rhValidateTotalTime(), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ drillingWorkingTime: [
|
|
|
+ { required: true, message: '请输入进尺工作时间', trigger: 'blur' },
|
|
|
+ { validator: ryValidateTotalTime(), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ otherProductionTime: [{ validator: ryValidateTotalTime(), trigger: 'blur' }],
|
|
|
+ // ratedProductionTime: [
|
|
|
+ // { required: true, message: '请输入额定生产时间', trigger: 'blur' },
|
|
|
+ // { validator: ryXjValidateTotalTime(), trigger: 'blur' }
|
|
|
+ // ],
|
|
|
+ // productionTime: [
|
|
|
+ // { required: true, message: '请输入生产时间', trigger: 'blur' },
|
|
|
+ // { validator: ryXjValidateTotalTime(), trigger: 'blur' }
|
|
|
+ // ],
|
|
|
+ otherNptReason: [{ validator: validateOtherReason, trigger: 'blur' }]
|
|
|
+})
|
|
|
+
|
|
|
+const totalValidatorComputed = computed(() => {
|
|
|
+ if (attrList.value.some((item) => item.description === 'dailyInjectGasTime')) {
|
|
|
+ return rhValidateTotalTime
|
|
|
+ }
|
|
|
+ // else if (attrList.value.some((item) => item.description === 'ratedProductionTime')) {
|
|
|
+ // return ryXjValidateTotalTime
|
|
|
+ // }
|
|
|
+ else if (attrList.value.some((item) => item.description === 'drillingWorkingTime')) {
|
|
|
+ return ryValidateTotalTime
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+nextTick(() => {
|
|
|
+ const validator = totalValidatorComputed.value
|
|
|
+ if (!validator) return
|
|
|
+ NON_KEYS.forEach((field) => {
|
|
|
+ rules[field] = [{ validator: validator(true), trigger: 'blur' }]
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
let cxStatus = true
|
|
|
|
|
|
// 计算数字输入的最大长度(根据阈值动态计算)
|
|
|
@@ -237,9 +452,10 @@ const calculateMaxLength = (item: any) => {
|
|
|
}
|
|
|
|
|
|
// 简单的节流函数,避免提示信息过于频繁
|
|
|
-const throttle = (fn: Function, delay: number) => {
|
|
|
+const throttle = <T extends (...args: any[]) => any>(fn: T, delay: number) => {
|
|
|
let lastTime = 0
|
|
|
- return function (...args: any[]) {
|
|
|
+
|
|
|
+ return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
|
|
|
const now = Date.now()
|
|
|
if (now - lastTime >= delay) {
|
|
|
fn.apply(this, args)
|
|
|
@@ -277,11 +493,11 @@ const getList = async () => {
|
|
|
}
|
|
|
}
|
|
|
function formatTimestamp(timestamp) {
|
|
|
- const date = new Date(timestamp * 1000)
|
|
|
+ // const date = new Date(timestamp * 1000)
|
|
|
return moment.unix(timestamp).format('YYYY-MM-DD')
|
|
|
}
|
|
|
|
|
|
-const open = async (type: string, id?: number) => {
|
|
|
+const open = async (_type: string, id?: number) => {
|
|
|
alert(id)
|
|
|
}
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
@@ -369,7 +585,14 @@ const getAttrList = async () => {
|
|
|
queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(',')[2].substring(0, 10)))
|
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
|
|
|
|
- attrList.value = data[0].nonSumList
|
|
|
+ const timeKeys = keys.filter((k) => k !== 'otherNptReason')
|
|
|
+
|
|
|
+ attrList.value = data[0].nonSumList.map((item) => {
|
|
|
+ if (timeKeys.includes(item.description)) {
|
|
|
+ item.fillContent = item.fillContent ?? 0
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
attrList1.value = data[0].sumList
|
|
|
|
|
|
// 建立累计数据映射,用于后续验证
|
|
|
@@ -381,7 +604,7 @@ const getAttrList = async () => {
|
|
|
})
|
|
|
|
|
|
// 为非累计数据添加最大值限制
|
|
|
- attrList.value.forEach(function (item, index) {
|
|
|
+ attrList.value.forEach(function (item) {
|
|
|
if (item.fillContent !== '' && item.fillContent !== null) {
|
|
|
const num = Number(item.fillContent)
|
|
|
if (!isNaN(num)) {
|
|
|
@@ -421,7 +644,7 @@ const getAttrList = async () => {
|
|
|
console.log(item.fillContent)
|
|
|
})
|
|
|
|
|
|
- attrList1.value.forEach(function (item, index) {
|
|
|
+ attrList1.value.forEach(function (item) {
|
|
|
item.deviceCode = queryParams.deviceCode
|
|
|
item.deptId = queryParams.deptId
|
|
|
item.deviceId = queryParams.deviceId
|
|
|
@@ -485,11 +708,8 @@ const getFillInfo = async () => {
|
|
|
const confirmResult = await message.confirm(
|
|
|
exceededMessage,
|
|
|
'以下填报项超出限制,是否继续保存?',
|
|
|
- {
|
|
|
- confirmButtonText: '继续保存',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }
|
|
|
+ '继续保存',
|
|
|
+ '取消'
|
|
|
)
|
|
|
if (!confirmResult) {
|
|
|
return // 用户取消保存
|
|
|
@@ -499,13 +719,15 @@ const getFillInfo = async () => {
|
|
|
|
|
|
attrList2.value = attrList.value.concat(attrList1.value)
|
|
|
|
|
|
- attrList2.value.forEach(function (item, index) {
|
|
|
+ attrList2.value.forEach(function (item) {
|
|
|
item.pointName = item.name
|
|
|
item.createTime = formatTimestamp(JSON.parse(deptId.split(',')[2].substring(0, 10)))
|
|
|
item.userId = deptId.split(',')[1]
|
|
|
item.id = deptId.split(',')[3]
|
|
|
})
|
|
|
const data = attrList2.value as unknown as IotOpeationFillVO
|
|
|
+
|
|
|
+ console.log('data :>> ', data)
|
|
|
await IotOpeationFillApi.insertLog(data)
|
|
|
message.success(t('common.createSuccess'))
|
|
|
// 发送操作成功的事件
|
|
|
@@ -519,7 +741,7 @@ const getFillInfo = async () => {
|
|
|
|
|
|
/**清空填写信息*/
|
|
|
const deleteFillInfo = () => {
|
|
|
- attrList.value.forEach(function (item, index) {
|
|
|
+ attrList.value.forEach(function (item) {
|
|
|
item.fillContent = ''
|
|
|
})
|
|
|
}
|
|
|
@@ -536,11 +758,13 @@ onMounted(async () => {
|
|
|
<style scoped>
|
|
|
.scrollable-form {
|
|
|
/* 设置最大高度,超过这个高度会出现滚动条 */
|
|
|
- max-height: 500px; /* 根据你的需求调整 */
|
|
|
- /* 超出部分显示垂直滚动条 */
|
|
|
- overflow-y: auto;
|
|
|
+ max-height: 100%; /* 根据你的需求调整 */
|
|
|
+
|
|
|
/* 可选:添加内边距和边框美化 */
|
|
|
padding: 16px;
|
|
|
+
|
|
|
+ /* 超出部分显示垂直滚动条 */
|
|
|
+ overflow-y: auto;
|
|
|
border: 1px solid #e5e7eb;
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
@@ -568,9 +792,11 @@ onMounted(async () => {
|
|
|
/* 红色背景 */
|
|
|
background-color: red;
|
|
|
}
|
|
|
+
|
|
|
.back-blue {
|
|
|
background-color: grey;
|
|
|
}
|
|
|
+
|
|
|
.step-container {
|
|
|
display: grid;
|
|
|
grid-template-columns: 220px 1fr;
|
|
|
@@ -580,15 +806,15 @@ onMounted(async () => {
|
|
|
}
|
|
|
|
|
|
.steps-nav {
|
|
|
- overflow-y: auto;
|
|
|
padding-right: 15px;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
|
|
|
.form-wrapper {
|
|
|
- background: #fff;
|
|
|
padding: 30px;
|
|
|
+ background: #fff;
|
|
|
border-radius: 8px;
|
|
|
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
|
+ box-shadow: 0 2px 12px rgb(0 0 0 / 10%);
|
|
|
}
|
|
|
|
|
|
.navigation-controls {
|
|
|
@@ -597,33 +823,37 @@ onMounted(async () => {
|
|
|
}
|
|
|
|
|
|
.custom-label {
|
|
|
- font-weight: 1000;
|
|
|
- font-size: 17px;
|
|
|
padding: 0 10px;
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: 1000;
|
|
|
color: forestgreen;
|
|
|
}
|
|
|
+
|
|
|
.custom-label1 {
|
|
|
- font-weight: 1000;
|
|
|
- font-size: 17px;
|
|
|
padding: 0 10px;
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: 1000;
|
|
|
}
|
|
|
+
|
|
|
.has-border {
|
|
|
- border: 2px solid #333; /* 加粗到2px,使用深灰色#333让边框更清晰 */
|
|
|
padding: 3px 8px; /* 适当增加内边距,避免文字太贴近边框 */
|
|
|
- border-radius: 2px; /* 轻微圆角,可选 */
|
|
|
font-size: 20px;
|
|
|
+ border: 2px solid #333; /* 加粗到2px,使用深灰色#333让边框更清晰 */
|
|
|
+ border-radius: 2px; /* 轻微圆角,可选 */
|
|
|
}
|
|
|
+
|
|
|
::v-deep .el-step__icon {
|
|
|
- background-color: #409eff;
|
|
|
color: #fff;
|
|
|
- border: 0px;
|
|
|
+ background-color: #409eff;
|
|
|
+ border: 0;
|
|
|
}
|
|
|
+
|
|
|
.step-title-wrapper {
|
|
|
+ position: relative;
|
|
|
display: inline-flex;
|
|
|
+ padding-right: 25px;
|
|
|
align-items: center;
|
|
|
gap: 8px;
|
|
|
- position: relative;
|
|
|
- padding-right: 25px;
|
|
|
}
|
|
|
|
|
|
/* 覆盖步骤条默认样式 */
|
|
|
@@ -636,8 +866,8 @@ onMounted(async () => {
|
|
|
/* 标题容器定位 */
|
|
|
.el-step__title {
|
|
|
display: inline-block;
|
|
|
- margin-left: 10px;
|
|
|
padding-right: 0;
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
|
|
|
/* 步骤连接线 */
|
|
|
@@ -668,10 +898,11 @@ onMounted(async () => {
|
|
|
flex: 1; /* 等宽分布 */
|
|
|
min-width: 200px; /* 最小宽度防止挤压 */
|
|
|
}
|
|
|
+
|
|
|
/* 新增日报填报项的边框样式 */
|
|
|
.report-border {
|
|
|
- border: 2px solid #42b983; /* 使用Vue标志性的绿色边框 */
|
|
|
padding: 2px 4px;
|
|
|
+ border: 2px solid #42b983; /* 使用Vue标志性的绿色边框 */
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
</style>
|