wenhongquan 1 year ago
parent
commit
67e19b8c37
4 changed files with 111 additions and 5 deletions
  1. 1 0
      package.json
  2. 36 1
      src/layout/components/Navbar.vue
  3. 72 2
      src/views/task/detail/index.vue
  4. 2 2
      src/views/task/list/index.vue

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
         "@element-plus/icons-vue": "1.1.4",
         "@vue/babel-plugin-jsx": "^1.1.1",
         "axios": "0.26.1",
+        "clipboard": "^2.0.11",
         "dingtalk-jsapi": "^2.15.2",
         "echarts": "^5.4.0",
         "element-plus": "2.1.8",

+ 36 - 1
src/layout/components/Navbar.vue

@@ -8,7 +8,10 @@
 
       <div class="time"><el-button type="success" @click="godap">大屏</el-button></div>
       <div class="time">{{currenttime}}</div>
-      <div class="username">{{getters.nickName}}</div>
+      <el-badge v-if="taskshnum>0" :value="taskshnum" class="item">
+        <div class="username">{{getters.nickName}}</div>
+     </el-badge>
+      <div v-if="taskshnum==0" class="time">{{getters.nickName}}</div>
       <div style="margin-right:5px">
          <el-button @click="logout"  style="background:rgba(0,0,0,0);border:none" plain><img style="width:15px;height:15px" :src="icon_loginout"></el-button>
       </div>
@@ -60,16 +63,35 @@ import moment from 'moment'
 import variables from '@/assets/styles/variables.module.scss'
 /** @ts-ignore */
 import icon_loginout from '@/assets/images/loginout.png';
+import {
+  listTask
+} from "@/api/system/task";
+
 
+const taskshnum = ref(0);
 
 
 const currenttime = ref("")
 
+var index = 0;
 setInterval(()=>{
   currenttime.value = moment().format('YYYY-MM-DD HH:mm:ss');
+  if (index++ / 3 == 0) {
+     gettaskshlist()
+  }
+  if (index > 30) {
+    index = 0;
+  }
+
 },1000)
 
 
+const gettaskshlist = () => {
+  listTask({status:3,pageNum:1,pageSize:1000}).then((response) => {
+     taskshnum.value = response.total;
+  });
+}
+
 const store = useStore();
 const getters = computed(() => store.getters);
 
@@ -118,9 +140,22 @@ const emits = defineEmits(['setLayout'])
 function setLayout() {
   emits('setLayout');
 }
+
+
 </script>
 
+<style lang='scss' >
+
+  .el-badge__content.is-fixed{
+    top: 10px !important;
+  }
+
+</style>
+
 <style lang='scss' scoped>
+
+
+
 .navbar {
   height: 50px;
   overflow: hidden;

+ 72 - 2
src/views/task/detail/index.vue

@@ -62,6 +62,18 @@
       <div class="card">
         <div class="title" style="position: relative">
           工单信息
+          <el-popover
+
+    title="项目信息"
+    :width="400"
+    trigger="hover"
+
+  >
+  <div slot="content" v-html='(gettaskInfoText() ?? "").replaceAll("\r\n","<br/>") '></div>
+    <template #reference>
+      <el-button  @click="copyTaskInfo"><el-icon><CopyDocument /></el-icon></el-button>
+    </template>
+  </el-popover>
 
           <div
             style="
@@ -1284,6 +1296,7 @@ import { ElMessage } from "element-plus";
 import ImageUpload from "@/components/ImageUpload";
 import FileUpload from "@/components/FileUpload";
 import moment from "moment";
+import clipboard from 'clipboard';
 
 const STATICURL = import.meta.env.VITE_APP_BASE_API;
 
@@ -1298,7 +1311,8 @@ const {
   zctype,
   zccz,
   zcdw,
-  zcgg
+  zcgg,
+  sys_area,
 } = useDict(
   "task_status",
   "task_type",
@@ -1310,7 +1324,8 @@ const {
   "zctype",
   "zccz",
   "zcdw",
-  "zcgg"
+  "zcgg",
+  "sys_area"
 );
 
 const route = useRoute();
@@ -1381,6 +1396,61 @@ const doseclt = (userinfo) => {
 
 }
 
+const gettaskInfoText = () => {
+  try {
+    var datap = "事件分类:" + (task_type.value.filter(
+    (i) =>
+      i.value.toString() === taskinfo.value.taskType.toString()
+  )[0]?.label ?? "-") + "\r\n";
+  datap+="区域:"+  (sys_area.value.filter(
+    (i) =>
+      i.value.toString() === taskinfo.value.taskArea.toString()
+        )[0]?.label ?? "-") + "\r\n";
+   datap+="班组:"+((taskinfo.value.taskDeptRange ?? "")
+                  .split(",")
+                  .map((i) => {
+                    return (
+                      alldept.value.find((p) => {
+                        return p.deptId + "" === i + "";
+                      })?.deptName ?? "-"
+                    );
+                  })
+     .join(",")) + "\r\n";
+
+        datap+="日期:"+(taskinfo.value.createTime)+ "\r\n";
+        datap+="工单号:"+(taskinfo.value.taskOtherId)+ "\r\n";
+        datap+="事件地址:"+(taskinfo.value.taskAddr)+ "\r\n";
+        datap+="事件内容:"+(taskinfo.value.taskContent)+ "\r\n";
+        datap+="事件类型:"+(task_event_type.value.filter(
+                  (i) =>
+                    i.value.toString() === taskinfo.value.taskEventType.toString()
+                )[0]?.label ?? "-")+ "\r\n";
+        datap+="现场核实:"+(JSON.parse(
+                    taskinfo.value.tblTaskLogList.filter(
+                      (ii) => ii.taskStatus === 3
+                    )[0].logDes ?? "{}"
+                  ).qsdes)+ "\r\n";
+        datap+="处理方法:"+( (JSON.parse(
+              taskinfo.value.tblTaskLogList.filter(
+              (ii) => ii.taskStatus === 3
+              )[0].logDes ?? "{}"
+                  ).czff == undefined ? '-' : JSON.parse(
+                    taskinfo.value.tblTaskLogList.filter(
+                      (ii) => ii.taskStatus === 3
+                    )[0].logDes ?? "{}"
+        ).czff)) + "\r\n";
+    return datap;
+  } catch (error) {
+
+  }
+  return "";
+}
+
+const copyTaskInfo = () => {
+  var datap = gettaskInfoText();
+  clipboard.copy(datap);
+   ElMessage.success("复制成功!");
+ }
 
 
 

+ 2 - 2
src/views/task/list/index.vue

@@ -505,7 +505,7 @@ const exportexcel = (row) => {
     {
       ...{ taskId: row.taskId },
     },
-    `${row.taskCode}工单.xlsx`
+    `${row.taskOtherId}工单.xlsx`
   );
 };
 const exportexcel1 = (row) => {
@@ -514,7 +514,7 @@ const exportexcel1 = (row) => {
     {
       ...{ taskId: row.taskId },
     },
-    `${row.taskCode}热线照片.xlsx`
+    `${row.taskOtherId}热线照片.xlsx`
   );
 };
 const exportexcel2 = (row) => {