Răsfoiți Sursa

Merge remote-tracking branch 'origin/master'

lipenghui 1 lună în urmă
părinte
comite
32b71c902b

+ 4 - 0
src/api/pms/iotopeationfill/index.ts

@@ -55,6 +55,10 @@ export const IotOpeationFillApi = {
     return await request.get({ url: `/rq/iot-opeation-fill/getAttrs`, params })
   },
 
+  getAttrs1:async (params: any) => {
+    return await request.get({ url: `/rq/iot-opeation-fill/getAttrs1`, params })
+  },
+
   getDeivceFillInfo:async (params: any) => {
     return await request.get({ url: `/rq/iot-opeation-fill/getDeivceFillInfo`, params })
   },

+ 1 - 1
src/views/pms/device/allotlog/DeviceAllot.vue

@@ -108,7 +108,7 @@
               type="primary"
               plain
               @click="openForm('create', undefined, queryParams.deptId)"
-              v-hasPermi="['rq:iot-device:create']"
+              v-hasPermi="['pms:iot-device-allot-log:create']"
             >
               <Icon icon="ep:plus" class="mr-5px" /> {{ t('deviceAllot.setUp') }}
             </el-button>

+ 52 - 19
src/views/pms/iotopeationfill/index.vue

@@ -105,24 +105,40 @@
         />
         <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
           <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                @click="openWrite(scope.row.deptId+','+scope.row.userId+','+scope.row.createTime
-                +','+scope.row.id+','+scope.row.orderStatus)"
-                v-hasPermi="['rq:iot-opeation-fill:update']"
-                v-if="scope.row.orderStatus !== 1"
-              >
-                {{t('operationFill.fill')}}
-              </el-button>
-              <el-button
-                link
-                type="success"
-                @click="openWrite(scope.row.deptId+','+scope.row.userId+','+scope.row.createTime+','+scope.row.id+','+scope.row.orderStatus)"
-                v-else
-              >
-                {{t('operationFill.view')}}
-              </el-button>
+
+              <div v-if="scope.row.orderStatus !== 1">
+                <el-button
+                  link
+                  type="primary"
+                  @click="openWrite(scope.row.deptId+','+scope.row.userId+','+scope.row.createTime+','+scope.row.id+','+scope.row.orderStatus)"
+                  v-hasPermi="['rq:iot-opeation-fill:update']"
+                  v-if="scope.row.orderStatus !== 1"
+                >
+                  {{t('operationFill.fill')}}
+                </el-button>
+              </div>
+              <div v-else>
+                <el-button
+                  link
+                  type="primary"
+                  @click="openWrite(scope.row.deptId+','+scope.row.userId+','+scope.row.createTime+','+scope.row.id+','+0)"
+                  v-hasPermi="['rq:iot-opeation-fill:update']"
+                  v-if="isSameDay(scope.row.createTime)"
+                >
+                  {{t('fault.edit')}}
+                </el-button>
+                <el-button
+                  link
+                  type="success"
+                  @click="openWrite(scope.row.deptId+','+scope.row.userId+','+scope.row.createTime+','+scope.row.id+','+scope.row.orderStatus)"
+                >
+                  {{t('operationFill.view')}}
+                </el-button>
+              </div>
+
+
+            <!-- 编辑按钮 -->
+
 
           </template>
         </el-table-column>
@@ -151,7 +167,6 @@ import DeptTree from "@/views/system/user/DeptTree.vue";
 import {IotOpeationFillApi, IotOpeationFillVO} from "@/api/pms/iotopeationfill";
 import {useUserStore} from "@/store/modules/user";
 const { push } = useRouter()
-
 /** 巡检工单 列表 */
 defineOptions({ name: 'IotOpeationFill' })
 
@@ -175,6 +190,23 @@ const queryParams = reactive({
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
+
+
+ // 判断两个日期是否为同一天
+const isSameDay = (dateString) => {
+  if (!dateString) return false
+
+  // 将日期字符串转换为日期对象
+  const targetDate = new Date(dateString)
+  const today = new Date()
+
+  // 比较年、月、日
+  return targetDate.getFullYear() === today.getFullYear() &&
+    targetDate.getMonth() === today.getMonth() &&
+    targetDate.getDate() === today.getDate()
+}
+
+
 const handleDeptNodeClick = async (row) => {
   queryParams.deptId = row.id
   await getList()
@@ -208,6 +240,7 @@ const formRef = ref()
 const openForm = (id?: number) => {
   push({ name: 'InspectOrderDetail', params:{id} })
 }
+
 const openWrite = (id?: string) => {
   push({ name: 'FillOrderInfo',params:{id}})
 }

+ 6 - 6
src/views/pms/iotopeationfill/index1.vue

@@ -30,12 +30,12 @@
                   <el-col
                     v-for="(item,index) in attrList1"
                     :key="index"
-                    :span="4"
+                    :span="24"
                   >
                     <el-form-item :label='item.name' class="custom-label1">
-                  <span style="text-decoration: underline;">
-                  {{item.totalRunTime}}
-                  </span>
+                      <span style="text-decoration: underline;">
+                      {{item.totalRunTime}}
+                      </span>
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -47,7 +47,7 @@
               </el-form>
             </div>
 
-            <div v-for="(item,index) in attrList" :key="index">
+            <div v-for="(item,index) in attrList" :key="index" style="margin-left: 24px">
               <!-- 添加提示文字 -->
               <div v-if="item.isCollection===1" class="plc-tip">
                 <el-alert
@@ -59,7 +59,7 @@
                   style="width: 320px;"
                 />
               </div>
-                <el-form-item :label='item.name' prop="deviceId"  >
+                <el-form-item :label='item.name' prop="deviceId"  label-position="top">
                   <el-input
                     v-if="fillStatus === '1'"
                     v-model="item.fillContent"