|
@@ -7,14 +7,19 @@
|
|
|
:key="index"
|
|
|
>
|
|
|
<template #label>
|
|
|
-<!-- <span @click="openFill(item.deviceCategoryId,item.deviceId,item.deptId,item.deviceName,item.deviceCode)">
|
|
|
- {{item.deviceCode}} ({{ item.deviceName }})
|
|
|
- </span>-->
|
|
|
- <span class="custom-label" v-if='item.isFill === 1' @click="openFill(item.deviceCategoryId,item.deviceId,item.deptId,item.deviceName,item.deviceCode)">
|
|
|
- {{item.deviceCode}} ({{ item.deviceName }})
|
|
|
+ <span
|
|
|
+ :class="['custom-label', { 'has-border': item.deviceName === '生产日报' }]"
|
|
|
+ v-if='item.isFill === 1'
|
|
|
+ @click="openFill(item.deviceCategoryId,item.deviceId,item.deptId,item.deviceName,item.deviceCode)"
|
|
|
+ >
|
|
|
+ {{item.deviceCode}} ({{ item.deviceName }})
|
|
|
</span>
|
|
|
- <span class="custom-label1" v-else @click="openFill(item.deviceCategoryId,item.deviceId,item.deptId,item.deviceName,item.deviceCode)">
|
|
|
- {{item.deviceCode}} ({{ item.deviceName }})
|
|
|
+ <span
|
|
|
+ :class="['custom-label1', { 'has-border': item.deviceName === '生产日报' }]"
|
|
|
+ v-else
|
|
|
+ @click="openFill(item.deviceCategoryId,item.deviceId,item.deptId,item.deviceName,item.deviceCode)"
|
|
|
+ >
|
|
|
+ {{item.deviceCode}} ({{ item.deviceName }})
|
|
|
</span>
|
|
|
</template>
|
|
|
<div class="form-wrapper">
|
|
@@ -65,28 +70,37 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<el-form-item :label='item.name' prop="deviceId" label-position="top">
|
|
|
- <el-input
|
|
|
- v-if="fillStatus === '1'"
|
|
|
- v-model="item.fillContent"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- disabled
|
|
|
- />
|
|
|
-<!-- <el-input
|
|
|
- v-else
|
|
|
- v-model="item.fillContent"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- />-->
|
|
|
- <el-input
|
|
|
- v-else
|
|
|
- v-model="item.fillContent"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- :placeholder="item.type === 'double' ? t('operationFillForm.enterNumber') : t('operationFillForm.enterContent')"
|
|
|
- @input="handleInput(item)"
|
|
|
- :maxlength="item.type === 'double' ? calculateMaxLength(item) : undefined"
|
|
|
- />
|
|
|
+ <el-input
|
|
|
+ v-if="fillStatus === '1'"
|
|
|
+ v-model="item.fillContent"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-else-if="item.type === 'textarea'"
|
|
|
+ v-model="item.fillContent"
|
|
|
+ type="textarea"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
+ <el-select v-model="item.fillContent" clearable v-else-if="item.type === 'enum' && item.description !== null" style="width: 200px" filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in getIntDictOptions(item.description)"
|
|
|
+ :key="dict.label"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ v-else
|
|
|
+ v-model="item.fillContent"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ :placeholder="item.type === 'double' ? t('operationFillForm.enterNumber') : t('operationFillForm.enterContent')"
|
|
|
+ @input="handleInput(item)"
|
|
|
+ :maxlength="item.type === 'double' ? calculateMaxLength(item) : undefined"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item>
|
|
@@ -112,7 +126,7 @@ import { ElMessage } from 'element-plus'
|
|
|
import moment from 'moment';
|
|
|
import { format } from 'date-fns';
|
|
|
import {cx} from "@fullcalendar/core/internal-common";
|
|
|
-
|
|
|
+import { DICT_TYPE, getIntDictOptions} from '@/utils/dict'
|
|
|
|
|
|
/** 运行记录填报 列表 */
|
|
|
defineOptions({ name: 'FillOrderInfo' })
|
|
@@ -306,9 +320,22 @@ const getAttrList = async () => {
|
|
|
attrList.value = data[0].nonSumList;
|
|
|
attrList1.value = data[0].sumList;
|
|
|
attrList.value.forEach(function (item,index){
|
|
|
-
|
|
|
- if(item.fillContent!=''){
|
|
|
- item.fillContent = Number(item.fillContent).toFixed(2)
|
|
|
+ if(item.fillContent!=''&& item.fillContent !== null){
|
|
|
+ // 尝试将字符串转换为数字
|
|
|
+ const num = Number(item.fillContent);
|
|
|
+
|
|
|
+ // 检查是否是有效的数字
|
|
|
+ if (!isNaN(num)) {
|
|
|
+ // 检查是否包含小数
|
|
|
+ if (item.fillContent.includes('.')) {
|
|
|
+ // 保留两位小数
|
|
|
+ item.fillContent = Number(num.toFixed(2));
|
|
|
+ } else {
|
|
|
+ // 转换为整数
|
|
|
+ item.fillContent = Math.floor(num);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果不是有效的数字,则保持原文本不变
|
|
|
}
|
|
|
item.deviceCode = queryParams.deviceCode;
|
|
|
item.deptId = queryParams.deptId;
|
|
@@ -316,7 +343,6 @@ const getAttrList = async () => {
|
|
|
item.deviceCategoryId = queryParams.deviceCategoryId;
|
|
|
item.modelId = item.id;
|
|
|
})
|
|
|
- console.log(JSON.stringify(attrList.value))
|
|
|
attrList1.value.forEach(function (item,index){
|
|
|
item.deviceCode = queryParams.deviceCode;
|
|
|
item.deptId = queryParams.deptId;
|
|
@@ -448,6 +474,12 @@ onMounted(() => {
|
|
|
font-size: 17px;
|
|
|
padding: 0 10px;
|
|
|
}
|
|
|
+.has-border {
|
|
|
+ border: 2px solid #333; /* 加粗到2px,使用深灰色#333让边框更清晰 */
|
|
|
+ padding: 3px 8px; /* 适当增加内边距,避免文字太贴近边框 */
|
|
|
+ border-radius: 2px; /* 轻微圆角,可选 */
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
::v-deep .el-step__icon {
|
|
|
background-color: #409eff;
|
|
|
color: #fff;
|
|
@@ -505,4 +537,10 @@ onMounted(() => {
|
|
|
flex: 1; /* 等宽分布 */
|
|
|
min-width: 200px; /* 最小宽度防止挤压 */
|
|
|
}
|
|
|
+/* 新增日报填报项的边框样式 */
|
|
|
+.report-border {
|
|
|
+ border: 2px solid #42b983; /* 使用Vue标志性的绿色边框 */
|
|
|
+ padding: 2px 4px;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
</style>
|