gjy 3 years ago
parent
commit
729e404d0f
3 changed files with 39 additions and 8 deletions
  1. 8 0
      src/api/shoreBasedMembers.js
  2. 30 8
      src/views/organizationNew/shoreMemberAdd.vue
  3. 1 0
      vue.config.js

+ 8 - 0
src/api/shoreBasedMembers.js

@@ -89,3 +89,11 @@ export function getDeptListByCompId(data) {
     params: data
   });
 }
+// 兼职职务保存
+export function saveRole(data) {
+  return request({
+    url: "/commonUser/api/saveRole",
+    method: "post",
+    data
+  });
+}

+ 30 - 8
src/views/organizationNew/shoreMemberAdd.vue

@@ -169,7 +169,7 @@
                  v-show="item.roleId"
                  style="margin-bottom: 10px">
               <span class=" aaa">兼职{{ index + 1 }}:{{ item.roleName }}</span>
-              <div class="lastspan">
+              <!-- <div class="lastspan">
                 <span class="star bbb">关联船舶</span>
                 <div class="ontent"
                      style="width: 800px;">
@@ -180,7 +180,7 @@
                   <span class="operaction shipSelectSet"
                         @click="setUpShip(item)">设置</span>
                 </div>
-              </div>
+              </div> -->
             </div>
           </div>
         </div>
@@ -405,6 +405,7 @@ import shoreApi from "../../api/organization/shore";
 import {
   staffInfo,
   changeInfo,
+  saveRole,
   companyVessels,
   getDeptListByCompId
 } from "../../api/shoreBasedMembers";
@@ -1239,6 +1240,15 @@ export default {
             type: "success",
             showClose: true
           });
+          for(var i =0;i<this.zhiwu2.length;i++){
+            var param = {
+              staffId:this.id,
+              roleId:this.zhiwu2[i].roleId,
+              roleMajor:'0'
+            }
+            saveRole(param).then(() => {
+            })
+          }
           // this.getMemberInfo();
           this.$router.go(-1);
           this.loading = false;
@@ -1284,7 +1294,6 @@ export default {
       addadmin(this.ruleForm)
         .then(() => {
           // this.cancel();
-          debugger
           var commonUser={};
           commonUser.phone = this.ruleForm.staffMobilePhone
           checkApp(commonUser).then(()=>{
@@ -1353,7 +1362,6 @@ export default {
     save (formName, flag) {
       this.$refs[formName].validate(valid => {
         if (valid) {
-          debugger
           if (this.ruleForm.roles.length !== 0)
                       if (this.ruleForm.roles[0].roleId === "" || this.zhiwu1.roleName === null) {
                         this.$message({
@@ -1560,6 +1568,7 @@ export default {
       //   roleName: this.data1.find(item => item.roleId === value).roleName
       // };
       this.zhiwu1 = {
+        major:1,
         roleId: value,
         roleName: this.data1.find(item => item.roleId === value).roleName
       };
@@ -1580,15 +1589,28 @@ export default {
       // if (this.zhiwu1.roleId) {
       this.setDuty = false;
       this.ruleForm.roleVesselIds = [];
+      this.zhiwu2 = []
+      this.zhiwu11 = this.zhiwu1;
+      const zhiwuAll = [];
+      zhiwuAll.push(this.zhiwu1);
       this.jobList.forEach(item => {
         item.asd.forEach(ite => {
           this.ruleForm.roleVesselIds.push(item.roleId + "_" + ite.vesselId);
         });
+        this.zhiwu2.push({
+          roleId: item.roleId,
+          roleName: this.partTimeJobList.find(item1 => item1.roleId === item.roleId)
+            .roleName,
+          major: "0"
+        });
+        zhiwuAll.push({
+          roleId: item.roleId,
+          roleName: this.partTimeJobList.find(item1 => item1.roleId === item.roleId)
+            .roleName,
+          major: "0"
+        });
       });
-      // this.zhiwu11 = this.zhiwu1;
-      // const zhiwuAll = [];
-      // zhiwuAll.push(this.zhiwu1);
-      // this.ruleForm.roles = zhiwuAll.concat(this.zhiwu2);
+      this.ruleForm.roles = zhiwuAll
       // } else {
       //   this.$message({
       //     type: "error",

+ 1 - 0
vue.config.js

@@ -41,6 +41,7 @@ module.exports = {
       },
       '/pb': {
         target: 'http://192.168.1.115:8090/',
+        // target: 'http://192.168.1.122:8090/',
         // target: 'http://192.168.1.109:9100/',
         // target: 'https://standard-dev.winsea.com/',
         changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题