Yue hace 2 años
padre
commit
38c60f2e51

+ 12 - 5
src/layouts/main-layout/menus/NotificationsMenu.vue

@@ -4,6 +4,7 @@ import { getAssetPath } from "@/core/helpers/assets"
 import Rs from "@/core/services/RequestService"
 import appStore from "@/stores"
 import router from "@/router"
+
 const total = ref(0)
 const curPage = ref(0)
 const perPage = ref(10)
@@ -17,6 +18,7 @@ const params = computed(() => {
 let reLoadTimre: any
 const listBox = ref<HTMLElement>()
 const dataList = ref<Array<any>>([])
+const isShow = ref(true)
 function jump(item: any) {
   read(item.id)
   switch (appStore.authStore.user?.userType) {
@@ -92,11 +94,15 @@ function readAll() {
 }
 function load() {
   curPage.value++
-  Rs.post("sys/pushEvent/getList", { data: params.value, successAlert: false }).then((res: any) => {
-    console.log("NOTIFI", res.data)
-    dataList.value.push(...res.data)
-    total.value = res.total
-  })
+  Rs.post("sys/pushEvent/getList", { data: params.value, successAlert: false, errorAlert: false })
+    .then((res: any) => {
+      console.log("NOTIFI", res.data)
+      dataList.value.push(...res.data)
+      total.value = res.total
+    })
+    .catch(() => {
+      isShow.value = false
+    })
 }
 function reLoad() {
   curPage.value = 0
@@ -126,6 +132,7 @@ onMounted(() => {
 
 <template>
   <div
+    v-if="isShow"
     class="btn btn-icon btn-custom btn-icon-muted btn-active-light btn-active-color-primary w-30px h-30px w-md-40px h-md-40px position-relative"
     data-kt-menu-trigger="click"
     data-kt-menu-attach="parent"

+ 10 - 0
src/router/menuMap/_purify.ts

@@ -5,6 +5,7 @@ export const menus: Array<MenuRouteMap> = [
     path: "/purify",
     icon: "fas fa-shower",
   },
+
   {
     path: "/purify/washInfo",
     component: () => import("@/views/purify/washInfo.vue"),
@@ -17,6 +18,15 @@ export const menus: Array<MenuRouteMap> = [
     path: "/purifyMonitor/TWP",
     component: () => import("@/views/purify/washInfo_company.vue"),
   },
+  //清洗运维
+  {
+    path: "/qxyw",
+    icon: "fas fa-shower",
+  },
+  {
+    path: "/qxyw/showlist",
+    component: () => import("@/views/purify/qxyw.vue"),
+  },
 ]
 
 export default menus

+ 8 - 0
src/router/statictRouter.ts

@@ -96,6 +96,14 @@ export const staticRotuer: Array<RouteRecordRaw> = [
           breadcrumbs: ["清洗管理", "清洗台账", "净化器清洗情况"],
         },
       },
+      {
+        path: "/qxyw/details",
+        component: () => import("@/views/purify/qxyw_detail.vue"),
+        meta: {
+          pageTitle: "清洗运维",
+          breadcrumbs: ["清洗运维"],
+        },
+      },
     ],
   },
   {

+ 107 - 0
src/views/purify/qxyw.vue

@@ -0,0 +1,107 @@
+<script setup lang="ts">
+import { ref, computed, onMounted } from "vue"
+import router from "@/router"
+const cols = ref([
+  {
+    name: "区域",
+    field: "org_name",
+  },
+  {
+    name: "商户",
+    field: "name",
+  },
+  {
+    name: "净化器数量",
+    field: "purifier_num",
+  },
+  {
+    name: "清洗次数",
+    field: "clean_num",
+  },
+  {
+    name: "操作",
+    field: "action",
+    width: 120,
+  },
+])
+const size = ref<any>("default")
+const companyName = ref("")
+const orgId = ref<string | null>(null)
+const queryParams = ref<any>({
+  cleaned: 0, //0,普通查询1.一周待清洗
+  name: "",
+  org_id: 0,
+})
+
+const jump = function (v: any) {
+  console.log("jump", v)
+  router.push({
+    path: "/goLineData/oilFumeConcentration",
+    query: {
+      comName: v.company_name,
+      company_id: v.company_id,
+      back: 1,
+    },
+  })
+}
+
+function query(type: number) {
+  const params = {
+    org_id: orgId.value,
+    name: companyName.value,
+    cleaned: type, //0,普通查询1.一周待清洗
+  }
+
+  queryParams.value = params
+}
+function reset() {
+  companyName.value = ""
+  orgId.value = "0"
+  query(0)
+}
+const detail = function (row: any) {
+  router.push({
+    path: "/qxyw/details",
+    query: {
+      back: 1,
+      company_id: row.company_id,
+      company_name: row.name,
+    },
+  })
+}
+</script>
+
+<template>
+  <VbDataTable
+    ref="table"
+    :header="cols"
+    url="sys/operationMerchant/getoperationMerchant"
+    method="post"
+    :query-params="queryParams"
+    :has-checkbox="false"
+  >
+    <template v-slot:table-tool="">
+      <el-form class="align-items-center" :inline="true">
+        <el-form-item class="mb-0 me-5 align-items-center" label="商户名称">
+          <el-input class="" style="width: 180px" v-model="companyName" placeholder="请输入商户名称" :size="size" />
+        </el-form-item>
+        <el-form-item class="mb-0 me-5 align-items-center" label="区域">
+          <OrgSelectTree v-model:value="orgId" style="width: 180px"></OrgSelectTree>
+        </el-form-item>
+
+        <el-form-item class="mb-0 me-0 align-items-center">
+          <el-button class="ms-3 mt-0 btn btn-sm btn-primary" @click="query(0)">查询</el-button>
+          <el-button class="ms-3 mt-0 btn btn-sm btn-info" @click="query(1)">一周待清洗</el-button>
+          <el-button class="ms-3 mt-0 btn btn-sm btn-light-primary btn-outline" @click="reset">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </template>
+    <template #name="{ row }">
+      <span class="text-primary" @click="jump(row)" style="cursor: pointer">{{ row["name"] }}</span>
+    </template>
+
+    <template #action="{ row }">
+      <span class="table-action" @click="detail(row)">查看详情</span>
+    </template>
+  </VbDataTable>
+</template>

+ 261 - 0
src/views/purify/qxyw_detail.vue

@@ -0,0 +1,261 @@
+<script setup lang="ts">
+import configs from "@/core/config/Index"
+import { ElDatePicker } from "element-plus"
+import moment from "moment"
+import { ref } from "vue"
+import VbUpload from "@/components/Upload/VbUpload.vue"
+import { useRoute } from "vue-router"
+import type { VbFormItem } from "@/components/Forms/models"
+import RequestService from "@/core/services/RequestService"
+const route = useRoute()
+const table = ref()
+const cols = ref([
+  {
+    name: "序号",
+    width: 60,
+    field: configs.TABLE_INDEX_FIELD,
+  },
+  {
+    name: "净化器名称",
+    field: "monitor_name",
+  },
+  {
+    name: "天数",
+    field: "day_condition",
+  },
+  {
+    name: "开机小时",
+    field: "hour_condition",
+  },
+  {
+    name: "最后清洗时间",
+    field: "last_clean_time",
+  },
+  {
+    name: "经过天数",
+    field: "run_day",
+  },
+  {
+    name: "开机小时数",
+    field: "run_hour",
+  },
+  {
+    name: "剩余天数",
+    field: "surplus_day",
+  },
+  {
+    name: "剩余小时数",
+    field: "surplus_hour",
+  },
+  {
+    name: "操作",
+    field: "action",
+  },
+])
+const queryParams = ref({
+  company_id: route.query.company_id as string,
+})
+const modal = ref()
+const modalTable = ref()
+const dateRange = ref<any>("")
+const col2s = ref<Array<any>>([
+  {
+    name: "设备名称",
+    field: "device_name",
+  },
+  {
+    name: "清洗时间",
+    field: "clean_start",
+  },
+  {
+    name: "清洗照片",
+    field: "pictures",
+  },
+])
+const queryParam2s = ref<any>({
+  device_id: "0",
+})
+const deviceId = ref("")
+function cleanList(row: any) {
+  deviceId.value = row.device_id
+  query()
+  modal.value.show()
+}
+function query() {
+  const params: any = {
+    device_id: deviceId.value + "",
+  }
+  if (dateRange.value[0]) {
+    params.clean_start = moment(dateRange.value[0]).format("YYYYMMDD")
+    params.clean_end = moment(dateRange.value[1]).format("YYYYMMDD")
+  }
+  //[moment(new Date()).add(-1, "M").toDate(), new Date()]
+  queryParam2s.value = params
+}
+function reset() {
+  dateRange.value = ""
+  query()
+}
+
+const uploadEl = ref()
+function clean(row: any) {
+  uploadEl.value?.clearFiles()
+  formData.value = Object.assign({}, row)
+  formData.value.picture_name = ""
+  formData.value.clean_end = new Date()
+
+  modal2.value.show()
+}
+const validatePic = (rule: any, value: any, callback: any) => {
+  if (!value) {
+    callback(new Error("请选择附件"))
+  } else {
+    callback()
+  }
+}
+const modal2 = ref()
+const formData = ref<any>({})
+const formItems = ref<Array<VbFormItem>>([
+  {
+    label: "设施名称:",
+    field: "monitor_name",
+    component: "innerText",
+  },
+  {
+    label: "清洗时间:",
+    field: "clean_end",
+    placeholder: "请选择清洗时间",
+    class: "w-100",
+    required: true,
+    component: ElDatePicker,
+    props: {
+      type: "date",
+      disabledDate: (v: any) => {
+        return (
+          (v && v > moment().endOf("day")) ||
+          v < moment(formData.value.last_clean_time, "YYYYMMDD").add(1, "days").toDate()
+        )
+      },
+    },
+  },
+  {
+    label: "清洗图片:",
+    field: "picture_name",
+    component: VbUpload,
+    rules: [{ validator: validatePic, trigger: "change" }],
+  },
+])
+function onSave() {
+  const data = {
+    company_id: route.query.company_id,
+    device_id: formData.value.device_id,
+    clean_end: moment(formData.value.clean_end).format("YYYYMMDD"),
+    picture_name: formData.value.picture_name,
+  }
+  RequestService.post("sys/operationMerchant/newCleanLog", { data }).then(() => {
+    table.value.search()
+  })
+}
+</script>
+
+<template>
+  <h2 class="text-primary mb-3">{{ route.query.company_name }}</h2>
+  <VbDataTable
+    ref="table"
+    url="sys/operationMerchant/getPurifierList"
+    :header="cols"
+    :query-params="queryParams"
+    method="post"
+    :has-checkbox="false"
+    :pagination="true"
+  >
+    <template #tableHeader>
+      <thead>
+        <tr class="text-center">
+          <th class="bg-light-primary" rowspan="2" style="vertical-align: middle">序号</th>
+          <th class="bg-light-primary" rowspan="2" style="vertical-align: middle">净化器名称</th>
+          <th class="bg-light-primary" colspan="2">清洗周期</th>
+          <th class="bg-light-primary" rowspan="2" style="vertical-align: middle">最后清洗时间</th>
+          <th class="bg-light-primary" colspan="2">上次清洗至今</th>
+          <th class="bg-light-primary" colspan="2">距下次清洗</th>
+          <th class="bg-light-primary" rowspan="2" style="vertical-align: middle">清洗记录</th>
+        </tr>
+        <tr class="text-center">
+          <th class="bg-light-primary">天数</th>
+          <th class="bg-light-primary">开机小时</th>
+          <th class="bg-light-primary">经过天数</th>
+          <th class="bg-light-primary">开机小时数</th>
+          <th class="bg-light-primary">剩余天数</th>
+          <th class="bg-light-primary">剩余小时数</th>
+        </tr>
+      </thead>
+    </template>
+
+    <template #last_clean_time="{ row }">
+      {{ moment(row.last_clean_time, "YYYYMMDDHHmmss").format("YYYY-MM-DD") }}
+    </template>
+    <template #action="{ row }">
+      <span class="table-action" @click="cleanList(row)">清洗记录</span>
+      <span class="table-action" @click="clean(row)">填报记录</span>
+    </template>
+  </VbDataTable>
+  <VbModal
+    v-model:modal="modal"
+    title="清洗记录"
+    close-btn-class="btn btn-primary"
+    :confirm-btn="false"
+    modal-dialog-style="max-width: 1100px;width: 1100px;"
+  >
+    <template #body>
+      <VbDataTable
+        ref="modalTable"
+        :header="col2s"
+        url="sys/operationMerchant/selectCleanLog"
+        method="post"
+        :auto-search="false"
+        :query-params="queryParam2s"
+        :has-checkbox="false"
+      >
+        <template v-slot:table-tool="">
+          <el-form class="align-items-center" :inline="true">
+            <el-form-item class="mb-0 me-0 align-items-center" label="日期">
+              <el-date-picker
+                v-model="dateRange"
+                type="daterange"
+                range-separator="~"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                size="default"
+              />
+            </el-form-item>
+            <el-form-item class="mb-0 me-0 align-items-center">
+              <el-button class="ms-3 mt-0 btn btn-sm btn-primary" @click="query">查询</el-button>
+              <el-button class="ms-3 mt-0 btn btn-sm btn-light-primary btn-outline" @click="reset">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </template>
+        <template #pictures="{ row }">
+          <div class="d-flex h-100 justify-content-center align-items-center p-3">
+            <el-image
+              v-for="(pic, i) in row.pictures?.split(',')"
+              :key="i"
+              :src="`/api/file/upload/res/${pic}`"
+              :preview-src-list="row.pictures.split(',').map((v:any)=>{
+                return `/api/file/upload/res/${v}`
+              })"
+              :hide-on-click-modal="true"
+              fit="cover"
+              style="height: 50px; width: 75px; max-width: none; border-radius: 0.475rem; margin-left: 5px"
+              alt=""
+            />
+          </div>
+        </template>
+      </VbDataTable>
+    </template>
+  </VbModal>
+  <VbModal v-model:modal="modal2" title="清洗填报" :form-data="formData" :form-items="formItems" @confirm="onSave">
+    <template #picture_name_form>
+      <VbUpload ref="uploadEl" v-model="formData.picture_name"></VbUpload>
+    </template>
+  </VbModal>
+</template>

+ 1 - 0
src/views/purify/washInfo_company.vue

@@ -86,6 +86,7 @@ function query() {
 }
 function reset() {
   dateRange.value = ""
+  query()
 }
 </script>
 

+ 7 - 3
src/views/purify/washInfo_details.vue

@@ -160,11 +160,15 @@ function onSaveNotice() {
     <template #pictures="{ row }">
       <div class="d-flex h-100 justify-content-center align-items-center p-3">
         <el-image
-          :src="`/api/file/upload/res/${row.pictures}`"
-          :preview-src-list="[`/api/file/upload/res/${row.pictures}`]"
+          v-for="(pic, i) in row.pictures?.split(',')"
+          :key="i"
+          :src="`/api/file/upload/res/${pic}`"
+          :preview-src-list="row.pictures.split(',').map((v:any)=>{
+                return `/api/file/upload/res/${v}`
+              })"
           :hide-on-click-modal="true"
           fit="cover"
-          style="height: 50px; width: 75px; max-width: none; border-radius: 0.475rem"
+          style="height: 50px; width: 75px; max-width: none; border-radius: 0.475rem; margin-left: 5px"
           alt=""
         />
       </div>