Explorar el Código

主部门功能和用户反馈开启流程时部门使用主部门信息

cyy hace 1 año
padre
commit
ce3dee8cb7

+ 12 - 0
src/router/routes.js

@@ -317,6 +317,18 @@ const frameCustom = [
         name: 'communicationList',
         meta: { title: '信息沟通' },
         component: _import('/platform/bpmn/communication/communicationList')
+      },
+      {
+        path: 'complaint/complaintList',
+        name: 'complaintList',
+        meta: { title: '投诉列表' },
+        component: _import('/platform/bpmn/complaint/complaintList')
+      },
+      {
+        path: 'satisfaction/satisfaction',
+        name: 'satisfaction',
+        meta: { title: '满意度评价' },
+        component: _import('/platform/bpmn/satisfaction/satisfaction')
       }
     ]
   },

+ 12 - 6
src/views/platform/bpmn/communication/communication.vue

@@ -254,9 +254,10 @@ export default {
     }
   },
   data() {
-    const useId = this.$store.getters.userId
+    const { useId, userInfo } = this.$store.getters
     return {
       useId,
+      userInfo,
       show: this.showPop,
       // typeValue: '3',
       sheetShow: false,
@@ -363,7 +364,12 @@ export default {
           }
           this.getKehu()
           this.level = this.$store.getters.level
-          const mainPosition = this.$store.getters.mainPosition
+          const mid = JSON.parse(localStorage.getItem('mainPosition'))
+          const mainPosition =
+            mid ||
+            (this.userInfo && this.userInfo.mainPosition
+              ? this.userInfo.mainPosition
+              : null)
           this.mainPosition = mainPosition
           if (this.id && this.id !== '') {
             // this.id = this.id
@@ -550,11 +556,11 @@ export default {
           }
         ]
       }
-      this.form.fuJian = tmpArray.join(',')
+      // this.form.fuJian = tmpArray.join(',')
       this.form.bianZhiRen = useId
       this.form.bianZhiShiJian = this.$methCommon.time(16)
-      // this.form.bianZhiBuMen = this.mainPosition.id || detpId
-      this.form.bianZhiBuMen = detpId
+      this.form.bianZhiBuMen = this.mainPosition.id || detpId
+      // this.form.bianZhiBuMen = detpId
 
       this.form.shiFouGuoShen = '已编制'
       this.form.diDian = this.level.second
@@ -564,7 +570,7 @@ export default {
 
       findFormJsonByBo(para)
         .then(res => {
-          if (res.data.state === 200) {
+          if (res.state === 200) {
             that.$toast.success('提交成功!')
             setTimeout(() => {
               that.closePop()

+ 5 - 3
src/views/platform/bpmn/complaint/complaint.vue

@@ -460,10 +460,12 @@ export default {
             qiTaFenLei: ''
           }
           this.level = this.$store.getters.level
-          const mainPosition = this.$store.getters.mainPosition
+          const info = this.$store.getters.userInfo
+          const mid = JSON.parse(localStorage.getItem('mainPosition'))
+          const mainPosition =
+            mid || (info && info.mainPosition ? info.mainPosition : null)
           this.mainPosition = mainPosition
 
-          const info = this.$store.getters.userInfo
           this.form.touSuRen = info.user.name
           this.form.touSuDanWei = info.user.qq
           this.form.lianXiDianHua = info.user.mobile
@@ -628,7 +630,7 @@ export default {
           }
         ]
       }
-      this.form.fuJian = tmpArray.join(',')
+      // this.form.fuJian = tmpArray.join(',')
       this.form.bianZhiRen = useId
       this.form.bianZhiShiJian = this.$methCommon.time(16)
       this.form.shiFouGuoShen = '已登记'

+ 6 - 3
src/views/platform/bpmn/satisfaction/satisfaction.vue

@@ -324,7 +324,11 @@ export default {
     }
   },
   created() {
-    const mainPosition = this.$store.getters.mainPosition
+    // const mainPosition = this.$store.getters.mainPosition
+    const info = this.$store.getters.userInfo
+    const mid = JSON.parse(localStorage.getItem('mainPosition'))
+    const mainPosition =
+      mid || (info && info.mainPosition ? info.mainPosition : null)
     this.mainPosition = mainPosition
     this.wenTiYiDaAn = 6
     this.wenTiErDaAn = 6
@@ -444,8 +448,7 @@ export default {
         yiJianHeJianYi: this.qingNinTianXie,
         bianZhiRen: useId,
         bianZhiShiJian: this.$methCommon.time(16),
-        // bianZhiBuMen: this.mainPosition.id || detpId,
-        bianZhiBuMen: detpId,
+        bianZhiBuMen: this.mainPosition.id || detpId,
 
         shiFouGuoShen: '已编制',
         shiWuShuoMing: this.shiWuShuoMing,

+ 195 - 115
src/views/platform/my/index.vue

@@ -4,7 +4,6 @@
       <van-nav-bar :title="generateTitle()" />
     </van-sticky>
     <div class="ibps-cell-wrapper ibps-top-wrapper">
-
       <!-- <van-card
         :thumb="avatar"
         :desc="org||$t('common.company')"
@@ -20,19 +19,46 @@
           <van-tag plain size="large" type="primary">{{ position }}</van-tag>
         </template>
       </van-card> -->
-      <van-card :thumb="avatar" :desc="org||$t('common.company')" centered @click="userInfo()">
-        <div slot="title" class="ibps-user-title">
+      <van-card
+        :thumb="avatar"
+        :desc="org || $t('common.company')"
+        centered
+        @click="userInfo()"
+      >
+        <div slot="title" class="ibps-user-title marginDistance">
           <span class="ibps-user-title__name">{{ userName }}</span>
-          <van-tag v-if="position" plain :size="size" type="primary">{{ position }}</van-tag>
+          <van-tag v-if="position" plain :size="size" type="primary">
+            {{ position }}
+          </van-tag>
+        </div>
+        <div slot="desc" class="ibps-user-desc alignCenter">
+          <span>当前部门:</span>
+          <!-- <van-tag v-if="position" plain type="primary"> -->
+          {{ mainPositionName }}
+          <!-- </van-tag> -->
+          <van-icon
+            name="replay"
+            color="#1989fa"
+            size="0.9em"
+            style="margin-left:3px"
+            @click.stop.prevent="onReplay"
+          />
         </div>
         <div slot="desc" class="ibps-user-desc">
-          {{ org||$t('common.company') }}
+          <span>所在地点:</span>
+          {{ org || $t('common.company') }}
         </div>
       </van-card>
     </div>
 
     <van-cell-group>
-      <van-cell :title="$t('platform.my.change-password.title')" icon="lock" is-link to="changePassword" :size="size" />
+      <van-cell
+        :title="$t('platform.my.change-password.title')"
+        icon="lock"
+        is-link
+        to="changePassword"
+        :size="size"
+      />
       <lang-select />
     </van-cell-group>
 
@@ -42,7 +68,6 @@
       <!-- <van-cell :title="$t('platform.my.about')" icon-prefix="ibps-icon" icon="logo" is-link :size="size"
         @click="about" /> -->
       <switch-environment v-if="$nodeEnv === 'development'" />
-
     </van-cell-group>
 
     <!-- 退出登录 -->
@@ -55,144 +80,199 @@
         </van-col>
       </van-row>
     </van-cell-group>
+    <!-- 更换主部门 -->
+    <van-action-sheet
+      v-model="show"
+      :actions="actions"
+      cancel-text="取消"
+      close-on-click-action
+      @cancel="onCancel"
+      @select="onSelect"
+    />
   </div>
 </template>
 <script>
-  import { mapState } from 'vuex'
-  import defaultImage from '@/assets/images/logo/lc.png'
-  import { getFile } from '@/utils/image'
-  // import LcCard from '@/components/LcCard'
-  import LangSelect from './lang-select'
-  import SwitchEnvironment from '@/views/system/switch-environment'
-  import navbar from '@/mixins/navbar'
+import { mapState } from 'vuex'
+import defaultImage from '@/assets/images/logo/lc.png'
+import { getFile } from '@/utils/image'
+// import LcCard from '@/components/LcCard'
+import LangSelect from './lang-select'
+import SwitchEnvironment from '@/views/system/switch-environment'
+import navbar from '@/mixins/navbar'
 
-  export default {
-    components: {
-      LangSelect,
-      SwitchEnvironment
-    },
-    mixins: [navbar],
-    data() {
-      const { first = '', second = '' } = this.$store.getters.level
-      const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
-      const t1 = deptList.find(i => i.positionId === first) || {}
-      const t2 = deptList.find(i => i.positionId === second) || {}
-      // console.log(first, second, deptList)
-      const locationName = second ? t1.positionName + t2.positionName : t1.positionName
-      return {
-        defaultImage: defaultImage,
-        size: 'large',
-        positionList: [],
-        locationName
+export default {
+  components: {
+    LangSelect,
+    SwitchEnvironment
+  },
+  mixins: [navbar],
+  data() {
+    const { first = '', second = '' } = this.$store.getters.level
+    const {
+      userId,
+      userList = [],
+      deptList = [],
+      menus,
+      userInfo
+    } = this.$store.getters
+    const t1 = deptList.find(i => i.positionId === first) || {}
+    const t2 = deptList.find(i => i.positionId === second) || {}
+    // console.log(first, second, deptList)
+    const locationName = second
+      ? t1.positionName + t2.positionName
+      : t1.positionName
+    return {
+      defaultImage: defaultImage,
+      size: 'large',
+      positionList: [],
+      locationName,
+      show: false,
+      actions: [],
+      mainPositionName: '',
+      mainPosition:
+        this.info && this.info.mainPosition ? this.info.mainPosition : null
+    }
+  },
+  computed: {
+    ...mapState('ibps/user', ['info']),
+    avatar() {
+      const str = '/file/getImage?attachmentId='
+      const photo =
+        this.info && this.info.employee
+          ? /^\d+$/.test(this.info.employee.photo)
+            ? str + this.info.employee.photo
+            : this.info.employee.photo
+          : null
+      if (this.$utils.isEmpty(photo)) {
+        return this.errorImage
       }
+      return getFile(photo)
     },
-    computed: {
-      ...mapState('ibps/user', [
-        'info'
-      ]),
-      avatar() {
-        const str = "/file/getImage?attachmentId="
-        const photo = this.info && this.info.employee ? (/^\d+$/.test(this.info.employee.photo) ? (str + this.info.employee.photo) : this.info.employee.photo) : null
-        if (this.$utils.isEmpty(photo)) {
-          return this.errorImage
-        }
-        return getFile(photo)
-      },
-      errorImage() {
-        return defaultImage
-      },
-      userName() {
-        return this.info && this.info.user ? this.info.user.fullname : ''
-      },
-      org() {
-        return this.locationName
-      },
-      position() {
-        const positions = this.info && this.info.positions ? this.info.positions : null
-        const pos = []
-        if (this.$utils.isNotEmpty(positions)) {
-          for (var i = 0; i < positions.length; i++) {
-            pos.push(positions[i].name)
-          }
+    errorImage() {
+      return defaultImage
+    },
+    userName() {
+      return this.info && this.info.user ? this.info.user.fullname : ''
+    },
+    org() {
+      return this.locationName
+    },
+    position() {
+      const positions =
+        this.info && this.info.positions ? this.info.positions : null
+      const pos = []
+      if (this.$utils.isNotEmpty(positions)) {
+        for (var i = 0; i < positions.length; i++) {
+          pos.push(positions[i].name)
+          this.actions.push({ name: positions[i].name, obj: positions[i] })
         }
-        return pos.join(',')
       }
+      console.log('12212121212121')
+      const mid = JSON.parse(localStorage.getItem('mainPosition'))
+      this.mainPositionName = mid
+        ? mid.name
+        : this.info && this.info.mainPosition
+          ? this.info.mainPosition.name
+          : null
+      this.mainPosition =
+        mid ||
+        (this.info && this.info.mainPosition ? this.info.mainPosition : null)
+
+      return pos.join(',')
+    }
+  },
+  methods: {
+    userInfo() {
+      this.$router.push({ name: 'userInfo' })
     },
-    methods: {
-      userInfo() {
-        this.$router.push({ name: 'userInfo' })
-      },
-      logout() {
-        this.$dialog.confirm({
+    logout() {
+      this.$dialog
+        .confirm({
           title: this.$t('common.dialog.title'),
           message: this.$t('platform.my.logoutMessage')
-        }).then(() => {
+        })
+        .then(() => {
           this.$store.dispatch('ibps/account/logout', { vm: this }).then(() => {
             // this.$router.push({ path: '/refresh' })
             this.$router.push({ path: '/' })
           })
-        }).catch(() => {
-
         })
-      },
-      about() {
-        this.$router.push({ path: '/my/aboutUs' })
-      },
-      help() {
-        this.$router.push({ path: '/my/help' })
-      },
-      switchEnvironment() {
-
-      }
+        .catch(() => {})
+    },
+    about() {
+      this.$router.push({ path: '/my/aboutUs' })
+    },
+    help() {
+      this.$router.push({ path: '/my/help' })
+    },
+    switchEnvironment() {},
+    onReplay() {
+      this.show = true
+    },
+    onCancel() {
+      this.show = false
+    },
+    onSelect(e) {
+      console.log(e, 'eeeeeeeeeeeeeeeeeeeee')
+      this.mainPositionName = e.name
+      this.mainPosition = e.obj
+      localStorage.setItem('mainPosition', JSON.stringify(this.mainPosition))
     }
   }
+}
 </script>
 <style lang="scss" scoped>
-  .divider {
-    height: 8px;
-    background: #f8f8f8;
-  }
+.divider {
+  height: 8px;
+  background: #f8f8f8;
+}
 
-  .my {
-    min-height: calc(100vh - 55px);
-    background: #f8f8f8;
+.my {
+  min-height: calc(100vh - 55px);
+  background: #f8f8f8;
 
-    .ibps-top-wrapper {
-      padding-top: 0;
+  .ibps-top-wrapper {
+    padding-top: 0;
 
-      .ibps-user-title {
-        display: flex;
-        align-items: center;
-        margin: 10px 0 6px 0;
+    .ibps-user-title {
+      display: flex;
+      align-items: center;
+      margin: 10px 0 6px 0;
 
-        .ibps-user-title__name {
-          font-size: 20px;
-          margin-right: 15px;
-          color: #333333;
-          font-weight: bold;
-        }
-      }
-
-      .ibps-user-desc {
-        font-size: 14px;
+      .ibps-user-title__name {
+        font-size: 20px;
+        margin-right: 15px;
         color: #333333;
+        font-weight: bold;
       }
     }
 
-    .van-card {
-      background-color: #fff;
+    .ibps-user-desc {
+      font-size: 14px;
+      color: #333333;
+    }
+  }
 
-      .van-card__header {
-        display: flex;
-        align-items: center;
-      }
+  .van-card {
+    background-color: #fff;
 
-      .van-card__thumb {
-        width: 58px;
-        height: 58px;
-        margin-right: 17px;
-      }
+    .van-card__header {
+      display: flex;
+      align-items: center;
     }
 
+    .van-card__thumb {
+      width: 58px;
+      height: 58px;
+      margin-right: 17px;
+    }
   }
-</style>
+}
+.marginDistance {
+  margin: 0 0 3px 0 !important;
+}
+.alignCenter {
+  display: flex;
+  align-items: center;
+}
+</style>