Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

zhangcl 1 сар өмнө
parent
commit
97271172d2

+ 2 - 0
src/locales/en.ts

@@ -558,6 +558,8 @@ export default {
     pdHolder:'Please select the production date',
     supplier:'Supplier',
     suppHolder:'Please enter supplier',
+    enable:'EnableDate',
+    enableHolder:'Please enter enable date',
     warranty:'Warranty',
     warrHolder:'Please select warranty expiration',
     ni:'Nameplate',

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

@@ -556,8 +556,10 @@ export default {
     suppHolder:'请输入供应商',
     warranty:'质保到期',
     warrHolder:'请选择质保到期',
+    enable:'启用日期',
+    enableHolder:'请选择启用日期',
     ni:'铭牌信息',
-    niHolder:'请选择质保到期',
+    niHolder:'请输入铭牌信息',
     pp:'采购价格',
     pdate:'采购日期',
     dp:'折旧年限',

+ 13 - 1
src/views/pms/device/IotDeviceForm.vue

@@ -180,7 +180,18 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="16">
+          <el-col :span="8">
+            <el-form-item :label="t('deviceForm.enable')" prop="enableDate">
+              <el-date-picker
+                style="width: 150%"
+                v-model="formData.enableDate"
+                type="date"
+                value-format="x"
+                :placeholder="t('deviceForm.enableHolder')"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
             <el-form-item :label="t('deviceForm.ni')" prop="nameplate">
               <el-input v-model="formData.nameplate" type="textarea" :placeholder="t('deviceForm.niHolder')"/>
             </el-form-item>
@@ -389,6 +400,7 @@ const zzLabel = ref('') // 表单的类型:create - 新增;update - 修改
 const supplierLabel = ref('') // 表单的类型:create - 新增;update - 修改
 const formData = ref({
   id: undefined,
+  enableDate: undefined,
   deviceCode: undefined,
   deviceName: undefined,
   brand: undefined,

+ 12 - 1
src/views/pms/device/IotDeviceFormAdd.vue

@@ -180,7 +180,18 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="16">
+          <el-col :span="8">
+            <el-form-item :label="t('deviceForm.enable')" prop="enableDate">
+              <el-date-picker
+                style="width: 150%"
+                v-model="formData.enableDate"
+                type="date"
+                value-format="x"
+                :placeholder="t('deviceForm.enableHolder')"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
             <el-form-item :label="t('deviceForm.ni')" prop="nameplate">
               <el-input v-model="formData.nameplate" type="textarea" :placeholder="t('deviceForm.niHolder')"/>
             </el-form-item>

+ 1 - 0
src/views/pms/device/index.vue

@@ -153,6 +153,7 @@
               <dict-tag :type="DICT_TYPE.PMS_ASSET_PROPERTY" :value="scope.row.assetProperty" />
             </template>
           </el-table-column>
+          <el-table-column :label="t('deviceForm.model')" align="center" prop="model" />
           <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
             <template #default="scope">
               <el-button

+ 130 - 84
src/views/pms/inspect/plan/index.vue

@@ -1,11 +1,21 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
+    <el-col :class="{'leftcontent': true, 'collapsed': isLeftContentCollapsed}" :span="isLeftContentCollapsed ? 0 : 4" :xs="24">
       <ContentWrap class="h-1/1">
         <DeptTree @node-click="handleDeptNodeClick" />
       </ContentWrap>
     </el-col>
-    <el-col :span="20" :xs="24">
+    <div
+      class="toggle-button"
+      :style="{ left: isLeftContentCollapsed ? '0px' : '16%' }"
+      @click="toggleLeftContent"
+      @mouseover="handleMouseOver"
+      @mouseout="handleMouseOut"
+      :title="hoverText"
+    >
+      <span style="font-size: 5px" :class="{'triangle': true, 'rotated': isLeftContentCollapsed}"></span>
+    </div>
+    <el-col class="rightcontent" :span="isLeftContentCollapsed ? 24 : 20" :xs="24">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -76,16 +86,14 @@
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-          <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.planTitle')" align="center" prop="planTitle"  />
+          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode"  />
           <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" width="80">
             <template #default="scope">
               <el-switch
@@ -96,7 +104,6 @@
               />
             </template>
           </el-table-column>
-<!--          <el-table-column :label="t('form.remark')" align="center" prop="remark" />-->
           <el-table-column
             :label="t('route.beginCreateTime')"
             align="center"
@@ -109,10 +116,10 @@
             align="center"
             prop="lastCreateTime"
             :formatter="dateFormatter"
-            width="180px"
+            width="150px"
           />
-          <!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
-          <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
+          <el-table-column :label="t('inspect.createName')" align="center" prop="createName" width="130"/>
+          <el-table-column :label="t('operationFill.operation')" align="center" width="180">
             <template #default="scope">
               <el-button
                 link
@@ -148,23 +155,23 @@
 </template>
 
 <script setup lang="ts">
-import { dateFormatter } from '@/utils/formatTime'
-import download from '@/utils/download'
-import { IotInspectPlanApi, IotInspectPlanVO } from '@/api/pms/inspect/plan'
-import IotInspectPlanForm from './IotInspectPlanForm.vue'
-import { CommonStatusEnum } from '@/utils/constants'
-import {DICT_TYPE} from "@/utils/dict";
+import { ref, reactive, onMounted } from 'vue';
+import { dateFormatter } from '@/utils/formatTime';
+import download from '@/utils/download';
+import { IotInspectPlanApi, IotInspectPlanVO } from '@/api/pms/inspect/plan';
+import IotInspectPlanForm from './IotInspectPlanForm.vue';
+import { CommonStatusEnum } from '@/utils/constants';
+import { DICT_TYPE } from "@/utils/dict";
 import DeptTree from "@/views/system/user/DeptTree.vue";
-const { push } = useRouter() // 路由跳转
-/** 巡检计划 列表 */
-defineOptions({ name: 'IotInspectPlan' })
+import { useRouter } from 'vue-router';
+import { useI18n } from 'vue-i18n';
 
-const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
+const { push } = useRouter();
+const { t } = useI18n();
 
-const loading = ref(true) // 列表的加载中
-const list = ref<IotInspectPlanVO[]>([]) // 列表的数据
-const total = ref(0) // 列表的总页数
+const loading = ref(true);
+const list = ref<IotInspectPlanVO[]>([]);
+const total = ref(0);
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -177,94 +184,133 @@ const queryParams = reactive({
   remark: undefined,
   createTime: [],
   deptId: undefined
-})
-const queryFormRef = ref() // 搜索的表单
-const exportLoading = ref(false) // 导出的加载中
+});
+const queryFormRef = ref();
+const exportLoading = ref(false);
+
+const isLeftContentCollapsed = ref(false);
+const hoverText = ref('');
+
 const handleDeptNodeClick = async (row) => {
-  queryParams.deptId = row.id
-  await getList()
-}
+  queryParams.deptId = row.id;
+  await getList();
+};
+
 const handleStatusChange = async (row: IotInspectPlanVO) => {
   try {
-    // 修改状态的二次确认
-    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
-    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?')
-    // 发起修改状态
-    await IotInspectPlanApi.updateIotInspectStatus(row.id, row.status)
-    // 刷新列表
-    await getList()
+    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用';
+    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?');
+    await IotInspectPlanApi.updateIotInspectStatus(row.id, row.status);
+    await getList();
   } catch {
-    // 取消后,进行恢复按钮
-    row.status =
-      row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
+    row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
   }
-}
+};
 
-/** 查询列表 */
 const getList = async () => {
-  loading.value = true
+  loading.value = true;
   try {
-    const data = await IotInspectPlanApi.getIotInspectPlanPage(queryParams)
-    list.value = data.list
-    total.value = data.total
+    const data = await IotInspectPlanApi.getIotInspectPlanPage(queryParams);
+    list.value = data.list;
+    total.value = data.total;
   } finally {
-    loading.value = false
+    loading.value = false;
   }
-}
+};
 
-/** 搜索按钮操作 */
 const handleQuery = () => {
-  queryParams.pageNo = 1
-  getList()
-}
+  queryParams.pageNo = 1;
+  getList();
+};
 
-/** 重置按钮操作 */
 const resetQuery = () => {
-  queryFormRef.value.resetFields()
-  handleQuery()
-}
+  queryFormRef.value.resetFields();
+  handleQuery();
+};
 
-/** 添加/修改操作 */
 const openForm = (type: string, id?: number) => {
-  //修改
   if (typeof id === 'number') {
-    push({ name: 'InspectPlanEdit', params: { id } })
-    return
+    push({ name: 'InspectPlanEdit', params: { id } });
+    return;
   }
-  // 新增
-  push({ name: 'InspectPlanAdd', params: {} })
-}
+  push({ name: 'InspectPlanAdd', params: {} });
+};
 
-/** 删除按钮操作 */
 const handleDelete = async (id: number) => {
   try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await IotInspectPlanApi.deleteIotInspectPlan(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getList()
+    await message.delConfirm();
+    await IotInspectPlanApi.deleteIotInspectPlan(id);
+    message.success(t('common.delSuccess'));
+    await getList();
   } catch {}
-}
+};
 
-/** 导出按钮操作 */
 const handleExport = async () => {
   try {
-    // 导出的二次确认
-    await message.exportConfirm()
-    // 发起导出
-    exportLoading.value = true
-    const data = await IotInspectPlanApi.exportIotInspectPlan(queryParams)
-    download.excel(data, '巡检计划.xls')
+    await message.exportConfirm();
+    exportLoading.value = true;
+    const data = await IotInspectPlanApi.exportIotInspectPlan(queryParams);
+    download.excel(data, '巡检计划.xls');
   } catch {
   } finally {
-    exportLoading.value = false
+    exportLoading.value = false;
   }
-}
+};
+
+const toggleLeftContent = () => {
+  isLeftContentCollapsed.value = !isLeftContentCollapsed.value;
+};
+
+const handleMouseOver = () => {
+  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起';
+};
+
+const handleMouseOut = () => {
+  hoverText.value = '';
+};
 
-/** 初始化 **/
 onMounted(() => {
-  getList()
-})
+  getList();
+});
 </script>
+
+<style scoped>
+.leftcontent {
+  transition: width 0.3s ease;
+  position: relative;
+}
+
+.leftcontent.collapsed {
+  width: 0;
+  overflow: hidden;
+}
+
+.toggle-button {
+  position: absolute;
+  top:0;
+  bottom:0;
+  margin: auto;
+  transform: translateY(-50%);
+  width: 15px;
+  height: 18px;
+  background-color: #ccc;
+  cursor: pointer;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 1;
+}
+
+.triangle {
+  width: 0;
+  height: 0;
+  border-top: 6px solid transparent;
+  border-bottom: 6px solid transparent;
+  border-left: 5px solid #333;
+  transition: transform 0.3s ease;
+}
+
+.triangle.rotated {
+  transform: rotate(180deg);
+}
+</style>

+ 4 - 3
src/views/pms/maintain/index.vue

@@ -140,8 +140,8 @@
           </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" width="250"/>
-          <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" width="250"/>
+          <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" width="85" >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_MAIN_STATUS" :value="scope.row.status" />
@@ -159,6 +159,7 @@
             </template>
           </el-table-column>
           <el-table-column :label="t('maintain.dept')" align="center" prop="deptName" width="135"/>
+          <el-table-column :label="t('inspect.createName')" align="center" prop="createName" width="130"/>
 <!--          <el-table-column-->
 <!--            :label="t('iotMaintain.startTime')"-->
 <!--            align="center"-->
@@ -188,7 +189,7 @@
 <!--            :formatter="dateFormatter"-->
 <!--            width="180px"-->
 <!--          />-->
-          <el-table-column :label="t('maintain.operation')" align="center" min-width="70">
+          <el-table-column :label="t('maintain.operation')" align="center" width="200">
             <template #default="scope">
               <el-button
                 link