Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zhangcl 1 mēnesi atpakaļ
vecāks
revīzija
6b8a3b2a3c

+ 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 })
   },

+ 3 - 1
src/locales/en.ts

@@ -774,7 +774,8 @@ export default {
     audit:'Audit',
     operation:'Operation',
     view:'View',
-    fill:'Fill'
+    fill:'Fill',
+    dept:'Dept',
   },
   iotMaintain:{
 
@@ -1001,6 +1002,7 @@ export default {
     IsItConfigured:'IsItConfigured',
     quantity:'Quantity',
     safetyStock:'SafetyStock',
+    lastCreateTime:'lastCreateTime',
   },
   stock:{
     selectStock:'SelectStock',

+ 3 - 1
src/locales/zh-CN.ts

@@ -770,7 +770,8 @@ export default {
     audit:'审核状态',
     operation:'操作',
     view:'查看',
-    fill:'填写'
+    fill:'填写',
+    dept:'所属部门'
   },
   iotMaintain:{
     device:'设备',
@@ -997,6 +998,7 @@ export default {
     IsItConfigured:'是否配置',
     quantity:'数量',
     safetyStock:'安全库存',
+    lastCreateTime:'上次执行时间'
   },
   stock:{
     selectStock:'选择库存',

+ 7 - 7
src/views/pms/inspect/plan/index.vue

@@ -76,17 +76,17 @@
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-          <el-table-column :label="t('route.planTitle')" align="center" prop="planTitle" width="160" />
-          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" width="170" />
-          <el-table-column :label="t('route.cycle')" align="center" prop="planCycle" />
-          <el-table-column :label="t('workOrderMaterial.unit')" align="center" prop="planUnit" >
+          <el-table-column :label="t('route.planTitle')" align="center" prop="planTitle" width="220" />
+          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" width="220" />
+          <el-table-column :label="t('route.cycle')" align="center" prop="planCycle"  width="80"/>
+          <el-table-column :label="t('workOrderMaterial.unit')" align="center" prop="planUnit" width="80">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_INSPECT_UNIT" :value="scope.row.planUnit" />
             </template>
           </el-table-column>
 <!--          <el-table-column :label="t('iotMaintain.PersonInCharge')" align="center" prop="chargeName" />-->
           <!--      <el-table-column label="设备" align="center" prop="deviceIds" />-->
-          <el-table-column :label="t('bomList.status')" key="status">
+          <el-table-column :label="t('bomList.status')" key="status" width="80">
             <template #default="scope">
               <el-switch
                 v-model="scope.row.status"
@@ -105,9 +105,9 @@
             width="180px"
           />
           <el-table-column
-            :label="t('table.createTime')"
+            :label="t('route.lastCreateTime')"
             align="center"
-            prop="createTime"
+            prop="lastCreateTime"
             :formatter="dateFormatter"
             width="180px"
           />

+ 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"

+ 8 - 7
src/views/pms/maintain/index.vue

@@ -140,24 +140,25 @@
           </el-table-column>
 <!--          <el-table-column label="故障编码" align="center" prop="failureCode" />-->
 <!--          <el-table-column label="故障名称" align="center" prop="failureName" />-->
-          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
-          <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" />
-          <el-table-column :label="t('maintain.status')" align="center" prop="status" >
+          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" width="220"/>
+          <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" width="220"/>
+          <el-table-column :label="t('maintain.status')" align="center" prop="status" width="85" >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_MAIN_STATUS" :value="scope.row.status" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('maintain.source')" align="center" prop="maintainType" />
-          <el-table-column :label="t('maintain.audit')" align="center" prop="auditStatus" >
+          <el-table-column :label="t('maintain.source')" align="center" prop="maintainType" width="110"/>
+          <el-table-column :label="t('maintain.audit')" align="center" prop="auditStatus" width="110">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('maintain.shutDown')" align="center" prop="ifStop" >
+          <el-table-column :label="t('maintain.shutDown')" align="center" prop="ifStop"  width="110">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.ifStop" />
             </template>
           </el-table-column>
+          <el-table-column :label="t('maintain.dept')" align="center" prop="deptName" width="110"/>
 <!--          <el-table-column-->
 <!--            :label="t('iotMaintain.startTime')"-->
 <!--            align="center"-->
@@ -187,7 +188,7 @@
 <!--            :formatter="dateFormatter"-->
 <!--            width="180px"-->
 <!--          />-->
-          <el-table-column :label="t('maintain.operation')" align="center" min-width="120px">
+          <el-table-column :label="t('maintain.operation')" align="center" min-width="70">
             <template #default="scope">
               <el-button
                 link