Lijy 2 days ago
parent
commit
a9c8b521b8

+ 28 - 17
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -20,14 +20,13 @@
     <div class="distribution_con contentRoll">
     <div class="distribution_con contentRoll">
       <div class="distribution_box" v-for="item,index in distributionList" :key="index">
       <div class="distribution_box" v-for="item,index in distributionList" :key="index">
         <div class="distribution_ItemBom">
         <div class="distribution_ItemBom">
-          <!-- <van-checkbox v-if="todayAndTomorrow" :disabled="item.checkboxDisabled  || (item.teamNames&&item.teamNames.indexOf(user.name) == -1)"  v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square"> -->
-          <template v-if="user.workTypeId == 1">
-            <van-checkbox v-if="todayAndTomorrow" v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square">
-            </van-checkbox>
-          </template>
-          <template v-if="user.workTypeId != 1">
+          <div class="distribution_ItemBomFlex">
             <van-checkbox v-if="todayAndTomorrow" :disabled="item.checkboxDisabled  || (item.teamNames&&item.teamNames.indexOf(user.name) == -1)"  v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square"></van-checkbox>
             <van-checkbox v-if="todayAndTomorrow" :disabled="item.checkboxDisabled  || (item.teamNames&&item.teamNames.indexOf(user.name) == -1)"  v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square"></van-checkbox>
-          </template>
+            <template v-if="user.workTypeId == 1 && (isCanAgree || !(item.prodProcedureTeamList || []).length)">
+              <van-button style="margin-right: 10px;" @click="cancelReassignment(item)" type="info" size="small" v-if="item.isTransfer == 1">取消改派</van-button>
+              <van-button style="margin-right: 10px;" @click="showReassignment(item)" type="info" size="small" v-if="item.isTransfer == 0">改派</van-button>
+            </template>
+          </div>
           <div class="PlanItem">
           <div class="PlanItem">
             <span>{{item.prodProcedure.seq}}. {{ item.prodProcedure.name }}</span>
             <span>{{item.prodProcedure.seq}}. {{ item.prodProcedure.name }}</span>
           </div>
           </div>
@@ -88,10 +87,10 @@
   <div class="formBatch" v-if="todayAndTomorrow">
   <div class="formBatch" v-if="todayAndTomorrow">
         <van-checkbox v-model="isAllChecked" :disabled="distributionList.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
         <van-checkbox v-model="isAllChecked" :disabled="distributionList.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
         <div style="padding:1vh 2vw">
         <div style="padding:1vh 2vw">
-          <template v-if="user.workTypeId == 1">
+          <!-- <template v-if="user.workTypeId == 1">
             <van-button style="margin-right: 10px;" @click="cancelReassignment()" :disabled="doYouWantToCancelTheReassignment" type="info" size="small">取消改派</van-button>
             <van-button style="margin-right: 10px;" @click="cancelReassignment()" :disabled="doYouWantToCancelTheReassignment" type="info" size="small">取消改派</van-button>
             <van-button style="margin-right: 10px;" @click="showReassignment()" :disabled="isItPossibleToReassign" type="info" size="small">改派</van-button>
             <van-button style="margin-right: 10px;" @click="showReassignment()" :disabled="isItPossibleToReassign" type="info" size="small">改派</van-button>
-          </template>
+          </template> -->
           
           
           <van-button style="margin-right: 10px;" @click="batchReceive()" :disabled="canBatchOperationsBePerformed" type="info" size="small">批量接收</van-button>
           <van-button style="margin-right: 10px;" @click="batchReceive()" :disabled="canBatchOperationsBePerformed" type="info" size="small">批量接收</van-button>
           <van-button @click="cancellationReceiveBatch()" :disabled="canBatchOperationsBePerformed" type="info" size="small">批量取消接收</van-button>
           <van-button @click="cancellationReceiveBatch()" :disabled="canBatchOperationsBePerformed" type="info" size="small">批量取消接收</van-button>
@@ -156,6 +155,7 @@ export default {
       dropDownSelectionValue: 2,
       dropDownSelectionValue: 2,
 
 
       deptId: '',
       deptId: '',
+      reassignRow: {}
     };
     };
   },
   },
   computed: {
   computed: {
@@ -221,10 +221,12 @@ export default {
     this.getPeople()
     this.getPeople()
   },
   },
   methods: {
   methods: {
-    cancelReassignment() {
-      const selectedData = this.distributionList.filter(item => item.prodProcedure && item.prodProcedure.isSelected)
-      const str = (selectedData || []).map(item => item.prodProcedure && item.prodProcedure.name).join(',')
-      const ids = (selectedData || []).map(item => item.id).join(',')
+    cancelReassignment(row) {
+      // const selectedData = this.distributionList.filter(item => item.prodProcedure && item.prodProcedure.isSelected)
+      // const str = (selectedData || []).map(item => item.prodProcedure && item.prodProcedure.name).join(',')
+      // const ids = (selectedData || []).map(item => item.id).join(',')
+      const str = row.prodProcedure.name
+      const ids = row.id
       Dialog.confirm({
       Dialog.confirm({
         title: '取消改派',
         title: '取消改派',
         message: `确定取消【${str}】改派吗?`,
         message: `确定取消【${str}】改派吗?`,
@@ -249,9 +251,11 @@ export default {
     },
     },
     changeDepartmentSelection(list) {
     changeDepartmentSelection(list) {
       const { value, label } = list[0] || {}
       const { value, label } = list[0] || {}
-      const selectedData = this.distributionList.filter(item => item.prodProcedure && item.prodProcedure.isSelected)
-      const str = (selectedData || []).map(item => item.prodProcedure && item.prodProcedure.name).join(',')
-      const ids = (selectedData || []).map(item => item.id).join(',')
+      // const selectedData = this.distributionList.filter(item => item.prodProcedure && item.prodProcedure.isSelected)
+      // const str = (selectedData || []).map(item => item.prodProcedure && item.prodProcedure.name).join(',')
+      // const ids = (selectedData || []).map(item => item.id).join(',')
+      const str = this.reassignRow.prodProcedure.name
+      const ids = this.reassignRow.id
       Dialog.confirm({
       Dialog.confirm({
         title: '改派',
         title: '改派',
         message: `确定将【${str}】改派给【${label}】部门吗?`,
         message: `确定将【${str}】改派给【${label}】部门吗?`,
@@ -276,7 +280,8 @@ export default {
         // on cancel
         // on cancel
       });
       });
     },
     },
-    showReassignment() {
+    showReassignment(row) {
+      this.reassignRow = { ...row }
       this.popupDepartmentShow = true
       this.popupDepartmentShow = true
     },
     },
     cancellationReceiveBatch(){
     cancellationReceiveBatch(){
@@ -693,6 +698,12 @@ export default {
           display: flex;
           display: flex;
           flex-wrap: wrap;
           flex-wrap: wrap;
           padding: 0px 6px 6px 6px;
           padding: 0px 6px 6px 6px;
+          .distribution_ItemBomFlex {
+            width: 100%;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          }
 
 
           .PlanItem {
           .PlanItem {
             width: 50%;
             width: 50%;