Jelajahi Sumber

提交车间工时文件

Lijy 1 tahun lalu
induk
melakukan
ad0d623a4a

+ 29 - 18
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/components/chooseSomeone.vue

@@ -20,7 +20,7 @@
         <van-checkbox :name="item.id" v-for="item, index in personnelList" :key="index">
           <div class="chooseSomeone_group_item">
             <div>{{ item.name }}</div>
-            <div class="textBeyondHiding">{{ item.workStation }}</div>
+            <div class="textBeyondHiding">{{ item.jobNumber }}</div>
           </div>
         </van-checkbox>
       </van-checkbox-group>
@@ -53,7 +53,11 @@ export default {
     groupViewBack: {
       type: Boolean,
       default: () => false // 是否显示从其他工位选择员工
-    } 
+    },
+    peopleList: {
+      type: Array,
+      default: () => []
+    }
   },
   components: {},
   data() {
@@ -63,22 +67,7 @@ export default {
       groupVal: [],
       treeVal: [],
       // 人员数组
-      personnelList: [
-        { id: 1, name: '张山', workNumber: '123', workStation: '工位1' },
-        { id: 2, name: '李四', workNumber: '123', workStation: '工位2' },
-        { id: 3, name: '王五', workNumber: '123', workStation: '工位3' },
-        { id: 4, name: '赵六', workNumber: '123', workStation: '工位4' },
-        { id: 5, name: '张山', workNumber: '123', workStation: '工位5' },
-        { id: 6, name: '李四', workNumber: '123', workStation: '工位6' },
-        { id: 7, name: '王五', workNumber: '123', workStation: '工位7' },
-        { id: 8, name: '赵六', workNumber: '123', workStation: '工位8' },
-        { id: 9, name: '张山', workNumber: '123', workStation: '工位9' },
-        { id: 10, name: '李四', workNumber: '123', workStation: '工位10' },
-        { id: 11, name: '王五', workNumber: '123', workStation: '工位11' },
-        { id: 12, name: '赵六', workNumber: '123', workStation: '工位12' },
-        { id: 13, name: '张山', workNumber: '123', workStation: '工位13' },
-        { id: 14, name: '李四', workNumber: '123', workStation: '工位14' },
-      ],
+      personnelList: [],
       personnelTree: [{
         label: '一级 1',
         children: [{
@@ -129,6 +118,7 @@ export default {
   mounted() { 
     this.newGroupView = JSON.parse(JSON.stringify(this.groupView)) 
     this.newGroupViewBack = JSON.parse(JSON.stringify(this.groupViewBack))
+    this.personnelList = JSON.parse(JSON.stringify(this.peopleList))
    },
   methods: {
     onSearch() {
@@ -137,6 +127,27 @@ export default {
     newGroupViewBackCli(flg, i) {
       this.newGroupViewBack = flg
       this.newGroupView = i
+    },
+    // 获取所有人员
+    getPeople() {
+      this.$axios.post('/user/getSimpleActiveUserList', {})
+      .then(res => {
+        if (res.code == "ok") {
+          if(!this.peopleList) {
+            this.peopleList = res.data.map(item => {
+              return {
+                name: item.name,
+                id: item.id,
+                phone: item.phone,
+                jobNumber: item.jobNumber
+              }
+            })
+          }
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); });
     }
   },
 };

+ 17 - 11
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -14,28 +14,28 @@
             <div v-if="item.flg">
               <div :class="`planComponent_ItemBom planComponent_show`">
                 <div class="PlanItem">
-                  <div>项目代码:</div><span>{{ item.projectCode }}</span>
+                  <div>项目代码:</div><span>{{ item.product.code }}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>计划总工价:</div><span class="textBeyondHiding">321</span>
+                  <div>计划总工价:</div><span class="textBeyondHiding">'-'</span>
                 </div>
                 <div class="PlanItem">
                   <div>数量:</div><span class="textBeyondHiding">{{ item.num }}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>单位:</div><span class="textBeyondHiding">321</span>
+                  <div>单位:</div><span class="textBeyondHiding">{{ item.product.unit }}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>订单数量:</div><span class="textBeyondHiding">123</span>
+                  <div>订单数量:</div><span class="textBeyondHiding">{{ item.product.orderNumber }}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>编组:</div><span class="textBeyondHiding">321</span>
+                  <div>编组:</div><span class="textBeyondHiding">{{item.product.groupNumber}}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>每列数量:</div><span class="textBeyondHiding">123</span>
+                  <div>每列数量:</div><span class="textBeyondHiding">{{ item.product.columnNumber }}</span>
                 </div>
                 <div class="PlanItem">
-                  <div>每辆数量:</div><span class="textBeyondHiding">321</span>
+                  <div>每辆数量:</div><span class="textBeyondHiding">{{ item.product.vehicleNumber }}</span>
                 </div>
                 <div class="PlanItemBtn">
                   <van-button type="info" size="small" @click="toDistribution(item)">派工单</van-button>
@@ -69,7 +69,8 @@ export default {
     return {
       activeNames: ['1'],
       productList: [],
-      paiArr: ['收起', '派工']
+      paiArr: ['收起', '派工'],
+      type: 0
     };
   },
   computed: {},
@@ -78,8 +79,10 @@ export default {
   mounted() { 
     if(this.titleText == '今日计划') {
       this.paiArr = ['收起', '派工']
+      this.type = 0
     } else {
       this.paiArr = ['收起', '展开']
+      this.type = 1
     }
     this.productList = this.planList
    },
@@ -88,11 +91,14 @@ export default {
       this.productList[index].flg = !this.productList[index].flg;
     },
     toDistribution(item) {
+      console.log(item, '点击的数据')
       this.$router.push({
         path: '/distribution',
         query: {
-          // id: item.id
-          titleText: this.titleText
+          id: item.id,
+          departmentId: item.stationId,
+          titleText: this.titleText,
+          type: this.type
         }
       })
     }
@@ -186,7 +192,7 @@ export default {
             width: 100%;
 
             span {
-              width: 230px;
+              width: 200px;
               word-break: break-all;
             }
           }

+ 57 - 20
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -10,7 +10,7 @@
       <div class="distribution_box" v-for="item,index in distributionList" :key="index">
         <div class="distribution_ItemBom">
           <div class="PlanItem">
-            <span>东湾2号线电池箱东湾2号线电池箱</span>
+            <span>{{ item.prodProcedure.name }}</span>
           </div>
           <div class="PlanItem" v-show="todayAndTomorrow">
             <div>组员:</div>
@@ -18,29 +18,31 @@
             <span style="color: #1989fa;" v-if="!item.personnel" @click="distributionProp(item,index)">分配</span>
           </div>
           <div class="PlanItem">
-            <div>单件工价:</div><span class="textBeyondHiding">123</span>
+            <div>单件工价:</div><span class="textBeyondHiding">{{ item.prodProcedure.workingTime }}</span>
           </div>
           <div class="PlanItem">
-            <div>总工价:</div><span class="textBeyondHiding">123</span>
+            <div>总工价:</div><span class="textBeyondHiding">{{ item.totalWages }}</span>
           </div>
           <div class="PlanItem">
-            <div>单件工时:</div><span class="textBeyondHiding">123</span>
+            <div>单件工时:</div><span class="textBeyondHiding">{{ item.prodProcedure.unitPrice }}</span>
           </div>
           <div class="PlanItem">
-            <div>总工时:</div><span class="textBeyondHiding">123</span>
+            <div>总工时:</div><span class="textBeyondHiding">{{ item.totalWorkingHours }}</span>
           </div>
           <div class="PlanItem" v-if="todayAndTomorrow">
-            <div>进度:</div><span class="textBeyondHiding">123</span>
+            <div>进度:</div><span class="textBeyondHiding">'V'</span>
           </div>
           <div class="PlanItem">
-            <div>质检类型:</div><span class="textBeyondHiding">123</span>
+            <div>质检类型:</div><span class="textBeyondHiding">
+              {{ item.prodProcedure.checkType == 0 ? '自检' : item.prodProcedure.checkType == 1 ? '互检' : '专检' }}
+            </span>
           </div>
         </div>
       </div>
     </div>
     <!-- 弹出层选人 -->
     <van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%',background: '#F4F4F4' }" >
-      <ChooseSomeone :groupView="2" :groupViewBack="true"></ChooseSomeone>
+      <ChooseSomeone :groupView="2" :groupViewBack="true" :peopleList="peopleList"></ChooseSomeone>
     </van-popup>
   </div>
 </template>
@@ -54,34 +56,33 @@ export default {
   },
   data() {
     return {
-      distributionList: [
-        {personnel: ''},
-        {personnel: '张三'},
-        {personnel: ''},
-        {personnel: '李四'},
-        {personnel: '王五'},
-        {personnel: ''},
-        {personnel: ''},
-        {personnel: ''},
-        {personnel: ''},
-        {personnel: ''},
-      ],
+      distributionList: [],
       distributionIndex: null,
       popupShow: false,
       titleText: '今日计划', // 默认文字
       todayAndTomorrow: true, // true 今日计划,false 明日计划
+      id: '', // 传过来的id
+      type: '', // 传过来的type
+      departmentId: '', // 部门id
+      peopleList: [], // 人员数据
     };
   },
   computed: {},
   watch: {},
   created() {},
   mounted() {
+    this.id = this.$route.query.id
+    this.type = this.$route.query.type
+    this.departmentId = this.$route.query.departmentId
+    console.log(this.id)
     this.titleText = this.$route.query.titleText
     if(this.titleText == '今日计划') {
       this.todayAndTomorrow = true
     } else {
       this.todayAndTomorrow = false
     }
+    this.getDistributionList()
+    this.getPeople()
   },
   methods: {
     back() {
@@ -94,6 +95,42 @@ export default {
     distributionProp(item, index) {
       this.distributionIndex = index
       this.popupShow = true
+    },
+    getDistributionList() {
+      this.$axios.post('/plan/planDetail', {
+        id: this.id,
+        type: this.type
+      })
+      .then(res => {
+        if (res.code == "ok") {
+          this.distributionList = res.data
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); });
+    },
+    // 获取人员
+    getPeople() {
+      this.$axios.post('/user/getSimpleActiveUserList', {
+        departmentId: this.departmentId,
+      })
+      .then(res => {
+        if (res.code == "ok") {
+          this.peopleList = res.data.map(item => {
+            return {
+              name: item.name,
+              id: item.id,
+              phone: item.phone,
+              jobNumber: item.jobNumber
+            }
+          })
+          console.log(this.peopleList, '人员数据')
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); });
     }
   },
 };