Browse Source

调整项目同步弹窗

Lijy 1 year ago
parent
commit
715c76cfeb
1 changed files with 40 additions and 12 deletions
  1. 40 12
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

+ 40 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -85,7 +85,7 @@
                                 <el-link type="primary" :underline="false" @click="projectLevelDialog = true">{{ $t('projectlevelmanagement') }}</el-link>
                             </el-dropdown-item>
                             <el-dropdown-item v-if="user.timeType.syncFanwei==1||user.timeType.syncSap==1">
-                                <el-link type="primary" :underline="false" @click="syncProjectDig=true">{{'同步项目信息'}}</el-link>
+                                <el-link type="primary" :underline="false" @click="syncProjectDig=true, synchronizationInputVal = ''">{{'同步项目信息'}}</el-link>
                             </el-dropdown-item>
                             <el-dropdown-item v-if="user.companyId==3385 && permissions.projectClassification">
                                 <el-link type="primary" :underline="false" @click="functionalDivisionDig=true,getFunctionalList()">{{'职能分工设置'}}</el-link>
@@ -1636,15 +1636,26 @@
         </el-dialog>
         <!-- 项目同步弹窗 -->
         <el-dialog title="项目服务同步" :visible.sync="syncProjectDig" width="600px" :before-close="handleClose">
-            <el-form label-width="100px">
-                <el-form-item :label="'项目编号:'">
-                     <el-select filterable collapse-tags clearable  v-model="hasChooseProjectCode" multiple placeholder="请选择" style="width:100%">
-                        <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName  + '\u3000' + item.projectCode" :value="item.projectCode">
-                            <span style="float: right; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
-                            <span style="float: left;">{{ item.projectName }}</span>
-                        </el-option>
-                    </el-select>
-                </el-form-item>
+            <el-form label-width="0">
+                <div class="synchronization">
+                    <div class="synchronizationLabel">
+                        <el-select v-model="synchronizationVal" placeholder="请选择" @change="synchronizationChange()">
+                            <el-option label="已同步项目" value="0"></el-option>
+                            <el-option label="未同步项目" value="1"></el-option>
+                        </el-select>
+                    </div>
+                    <el-form-item style="flex: 1" v-if="synchronizationVal == 0">
+                        <el-select filterable collapse-tags clearable  v-model="hasChooseProjectCode" multiple placeholder="请选择" style="width:100%">
+                            <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName  + '\u3000' + item.projectCode" :value="item.projectCode">
+                                <span style="float: right; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
+                                <span style="float: left;">{{ item.projectName }}</span>
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item style="flex: 1" v-if="synchronizationVal == 1">
+                        <el-input placeholder="请输入项目编号" v-model="synchronizationInputVal" clearable></el-input>
+                    </el-form-item>
+                </div>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="syncProjectDig = false">取 消</el-button>
@@ -1948,6 +1959,8 @@ a {
                 syncProjectDig:false,
                 allProjectList:[],
                 hasChooseProjectCode:[],
+                synchronizationVal: '0',
+                synchronizationInputVal: ''
             };
         },
         // 过滤器
@@ -3987,7 +4000,7 @@ a {
                     url='/project/syncProjectWithSap'
                     if(hasChooseProjectCode){
                         param={
-                            projectCodes:hasChooseProjectCode.toString()
+                            projectCodes: this.synchronizationVal == '0' ? hasChooseProjectCode.toString() : this.synchronizationInputVal
                         }
                     }
                 }
@@ -5680,8 +5693,15 @@ a {
                     });
                     }
                 );
+            },
+            
+            synchronizationChange() {
+                if(this.synchronizationVal == '1') {
+                    this.hasChooseProjectCode = []
+                } else {
+                    this.synchronizationInputVal = ''
+                }
             }
-
         },
         created() {
             let height = window.innerHeight;
@@ -5751,6 +5771,14 @@ a {
 </script>
 
 <style lang="scss" scoped>
+.synchronization {
+    display: flex;
+    justify-content: space-between;
+    // align-items: center;
+    .synchronizationLabel {
+        width: 140px;
+    }
+}
 .rg_span{
     display: inline-block;
 }