ソースを参照

Merge remote-tracking branch 'origin/master'

zhangcl 1 ヶ月 前
コミット
eee02db0b8

+ 4 - 2
src/locales/en.ts

@@ -484,8 +484,8 @@ export default {
     dataPlaceholder:'please enter dataLabel'
     dataPlaceholder:'please enter dataLabel'
   },
   },
   operationFill:{
   operationFill:{
-    name:'OrderName',
-    nameHolder:'Please enter the work order name',
+    name:'QueryCriteria',
+    nameHolder:'Please enter the query criteria',
     status:'OrderStatus',
     status:'OrderStatus',
     createTime:'CreateTime',
     createTime:'CreateTime',
     start:'StartTime',
     start:'StartTime',
@@ -507,6 +507,8 @@ export default {
     sumKil:'COKM(Km)',
     sumKil:'COKM(Km)',
     confirm:'Confirm',
     confirm:'Confirm',
     cancel:'Cancel',
     cancel:'Cancel',
+    alert:'The following values are from the PLC. Please correct any discrepancies.',
+    fill:'Please fill all of items'
   },
   },
   modelTemplate:{
   modelTemplate:{
     name:'TemplateName',
     name:'TemplateName',

+ 4 - 2
src/locales/zh-CN.ts

@@ -480,8 +480,8 @@ export default {
     dataPlaceholder:'请输入数据标签'
     dataPlaceholder:'请输入数据标签'
   },
   },
   operationFill:{
   operationFill:{
-    name:'工单名',
-    nameHolder:'请输入工单名',
+    name:'查询条件',
+    nameHolder:'请输入查询条件',
     status:'工单状态',
     status:'工单状态',
     createTime:'创建时间:',
     createTime:'创建时间:',
     start:'开始日期',
     start:'开始日期',
@@ -503,6 +503,8 @@ export default {
     sumKil:'累计运行公里数(Km)',
     sumKil:'累计运行公里数(Km)',
     confirm:'确定',
     confirm:'确定',
     cancel:'取消',
     cancel:'取消',
+    alert:'以下数值取自PLC,如有不符请修改',
+    fill:'请填写所有项'
   },
   },
   modelTemplate:{
   modelTemplate:{
     name:'模板名称',
     name:'模板名称',

+ 1 - 1
src/views/pms/iotopeationfill/index.vue

@@ -52,7 +52,7 @@
         </el-form-item>
         </el-form-item>
         <el-form-item>
         <el-form-item>
           <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />{{t('operationFill.search')}}</el-button>
           <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />{{t('operationFill.search')}}</el-button>
-          <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />{{t('operationFill.query')}}</el-button>
+          <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />{{t('operationFill.reset')}}</el-button>
 <!--          <el-button-->
 <!--          <el-button-->
 <!--            type="primary"-->
 <!--            type="primary"-->
 <!--            plain-->
 <!--            plain-->

+ 29 - 5
src/views/pms/iotopeationfill/index1.vue

@@ -46,10 +46,22 @@
                 </el-form-item>-->
                 </el-form-item>-->
               </el-form>
               </el-form>
             </div>
             </div>
+
             <div v-for="(item,index) in attrList" :key="index">
             <div v-for="(item,index) in attrList" :key="index">
+              <!-- 添加提示文字 -->
+              <div v-if="item.isCollection===1" class="plc-tip">
+                <el-alert
+                  :title="t('operationFillForm.alert')"
+                  type="warning"
+                  :closable="false"
+                  center
+                  show-icon
+                  style="width: 320px;"
+                />
+              </div>
                 <el-form-item :label='item.name' prop="deviceId"  >
                 <el-form-item :label='item.name' prop="deviceId"  >
                   <el-input
                   <el-input
-                    v-if="item.isCollection===1||fillStatus === '1'"
+                    v-if="fillStatus === '1'"
                     v-model="item.fillContent"
                     v-model="item.fillContent"
                     clearable
                     clearable
                     style="width: 200px"
                     style="width: 200px"
@@ -211,10 +223,10 @@ const getAttrList = async () => {
     attrList.value = data[0].nonSumList;
     attrList.value = data[0].nonSumList;
     attrList1.value = data[0].sumList;
     attrList1.value = data[0].sumList;
     attrList.value.forEach(function (item,index){
     attrList.value.forEach(function (item,index){
-      /*if(item.name === '当日运转时间'){
-        totalRunTime1 = Number(item.totalRunTime).toFixed(2)
-      }*/
-      item.fillContent = Number(item.fillContent).toFixed(2)
+
+      if(item.fillContent!=''){
+        item.fillContent = Number(item.fillContent).toFixed(2)
+      }
       item.deviceCode = queryParams.deviceCode;
       item.deviceCode = queryParams.deviceCode;
       item.deptId = queryParams.deptId;
       item.deptId = queryParams.deptId;
       item.deviceId = queryParams.deviceId;
       item.deviceId = queryParams.deviceId;
@@ -234,6 +246,18 @@ const getAttrList = async () => {
 /** 获取填写信息保存到后台*/
 /** 获取填写信息保存到后台*/
 const getFillInfo = async () => {
 const getFillInfo = async () => {
   try {
   try {
+    // 检查必填字段
+    const emptyFields = attrList.value.filter(item => {
+      // 只检查非disabled的字段
+      return !(item.isCollection===1||fillStatus === '1') &&
+        (item.fillContent === undefined || item.fillContent === '');
+    });
+
+    if (emptyFields.length > 0) {
+      ElMessage.error(t('operationFillForm.fill'));
+      return;
+    }
+
     attrList2.value = attrList.value.concat(attrList1.value)
     attrList2.value = attrList.value.concat(attrList1.value)
 
 
     attrList2.value.forEach(function (item,index){
     attrList2.value.forEach(function (item,index){

+ 1 - 1
src/views/pms/modeltemplate/index.vue

@@ -172,7 +172,7 @@ import ModelCategoryTree from './ModelCategoryTree.vue'
 import { useTreeStore } from '@/store/modules/attrTemplateTreeStore';
 import { useTreeStore } from '@/store/modules/attrTemplateTreeStore';
 import {DeviceAttrModelApi} from "@/api/pms/modelattrtemplate";
 import {DeviceAttrModelApi} from "@/api/pms/modelattrtemplate";
 
 
-defineOptions({ name: 'DeviceAttrsTemplate' })
+defineOptions({ name: 'ModelAttrsTemplate' })
 
 
 const treeStore = useTreeStore();
 const treeStore = useTreeStore();
 const message = useMessage() // 消息弹窗
 const message = useMessage() // 消息弹窗