Browse Source

Merge branch 'zz-test' into master

LAPTOP-U5GOA5HA\zz 1 year ago
parent
commit
cab1c23df3

+ 7 - 0
src/api/clw/applyCarLog.js

@@ -42,3 +42,10 @@ export function delApplyCarLog (id) {
     method: 'delete'
   })
 }
+// 流程图
+export function getWorkflow (id) {
+  return request({
+    url: '/clw/workflow/' + id,
+    method: 'get'
+  })
+}

+ 3 - 0
src/main.js

@@ -12,6 +12,8 @@ import { VueAxios } from './utils/request'
 import ProLayout, { PageHeaderWrapper } from '@/components/ProLayout'
 import FooterToolBar from '@/components/FooterToolbar'
 import FileUpload from '@/components/FileUpload'
+import ElementUI from 'element-ui';
+import 'element-ui/lib/theme-chalk/index.css';
 import themePluginConfig from '../config/themePluginConfig'
 import { TableSetting } from '@/components'
 // 字典数据组件
@@ -45,6 +47,7 @@ Vue.config.productionTip = false
 
 // mount axios to `Vue.$http` and `this.$http`
 Vue.use(VueAxios)
+Vue.use(ElementUI);
 // use pro-layout components
 Vue.component('pro-layout', ProLayout)
 Vue.component('page-container', PageHeaderWrapper)

+ 197 - 25
src/views/clw/applyCarLog/modules/CreateForm.vue

@@ -7,11 +7,7 @@
       <a-row>
         <a-col :span="10">
           <a-form-model-item label="申请用车时间" prop="applicationTime">
-            <a-input
-              v-model="form.applicationTime"
-              placeholder="暂无信息"
-              :disabled="true"
-            /> </a-form-model-item
+            <a-input v-model="form.applicationTime" placeholder="暂无信息" :disabled="true" /> </a-form-model-item
         ></a-col>
         <a-col :span="10"
           ><a-form-model-item label="预计归还时间" prop="returnTime">
@@ -61,11 +57,7 @@
       <a-row>
         <a-col :span="10"
           ><a-form-model-item label="实际归还时间" prop="realReturnTime">
-            <a-input
-              v-model="form.realReturnTime"
-              placeholder="暂无信息"
-              :disabled="true"
-            /> </a-form-model-item
+            <a-input v-model="form.realReturnTime" placeholder="暂无信息" :disabled="true" /> </a-form-model-item
         ></a-col>
         <a-col :span="10">
           <a-form-item label="审核状态">
@@ -98,6 +90,48 @@
       <a-form-model-item label="备注" prop="remark">
         <a-input v-model="form.remark" placeholder="暂无信息" :disabled="true" />
       </a-form-model-item>
+      <div>
+        <template>
+          <div>
+            <!-- <Timeline pending="Recording..." :reverse="reverse">
+              <TimelineItem v-for="(item, index) in list" :key="index">
+                <div>{{ item.nodeRole }}</div>
+                <div slot="dot">
+                  <img :src="item.list" alt="">
+                </div>
+              </TimelineItem>
+              <TimelineItem>Solve initial network problems 2015-09-01</TimelineItem>
+              <TimelineItem>Technical testing 2015-09-01</TimelineItem>
+            </Timeline> -->
+            <div class="timeLines" style=" margin-bottom: 14px; ">
+              <div style="margin-left: 10px; margin-bottom: 18px; font-size: 16px;font-weight:600">用车申请审批</div>
+              <div class="ul_box">
+                <ul class="timeline-wrapper">
+                  <li class="timeline-item" v-for="(t, index) in list" :key="index">
+                    <div class="timeline-box">
+                      <div class="out-circle">
+                        <div class="in-circle" :class="addinCircle(t.list)"></div>
+                      </div>
+                      <div class="long-line"></div>
+                    </div>
+                    <div style="margin-left: 25px; margin-bottom: 4px; font-size: 16px">{{ t.nodeRole }}</div>
+                    <div class="timeline-content" v-if="t.list">
+                      <div class="timeline-date" v-for="(item, index1) in t.list" :key="index1">
+                        <span style="display: inline-block; margin-bottom: 15px"> 审核人:{{ item.userName }}</span>
+                        <div class="timeline-title">审核时间:{{ item.approvalTime }}</div>
+                        <div class="timeline-desc">
+                          审核状态:
+                          <span>{{ item.status }}</span>
+                        </div>
+                      </div>
+                    </div>
+                  </li>
+                </ul>
+              </div>
+            </div>
+          </div>
+        </template>
+      </div>
       <div class="bottom-control">
         <a-space>
           <!-- <a-button type="primary" :loading="submitLoading" @click="submitForm"> 保存 </a-button> -->
@@ -109,8 +143,12 @@
 </template>
 
 <script>
-import { getApplyCarLog, addApplyCarLog, updateApplyCarLog } from '@/api/clw/applyCarLog'
+import { getApplyCarLog, addApplyCarLog, updateApplyCarLog, getWorkflow } from '@/api/clw/applyCarLog'
 
+import { Timeline } from 'ant-design-vue'
+
+// Timeline.
+const TimelineItem = Timeline.Item
 export default {
   name: 'CreateForm',
   props: {
@@ -119,7 +157,7 @@ export default {
       required: true,
     },
   },
-  components: {},
+  components: { Timeline, TimelineItem },
   dicts: ['apply_status'],
   data() {
     return {
@@ -165,17 +203,38 @@ export default {
       formType: 1,
       open: false,
       rules: {},
+      reverse: false,
+      list: [],
     }
   },
   filters: {},
   created() {},
-  computed: {},
+  computed: {
+    // 监听agree颜色变化
+    fontstyle() {
+      return (icontent) => {
+        // 使用JavaScript闭包,进行传值操作
+        console.log(icontent)
+
+        if (icontent == '1') {
+          return { color: 'green' }
+        } else {
+          return { color: 'red' }
+        }
+      }
+    },
+  },
   watch: {},
   mounted() {},
   methods: {
     onClose() {
       this.open = false
     },
+    colors(index) {
+      if (index != null) {
+        return '#2a9c4a'
+      }
+    },
     // 取消按钮
     cancel() {
       this.open = false
@@ -233,20 +292,24 @@ export default {
       this.formType = 2
       const id = row ? row.id : ids
       getApplyCarLog(id).then((response) => {
-        let obj=response.data
-        if(obj.isTimeout=='1'){
-          obj.isTimeout='已超期'
-        }else if(obj.isTimeout=='0'){
-          obj.isTimeout='未超期'
+        let obj = response.data
+        if (obj.isTimeout == '1') {
+          obj.isTimeout = '已超期'
+        } else if (obj.isTimeout == '0') {
+          obj.isTimeout = '未超期'
         }
-        if(obj.isTips=='1'){
-          obj.isTips='超期已提醒'
-        }else if(obj.isTips=='0'){
-          obj.isTips='超期未提醒'
+        if (obj.isTips == '1') {
+          obj.isTips = '超期已提醒'
+        } else if (obj.isTips == '0') {
+          obj.isTips = '超期未提醒'
         }
         this.form = obj
         this.open = true
         this.formTitle = '用车申请详情'
+        getWorkflow(obj.taskId).then((res) => {
+          console.log('---------流程', res)
+          this.list = res.data.nodes
+        })
       })
     },
     /** 提交按钮 */
@@ -280,17 +343,126 @@ export default {
         }
       })
     },
+    addinCircle(item) {
+      if (item) {
+        for (let index = 0; index < item.length; index++) {
+          if (item[index].status === 1) {
+            return 'in-circle in-circle1'
+          }
+          if (item[index].status === 2) {
+            return 'in-circle in-circle2'
+          }
+          if (item[index].status === 3 ||item[index].status === 4) {
+            return 'in-circle in-circle3'
+          }
+        }
+      }
+    },
   },
 }
 </script>
 <style lang="less" scoped>
-/deep/.ant-col{
+/deep/.ant-col {
   margin-right: 40px;
 }
-/deep/.ant-select{
+/deep/.ant-select {
   color: #000;
 }
-/deep/.ant-input{
+/deep/.ant-input {
   color: #000;
 }
+ul.timeline-wrapper {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+}
+
+/* 时间线 */
+.timeline-item {
+  position: relative;
+
+  .timeline-box {
+    text-align: center;
+    position: absolute;
+
+    .out-circle {
+      width: 16px;
+      height: 16px;
+      background: rgba(14, 116, 218, 0.1);
+      box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
+      /*opacity: 0.1;*/
+      border-radius: 50%;
+      display: flex;
+      align-items: center;
+
+      .in-circle {
+        width: 8px;
+        height: 8px;
+        margin: 0 auto;
+        background: rgba(14, 116, 218, 1);
+        border-radius: 50%;
+        box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
+      }
+      .in-circle1 {
+        background: #0ceb2e !important;
+      }
+      .in-circle2 {
+        background: rgba(14, 116, 218, 1) !important;
+      }
+      .in-circle3 {
+        background-color: rgb(218, 106, 14) !important;
+      }
+    }
+
+    .long-line {
+      width: 2px;
+      height: 98px;
+      background: rgba(14, 116, 218, 1);
+      box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
+      opacity: 0.1;
+      margin-left: 8px;
+    }
+    // .long-line:nth-last-child(1) {
+    //   height: 0;
+    // }
+  }
+
+  .timeline-content {
+    box-sizing: border-box;
+    margin-left: 20px;
+    height: 106px;
+    padding: 0 0 0 20px;
+    text-align: left;
+    // margin-bottom: 30px;
+
+    .timeline-title {
+      font-size: 14px;
+      word-break: break-all;
+      margin-bottom: 16px;
+      color: #333;
+      font-weight: 500;
+      /*display: inline;*/
+    }
+
+    .timeline-date {
+      font-size: 16px;
+      color: #333;
+      font-weight: 500;
+      margin-bottom: 16px;
+    }
+    .timeline-desc {
+      font-size: 14px;
+      color: #999999;
+    }
+  }
+}
+.timeline-item:last-child{
+  .long-line {
+      height: 0;
+    }
+}
+
+.timeline-item:last-of-type .timeline-content {
+  margin-bottom: 0;
+}
 </style>

+ 1 - 0
src/views/vehicle/components/CarType.vue

@@ -147,6 +147,7 @@ export default {
                   }
                   return str
                 },
+                color:'#fff',
                 padding: [0, -20],
                 height: 35,
                 rich: {

+ 1 - 1
src/views/vehicle/components/VehicleDistribution.vue

@@ -59,7 +59,7 @@ export default {
       var spNum = 5,
         _max = 100
       var legendData = ['灭火消防车', '举高消防车', '后援消防车', '专勤消防车', '机场消防车']
-      var y_data = ['两江支队', '鸳鸯支队', '大竹林站', '礼嘉站', '翠云站', '龙头寺站']
+      var y_data = ['两江支队', '鸳鸯', '大竹林站', '礼嘉站', '翠云站', '龙头寺站']
       var _datamax = [100, 100, 100, 100, 100, 100]
       var fomatter_fn = function (v) {
         return ((v.value / _max) * 100).toFixed(0)

+ 1 - 1
src/views/vehicle/components/fuelEchart.vue

@@ -48,7 +48,7 @@ export default {
           bottom: '10%',
         },
         xAxis: {
-          data: ['两江支队', '鸳鸯支队', '大竹林站', '礼嘉站', '翠云站', '龙头寺站'],
+          data: ['两江支队', '鸳鸯', '大竹林站', '礼嘉站', '翠云站', '龙头寺站'],
           axisLine: {
             lineStyle: {
               color: '#0177d4',

+ 2 - 2
vue.config.js

@@ -110,8 +110,8 @@ const vueConfig = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `https://ruoyi.setworld.net`,
-        target: `http://113.249.153.164:7618/api`,
-        // target:`http://192.168.31.129:8080/`,
+        // target: `http://113.249.153.164:7618/api`,
+        target:`http://192.168.31.129:8080/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''