Browse Source

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

noob 3 years ago
parent
commit
fd103b831a
5 changed files with 188 additions and 77 deletions
  1. 40 13
      src/components/p-header.vue
  2. 3 0
      src/http/index.js
  3. 128 55
      src/pages/main/performance/department.vue
  4. 16 8
      src/router/index.js
  5. 1 1
      vue.config.js

+ 40 - 13
src/components/p-header.vue

@@ -99,20 +99,47 @@ export default {
       })
         .then((res) => {
           if (res === "confirm") {
-            //TODO先执行退出登录
-            this.$store.commit("setUserInfo", undefined);
-            this.$store.commit("setToken", undefined);
-            this.$store.commit("setMenus", undefined);
-            this.$store.commit("setTabList", []);
-            this.$cookie.delete("userInfo");
-            this.$cookie.delete("menus");
-            this.$cookie.delete("token");
-            window.sessionStorage.agileauthtoken = undefined;
-            window.sessionStorage.menus = undefined;
-            window.sessionStorage.userInfo = undefined;
-            window.sessionStorage.childrenMenus = undefined
+              this.$store.commit("setUserInfo", undefined);
+              this.$store.commit("setToken", undefined);
+              this.$store.commit("setMenus", undefined);
+              this.$store.commit("setTabList", []);
+              this.$cookie.delete("userInfo");
+              this.$cookie.delete("menus");
+              this.$cookie.delete("token");
+              window.sessionStorage.agileauthtoken = undefined;
+              window.sessionStorage.menus = undefined;
+              window.sessionStorage.userInfo = undefined;
+              window.sessionStorage.childrenMenus = undefined;
+              window.opener=null;
+              window.open('','_self');
+              window.close();
+              // window.parent.close();
             //返回到登录页面
-            this.$router.push("/login");
+            // this.$router.push("/login");
+            //   this.$http({
+            //       url: "http://cas.hl.cmcc/cas/logout",
+            //       method: "get",
+            //       headers: {
+            //           "Access-Control-Allow-Origin": "http://cas.hl.cmcc/cas/logout",
+            //       },
+            //   }).then((res) => {
+            //       //TODO先执行退出登录
+            //       this.$store.commit("setUserInfo", undefined);
+            //       this.$store.commit("setToken", undefined);
+            //       this.$store.commit("setMenus", undefined);
+            //       this.$store.commit("setTabList", []);
+            //       this.$cookie.delete("userInfo");
+            //       this.$cookie.delete("menus");
+            //       this.$cookie.delete("token");
+            //       window.sessionStorage.agileauthtoken = undefined;
+            //       window.sessionStorage.menus = undefined;
+            //       window.sessionStorage.userInfo = undefined;
+            //       window.sessionStorage.childrenMenus = undefined;
+            //
+            //       window.location.href = " http://cas.hl.cmcc/cas/login?service=http%3A%2F%2F10.230.26.15%3A8000%2Fspfm%2Fsysmgr%2FssLogin%3FsysFlag%3D0";
+            //   });
+
+
           }
         })
         .catch((err) => {

+ 3 - 0
src/http/index.js

@@ -10,6 +10,9 @@ axios.defaults.transformRequest = [function (data) {
 }],
     // 添加请求拦截器
     axios.interceptors.request.use(function (config) {
+        if (config.url.startsWith("http")) {
+            return config;
+        }
         let localhost = ''
         if (process.env.NODE_ENV == "production") {
             localhost = window.staticHost ? window.staticHost : "/spfm/"

+ 128 - 55
src/pages/main/performance/department.vue

@@ -34,29 +34,29 @@
         <div class="flex-justify-between padding-right-20 padding-left-20">
           <div>
             <template v-if="edit_visible">
-              <!-- 转派按钮 科室经理、分管副总、总经理可见   -->
+              <!-- 转派按钮 科室经理 7、分管副总 2、总经理 1可见   -->
               <el-button
                 type="primary"
                 v-if="
-                  edit_form.status === '0' && (duty === '7' || duty === '10')
+                  edit_form.status === '0' &&
+                  (duty === '7' || duty === '2' || duty === '1')
                 "
                 @click="handleTransfer"
                 >转派</el-button
               >
-              <!-- 提交按钮 科员可见  -->
-              <el-button
+              <!-- 提交按钮 科员可见 9  -->
+              <!-- <el-button
                 type="primary"
-                v-if="
-                  edit_form.status === '0' && (duty === '1' || duty === '10')
-                "
+                v-if="edit_form.status === '1' && duty === '9'"
                 @click="handleSubmit"
                 >提交</el-button
-              >
+              > -->
               <!-- 审批按钮 科室经理、分管副总、总经理可见  -->
               <el-button
                 type="primary"
                 v-if="
-                  edit_form.status === '2' && (duty === '7' || duty === '10')
+                  edit_form.status === '2' &&
+                  (duty === '7' || duty === '2' || duty === '1')
                 "
                 @click="handleApprove"
                 >审批</el-button
@@ -72,7 +72,12 @@
           </div> -->
         </div>
         <!-- 主体部分 -->
-        <simple-sheet v-if="visible" :id="edit_form.id" :type="edit_visible?'edit':'view'" attribute="file" />
+        <simple-sheet
+          v-if="visible"
+          :id="edit_form.id"
+          :type="edit_visible&&edit_form.status === '1' && duty === '9' ? 'edit' : 'view'"
+          attribute="file"
+        />
         <!-- <analysis
           :edit="edit_form.department_status === '待处理' && edit_visible"
         /> -->
@@ -136,8 +141,23 @@
             placeholder="请选择转派人员"
           >
             <el-option
-              v-for="item in transfer_list"
-              :key="item.value"
+              v-for="(item, index) in transfer_list"
+              :key="index"
+              :label="item.label"
+              :value="item.loginNoStr"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="可编辑行" prop="rows">
+          <el-select
+            v-model="transfer_form.rows"
+            placeholder="可编辑行"
+            multiple
+          >
+            <el-option
+              v-for="(item, index) in transfer_rows"
+              :key="index"
               :label="item.label"
               :value="item.value"
             >
@@ -210,8 +230,10 @@ export default {
       track_visible: false,
       edit_form: {},
       transfer_list: [],
+      transfer_rows: [],
       transfer_form: {
         personnel: "", // 转派人员
+        rows: [],
       },
       reload: 0,
       // 判断类型
@@ -234,6 +256,13 @@ export default {
             trigger: "change",
           },
         ],
+        rows: [
+          {
+            required: true,
+            message: "请选择行",
+            trigger: "change",
+          },
+        ],
       },
       // 审批意见
       approveForm: { comments: "" },
@@ -288,7 +317,7 @@ export default {
           label: "处理",
           props: "edit",
           visible: {
-            status: ["0", "2"],
+            status: ["0", "1", "2"],
           },
         },
       ],
@@ -332,18 +361,20 @@ export default {
     });
     // 职位
     this.duty = JSON.parse(sessionStorage.userInfo).duty;
-    // 根据职位判定  科室经理7、分管副总 5 、总经理 10 、职员 1  3,4
+    // 根据职位判定  科室经理7、分管副总 2 、总经理 1 、职员 9
     console.log(this.duty, "duty");
     switch (this.duty) {
       // 科室经理
       case "7":
         this.type = "1";
         break;
-      case "3":
+      // 分管副总
+      case "2":
         this.type = "2";
         break;
-      case "4":
-        this.type = "2";
+      // 总经理
+      case "1":
+        this.type = "3";
         break;
     }
   },
@@ -357,8 +388,8 @@ export default {
           "Content-Type": "application/json",
         },
         data: data,
-      }).then(({ data: { data } }) => {
-        console.log(data);
+      }).then(({ data: { count, data } }) => {
+        this.total = count;
         this.table_list = data;
         // this.table_list = [
         //   {
@@ -441,29 +472,43 @@ export default {
     transferConfirm() {
       this.$refs["transfer_form"].validate((valid) => {
         if (valid) {
-          this.transfer_visible = false;
-          // this.$http({
-          //   url: "/market/CMKIssued/CMKIssuedTransfer",
-          //   method: "post",
-          //   headers: {
-          //     "Content-Type": "application/json",
-          //   },
-          //   data: {
-          //     issuedId:Number(this.transfer_form.personnel),
-          //   },
-          // }).then((res) => {
-          //   console.log(res, "res");
-          // });
+          let obj = {};
+          this.transfer_form.rows.forEach((el) => {
+            obj = {
+              ...obj,
+              [el]: this.transfer_form.personnel,
+            };
+          });
+          let reqdata = {
+            forward: JSON.stringify(obj),
+            issuedId: this.edit_form.id,
+          };
+          this.$http({
+            url: "/market/CMKIssued/CMKIssuedTransfer",
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
+            },
+            data: reqdata,
+          }).then(({ data: { desc } }) => {
+            if (desc === "转派成功") {
+              this.$message({
+                type: "success",
+                message: desc,
+              });
+              this.transfer_visible = false;
+              this.handleCancel("visible");
+            }
+          });
         }
       });
     },
-    handleTransfer() {
+    async handleTransfer() {
       console.log(this.edit_form, "prams");
-      this.transfer_visible = true;
+      let loginNoStr = JSON.parse(sessionStorage.userInfo).loginNoStr;
       let groupId = JSON.parse(sessionStorage.userInfo).groupId;
-      console.log(groupId, "groupId");
-      this.$http({
-        url: "/spfm/sysmgr/sysuserinfo/queryList",
+      await this.$http({
+        url: "/sysmgr/sysuserinfo/queryList",
         method: "post",
         headers: {
           "Content-Type": "application/json",
@@ -471,9 +516,34 @@ export default {
         data: {
           groupId,
         },
-      }).then((res) => {
-        console.log(res, "res");
+      }).then(({ data }) => {
+        this.transfer_list = data
+          .filter((el) => {
+            return el.loginNoStr !== loginNoStr;
+          })
+          .map((el) => ({
+            ...el,
+            label: el.loginNameStr,
+          }));
+        // 可编辑行
+      });
+      await this.$http({
+        url: "/market/CMKIssued/CMKIssuedRow",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          id: this.edit_form.id,
+        },
+      }).then(({ data }) => {
+        console.log(data);
+        this.transfer_rows = data.map((el) => ({
+          label: el,
+          value: el,
+        }));
       });
+      this.transfer_visible = true;
     },
     handleTurn(type) {
       // finish 结束 transfer 转派 back //打回 // agree 同意
@@ -484,10 +554,11 @@ export default {
       };
       switch (type) {
         case "finish":
-          // 0.打回 3.结束
+          // status 0.打回 3.结束
           reqdata.status = "3";
           break;
         case "transfer":
+          // reviewType 2.副总经理 3.经理
           if (this.duty === "7") {
             reqdata.reviewType = 2;
           } else {
@@ -602,22 +673,24 @@ export default {
       // 提交好了
       let reqdata = {
         id: this.edit_form.id,
-        templateContent: this.edit_form.templateContent,
+        templateContent: "asdad",
       };
-      console.log(reqdata, "reqdata");
-
-      // this.$http({
-      //   url: "/CMKIssued/CMKIssuedSubmit",
-      //   method: "post",
-      //   headers: {
-      //     "Content-Type": "application/json",
-      //   },
-      //   data: reqdata,
-      // }).then((res) => {
-      //   console.log(res);
-      //   this.$message.success("提交成功");
-      //   this.handleCancel("visible");
-      // });
+      this.$http({
+        url: "/CMKIssued/CMKIssuedSubmit",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: reqdata,
+      }).then(({ data }) => {
+        console.log(data, "data");
+        if (data) {
+          this.$message.success("提交成功");
+          this.handleCancel("visible");
+        } else {
+            this.$message.error("提交失败");
+        }
+      });
     },
   },
 };

+ 16 - 8
src/router/index.js

@@ -1661,18 +1661,23 @@ const router = new VueRouter({
 })
 let menuList = [];
 router.beforeEach((to, from, next) => {
-    console.log("====token===="+window.sessionStorage.agileauthtoken)
     if (to.name == 'login') {
-
-        window.location.href = "http://cas.hl.cmcc/cas/login?service=?service=http%3A%2F%2F10.230.26.15%3A8000%2Fspfm%2Fsysmgr%2FssLogin%3FsysFlag%3D0"
-
-        // next()
+        //window.location.href = "http://cas.hl.cmcc/cas/login?service=?service=http%3A%2F%2F10.230.26.15%3A8000%2Fspfm%2Fsysmgr%2FssLogin%3FsysFlag%3D0"
+        next()
     } else {
+        // if (window.location.href.indexOf('?agileauthtoken=') == -1) {
         if (window.sessionStorage.agileauthtoken == undefined) {
-             router.push('/login')
-            next()
+            window.location.href = "http://10.230.26.15:8000/spfm/sysmgr/ssLogin?sysFlag=0";
+            //window.location.href = "http://cas.hl.cmcc/cas/login?service=?service=http%3A%2F%2F10.230.26.15%3A8000%2Fspfm%2Fsysmgr%2FssLogin%3FsysFlag%3D0"
         } else {
             next()
+        }
+
+        // if (window.sessionStorage.agileauthtoken == undefined) {
+        //      router.push('/login')
+        //     next()
+        // } else {
+        //     next()
             //权限控制 过于霸道暂时注释
             // let toNext = false;
             // let Menus = JSON.parse(window.sessionStorage.childrenMenus);
@@ -1687,7 +1692,7 @@ router.beforeEach((to, from, next) => {
             // } else {
             //     alert('暂无使用权限');
             // }
-        }
+        // }
     }
     // let menus = JSON.parse(window.sessionStorage.menus);
     // menuList = [];
@@ -1698,6 +1703,7 @@ router.beforeEach((to, from, next) => {
     //     }
     // }
 });
+
 function callmenus(v) {
     for (let i = 0; i < v.length; i++) {
         if (v[i].rountPath) {
@@ -1708,6 +1714,8 @@ function callmenus(v) {
         }
     }
 }
+
+
 const originalReplace = VueRouter.prototype.replace
 VueRouter.prototype.replace = function replace(location) {
     return originalReplace.call(this, location).catch(err => err)

+ 1 - 1
vue.config.js

@@ -96,7 +96,7 @@ module.exports = {
                 // target: 'http://114.215.71.182:29600',
                 target: 'http://192.168.1.9:9600/spfm',
                 // target: 'http://127.0.0.1:9600/',
-                // target: 'http://192.168.0.103:9600/',
+                // target: 'http://192.168.0.156:9600/',
                 // target: 'http://192.168.2.170:9600/',
                 // target: 'http://192.168.2.169:9600/',
                 changeOrigin: true