Bläddra i källkod

手机版项目管理增加选择研究中心

Lijy 3 år sedan
förälder
incheckning
e42607b23d

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

@@ -1360,7 +1360,7 @@
                         customerId:item.customerId==0?null:item.customerId,
                     }
                     console.log(item.associateDegrees)
-                    if(item.associateDegrees) {
+                    if(item.associateDegrees != null && item.associateDegrees != 'null') {
                         var spli = item.associateDegrees.split(',')
                         var sl  = []
                         for(var i in spli) {

+ 88 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -23,6 +23,9 @@
                     placeholder="请选择参与人" @click="clickPicker()" />
                     <van-field readonly clickable  v-model="form.inchargerName"  label="负责人" 
                     placeholder="请选择负责人" @click="showPickerIncharger = true" />
+                    <!-- 研究中心 -->
+                    <van-field readonly clickable name="userNames" v-model="form.associateDegreeNames"  label="研究中心" 
+                    placeholder="请选择" @click="clikls()"/>
                 </van-form>
             </van-dialog>
             <van-popup v-model="showPickerUser" position="bottom">
@@ -35,6 +38,13 @@
             <van-popup v-model="showPickerIncharger" position="bottom">
                 <van-picker show-toolbar :columns="inchargerUserList" value-key="name" @confirm="choseIncharger" @cancel="showPickerIncharger = false" />
             </van-popup>
+            <!-- 研究中心 -->
+            <van-popup v-model="cliklss" position="bottom">
+                <div style="minHeight:300px;">
+                <van-checkbox class="userCheckbox" v-for="(item) in ause" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
+                <van-button style="width:100%;" @click="refreshParticipatess();cliklss=false">确定</van-button>
+                </div>
+            </van-popup>
         </div>
     </div>
 </template>
@@ -64,12 +74,24 @@
                 form: {
                     id: null,
                     projectName: "",
-                }
+                },
+                cliklss: false,
+                ause: []
             };
         },
         created() {
         },
         methods: {
+            yanjiuzx() {
+                this.$axios.post("/report-extra-degree/getAll", {})
+                .then(res => {
+                    if(res.code == "ok") {
+                        this.ause = res.data
+                    } else {
+                        this.$toast.fail('获取失败');
+                    }
+                }).catch(err=> {toast.clear();});
+            },
             choseIncharger(value, index) {
                 this.showPickerIncharger = false;
                 this.form.inchargerName = value.name;
@@ -98,6 +120,22 @@
                     this.form.userNames = this.form.userNames.substring(0, this.form.userNames.length-1);
                 }
             },
+            // 刷新研究中心
+            refreshParticipatess() {
+                var auseNme = []
+                var auseList = []
+                for(var i in this.ause) {
+                    if(this.ause[i].isChecked) {
+                        if(this.ause[i].isChecked == true) {
+                            auseNme.push(this.ause[i].name)
+                            auseList.push(this.ause[i].id)
+                        }
+                    }
+                }
+                this.form.associateDegreeNames = auseNme.toString()
+                this.form.associateDegrees = auseList
+                console.log(this.form, '刷新')
+            },
             onChange() {
                 console.log('===');
             },
@@ -107,6 +145,19 @@
             clickPicker() {
                 this.showPickerUser = true;
             },
+            clikls() {
+                this.cliklss = true
+                for(var i in this.ause) {
+                    if(this.form.associateDegrees.length > 0) {
+                        for(var j in this.form.associateDegrees) {
+                            if(this.form.associateDegrees[j] == this.ause[i].id) {
+                                this.ause[i].isChecked = true
+                            }
+                        }
+                    }
+                }
+                console.log(this.ause)
+            },
             // 返回
             back() {
                 history.back();
@@ -180,18 +231,38 @@
                         inchargerName:null,
                         inchargerId:null,
                         userId:null,
-                        userNames:null
+                        userNames:null,
+                        associateDegreeNames: null,
+                        associateDegrees: null
                     }
                     // this.userList.forEach(u=>u.isChecked=false);
                     // this.refreshParticipate();
                 } else {
                     this.title = "修改项目";
+                    var arrs
+                    if(this.list[i].associateDegrees) {
+                        arrs = this.list[i].associateDegrees.split(',')
+                        for(var j in arrs) {
+                            arrs[j] = +arrs[j] + 0
+                        }
+                    } else {
+                        arrs = []
+                    }
+                    var name
+                    if(this.list[i].associateDegreeNames != null && this.list[i].associateDegreeNames != 'null') {
+                        name = this.list[i].associateDegreeNames
+                    } else {
+                        name = ''
+                    }
+                    console.log(name, '看看')
                     this.form = {
                         id: this.list[i].id,
                         projectName: this.list[i].projectName,
                         projectCode: this.list[i].projectCode,
                         inchargerId: this.list[i].inchargerId,
                         inchargerName: this.list[i].inchargerName,
+                        associateDegreeNames: name,
+                        associateDegrees: arrs
                     }
                     var part = this.list[i].participator;
                     
@@ -230,6 +301,18 @@
                         // form.id = this.form.id;
                         formData.append("id", this.form.id);
                     }
+                    if(this.form.associateDegreeNames != '' &&  this.form.associateDegreeNames != null) {
+                        formData.append("associateDegreeNames", this.form.associateDegreeNames);
+                    } else {
+                        formData.append("associateDegreeNames", null);
+                    }
+
+                    if(this.form.associateDegrees.length > 0) {
+                        var sss = this.form.associateDegrees.toString()
+                        formData.append("associateDegrees", sss);
+                    } else {
+                        formData.append("associateDegrees", null);
+                    }
                     const config = {
                         headers: {
                         'Content-Type': 'multipart/form-data'
@@ -243,6 +326,7 @@
                             this.list = [];
                             this.page = 1;
                             this.getProject();
+                            this.yanjiuzx()
                         } else {
                             toast.clear();
                             this.$toast.fail(this.form.id==null?'新增失败':'修改失败');
@@ -250,6 +334,7 @@
                     }).catch(err=> {toast.clear();});
                 } else {
                     this.show = false;
+                    this.yanjiuzx()
                 }
                 done();
             },
@@ -284,6 +369,7 @@
 
         mounted() {
             this.getUsers();
+            this.yanjiuzx()
             this.canEdit = (this.user.role==1||this.user.role==2||this.user.role==5);
         }
     };

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -4,7 +4,8 @@ const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 
 // var ip = '127.0.0.1'
-var ip = '192.168.2.34'
+// var ip = '192.168.2.34'
+var ip = '47.100.37.243'
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {
 //     for (var j in ifaces[i]) {