Przeglądaj źródła

整合element-ui

walter 8 miesięcy temu
rodzic
commit
a003233fd7

+ 18 - 5
.babelrc

@@ -12,10 +12,23 @@
     "syntax-dynamic-import",
     "transform-vue-jsx",
     "transform-runtime",
-    ["import", {
-      "libraryName": "vant",
-      "libraryDirectory": "es",
-      "style": true
-    }]
+    [
+      "import",
+      {
+        "libraryName": "vant",
+        "libraryDirectory": "es",
+        "style": true
+      },
+      "vant"
+    ],
+    [
+      "component",
+      {
+        "libraryName": "element-ui",
+        "styleLibraryName": "theme-chalk"
+      }
+    ],
+    "syntax-dynamic-import",
+    "transform-object-rest-spread"
   ]
 }

+ 1 - 1
build/utils.js

@@ -52,7 +52,7 @@ exports.cssLoaders = function (options) {
     if (options.extract) {
       return ExtractTextPlugin.extract({
         use: loaders,
-        // publicPath:'../../',
+        publicPath:'../../',
         fallback: 'vue-style-loader'
       })
     } else {

+ 82 - 2
package-lock.json

@@ -681,6 +681,14 @@
       "integrity": "sha512-VUeSMD8nEGBWaZK4lizI1sf3yEC7pnAQ/mrI7pC2fBz2s/tq5jWWEngTwaf0Gruu/OoXRGLGg1XFqpYBiGTYJA==",
       "dev": true
     },
+    "async-validator": {
+      "version": "1.8.5",
+      "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-1.8.5.tgz",
+      "integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
+      "requires": {
+        "babel-runtime": "6.x"
+      }
+    },
     "asynckit": {
       "version": "0.4.0",
       "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
@@ -1052,8 +1060,7 @@
     "babel-helper-vue-jsx-merge-props": {
       "version": "2.0.3",
       "resolved": "https://registry.npmmirror.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
-      "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==",
-      "dev": true
+      "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
     },
     "babel-helpers": {
       "version": "6.24.1",
@@ -1092,6 +1099,44 @@
         "babel-runtime": "^6.22.0"
       }
     },
+    "babel-plugin-component": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmmirror.com/babel-plugin-component/-/babel-plugin-component-1.1.1.tgz",
+      "integrity": "sha512-WUw887kJf2GH80Ng/ZMctKZ511iamHNqPhd9uKo14yzisvV7Wt1EckIrb8oq/uCz3B3PpAW7Xfl7AkTLDYT6ag==",
+      "dev": true,
+      "requires": {
+        "@babel/helper-module-imports": "7.0.0-beta.35"
+      },
+      "dependencies": {
+        "@babel/helper-module-imports": {
+          "version": "7.0.0-beta.35",
+          "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.35.tgz",
+          "integrity": "sha512-vaC1KyIZSuyWb3Lj277fX0pxivyHwuDU4xZsofqgYAbkDxNieMg2vuhzP5AgMweMY7fCQUMTi+BgPqTLjkxXFg==",
+          "dev": true,
+          "requires": {
+            "@babel/types": "7.0.0-beta.35",
+            "lodash": "^4.2.0"
+          }
+        },
+        "@babel/types": {
+          "version": "7.0.0-beta.35",
+          "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.0.0-beta.35.tgz",
+          "integrity": "sha512-y9XT11CozHDgjWcTdxmhSj13rJVXpa5ZXwjjOiTedjaM0ba5ItqdS02t31EhPl7HtOWxsZkYCCUNrSfrOisA6w==",
+          "dev": true,
+          "requires": {
+            "esutils": "^2.0.2",
+            "lodash": "^4.2.0",
+            "to-fast-properties": "^2.0.0"
+          }
+        },
+        "to-fast-properties": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+          "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+          "dev": true
+        }
+      }
+    },
     "babel-plugin-import": {
       "version": "1.13.8",
       "resolved": "https://registry.npmjs.org/babel-plugin-import/-/babel-plugin-import-1.13.8.tgz",
@@ -4246,6 +4291,26 @@
       "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==",
       "dev": true
     },
+    "element-ui": {
+      "version": "2.15.14",
+      "resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.14.tgz",
+      "integrity": "sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==",
+      "requires": {
+        "async-validator": "~1.8.1",
+        "babel-helper-vue-jsx-merge-props": "^2.0.0",
+        "deepmerge": "^1.2.0",
+        "normalize-wheel": "^1.0.1",
+        "resize-observer-polyfill": "^1.5.0",
+        "throttle-debounce": "^1.0.1"
+      },
+      "dependencies": {
+        "deepmerge": {
+          "version": "1.5.2",
+          "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.5.2.tgz",
+          "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ=="
+        }
+      }
+    },
     "elliptic": {
       "version": "6.5.4",
       "resolved": "https://registry.npmmirror.com/elliptic/-/elliptic-6.5.4.tgz",
@@ -8966,6 +9031,11 @@
         }
       }
     },
+    "normalize-wheel": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
+      "integrity": "sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA=="
+    },
     "npm-conf": {
       "version": "1.1.3",
       "resolved": "https://registry.npmmirror.com/npm-conf/-/npm-conf-1.1.3.tgz",
@@ -11999,6 +12069,11 @@
       "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
       "dev": true
     },
+    "resize-observer-polyfill": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
+      "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
+    },
     "resolve": {
       "version": "1.22.1",
       "resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.1.tgz",
@@ -13758,6 +13833,11 @@
         "utrie": "^1.0.2"
       }
     },
+    "throttle-debounce": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
+      "integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
+    },
     "through": {
       "version": "2.3.8",
       "resolved": "https://registry.npmmirror.com/through/-/through-2.3.8.tgz",

+ 2 - 0
package.json

@@ -17,6 +17,7 @@
     "clipboard": "^2.0.11",
     "dayjs": "^1.10.5",
     "echarts": "^4.7.0",
+    "element-ui": "^2.15.14",
     "exif-js": "^2.3.0",
     "fastclick": "^1.0.6",
     "html2canvas": "^1.0.0-rc.3",
@@ -55,6 +56,7 @@
     "babel-eslint": "^8.2.1",
     "babel-helper-vue-jsx-merge-props": "^2.0.3",
     "babel-loader": "^7.1.1",
+    "babel-plugin-component": "^1.1.1",
     "babel-plugin-import": "^1.13.0",
     "babel-plugin-syntax-dynamic-import": "^6.18.0",
     "babel-plugin-syntax-jsx": "^6.18.0",

+ 388 - 0
src/components/RuleScopeSelector.vue

@@ -0,0 +1,388 @@
+<template>
+<!--  <van-popup :duration="0.2" :overlay="false" class="employee_selector_popup" v-model="showSelector" position="bottom" >-->
+<!--    <van-nav-bar title="积分规则" left-text="取消" @click-left="cancel"  />-->
+<!--    <van-search v-model="keyword" placeholder="搜索规则" show-action >-->
+<!--      <van-icon slot="action" name="bars" @click="showRule = true"/>-->
+<!--    </van-search>-->
+<!--    <div class="container">-->
+<!--      <scroller>-->
+<!--        <van-cell-group inset>-->
+<!--          <van-cell-->
+<!--            v-for="(item,index) in list"-->
+<!--            :key="index"-->
+<!--            @click="onSelected(item)"-->
+<!--          >-->
+<!--            <template slot="label">-->
+<!--              <span class="record green" v-if="item.min_point <= 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>-->
+<!--              <span class="record red" v-if="item.min_point > 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>-->
+<!--              <span class="type">{{$getTypesName(item.pt_id)}}</span>-->
+<!--            </template>-->
+<!--            <template slot="icon">-->
+<!--              <van-checkbox v-model="item.selected" shape="square" style="margin-right: 0.16rem;" />-->
+<!--            </template>-->
+<!--            <template slot="title">-->
+<!--              <div class="item-remark">{{item.remark}}</div>-->
+<!--            </template>-->
+<!--          </van-cell>-->
+
+<!--        </van-cell-group>-->
+<!--      </scroller>-->
+<!--    </div>-->
+
+<!--    <div class="flex-box-ce footer">-->
+<!--      <van-button-->
+<!--        size="large"-->
+<!--        plain-->
+<!--        type="info"-->
+<!--        style="margin-right: 0.2rem;"-->
+<!--        :text="`已选${itemSelected.length}条,取消选中`"-->
+<!--        @click="clear"-->
+<!--      />-->
+<!--      <van-button-->
+<!--        text="确认"-->
+<!--        type="info"-->
+<!--        size="large"-->
+<!--        @click="onConfirm"-->
+<!--      />-->
+<!--    </div>-->
+<!--    <van-dialog-->
+<!--      v-model="showRule"-->
+<!--      :show-confirm-button="false"-->
+<!--      close-on-click-overlay-->
+<!--      title="规则分类"-->
+<!--    >-->
+<!--      <template slot="default">-->
+<!--        <div style="height: 8rem;overflow: auto; " class="scroll-bar">-->
+<!--          <el-button-->
+<!--            type="primary"-->
+<!--            style="margin-left: 0.3rem;"-->
+<!--            size="small"-->
+<!--            round-->
+<!--            @click="onRuleClear"-->
+<!--          >-->
+<!--            全部-->
+<!--          </el-button>-->
+<!--          <el-tree-->
+<!--            ref="ruleTree"-->
+<!--            node-key="id"-->
+<!--            :data="ruleTree"-->
+<!--            :props="{children:'child',label:'name'}"-->
+<!--            highlight-current-->
+<!--            style="margin-top: 16px"-->
+<!--            @node-click="onRuleClick"-->
+<!--          />-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </van-dialog>-->
+<!--  </van-popup>-->
+  <el-drawer
+    append-to-body
+    :show-close="false"
+    direction="btt"
+    :visible.sync="showSelector"
+    :before-close="cancel"
+    :size="'80%'"
+  >
+    <template slot="title">
+      <div>
+<!--        <van-nav-bar title="积分规则" left-text="取消" @click-left="cancel"  />-->
+        <van-search v-model="keyword" placeholder="搜索规则" show-action >
+          <van-icon slot="action" name="bars" @click="showRule = true"/>
+        </van-search>
+      </div>
+    </template>
+    <div class="container">
+      <scroller>
+        <van-cell-group inset>
+          <van-cell
+            v-for="(item,index) in list"
+            :key="index"
+            @click="onSelected(item)"
+          >
+            <template slot="label">
+              <span class="record green" v-if="item.min_point <= 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+              <span class="record red" v-if="item.min_point > 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+              <span class="type">{{$getTypesName(item.pt_id)}}</span>
+            </template>
+            <template slot="icon">
+              <van-checkbox v-model="item.selected" shape="square" style="margin-right: 0.16rem;" />
+            </template>
+            <template slot="title">
+              <div class="item-remark">{{item.remark}}</div>
+            </template>
+          </van-cell>
+
+        </van-cell-group>
+        <div style="height: 1rem;"></div>
+      </scroller>
+    </div>
+
+    <div class="flex-box-ce footer">
+      <van-button
+        size="large"
+        plain
+        type="info"
+        style="margin-right: 0.2rem;"
+        :text="`已选${itemSelected.length}条,取消选中`"
+        @click="clear"
+      />
+      <van-button
+        text="确认"
+        type="info"
+        size="large"
+        @click="onConfirm"
+      />
+    </div>
+    <van-dialog
+      v-model="showRule"
+      :show-confirm-button="false"
+      close-on-click-overlay
+      title="规则分类"
+    >
+      <template slot="default">
+        <div style="height: 8rem;overflow: auto; " class="scroll-bar">
+          <el-button
+            type="primary"
+            style="margin-left: 0.3rem;"
+            size="small"
+            round
+            @click="onRuleClear"
+          >
+            全部
+          </el-button>
+          <el-tree
+            ref="ruleTree"
+            node-key="id"
+            :data="ruleTree"
+            :props="{children:'child',label:'name'}"
+            highlight-current
+            style="margin-top: 16px"
+            @node-click="onRuleClick"
+          />
+          <div style="height: 0.5rem;"></div>
+        </div>
+      </template>
+    </van-dialog>
+  </el-drawer>
+</template>
+
+<script>
+export default {
+  name:'RuleScopeSelector',
+  props:{
+    visible:{
+      type:Boolean,
+      default:false
+    },
+    ptId:{
+      type:Number,
+      default: 0,
+    },
+    multi: {
+      type: Boolean,
+      default: false
+    },
+    cycleType:{
+      type: Number,
+      default: 1
+    },
+    selected:{
+      type: Array,
+      default: () => []
+    },
+  },
+  data(){
+    return {
+      showSelector:false,
+      itemObject:null,
+      ruleTree:[],
+      items:[],
+      itemSelected:[],
+      currentRuleId:0,
+      keyword:'',
+      showRule:false
+    }
+  },
+  watch:{
+    visible(val){
+      this.showSelector = val
+    },
+    showSelector(v){
+      if(v) {
+        this.itemSelected = this.selected.map(item => {
+          return {...item}
+        })
+        this.keyword = ''
+        this.currentRuleId = 0
+        this.getRuleScope()
+      }
+    },
+  },
+  computed:{
+    list(){
+      if (this.currentRuleId > 0){
+        if (!this.itemObject[`rule_${this.currentRuleId}`]) return []
+        this.items = []
+        this.initItems({1:this.itemObject[`rule_${this.currentRuleId}`]})
+      } else {
+        if (!this.itemObject) return []
+        this.items = []
+        this.initItems(this.itemObject)
+      }
+      return this.items.filter(item => this.keyword ? item.remark.indexOf(this.keyword) > -1 : true)
+    },
+  },
+  methods:{
+    initItems(itemObj){
+      Object.values(itemObj).forEach((item) => {
+        item.forEach((record) => {
+          let temp = {
+            ...record,
+            selected:this.itemSelected.some(i => i.id === record.id)
+          }
+          this.items.push(temp)
+        })
+      })
+    },
+    close(){
+      this.$emit('update:visible',false)
+    },
+    getRuleScope(){
+      this.ruleTree = []
+      this.itemObject = null
+      this.items = []
+      let data = {
+        cycle_type:this.cycleType,
+        pt_id:this.ptId
+      }
+      this.$axiosUser('get','/api/pro/integral/rule/trees/scope',data)
+        .then(res => {
+          if (res.data.code === 1){
+            this.ruleTree = res.data.data.rule_tree
+            this.itemObject = res.data.data.item_list
+            this.initItems(this.itemObject)
+          }
+        })
+    },
+    onSelected(item){
+      if (this.multi){
+        if (item.selected){
+          /*取消选中*/
+          this.itemSelected = this.itemSelected.filter(i => i.id !== item.id)
+        } else {
+          /*选中*/
+          this.itemSelected.push(item)
+        }
+        item.selected = !item.selected
+      } else {
+        this.itemSelected = item.selected ? [] : [item]
+        this.items.forEach(i => {
+          i.selected = i.id !== item.id ? false : (!item.selected)
+        })
+      }
+    },
+    onRuleClick(rule){
+      this.currentRuleId = rule.id || 0
+    },
+    onRuleClear(){
+      this.$refs['ruleTree'].setCurrentKey(null)
+      this.currentRuleId = 0
+    },
+    onConfirm(){
+      this.$emit("confirm",this.itemSelected.map(item => {
+        return {...item}
+      }))
+      this.close()
+    },
+    cancel(){
+      this.itemSelected = this.selected.map(item => {
+        return {...item}
+      })
+      this.onConfirm()
+    },
+    clear(){
+      this.itemSelected = []
+      this.initItems(this.itemObject)
+    }
+  },
+  mounted() {}
+}
+
+</script>
+
+<style scoped>
+.employee_selector_popup{
+  background-color: rgb(245, 245, 245);
+  height: 90%;
+}
+.container{
+  //height: calc(100% - 3.6rem);
+  height: 90%;
+  position: relative;
+  margin-bottom: 0.1rem;
+}
+
+/* // 滚动条样式 */
+.scroll-bar {
+  scroll-behavior: smooth;
+}
+.scroll-bar::-webkit-scrollbar {
+  width: 7px;
+  height: 7px;
+}
+
+/*外层轨道。可以用display:none让其不显示,也可以添加背景图片,颜色改变显示效果*/
+.scroll-bar::-webkit-scrollbar-track {
+  width: 7px;
+  background-color: #fff0;
+  -webkit-border-radius: 2em;
+  -moz-border-radius: 2em;
+  border-radius: 2em;
+}
+
+/*滚动条的设置*/
+.scroll-bar::-webkit-scrollbar-thumb {
+  background-color: #C1C7D4;
+  background-clip: padding-box;
+  -webkit-border-radius: 2em;
+  -moz-border-radius: 2em;
+  border-radius: 2em;
+}
+/*滚动条移上去的背景*/
+.scroll-bar:hover::-webkit-scrollbar-thumb {
+  background-color: rgba(144, 147, 153, 0.3);
+  height: 20px;
+}
+
+
+.footer{
+  padding: 0.24rem;
+  position: fixed;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 2;
+  background: #fff;
+  border-top: 1px solid #f1f1f1;
+}
+
+/deep/.van-cell .van-checkbox {
+  width: 10%;
+}
+/deep/.van-cell .van-cell__title{
+  width: 80%;
+}
+
+/deep/.van-cell .van-cell__title .item-remark{
+  white-space: pre-wrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  word-wrap: break-word;
+  word-break: break-all;
+}
+
+/deep/ .el-drawer__header{
+  padding: 0;
+}
+
+</style>

+ 14 - 1
src/main.js

@@ -10,7 +10,6 @@ import '@/utils/validator'
 import '@/assets/css/reset.css'
 import '@/attendanceSet' // 考勤相关
 import '@/performanceSet' // 绩效系统相关配置
-
 import icon from 'vue2-svg-icon/Icon'
 import VueScroller from '@/components/scroller/src'
 import noData from '@/components/noData'
@@ -23,7 +22,18 @@ import axiosUser from '@/utils/axiosUser'
 import axiosKc from '@/utils/axiosKc'
 import 'shepherd.js/dist/css/shepherd.css';
 
+// import 'vant/lib/index.css';
 import { Tabbar, Empty, TabbarItem, ShareSheet, Loading, Divider, Overlay,Grid, GridItem, Form, Field, NavBar, Row, Col, List, Picker, Cell, CellGroup, Toast, Popup, Dialog, RadioGroup, Radio, Notify, Button, Icon, Tab, Tabs } from 'vant'
+
+/*element ui*/
+import {
+  Tree as ELTree,
+  Button as ELButton,
+  Drawer as ELDrawer,
+} from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css';
+
+
 import { getWxToken, setWxToken, getIsIdentity, supremeAuthority, getIsWx, getTypes, getTypesName, getUserData, getEmployeeMap, getCache, setCache, removeCache, returnDeptName, getEmployeeMapItem, returnFh } from '@/utils/auth'
 Vue.prototype.$echarts = echarts
 Vue.prototype.$moment = moment
@@ -57,6 +67,9 @@ Vue.use(VueScroller)
 Vue.component('icon', icon)
 Vue.component('noData', noData)
 Vue.component('userImage', userImage)
+/*element ui 按需引入*/
+Vue.use(ELTree).use(ELButton).use(ELDrawer)
+
 Vue.use(Button).use(Tabbar).use(TabbarItem).use(ShareSheet).use(Grid).use(Overlay).use(Loading).use(Divider).use(GridItem).use(Picker).use(Form).use(Field).use(List).use(Tabs).use(Tab).use(NavBar).use(Row).use(Col).use(Cell).use(CellGroup).use(Toast).use(Popup).use(Dialog).use(RadioGroup).use(Radio).use(Icon).use(Notify).use(Empty)
 
 Vue.prototype.$route_back = function (setp) {

+ 9 - 0
src/point/view/integral/edit_user_power.vue

@@ -383,6 +383,15 @@ export default {
             self.$notify({ type: 'danger', message: '月奖分任务不能为空' })
             return false
           }
+
+          if (self.limit_list.reward_ratio_point > 0 && self.limit_list.reward_ratio == 0){
+            self.$notify({type:'danger',message:'月奖扣比例不能为1:0'})
+            return false
+          }
+          if (self.limit_list.exec_count_point > 0 && self.limit_list.exec_count == 0){
+            self.$notify({type:'danger',message:'月奖扣次数不能为0'})
+            return false
+          }
           self.showLoading()
           self.limit_list['employee_id'] = self.$route.query.id
           let data = JSON.parse(JSON.stringify(self.limit_list))

+ 17 - 6
src/point/view/integral/integral_application.vue

@@ -19,7 +19,15 @@
             </template>
           </van-cell>
           <!--选择规则  -->
-          <RuleCategorySelectorCell v-if="rule_switch" required  ref="rule_selector" name="选择规则"  title="选择规则" v-model="itemRule" scope/>
+          <van-cell
+            v-if="rule_switch"
+            title="选择规则"
+            @click="showRuleSelector = true"
+            required
+            :value="itemRule.length <= 0 ? '' : `已选${itemRule.length}条`"
+          />
+          <RuleScopeSelector :visible.sync = showRuleSelector :selected="itemRule" multi @confirm="selected => itemRule = selected" />
+<!--          <RuleCategorySelectorCell v-if="rule_switch" required  ref="rule_selector" name="选择规则"  title="选择规则" v-model="itemRule" scope/>-->
         </van-cell-group>
 
         <div v-for="(item, index) in items" :key="index">
@@ -33,13 +41,13 @@
                   <div style="word-break:break-all">{{ item.ruleData.remark }}</div>
                   <div v-if="item.ruleData.range_type == 1">
                     <span :class="item.ruleData.min_point > 0 ? 'red' : 'green'">{{ item.ruleData.min_point }}</span>
-                    {{ item.pc_name }}
+                    {{ $getTypesName(item.pt_id) }}
                   </div>
                   <div v-if="item.ruleData.range_type == 2">
                     <span :class="item.ruleData.min_point > 0 ? 'red' : 'green'">{{ item.ruleData.min_point }}</span>
                     <span :class="item.ruleData.max_point > 0 ? 'red' : 'green'">{{ item.ruleData.max_point }}</span>
-                    {{ item.pc_name }}
+                    {{ $getTypesName(item.pt_id) }}
                   </div>
               </div>
             </template>
@@ -121,27 +129,30 @@
 <script>
 import Mtextarea from '@/components/Mtextarea'
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell'
-import RuleCategorySelectorCell from '@/components/RuleCategorySelectorCell1'
+// import RuleCategorySelectorCell from '@/components/RuleCategorySelectorCell1'
 import CategorySelectorCell from '@/components/CategorySelectorCell'
 import DateCell from '@/components/DateCell'
 import moment from 'moment'
 import Vue from 'vue'
 import {Switch,Progress,Icon  } from 'vant'
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 
 Vue.use(Switch).use(Progress).use(Icon)
 
 export default {
   name: 'integral_application',
   components: {
+    RuleScopeSelector,
     DateCell,
     Mtextarea,
     EmployeeSelectorCell,
-    RuleCategorySelectorCell,
+    // RuleCategorySelectorCell,
     CategorySelectorCell,
   },
   data () {
     let date = moment().format('YYYY-MM-DD')
     return {
+      showRuleSelector:false,
       specified_rule_item:this.$userInfo().site_config.specified_rule_item? true:false,//奖扣时是否必选规则
       isNeed:!this.$getCache('isAndroid'),
       close_buttom: false,
@@ -204,7 +215,7 @@ export default {
             item.ruleData = e;
             item.rule_id = e.rule_id;
             item.item_id = e.id;
-            item.pc_name=e.name
+            item.pt_id = e.pt_id;
             items.push(item);
           }
         });

+ 15 - 3
src/point/view/integral/integral_entry_n.vue

@@ -16,7 +16,15 @@
             </template>
           </van-cell>
           <!--选择规则  -->
-          <RuleCategorySelectorCell v-if="rule_switch" required  ref="rule_selector" name="选择规则"  title="选择规则" v-model="itemRule" :ptId="ptId" scope></RuleCategorySelectorCell>
+          <van-cell
+            v-if="rule_switch"
+            title="选择规则"
+            @click="showRuleSelector = true"
+            required
+            :value="itemRule.length <= 0 ? '' : `已选${itemRule.length}条`"
+          />
+
+<!--          <RuleCategorySelectorCell v-if="rule_switch" required  ref="rule_selector" name="选择规则"  title="选择规则" v-model="itemRule" :ptId="ptId" scope></RuleCategorySelectorCell>-->
           <!--选择分类  -->
           <CategorySelectorCell v-if="!rule_switch" title="选择分类" ref="rule_selector2" v-model="ruleCate" required :ptId="ptId" scope></CategorySelectorCell>
         </van-cell-group>
@@ -119,34 +127,38 @@
     		</div>
     	</div>
     </van-popup>
+    <RuleScopeSelector :visible.sync = showRuleSelector :selected="itemRule" multi @confirm="selected => itemRule = selected" :pt-id="ptId" />
   </div>
 </template>
 <script>
 import Mtextarea from '@/components/Mtextarea'
 import NumberInput from '@/components/NumberInput'
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell'
-import RuleCategorySelectorCell from '@/components/RuleCategorySelectorCell1'
+// import RuleCategorySelectorCell from '@/components/RuleCategorySelectorCell1'
 import CategorySelectorCell from '@/components/CategorySelectorCell'
 import DateCell from '@/components/DateCell'
 import moment from 'moment'
 import Vue from 'vue'
 import ImageCamera from '@/attendance/components/image-camera';
 import {Switch,Progress} from 'vant'
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 
 Vue.use(Switch).use(Progress)
 export default {
   name: 'integral_entry_n',
   components: {
+    RuleScopeSelector,
     DateCell,
     Mtextarea,
     EmployeeSelectorCell,
-    RuleCategorySelectorCell,
+    // RuleCategorySelectorCell,
     CategorySelectorCell,
     NumberInput,
     ImageCamera
   },
   data () {
     return {
+      showRuleSelector:false,
       isNeed:!this.$getCache('isAndroid'),
       manage_scope: this.$userInfo().employee_detail.manage_scope,
       superior_list:this.$userInfo().employee_detail.superior_list,

+ 23 - 12
src/point/view/task/TaskEdit.vue

@@ -62,20 +62,28 @@
           />
 
           <!--选择规则  -->
-          <RuleCategorySelectorCell
+          <van-cell
             v-if="formData.rule_type === 2"
-            :pt-id="formData.pt_id"
-            required
-            name="请选择积分规则"
             title="积分规则"
-            v-model="rule_items"
-            scope
-            :multi="false"
-          >
-            <template slot="label">
-              <span style="color: red">{{ruleItemLabel}}</span>
-            </template>
-          </RuleCategorySelectorCell>
+            @click="showRuleSelector = true"
+            required
+            :value="rule_items.length <= 0 ? '' : `已选${rule_items.length}条`"
+          />
+          <RuleScopeSelector :visible.sync = showRuleSelector :selected="rule_items" @confirm="selected => rule_items = selected" :pt-id="formData.pt_id" />
+<!--          <RuleCategorySelectorCell-->
+<!--            v-if="formData.rule_type === 2"-->
+<!--            :pt-id="formData.pt_id"-->
+<!--            required-->
+<!--            name="请选择积分规则"-->
+<!--            title="积分规则"-->
+<!--            v-model="rule_items"-->
+<!--            scope-->
+<!--            :multi="false"-->
+<!--          >-->
+<!--            <template slot="label">-->
+<!--              <span style="color: red">{{ruleItemLabel}}</span>-->
+<!--            </template>-->
+<!--          </RuleCategorySelectorCell>-->
 
           <van-cell title="任务积分" style="padding:0 0.32rem; padding-top:0.16rem;" :border="false" required/>
           <NumberInput v-model="formData.base_point" v-validate="'required'"  :min="minPoint" :max="maxPoint"/>
@@ -157,10 +165,12 @@ import NumberInput from '@/components/NumberInput';
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell';
 import DateTimeCell from '@/components/DateTimeCell'
 import DeptSelectorCell from '@/components/DeptSelectorCell'
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 
 export default {
   name: "TaskEdit",
   components:{
+    RuleScopeSelector,
     Mtextarea,
     RuleCategorySelectorCell,
     CategorySelectorCell,
@@ -177,6 +187,7 @@ export default {
   },
   data(){
     return {
+      showRuleSelector: false,
       isNeed: !this.$getCache('isAndroid'),
       pts:this.$getTypes,
       rule_items:[],

+ 24 - 12
src/point/view/task/WorkEdit.vue

@@ -62,20 +62,29 @@
           />
 
           <!--选择规则  -->
-          <RuleCategorySelectorCell
+          <van-cell
             v-if="formData.rule_type === 2"
-            :pt-id="formData.pt_id"
-            required
-            name="请选择积分规则"
             title="积分规则"
-            v-model="rule_items"
-            scope
-            :multi="false"
-          >
-            <template slot="label">
-              <span style="color: red">{{ruleItemLabel}}</span>
-            </template>
-          </RuleCategorySelectorCell>
+            @click="showRuleSelector = true"
+            required
+            :value="rule_items.length <= 0 ? '' : `已选${rule_items.length}条`"
+          />
+          <RuleScopeSelector :visible.sync = showRuleSelector :selected="rule_items" @confirm="selected => rule_items = selected" :pt-id="formData.pt_id" />
+
+<!--          <RuleCategorySelectorCell-->
+<!--            v-if="formData.rule_type === 2"-->
+<!--            :pt-id="formData.pt_id"-->
+<!--            required-->
+<!--            name="请选择积分规则"-->
+<!--            title="积分规则"-->
+<!--            v-model="rule_items"-->
+<!--            scope-->
+<!--            :multi="false"-->
+<!--          >-->
+<!--            <template slot="label">-->
+<!--              <span style="color: red">{{ruleItemLabel}}</span>-->
+<!--            </template>-->
+<!--          </RuleCategorySelectorCell>-->
 
           <van-cell title="任务积分" style="padding:0 0.32rem; padding-top:0.16rem;" :border="false" required/>
           <NumberInput v-model="formData.base_point" v-validate="'required'"  :min="minPoint" :max="maxPoint"/>
@@ -164,10 +173,12 @@ import CategorySelectorCell from '@/components/CategorySelectorCell'
 import NumberInput from '@/components/NumberInput';
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell';
 import DateTimeCell from '@/components/DateTimeCell'
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 
 export default {
   name: "WorkEdit",
   components: {
+    RuleScopeSelector,
     Mtextarea,
     RuleCategorySelectorCell,
     CategorySelectorCell,
@@ -183,6 +194,7 @@ export default {
   },
   data() {
     return {
+      showRuleSelector: false,
       isNeed: !this.$getCache('isAndroid'),
       pts:this.$getTypes,
       rule_items:[],

+ 24 - 12
src/point/view/task/short_task.vue

@@ -59,20 +59,29 @@
           />
 
           <!--选择规则  -->
-          <RuleCategorySelectorCell
+          <van-cell
             v-if="data.rule_type === 2"
-            :pt-id="data.pt_id"
-            required
-            name="请选择积分规则"
             title="积分规则"
-            v-model="rule_items"
-            scope
-            :multi="false"
-          >
-            <template slot="label">
-              <span style="color: red">{{ruleItemLabel}}</span>
-            </template>
-          </RuleCategorySelectorCell>
+            @click="showRuleSelector = true"
+            required
+            :value="rule_items.length <= 0 ? '' : `已选${rule_items.length}条`"
+          />
+          <RuleScopeSelector :visible.sync = showRuleSelector :selected="rule_items" @confirm="selected => rule_items = selected" :pt-id="data.pt_id" />
+
+<!--          <RuleCategorySelectorCell-->
+<!--            v-if="data.rule_type === 2"-->
+<!--            :pt-id="data.pt_id"-->
+<!--            required-->
+<!--            name="请选择积分规则"-->
+<!--            title="积分规则"-->
+<!--            v-model="rule_items"-->
+<!--            scope-->
+<!--            :multi="false"-->
+<!--          >-->
+<!--            <template slot="label">-->
+<!--              <span style="color: red">{{ruleItemLabel}}</span>-->
+<!--            </template>-->
+<!--          </RuleCategorySelectorCell>-->
 
 
           <van-cell title="任务积分" style="padding:0 0.32rem; padding-top:0.16rem;" :border="false" required></van-cell>
@@ -337,6 +346,7 @@ import moment from 'moment'
 import Mtextarea from '@/components/Mtextarea';
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell';
 import { calendar, Overlay, DatetimePicker, RadioGroup, Radio, Picker, Dialog } from 'vant';
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 Vue.use(Radio);
 Vue.use(Picker);
 Vue.use(RadioGroup);
@@ -346,6 +356,7 @@ Vue.use(calendar)
   .use(Dialog);
 export default {
   components: {
+    RuleScopeSelector,
     EmployeeSelectorCell,
     Mtextarea,
     DateTimeCell,
@@ -358,6 +369,7 @@ export default {
     let ptB = pts.filter(pt => pt.code === 'BF');
     ptB = ptB ? ptB[0] : null;
     return {
+      showRuleSelector: false,
       point: 0,
       exced: 0, // 超预期计算标准
       pleased: 0, // 满意计算标准

+ 24 - 12
src/point/view/task/temp_task.vue

@@ -65,20 +65,29 @@
 
 
           <!--选择规则  -->
-          <RuleCategorySelectorCell
+          <van-cell
             v-if="data.rule_type === 2"
-            :pt-id="data.pt_id"
-            required
-            name="请选择积分规则"
             title="积分规则"
-            v-model="rule_items"
-            scope
-            :multi="false"
-          >
-            <template slot="label">
-              <span style="color: red">{{ruleItemLabel}}</span>
-            </template>
-          </RuleCategorySelectorCell>
+            @click="showRuleSelector = true"
+            required
+            :value="rule_items.length <= 0 ? '' : `已选${rule_items.length}条`"
+          />
+          <RuleScopeSelector :visible.sync = showRuleSelector :selected="rule_items" @confirm="selected => rule_items = selected" :pt-id="data.pt_id" />
+
+<!--          <RuleCategorySelectorCell-->
+<!--            v-if="data.rule_type === 2"-->
+<!--            :pt-id="data.pt_id"-->
+<!--            required-->
+<!--            name="请选择积分规则"-->
+<!--            title="积分规则"-->
+<!--            v-model="rule_items"-->
+<!--            scope-->
+<!--            :multi="false"-->
+<!--          >-->
+<!--            <template slot="label">-->
+<!--              <span style="color: red">{{ruleItemLabel}}</span>-->
+<!--            </template>-->
+<!--          </RuleCategorySelectorCell>-->
 
           <van-cell title="任务积分" style="padding:0 0.32rem; padding-top:0.16rem;" :border="false" required />
           <NumberInput v-model="data.base_point" v-validate="'required'" :min="minPoint" :max="maxPoint"/>
@@ -334,6 +343,7 @@ import Mtextarea from '@/components/Mtextarea';
 import EmployeeSelectorCell from '@/components/EmployeeSelectorCell';
 import smallTip from '@/components/smallTip';
 import { calendar, Overlay, DatetimePicker, RadioGroup, Radio, Picker } from 'vant';
+import RuleScopeSelector from "../../../components/RuleScopeSelector.vue";
 Vue.use(Radio);
 Vue.use(Picker);
 Vue.use(RadioGroup);
@@ -349,6 +359,7 @@ export default {
     ptB = ptB ? ptB[0] : null;
 
     return {
+      showRuleSelector: false,
       isNeed: !this.$getCache('isAndroid'),
       bar_height: 0,
       task_expire_day_text: '',
@@ -468,6 +479,7 @@ export default {
     };
   },
   components: {
+    RuleScopeSelector,
     EmployeeSelectorCell,
     Mtextarea,
     DateTimeCell,

+ 1 - 1
src/router/pointRoute.js

@@ -507,6 +507,6 @@ const routes = [
     label: '悬赏编辑',
     need_login: true,
     props: true
-  }
+  },
 ]
 export default routes