Bladeren bron

提交车间移动端

Lijy 1 jaar geleden
bovenliggende
commit
22ae2e132b

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/index/index.vue

@@ -88,6 +88,13 @@ export default {
                 this.previewPicture()
             }
         }
+        console.log(this.user, '====>')
+
+        if(this.user.beDeptList && this.user.beDeptList.length > 0) {
+            localStorage.setItem('beDeptList', true)
+        } else {
+            localStorage.setItem('beDeptList', false)
+        }
     },
     components: {
         Footer

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/InsertionPlan/InsertionPlan.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="flexCoum">
-    <van-nav-bar title="插单计划" left-text="返回" @click-left="back" fixed left-arrow v-if="!user.beDeptList" />
-    <van-nav-bar title="插单计划" left-text="返回" right-text="新建" @click-left="back" v-if="user.beDeptList" fixed left-arrow @click-right="add" />
+    <van-nav-bar title="插单计划" left-text="返回" @click-left="back" fixed left-arrow v-if="!beDeptList" />
+    <van-nav-bar title="插单计划" left-text="返回" right-text="新建" @click-left="back" v-if="beDeptList" fixed left-arrow @click-right="add" />
     <div class="InsertionPlan flexCoum-box">
       <div class="InsertionPlanBox contentRoll">
         <div v-for="item,index in planList" :key="index" class="InsertionPlanBox_item">
@@ -21,6 +21,7 @@ export default {
   },
   data() {
     return {
+      beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
       user: JSON.parse(localStorage.getItem('userInfo')),
       planList: [],
     };

+ 9 - 5
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/InsertionPlan/InsertionPlanItem.vue

@@ -11,11 +11,11 @@
       <div class="item"><p>工时:</p><span>{{ planList.planWorkHour }}小时</span></div>
       <div class="item" style="width: 100%;">
         <p>组员:</p>
-        <span :style="`color: #1989fa`" @click.stop="distributionProp()" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">
+        <span :style="`color: #333`" @click.stop="distributionProp()" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">
           {{ planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames }}
           <van-icon name="edit" color="#1989fa"/>
         </span>
-        <span :style="`color: #1989fa`" @click.stop="distributionProp()" v-if="!(planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames)">分配</span>
+        <span :style="`color: #1989fa`" @click.stop="distributionProp()" v-if="!(planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames) && beDeptList">分配</span>
       </div>
       <div class="planItem_conter_icon">
         <van-icon name="arrow" size="20" color="#999" />
@@ -44,6 +44,7 @@ export default {
   },
   data() {
     return {
+      beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
       popupShow: false,
       peopleList: {
         planProcedureTotals: [{teamNames: ''}]
@@ -68,9 +69,12 @@ export default {
       })
     },
     distributionProp() {
-      console.log(this.planList, '看看你')
-      this.peopleListId =  this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
-      this.popupShow = true
+      if(this.beDeptList) {
+        console.log(this.planList, '看看你')
+        this.peopleListId =  this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
+        this.popupShow = true
+      }
+      
     },
     // 获取人员
     getPeople() {

+ 12 - 9
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -14,8 +14,8 @@
           </div>
           <div class="PlanItem" v-show="todayAndTomorrow">
             <div>组员:</div>
-            <span class="textBeyondHiding" v-if="item.teamNames" @click="distributionProp(item,index)">{{ item.teamNames }} <van-icon name="edit" color="#1989fa" /> </span>
-            <span style="color: #1989fa;" v-if="!item.teamNames" @click="distributionProp(item,index)">分配</span>
+            <span class="" v-if="item.teamNames" @click="distributionProp(item,index)">{{ item.teamNames }} <van-icon name="edit" color="#1989fa" /> </span>
+            <span style="color: #1989fa;" v-if="!item.teamNames && beDeptList" @click="distributionProp(item,index)">分配</span>
           </div>
           <div class="PlanItem">
             <div>单件工价:</div><span class="textBeyondHiding">{{ item.prodProcedure.workingTime }}</span>
@@ -56,6 +56,7 @@ export default {
   },
   data() {
     return {
+      beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
       distributionList: [],
       distributionIndex: null,
       popupShow: false,
@@ -94,14 +95,16 @@ export default {
       console.log('点击了下单计划')
     },
     distributionProp(item, index) {
-      console.log(item, index)
-      if(item.teamIds) {
-        this.peopleListId = item.teamIds.split(',')
-      } else {
-        this.peopleListId = []
+      if(this.beDeptList) {
+        console.log(item, index)
+        if(item.teamIds) {
+          this.peopleListId = item.teamIds.split(',')
+        } else {
+          this.peopleListId = []
+        }
+        this.distributionIndex = index
+        this.popupShow = true
       }
-      this.distributionIndex = index
-      this.popupShow = true
     },
     getDistributionList() {
       this.$axios.post('/plan/planDetail', {