whj vor 1 Jahr
Ursprung
Commit
98507b0632

+ 15 - 1
src/api/preparation/preparation.js

@@ -64,7 +64,21 @@ export function fetchPreparation (parameter) {
     }
   })
 }
-
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getPreparationNum () {
+  return axios({
+    url: '/preparation/preparations/repair/num',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
 /**
  * query list func
  * parameter: { }

BIN
src/assets/blue.png


BIN
src/assets/red2.png


BIN
src/assets/violet.png


BIN
src/assets/yellow.png


+ 4 - 1
src/views/preparation/preparation/Preparation.vue

@@ -11,7 +11,7 @@
             </a-col>
             <a-col :md="8" :sm="24">
               <a-form-item label="状态">
-                <a-select v-model="queryParam.status" placeholder="请选择">
+                <a-select mode="multiple" v-model="queryParam.statusList" placeholder="请选择">
                   <a-select-option
                     v-for="(label,value) in statusMap"
                     :key="value"
@@ -179,6 +179,8 @@ export default {
           title: '工单状态',
           checked: true,
           dataIndex: 'status',
+          fixed: 'right',
+          align: 'center',
           width: 200,
           scopedSlots: { customRender: 'status' }
         },
@@ -227,6 +229,7 @@ export default {
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PREPARATION_STATUS)
     this.preparationMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PREPARATION_PARENT)
     this.getData('')
+    this.queryParam.statusList = JSON.parse(this.$route.query.status)
   },
   methods: {
     getData (parentId) {

+ 11 - 2
src/views/workplace/backlog/NewWorkplaceBacklog.vue

@@ -486,7 +486,7 @@ export default {
       this.chartLine.render()
     },
     toCalendar () {
-      let repairTips = cookie.get('repairTips')
+      const repairTips = cookie.get('repairTips')
       if (repairTips === '1') {
         getCalendarNotice().then(res => {
           const router = this.$router
@@ -494,7 +494,16 @@ export default {
           if (res.data !== null && res.data.length > 0) {
             this.$confirm({
               title: '提示',
-              content: '七天内需要完成的任务!',
+              content: () => {
+                return (<div>
+              近一周工单任务如下: <br />
+                  {
+                    res.data.map(item => {
+                      return <div>{item.calendarDate + ' : ' + item.num }</div>
+                    })
+                  }
+                </div>)
+              },
               okText: '去查看',
               icon: 'info-circle',
               onOk () {

+ 36 - 23
src/views/workplace/backlog/SbInfoWorkplaceBacklog.vue

@@ -489,29 +489,42 @@ export default {
       this.chartLine.render()
     },
     toCalendar () {
-      // getCalendarNotice().then(res => {
-      //   const router = this.$router
-      //   if (res.data.calendar_date !== null) {
-      //     this.$confirm({
-      //       title: '提示',
-      //       content: '七天内需要完成的任务!',
-      //       okText: '去查看',
-      //       icon: 'info-circle',
-      //       onOk () {
-      //         return new Promise((resolve, reject) => {
-      //           router.push({ path: '/repaire/calendar' })
-      //           resolve()
-      //         }).catch(err => {
-      //           this.$message.error({
-      //             title: '错误',
-      //             description: err.message
-      //           })
-      //         })
-      //       },
-      //       onCancel () {}
-      //     })
-      //   }
-      // })
+      const repairTips = cookie.get('repairTips')
+      if (repairTips === '1') {
+        getCalendarNotice().then(res => {
+          const router = this.$router
+          cookie.set('repairTips', 2, 7)
+          if (res.data !== null && res.data.length > 0) {
+            this.$confirm({
+              title: '提示',
+              content: () => {
+                return (<div>
+              近一周工单任务如下: <br />
+                  {
+                    res.data.map(item => {
+                      return <div>{item.calendarDate + ' : ' + item.num }</div>
+                    })
+                  }
+                </div>)
+              },
+              okText: '去查看',
+              icon: 'info-circle',
+              onOk () {
+                return new Promise((resolve, reject) => {
+                  router.push({ path: '/repaire/calendar' })
+                  resolve()
+                }).catch(err => {
+                  this.$message.error({
+                    title: '错误',
+                    description: err.message
+                  })
+                })
+              },
+              onCancel () {}
+            })
+          }
+        })
+      }
     }
     /* getLineCharts (id, data) {
       this.chartLine = new Chart({

+ 35 - 22
src/views/workplace/backlog/SbWorkplaceBacklog.vue

@@ -443,29 +443,42 @@ export default {
       this.chartLine.render()
     },
     toCalendar () {
-      /* getCalendarNotice().then(res => {
-        const router = this.$router
-        if (res.data.calendar_date !== null) {
-          this.$confirm({
-            title: '提示',
-            content: '七天内需要完成的任务!',
-            okText: '去查看',
-            icon: 'info-circle',
-            onOk () {
-              return new Promise((resolve, reject) => {
-                router.push({ path: '/repaire/calendar' })
-                resolve()
-              }).catch(err => {
-                this.$message.error({
-                  title: '错误',
-                  description: err.message
+      const repairTips = cookie.get('repairTips')
+      if (repairTips === '1') {
+        getCalendarNotice().then(res => {
+          const router = this.$router
+          cookie.set('repairTips', 2, 7)
+          if (res.data !== null && res.data.length > 0) {
+            this.$confirm({
+              title: '提示',
+              content: () => {
+                return (<div>
+              近一周工单任务如下: <br />
+                  {
+                    res.data.map(item => {
+                      return <div>{item.calendarDate + ' : ' + item.num }</div>
+                    })
+                  }
+                </div>)
+              },
+              okText: '去查看',
+              icon: 'info-circle',
+              onOk () {
+                return new Promise((resolve, reject) => {
+                  router.push({ path: '/repaire/calendar' })
+                  resolve()
+                }).catch(err => {
+                  this.$message.error({
+                    title: '错误',
+                    description: err.message
+                  })
                 })
-              })
-            },
-            onCancel () {}
-          })
-        }
-      }) */
+              },
+              onCancel () {}
+            })
+          }
+        })
+      }
     }
   }
 }

+ 35 - 22
src/views/workplace/backlog/StoreWorkplaceBacklog.vue

@@ -546,29 +546,42 @@ export default {
       modal.base()
     },
     toCalendar () {
-      /* getCalendarNotice().then(res => {
-        const router = this.$router
-        if (res.data.calendar_date !== null) {
-          this.$confirm({
-            title: '提示',
-            content: '七天内需要完成的任务!',
-            okText: '去查看',
-            icon: 'info-circle',
-            onOk () {
-              return new Promise((resolve, reject) => {
-                router.push({ path: '/repaire/calendar' })
-                resolve()
-              }).catch(err => {
-                this.$message.error({
-                  title: '错误',
-                  description: err.message
+      const repairTips = cookie.get('repairTips')
+      if (repairTips === '1') {
+        getCalendarNotice().then(res => {
+          const router = this.$router
+          cookie.set('repairTips', 2, 7)
+          if (res.data !== null && res.data.length > 0) {
+            this.$confirm({
+              title: '提示',
+              content: () => {
+                return (<div>
+              近一周工单任务如下: <br />
+                  {
+                    res.data.map(item => {
+                      return <div>{item.calendarDate + ' : ' + item.num }</div>
+                    })
+                  }
+                </div>)
+              },
+              okText: '去查看',
+              icon: 'info-circle',
+              onOk () {
+                return new Promise((resolve, reject) => {
+                  router.push({ path: '/repaire/calendar' })
+                  resolve()
+                }).catch(err => {
+                  this.$message.error({
+                    title: '错误',
+                    description: err.message
+                  })
                 })
-              })
-            },
-            onCancel () {}
-          })
-        }
-      }) */
+              },
+              onCancel () {}
+            })
+          }
+        })
+      }
     }
   }
 }

+ 129 - 13
src/views/workplace/backlog/WorkplaceBacklog.vue

@@ -6,7 +6,62 @@
     </div>
     <div slot="extra">
     </div>
-
+    <a-row type="flex" :gutter="20">
+      <a-col :span="6">
+        <div class="target">
+          <div class="target-title" @click="$router.push('/preparation/verify')">
+            待审核 <a-icon type="caret-left" />
+          </div>
+          <div class="target-main">
+            <a-icon class="icon" type="project" />
+            <div><div><span>{{ preparationNum.waitVerifyNum }}</span> 个</div>
+            </div>
+          </div>
+          <img src="@/assets/red2.png" alt="" width="100%" height="17px">
+        </div>
+      </a-col>
+      <a-col :span="6">
+        <div class="target">
+          <div class="target-title" @click="$router.push('/preparation/mine?status='+ JSON.stringify([3,6,9,12,18]))">
+            被拒工单 <a-icon type="caret-left" />
+          </div>
+          <div class="target-main">
+            <a-icon class="icon" type="stop" style="background:#029BFF" />
+            <div><div><span>{{ preparationNum.refusedNum }}</span> 个</div>
+            </div>
+          </div>
+          <img src="@/assets/blue.png" alt="" width="100%" height="17px">
+        </div>
+      </a-col>
+      <a-col :span="6">
+        <div class="target">
+          <div class="target-title" @click="$router.push('/preparation/mine?status='+JSON.stringify([4,7,10,13,17]))">
+            回退工单 <a-icon type="caret-left" />
+          </div>
+          <div class="target-main">
+            <a-icon class="icon" type="apartment" style="background:#FFB22B" />
+            <div><div><span>{{ preparationNum.backNum }}</span> 个</div>
+            </div>
+          </div>
+          <img src="@/assets/yellow.png" alt="" width="100%" height="17px">
+        </div>
+      </a-col>
+      <a-col :span="6">
+        <div class="target">
+          <div class="target-title" @click="$router.push('/preparation/mine?status='+JSON.stringify([14]))">
+            执行工单 <a-icon type="caret-left" />
+          </div>
+          <div class="target-main">
+            <a-icon class="icon" type="clock-circle" style="background:#7460EE" />
+            <div>
+              <div><span>{{ preparationNum.workingNum }}</span> 个</div>
+            </div>
+          </div>
+          <img src="@/assets/violet.png" alt="" width="100%" height="17px">
+        </div>
+      </a-col>
+    </a-row>
+    <br>
     <a-card :bordered="false" v-show="dataFlag">
       <div v-show="visible">
         <div class="table-page-search-wrapper">
@@ -105,7 +160,7 @@ import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
 import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
 import DetailScrap from '@/views/sb/scrap/modules/Detail'
 import DetailPreparationModal from '@/views/preparation/preparation/modules/Detail'
-import { fetchPreparation } from '@/api/preparation/preparation'
+import { fetchPreparation, getPreparationNum } from '@/api/preparation/preparation'
 import cookie from 'vue-cookie'
 
 export default {
@@ -206,6 +261,7 @@ export default {
           ...parameter,
           ...this.queryParam
         }
+
         return getWorkplaceBacklogUserPage(parameter)
           .then(res => {
             return res.data
@@ -230,7 +286,8 @@ export default {
       sbOilTaskShow: false,
       sbOilAuditShow: false,
       sbAllocateTaskAuditShow: false,
-      loading: true
+      loading: true,
+      preparationNum: {}
     }
   },
   computed: {
@@ -245,6 +302,7 @@ export default {
   created () {
     this.user = this.userInfo
     this.avatar = this.BaseTool.Constant.FILE_URL + this.userInfo.avatar
+    this.getPrep()
     this.getDict()
     this.tableOption()
     this.toCalendar()
@@ -256,6 +314,12 @@ export default {
     // this.initRadar()
   },
   methods: {
+    getPrep () {
+      getPreparationNum().then(res => {
+        console.log(res, 12321312)
+        this.preparationNum = res.data
+      })
+    },
     tableOption () {
       this.options = {
         alert: false,
@@ -450,22 +514,24 @@ export default {
       this.$refs.table.refresh()
     },
     toCalendar () {
-      let repairTips = cookie.get('repairTips')
+      const repairTips = cookie.get('repairTips')
       if (repairTips === '1') {
         getCalendarNotice().then(res => {
           const router = this.$router
           cookie.set('repairTips', 2, 7)
           if (res.data !== null && res.data.length > 0) {
-            let infoStr = ''
-            res.data.forEach(res => {
-              infoStr += res.calendarDate
-              infoStr += ' : '
-              infoStr += res.num
-              infoStr += '\t'
-            })
             this.$confirm({
               title: '提示',
-              content: '近一周工单任务如下:<br>' + infoStr,
+              content: () => {
+                return (<div>
+              近一周工单任务如下: <br />
+                  {
+                    res.data.map(item => {
+                      return <div>{item.calendarDate + ' : ' + item.num }</div>
+                    })
+                  }
+                </div>)
+              },
               okText: '去查看',
               icon: 'info-circle',
               onOk () {
@@ -521,5 +587,55 @@ export default {
     display: none;
   }
 }
-
+.target{
+  height: 150px;
+  background: #FFFFFF;
+  display: flex;
+  align-items: center;
+  position: relative;
+  box-shadow: 0px 2px 6px 0px rgba(15,6,14,0.1);
+  .target-title{
+    text-align: right;
+    position: absolute;
+    font-weight: 700;
+    top: 15px;
+    right:0;
+    font-size: 20px;
+    &:hover{
+      cursor: pointer;
+    }
+    i{
+      font-size: 20px;
+      color:#FF0000;
+      transform: scale(2);
+    }
+  }
+  &>img{
+    position: absolute;
+    bottom: 0;
+  }
+  .target-main{
+    padding:0 20px;
+    display: flex;
+    align-items: center;
+    div{
+     padding: 0 20px;
+    color: #333333;
+    font-size:16px;
+    span{
+      font-size: 30px;
+    }
+    }
+   .icon{
+    color:#FFFFFF;
+    background:#FF0000;
+    width: 80px;
+    height: 80px;
+    line-height: 88px;
+    text-align: center;
+    border-radius: 50%;
+    font-size: 40px;
+   }
+  }
+}
 </style>