Kaynağa Gözat

Merge branch 'master' of http://119.23.210.103:3000/wy/mj_firm_former

zhangjingyuan 3 yıl önce
ebeveyn
işleme
6b44b7dd40

+ 1 - 1
.editorconfig

@@ -1,6 +1,6 @@
 [*.{js,jsx,ts,tsx,vue}]
 charset = utf-8
 indent_style = space
-indent_size = 2
+indent_size = 4
 trim_trailing_whitespace = true
 insert_final_newline = true

+ 3 - 1
.gitignore

@@ -1,4 +1,6 @@
 dist/
 node_modules/
 *.git
-
+package-lock.json
+.idea
+.history

+ 9 - 4
src/business/platform/bpmn/components/approval-opinion/index.vue

@@ -168,7 +168,7 @@ export default {
        watchKey:false,
        inputKey:"",
        dict_add:false,
-       data: '同意'
+       data: ''
     }
   },
   filters: { //定义过滤器
@@ -181,11 +181,16 @@ export default {
     }
   },
   created(){
-    this.data = this.value ? this.value : '同意'
+    setTimeout(()=> {
+        this.data = this.value ? this.value : '同意'
+    },100)
   },
   watch: {
-    data(){
-      this.$emit('input', this.data)
+    data:{
+        handler(){
+          this.$emit('input', this.data)
+        },
+        immediate: true
     },
     value: {
       handler(val, oldVal) {

+ 288 - 295
src/business/platform/form/formbuilder/right-aside/components/form-script.vue

@@ -1,306 +1,299 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    class="form-script-dialog"
-    top="0"
-    width="80%"
-    append-to-body
-    @close="closeDialog"
-    @open="getFormData"
-  >
-    <div v-if="dialogVisible">
-      <ibps-layout ref="layout">
-        <div slot="west" :style="{width:'200px',height:'450px'}">
-          <el-scrollbar
-            style="height:100%;width:100%;"
-            wrap-class="ibps-scrollbar-wrapper"
-          >
-            <el-tree
-              :data.sync="boTreeData"
-              :props="{
-                children: 'children',
-                label: 'name'
-              }"
-              default-expand-all
-              @node-click="clickBoNode"
-            />
-          </el-scrollbar>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        class="form-script-dialog"
+        top="0"
+        width="80%"
+        append-to-body
+        @close="closeDialog"
+        @open="getFormData"
+    >
+        <div v-if="dialogVisible">
+            <ibps-layout ref="layout">
+                <div slot="west" :style="{ width: '200px', height: '450px' }">
+                    <el-scrollbar style="height: 100%; width: 100%" wrap-class="ibps-scrollbar-wrapper">
+                        <el-tree
+                            :data.sync="boTreeData"
+                            :props="{
+                                children: 'children',
+                                label: 'name'
+                            }"
+                            default-expand-all
+                            @node-click="clickBoNode"
+                        />
+                    </el-scrollbar>
+                </div>
+                <div>
+                    <el-form label-position="top" @submit.native.prevent>
+                        <el-form-item class="form-script-head-title">
+                            <label slot="label">表单脚本 &nbsp;&nbsp;
+                                <el-button type="text" @click="handleDefaultScript">插入默认脚本</el-button>&nbsp;&nbsp;
+                                <el-dropdown @command="handleScriptCommand">
+                                    <span class="el-dropdown-link">
+                                        <el-button type="text">
+                                            插入表单函数<i class="el-icon-arrow-down el-icon--right"/>
+                                        </el-button>
+                                    </span>
+                                    <el-dropdown-menu slot="dropdown">
+                                        <el-dropdown-item command="onLoad">表单加载事件(onLoad)</el-dropdown-item>
+                                        <el-dropdown-item command="onLoadActions">表单加载按钮事件(onLoadActions)</el-dropdown-item>
+                                        <el-dropdown-item command="onValidate">表单提交校验(onValidate)</el-dropdown-item>
+                                        <el-dropdown-item command="beforeSubmit">表单按钮提交前置事件(beforeSubmit)</el-dropdown-item>
+                                        <el-dropdown-item command="afterSubmit">表单按钮提交后置事件(afterSubmit)</el-dropdown-item>
+                                        <el-dropdown-item command="beforeSubButton">表单子表按钮提交前置事件(beforeSubButton)</el-dropdown-item>
+                                        <el-dropdown-item command="afterSubButton">表单子表按钮提交后置事件(afterSubButton)</el-dropdown-item>
+                                    </el-dropdown-menu>
+                                </el-dropdown>
+                            </label>
+                            <codemirror
+                                v-if="dialogVisible"
+                                ref="formScript"
+                                v-model="formScript"
+                                :options="cmOption"
+                            />
+                        </el-form-item>
+                        <div class="form-script-foot">
+                            <ul>
+                                <li>请从左侧面板选择的字段名</li>
+                                <li>支持<span class="red">JavaScript</span>的脚本.参考编写脚本API。</li>
+                            </ul>
+                        </div>
+                    </el-form>
+                </div>
+            </ibps-layout>
         </div>
-        <div>
-          <el-form label-position="top" @submit.native.prevent>
-            <el-form-item class="form-script-head-title">
-              <label slot="label">表单脚本
-                &nbsp;&nbsp;
-                <el-button type="text" @click="handleDefaultScript">插入默认脚本</el-button>
-                &nbsp;&nbsp;
-                <el-dropdown @command="handleScriptCommand">
-                  <span class="el-dropdown-link">
-                    <el-button type="text">插入表单函数<i class="el-icon-arrow-down el-icon--right" /></el-button>
-                  </span>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item command="onLoad">表单加载事件(onLoad)</el-dropdown-item>
-                    <el-dropdown-item command="onLoadActions">表单加载按钮事件(onLoadActions)</el-dropdown-item>
-                    <el-dropdown-item command="onValidate">表单提交校验(onValidate)</el-dropdown-item>
-                    <el-dropdown-item command="beforeSubmit">表单按钮提交前置事件(beforeSubmit)</el-dropdown-item>
-                    <el-dropdown-item command="afterSubmit">表单按钮提交后置事件(afterSubmit)</el-dropdown-item>
-                    <el-dropdown-item command="beforeSubButton">表单子表按钮提交前置事件(beforeSubButton)</el-dropdown-item>
-                    <el-dropdown-item command="afterSubButton">表单子表按钮提交后置事件(afterSubButton)</el-dropdown-item>
-                  </el-dropdown-menu>
-                </el-dropdown>
-              </label>
-              <codemirror v-if="dialogVisible" ref="formScript" v-model="formScript" :options="cmOption" />
-            </el-form-item>
-            <div class="form-script-foot">
-              <ul>
-                <li>请从左侧面板选择的字段名</li>
-                <li>支持<span class="red">JavaScript</span>的脚本.参考编写脚本API。</li>
-              </ul>
-            </div>
-          </el-form>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
         </div>
-      </ibps-layout>
-    </div>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-
-  </el-dialog>
+    </el-dialog>
 </template>
 <script>
-import TreeUtils from '@/utils/tree'
-import { codemirror } from 'vue-codemirror'
-import 'codemirror/lib/codemirror.css'
-import 'codemirror/theme/eclipse.css'
-import 'codemirror/mode/javascript/javascript.js'
+    import TreeUtils from '@/utils/tree'
+    import { codemirror } from 'vue-codemirror'
+    import 'codemirror/lib/codemirror.css'
+    import 'codemirror/theme/idea.css'
+    import 'codemirror/mode/javascript/javascript.js'
 
-export default {
-  components: {
-    codemirror
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: String
-    },
-    boData: {
-      type: Array
-    },
-    title: {
-      type: String,
-      default: '表单脚本'
-    }
-  },
-  data() {
-    const _this = this
-    return {
-      dialogVisible: false,
-      formScript: '',
-      cmOption: {
-        tabSize: 4,
-        lineNumbers: true,
-        line: true,
-        autoCloseTags: true,
-        mode: 'text/javascript',
-        theme: 'eclipse',
-        extraKeys: {
-          'Ctrl-S': function(e) {
-            _this.handleConfirm(false)
-          }
+    export default {
+        components: {
+            codemirror
+        },
+        props: {
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            data: {
+                type: String
+            },
+            boData: {
+                type: Array
+            },
+            title: {
+                type: String,
+                default: '表单脚本'
+            }
+        },
+        data() {
+            const _this = this
+            return {
+                dialogVisible: false,
+                formScript: '',
+                cmOption: {
+                    indentUnit: 4,
+                    tabSize: 4,
+                    lineNumbers: true,
+                    line: true,
+                    autoCloseTags: true,
+                    mode: 'text/javascript',
+                    // idea, 3024-day, base-16-light, darcula, panda-syntax, paraiso-light
+                    theme: 'idea',
+                    extraKeys: {
+                        'Ctrl-S': function (e) {
+                            _this.handleConfirm(false)
+                        }
+                    }
+                },
+                toolbars: [
+                    { key: 'confirm' },
+                    { key: 'cancel' }
+                ]
+            }
+        },
+        computed: {
+            boTreeData() {
+                return TreeUtils.transformToTreeFormat(this.boData, {
+                    idKey: 'id',
+                    pIdKey: 'parentId'
+                })
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = this.visible
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            getFormData() {
+                this.$nextTick(() => {
+                    this.formScript = this.data || ''
+                })
+            },
+            getEditor() {
+                return this.$refs.formScript.cminstance
+            },
+            handleActionEvent({ key }) {
+                switch (key) {
+                    case 'confirm':
+                        this.handleConfirm()
+                        break
+                    case 'cancel':
+                        this.closeDialog()
+                        break
+                    default:
+                        break
+                }
+            },
+            handleConfirm(isColse = true) {
+                const data = this.formScript
+                if (this.$utils.isEmpty(data)) {
+                    this.$message.closeAll()
+                    this.$message.warning('请设置表单脚本')
+                    this.getEditor().focus()
+                    return
+                }
+                this.$emit('callback', data)
+                if (isColse) {
+                    this.closeDialog()
+                } else {
+                    this.$message.closeAll()
+                    this.$message.success('设置表单脚本成功')
+                }
+            },
+            // 关闭当前窗口
+            closeDialog() {
+                this.$emit('close', false)
+            },
+            clickBoNode(data) {
+                this.insertField(data, false)
+            },
+            insertField: function (obj, b) {
+                this.getEditor().replaceSelection(obj.key)
+                this.getEditor().focus()
+            },
+            handleDefaultScript() {
+                const val = 'Object.assign(JForm, {\n\t// 加载事件\n\tonLoad (form) {\n\t\tconsole.log(form)\n\t}\n})'
+                this.formScript = val
+                this.getEditor().focus()
+            },
+            handleScriptCommand(command) {
+                let val = ''
+                switch (command) {
+                    case 'onLoad':
+                        val = '\n\t// 加载事件\n\tonLoad (form) {\n\t\t\n\t}'
+                        break
+                    case 'onLoadActions':
+                        val = '\n\t// 表单加载按钮事件\n\tonLoadActions (form, action, button, type) {\n\t\t\n\t}'
+                        break
+                    case 'onValidate':
+                        val = '\n\t// 表单提交校验\n\tonValidate (form, callback) {\n\t\tcallback(true)\n\t}'
+                        break
+                    case 'beforeSubmit':
+                        val = '\n\t// 表单按钮前置事件\n\tbeforeSubmit (form, action, postValue, callback) {\n\t\tcallback(true)\n\t}'
+                        break
+                    case 'afterSubmit':
+                        val = ' \n\t// 表单按钮后置事件\n\tafterSubmit (form, action, postValue, callback) {\n\t\tcallback(true)\n\t}'
+                        break
+                    case 'beforeSubButton':
+                        val = '\n\t// 表单子表按钮前置事件\n\tbeforeSubButton (tableForm, action, position, params, callback) {\n\t\tcallback(true)\n\t}'
+                        break
+                    case 'afterSubButton':
+                        val = ' \n\t// 表单子表按钮后置事件\n\tafterSubButton (tableForm, action, position, params, callback) {\n\t\tcallback(true)\n\t}'
+                        break
+                    default:
+                        break
+                }
+                this.getEditor().replaceSelection(val)
+                this.getEditor().focus()
+            }
         }
-      },
-      toolbars: [
-        { key: 'confirm' },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    boTreeData() {
-      return TreeUtils.transformToTreeFormat(this.boData, {
-        idKey: 'id',
-        pIdKey: 'parentId'
-      })
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
     }
-  },
-  methods: {
-    getFormData() {
-      this.$nextTick(() => {
-        this.formScript = this.data || ''
-      })
-    },
-    getEditor() {
-      return this.$refs.formScript.cminstance
-    },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'confirm':
-          this.handleConfirm()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    handleConfirm(isColse = true) {
-      const data = this.formScript
-      if (this.$utils.isEmpty(data)) {
-        this.$message.closeAll()
-        this.$message.warning('请设置表单脚本')
-        this.getEditor().focus()
-        return
-      }
-      this.$emit('callback', data)
-      if (isColse) {
-        this.closeDialog()
-      } else {
-        this.$message.closeAll()
-        this.$message.success('设置表单脚本成功')
-      }
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
-    },
-    clickBoNode(data) {
-      this.insertField(data, false)
-    },
-    insertField: function(obj, b) {
-      this.getEditor().replaceSelection(obj.key)
-      this.getEditor().focus()
-    },
-    handleDefaultScript() {
-      const val = 'Object.assign(JForm,{\n  //加载事件\n  onLoad:function(form){\n    \n  }\n});'
-      this.formScript = val
-      this.getEditor().focus()
-    },
-    handleScriptCommand(command) {
-      let val = ''
-      switch (command) {
-        case 'onLoad':
-          val = '\n //加载事件\n  onLoad:function(form){\n    \n  }\n'
-          break
-        case 'onLoadActions':
-          val = '\n //表单加载按钮事件\n  onLoadActions:function(form,action,button,type){\n    \n  }\n'
-          break
-        case 'onValidate':
-          val = '\n //表单提交校验\n  onValidate:function(form,callback){\n    callback(true) \n  }\n'
-          break
-        case 'beforeSubmit':
-          val = '\n //表单按钮前置事件\n  beforeSubmit:function(form,action,postValue,callback){\n    callback(true) \n  }\n'
-          break
-        case 'afterSubmit':
-          val = ' \n //表单按钮后置事件\n  afterSubmit:function(form,action,postValue,callback){\n    callback(true) \n  }\n'
-          break
-        case 'beforeSubButton':
-          val = '\n //表单子表按钮前置事件\n  beforeSubButton:function(tableForm,action,position,params,callback){\n    callback(true) \n  }\n'
-          break
-        case 'afterSubButton':
-          val = ' \n //表单子表按钮后置事件\n  afterSubButton:function(tableForm,action,position,params,callback){\n    callback(true) \n  }\n'
-          break
-        default:
-          break
-      }
-      this.getEditor().replaceSelection(val)
-      this.getEditor().focus()
-    }
-  }
-}
 </script>
-<style lang="scss" >
-
-.form-script-dialog{
-  .el-dialog__body{
-    padding-top:10px ;
-  }
-  .ibps-layout__body{
-    width: 80%;
-  }
-  .CodeMirror{
-    height: 400px ;
-  }
-
-  .form-script-head-title{
-    border: 1px solid #e0e0e0;
-    .el-form-item__label{
-        background: #f3f8fb;
-        padding: 0 10px;
-        border-top-left-radius: 4px;
-        border-top-right-radius: 4px;
-        font-size: 14px;
-        width: 100%;
-    }
-  }
-
-  .form-script-info-name {
-    font-size: 12px;
-    color: #91A1B7;
-    line-height: 18px;
-    margin-bottom: 5px;
-  }
-  .form-script-info-main{
-    height: 300px;
-    border: 1px solid #e0e0e0;
-    padding: 0 5px;
-  }
-
-  .function-tree-node{
-    width: 100%;
-  }
-
-  .form-script-intro{
-     .form-script-title {
-      height: 38px;
-      line-height: 38px;
-      border-bottom: solid 1px #e0e0e0;
-      padding-left: 10px;
-    }
-    .form-script-name {
-      color: #761086;
+<style lang="scss">
+    .form-script-dialog {
+        .el-dialog__body {
+            padding-top: 10px;
+        }
+        .ibps-layout__body {
+            width: 80%;
+        }
+        .CodeMirror {
+            height: 400px;
+        }
+        .form-script-head-title {
+            border: 1px solid #e0e0e0;
+            .el-form-item__label {
+                background: #f3f8fb;
+                padding: 0 10px;
+                border-top-left-radius: 4px;
+                border-top-right-radius: 4px;
+                font-size: 14px;
+                width: 100%;
+            }
+        }
+        .form-script-info-name {
+            font-size: 12px;
+            color: #91a1b7;
+            line-height: 18px;
+            margin-bottom: 5px;
+        }
+        .form-script-info-main {
+            height: 300px;
+            border: 1px solid #e0e0e0;
+            padding: 0 5px;
+        }
+        .function-tree-node {
+            width: 100%;
+        }
+        .form-script-intro {
+            .form-script-title {
+                height: 38px;
+                line-height: 38px;
+                border-bottom: solid 1px #e0e0e0;
+                padding-left: 10px;
+            }
+            .form-script-name {
+                color: #761086;
+            }
+        }
+        ul {
+            font-size: 10px;
+            padding: 5px 0 5px 15px;
+            margin: 0 10px;
+        }
+        ul li {
+            line-height: 20px;
+            list-style-type: disc;
+        }
+        ul span.form-script-key {
+            margin: 0 3px;
+            color: #708;
+        }
+        ul span.form-script-field {
+            padding: 0 5px;
+            margin: 0 3px;
+            display: inline-block;
+            -webkit-border-radius: 2px;
+            -moz-border-radius: 2px;
+            border-radius: 2px;
+            color: #fff;
+            background-color: #178cdf;
+        }
     }
-  }
-
-  ul {
-    font-size: 10px;
-    padding: 5px 0 5px 15px;
-    margin: 0 10px;
-  }
-  ul li {
-      line-height: 20px;
-      list-style-type: disc;
-  }
-  ul span.form-script-key {
-      margin: 0 3px;
-      color: #708
-  }
-
-  ul span.form-script-field {
-      padding: 0 5px;
-      margin: 0 3px;
-      display: inline-block;
-      -webkit-border-radius: 2px;
-      -moz-border-radius: 2px;
-      border-radius: 2px;
-      color: #fff;
-      background-color: #178cdf
-  }
-}
 </style>

+ 114 - 0
src/views/crm/component/customerStatistics.vue

@@ -0,0 +1,114 @@
+<template>
+    <div>
+        <div id="chart" style="width:100%;height:85%"></div>
+    </div>
+</template>
+<script>
+import echarts from 'echarts'
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+       }
+    },
+    props:{
+        data: {
+            type: Array,
+            default: []
+        }
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      getEchartData() {
+        if (true) {
+            let myChart =  echarts.init(document.getElementById("chart"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#FF3366','#66FFFF','#66CC00'],
+                dataset: {
+                    dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                // Declare several bar series, each will be mapped
+                // to a column of dataset.source by default.
+                series: [
+                    { 
+                        name: '潜在客户数量',
+                        type: 'bar',
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }, { 
+                        name: '意向客户数量',
+                        type: 'bar', 
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }, {
+                        name: '已签约客户数量',
+                        type: 'bar',
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }
+                ]
+            };
+            option && myChart.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 112 - 0
src/views/crm/component/customerStatisticsM.vue

@@ -0,0 +1,112 @@
+<template>
+    <div>
+        <div id="chartM" style="width:100%;height:85%"></div>
+    </div>
+</template>
+<script>
+import echarts from 'echarts'
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+       }
+    },
+    props:{
+        data: {
+            type: Array,
+        }
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      getEchartData() {
+        
+        if (true) {
+            let mcm =  echarts.init(document.getElementById("chartM"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#FF33FF','#66FFFF','#33CC00'],
+                dataset: {
+                    dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [
+                    { 
+                        name: '潜在客户数量',
+                        type: 'bar',
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }, { 
+                        name: '意向客户数量',
+                        type: 'bar',
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }, { 
+                        name: '已签约客户数量',
+                        type: 'bar',
+                        label: {
+                            show: true,
+                            position: 'top'
+                        } 
+                    }
+                ]
+            };
+            option && mcm.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 85 - 0
src/views/crm/component/headerDecoration.vue

@@ -0,0 +1,85 @@
+<!--
+ * @Author: cyy szjbdcyy@126.com
+ * @Date: 2023-03-09 15:33:26
+ * @LastEditors: cyy szjbdcyy@126.com
+ * @LastEditTime: 2023-03-09 15:36:54
+ * @FilePath: \lh_firm_former\src\views\statistics\headerDecoration.vue
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<template>
+  <div id="top">
+    <dv-decoration-8 class="header-left-decoration" />
+    <dv-decoration-5 class="header-center-decoration" />
+   
+    <dv-decoration-8 class="header-right-decoration" :reverse="true" />
+    <div class="center-title">CRM看板</div></div>
+    <!-- <span class="showTime">当前时间为:{{sendTime}}</span> -->
+    
+  </div>
+</template>
+
+<script>
+
+export default {
+  // props:['titleName'],
+  data () {
+    return {
+      sendTime:''
+      
+	}
+  },
+  created(){
+    this.currentTime()
+  },
+  methods:{
+    currentTime() {
+      setInterval(this.getNowTime, 500);
+    },
+    getNowTime(){
+      const nowDate = new Date();
+      const date = {
+          year: nowDate.getFullYear(),
+          month: nowDate.getMonth() + 1,
+          day: nowDate.getDate(),
+          hour: nowDate.getHours(),
+          minute: nowDate.getMinutes(),
+          second: nowDate.getSeconds()
+      }
+      this.sendTime = date.year + '年' + date.month + '月' + date.day + '日' +date.hour + '时' + date.minute + '分' + date.second + '秒'
+
+
+
+    }
+  }
+}
+</script>
+
+<style lang="less">
+#top {
+  position: relative;
+  width: 100%;
+  height: 100px;
+  display: flex;
+  justify-content: space-between;
+  flex-shrink: 0;
+ 
+  .header-center-decoration {
+    width: 40%;
+    height: 60px;
+    margin-top: 30px;
+  }
+  .header-left-decoration, .header-right-decoration {
+    width: 25%;
+    height: 60px;
+  }
+  .center-title {
+    position: absolute;
+    font-size: 30px;
+    font-weight: bold;
+    left: 50%;
+    top: 15px;
+    color: #fff;
+    transform: translateX(-50%);
+  }
+}
+</style>

+ 89 - 0
src/views/crm/component/individualPerformance.vue

@@ -0,0 +1,89 @@
+<template>
+    <div>
+        <div id="inpm" style="width:100%;height:85%"></div>
+    </div>
+</template>
+<script>
+import echarts from 'echarts'
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+       }
+    },
+    props:{
+        data: {
+            type: Array,
+        }
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      getEchartData() {
+        
+        if (true) {
+            let inpms=  echarts.init(document.getElementById("inpm"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#FFFF66'],
+                dataset: {
+                    dimensions: ['lei_bie_', 'jiage'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [{ name: '销量',type: 'bar',barWidth:'10%',label: {show: true,position: 'top'}  }]
+            };
+            option && inpms.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 89 - 0
src/views/crm/component/orderStatistics.vue

@@ -0,0 +1,89 @@
+<template>
+    <div>
+        <div id="chartOR" style="width:100%;height:100%"></div>
+    </div>
+</template>
+<script>
+import echarts from 'echarts'
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+       }
+    },
+    props:{
+        data: {
+            type: Array,
+        }
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      getEchartData() {
+        
+        if (true) {
+            let ors=  echarts.init(document.getElementById("chartOR"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#FF33FF','#66FFFF','#33CC00'],
+                dataset: {
+                    dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [{ name: '潜在客户数量',type: 'bar' }, { name: '意向客户数量',type: 'bar' }, { name: '已签约客户数量',type: 'bar' }]
+            };
+            option && ors.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 142 - 0
src/views/crm/component/personPerformance.vue

@@ -0,0 +1,142 @@
+<template>
+<div @click="toDetailed()" class="statisticsPage" style="width:100%;height:85%">
+    <div id="chart" style="width:100%;height:100%"></div>
+    <div v-if="dialogOff">
+      <dialogView
+        :dialogOff = "dialogOff"
+        @close = "close"
+        :data="userInfo"
+        :date="date"
+      />
+    </div>
+</div>
+</template>
+<script>
+import echarts from 'echarts'
+import dialogView from '../messageBox/personAllDetails'
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+            userInfo:[]
+
+       }
+    },
+    components:{
+      dialogView
+    },
+    props:{
+        data: {
+            type: Array,
+        },
+        date: {
+            type: String,
+        },
+        click:{
+            type:String,
+            default:'true'
+        },
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+        close(){
+        this.dialogOff = false
+      },
+      /* 跳转统计页面*/
+      toDetailed(){
+        if(this.click == "true"){
+            this.dialogOff = true
+        }
+      },
+      getEchartData() {
+        if (true) {
+            let that = this
+            let myChart =  echarts.init(document.getElementById("chart"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#66CC00'],
+                xAxis: {
+                    type: 'category',
+                    data: this.data[0],
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [
+                    {
+                        data: this.data[1],
+                        type: 'bar',
+                        name: '销量',
+                        // showBackground: true,
+                        backgroundStyle: {
+                            color: 'rgba(180, 180, 180, 0.2)'
+                        },
+                        label: {
+                            show: true,
+                            position: 'top',
+                            formatter: function(params) {
+                                if (params.value > 0) {
+                                    return params.value;
+                                } else {
+                                    return '';
+                                }
+                            }
+                        } 
+                    }
+                ]
+            };
+            myChart.on('click', function (params) {
+                that.userInfo[0] = params.dataIndex+1
+                // that.userInfo[1] = params.data.NAME_
+            })
+            option && myChart.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 146 - 0
src/views/crm/component/personPerformanceMonth.vue

@@ -0,0 +1,146 @@
+<template>
+<div @click="toDetailed()" class="statisticsPage" style="width:100%;height:85%">
+
+    <div id="chartqq" style="width:100%;height:100%"></div>
+    <div v-if="dialogOff">
+      <dialogView
+        :dialogOff = "dialogOff"
+        @close = "close"
+        :data="userInfo"
+        :date="date"
+      />
+    </div>
+</div>
+</template>
+<script>
+import echarts from 'echarts'
+import dialogView from '../messageBox/personMonthDetails'
+
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+            userInfo:[]
+       }
+    },
+    components:{
+      dialogView
+    },
+    props:{
+        data: {
+            type: Array,
+        },
+        date: {
+            type: String,
+        },
+        click:{
+            type:String,
+            default:'true'
+        },
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+        close(){
+        this.dialogOff = false
+      },
+      /* 跳转统计页面*/
+      toDetailed(){
+        if(this.click == "true"){
+            this.dialogOff = true
+        }
+      },
+      getEchartData() {
+        if (true) {
+            let that = this
+
+            let qq =  echarts.init(document.getElementById("chartqq"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#FFD700'],
+                xAxis: {
+                    type: 'category',
+                    data: this.data[0],
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [
+                    {
+                        data: this.data[1],
+                        type: 'bar',
+                        name: '销量',
+                        // showBackground: true,
+                        backgroundStyle: {
+                            color: 'rgba(180, 180, 180, 0.2)'
+                        },
+                        label: {
+                            show: true,
+                            position: 'top',
+                            formatter: function(params) {
+                                if (params.value > 0) {
+                                    return params.value;
+                                } else {
+                                    return '';
+                                }
+                            }
+                        } 
+                    }
+                ]
+            };
+            qq.on('click', function (params) {
+                // console.log(params)
+                that.userInfo[0] = params.dataIndex+1
+                // that.userInfo[1] = params.data.NAME_
+                // console.log(params.dataIndex);
+            })
+            option && qq.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 124 - 0
src/views/crm/component/teamPerformance.vue

@@ -0,0 +1,124 @@
+<template>
+<div @click="toDetailed()" class="statisticsPage" style="width:100%;height:85%">
+    <div id="tmec" style="width:100%;height:100%"></div>
+    <div v-if="dialogOff">
+      <dialogView
+        :dialogOff = "dialogOff"
+        @close = "close"
+        :data="userInfo"
+        :date="date"
+      />
+    </div>
+</div>
+</template>
+<script>
+import echarts from 'echarts'
+import dialogView from '../messageBox/teamAllDetails'
+
+export default {
+    data() {
+        return {
+            dialogOff:false,
+            userInfo:[]
+       }
+    },
+    components:{
+      dialogView
+    },
+    props:{
+        data: {
+            type: Array,
+        },
+        date: {
+            type: String,
+        },
+        click:{
+            type:String,
+            default:'true'
+        },
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      close(){
+        this.dialogOff = false
+      },
+      /* 跳转统计页面*/
+      toDetailed(){
+        if(this.click == "true"){
+            this.dialogOff = true
+        }
+      },
+      getEchartData() {
+        if (true) {
+            let that = this
+            let tmecs=  echarts.init(document.getElementById("tmec"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#99FF00'],
+                dataset: {
+                    dimensions: ['NAME_', 'jiage'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [{ name: '销量',type: 'bar',barWidth:'10%',label: {show: true,position: 'top'} }]
+            };
+            tmecs.on('click', function (params) {
+                // console.log(params.data.bian_zhi_ren_)
+                that.userInfo[0] = params.data.bian_zhi_ren_
+                that.userInfo[1] = params.data.NAME_
+                // console.log(params.dataIndex);
+            })
+            option && tmecs.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 125 - 0
src/views/crm/component/teamPerformanceMonth.vue

@@ -0,0 +1,125 @@
+<template>
+<div @click="toDetailed()" class="statisticsPage" style="width:100%;height:85%">
+    <div id="chartOR" style="width:100%;height:100%"></div>
+        <div v-if="dialogOff">
+      <dialogView
+        :dialogOff = "dialogOff"
+        @close = "close"
+        :data="userInfo"
+        :date="date"
+      />
+    </div>
+</div>
+</template>
+<script>
+import echarts from 'echarts'
+import dialogView from '../messageBox/teamMonthDetails'
+
+  export default {
+    data() {
+        return {
+            // title:'人员培训',
+            dialogOff:false,
+            userInfo:[]
+       }
+    },
+    props:{
+        data: {
+            type: Array,
+        },
+        date: {
+            type: String,
+        },
+        click:{
+            type:String,
+            default:'true'
+        },
+    },
+    components:{
+      dialogView
+    },
+    watch: {
+        data(v) {
+            this.getEchartData()
+        }
+    },
+    mounted() {
+      this.getEchartData()
+    },
+    methods: {
+      close(){
+        this.dialogOff = false
+      },
+      /* 跳转统计页面*/
+      toDetailed(){
+        if(this.click == "true"){
+            this.dialogOff = true
+        }
+      },
+      getEchartData() {
+        if (true) {
+            let that = this
+            let ors=  echarts.init(document.getElementById("chartOR"))
+            let option = {
+                legend: {                  
+                    textStyle:{
+                        color:'#fff'
+                    }
+                },
+                tooltip: {},
+                color:['#99FFFF'],
+                dataset: {
+                    dimensions: ['NAME_', 'jiage'],
+                    source: this.data
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        }
+                    }
+                },
+                yAxis: {
+                    axisLabel:{//修改坐标系字体颜色
+                        show:true,
+                        textStyle:{
+                            color:"#fff"
+                        }
+                    },
+                    axisLine: {//y轴线的颜色以及宽度
+                        show: true,
+                        lineStyle: {
+                            color: "rgba(255,255,255,1)",
+                            type: "solid"
+                        },
+                    },
+                    splitLine: {
+                        show: false
+                    }
+                },
+                series: [{ name: '销量',type: 'bar',barWidth:'10%',label: {show: true,position: 'top'} }]
+            };
+            ors.on('click', function (params) {
+                // console.log(params.data.bian_zhi_ren_)
+                that.userInfo[0] = params.data.bian_zhi_ren_
+                that.userInfo[1] = params.data.NAME_
+                // console.log(params.dataIndex);
+            })
+            option && ors.setOption(option);
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+</style>

BIN
src/views/crm/img/bg.png


BIN
src/views/crm/img/stars.png


+ 147 - 0
src/views/crm/messageBox/personAllDetails.vue

@@ -0,0 +1,147 @@
+<template>
+    <el-dialog
+      :visible.sync="visible"
+      ref="dialog"
+      :title="'个人月度销售详情'"
+      width="100%"
+      lock-scroll
+      append-to-body
+      fullscreen
+      close-on-press-escape
+      destroy-on-close
+      v-if="visible"
+      @close="handleClose">
+
+        <el-table
+        :data="tableData.slice((currpage - 1) * pagesize, currpage * pagesize)"
+        style="width: 100%"
+        :row-class-name="tableRowClassName">
+            <el-table-column
+            prop="he_tong_bian_hao_"
+            label="合同编号"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuan_huan_ke_hu_"
+            label="客户名称"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="sheng_xiao_shi_ji"
+            label="生效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="shi_xiao_shi_jian"
+            label="失效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuang_tai_"
+            label="合同状态"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="fu_kuan_fang_shi_"
+            label="付款方式"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="jiage"
+            label="总价(元)"
+            width="180">
+            </el-table-column>
+        </el-table>
+
+        <el-pagination
+        layout="prev, pager, next, jumper"
+        @size-change = 'handleSizeChange'
+        @current-change='handleCurrentChange'
+        :current-page='currpage'
+        :page-size='pagesize'
+        :total="tableData.length">
+
+        </el-pagination>
+    </el-dialog>
+</template>
+
+<script>
+  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+
+  export default {
+    props:{
+        dialogOff:{ //当前表单示例
+            type: Boolean,
+            default:false,
+        },
+        data:{
+            type:Array
+        },
+        date:{
+            type:String
+        },
+        height:{
+            type:String,
+            default:window.screen.height * 0.5 +'px'
+        }
+    },
+    beforeMount: function () {
+        let tempid = this.$store.state.ibps.user.info.user.id
+        const newmonth = this.data[0] > 10 ? this.data[0] : "0" + this.data[0];
+
+        let sql = "select e.*,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+ this.date.split('-')[0]+"-"+newmonth +"%' and t_bjd.bian_zhi_ren_ = '"+tempid+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ ORDER BY e.he_tong_bian_hao_ desc"
+        curdPost('sql',sql).then(res=>{
+
+          this.tableData = res.variables.data
+        })
+    },
+    watch:{
+        dialogOff: {
+            handler: function(val, oldVal) {
+                this.visible = JSON.parse(JSON.stringify(val));
+                this.itemShow = true
+            },
+            immediate: true
+        }
+    },
+    data() {
+        return {
+            visible:false,
+            itemShow:false,
+            tableData: [],
+            curentPage1: 1, //默认最开始是第几页
+            pagesize: 10, //每页数据条数
+            currpage: 1, //默认开始页面
+        }
+    },
+    methods:{
+        // 关闭窗口
+        handleClose(){
+            this.$emit('close', false)
+        },
+        tableRowClassName({row, rowIndex}) {
+            if (rowIndex === 1) {
+            return 'warning-row';
+            } else if (rowIndex === 3) {
+            return 'success-row';
+            }
+            return '';
+        },
+        handleSizeChange(val) {
+            this.pagesize = val
+        },
+        handleCurrentChange(val) {
+            this.currpage = val
+        }
+    }
+  }
+</script>
+
+<style scoped>
+  .dataCont{
+    border:0px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    height: calc(100vh * 0.85);
+    padding:20px;
+  }
+</style>

+ 147 - 0
src/views/crm/messageBox/personMonthDetails.vue

@@ -0,0 +1,147 @@
+<template>
+    <el-dialog
+      :visible.sync="visible"
+      ref="dialog"
+      :title="'个人日销售详情'"
+      width="100%"
+      lock-scroll
+      append-to-body
+      fullscreen
+      close-on-press-escape
+      destroy-on-close
+      v-if="visible"
+      @close="handleClose">
+
+        <el-table
+        :data="tableData.slice((currpage - 1) * pagesize, currpage * pagesize)"
+        style="width: 100%"
+        :row-class-name="tableRowClassName">
+            <el-table-column
+            prop="he_tong_bian_hao_"
+            label="合同编号"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuan_huan_ke_hu_"
+            label="客户名称"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="sheng_xiao_shi_ji"
+            label="生效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="shi_xiao_shi_jian"
+            label="失效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuang_tai_"
+            label="合同状态"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="fu_kuan_fang_shi_"
+            label="付款方式"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="jiage"
+            label="总价(元)"
+            width="180">
+            </el-table-column>
+        </el-table>
+
+        <el-pagination
+        layout="prev, pager, next, jumper"
+        @size-change = 'handleSizeChange'
+        @current-change='handleCurrentChange'
+        :current-page='currpage'
+        :page-size='pagesize'
+        :total="tableData.length">
+
+        </el-pagination>
+    </el-dialog>
+</template>
+
+<script>
+  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+
+  export default {
+    props:{
+        dialogOff:{ //当前表单示例
+            type: Boolean,
+            default:false,
+        },
+        data:{
+            type:Array
+        },
+        date:{
+            type:String
+        },
+        height:{
+            type:String,
+            default:window.screen.height * 0.5 +'px'
+        }
+    },
+    beforeMount: function () {
+        let tempid = this.$store.state.ibps.user.info.user.id
+        const newmonth = this.data[0] > 10 ? this.data[0] : "0" + this.data[0];
+
+        let sql = "select e.*,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+ this.date+"-"+newmonth +"%' and t_bjd.bian_zhi_ren_ = '"+tempid+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ ORDER BY e.he_tong_bian_hao_ desc"
+        curdPost('sql',sql).then(res=>{
+
+          this.tableData = res.variables.data
+        })
+    },
+    watch:{
+        dialogOff: {
+            handler: function(val, oldVal) {
+                this.visible = JSON.parse(JSON.stringify(val));
+                this.itemShow = true
+            },
+            immediate: true
+        }
+    },
+    data() {
+        return {
+            visible:false,
+            itemShow:false,
+            tableData: [],
+            curentPage1: 1, //默认最开始是第几页
+            pagesize: 10, //每页数据条数
+            currpage: 1, //默认开始页面
+        }
+    },
+    methods:{
+        // 关闭窗口
+        handleClose(){
+            this.$emit('close', false)
+        },
+        tableRowClassName({row, rowIndex}) {
+            if (rowIndex === 1) {
+            return 'warning-row';
+            } else if (rowIndex === 3) {
+            return 'success-row';
+            }
+            return '';
+        },
+        handleSizeChange(val) {
+            this.pagesize = val
+        },
+        handleCurrentChange(val) {
+            this.currpage = val
+        }
+    }
+  }
+</script>
+
+<style scoped>
+  .dataCont{
+    border:0px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    height: calc(100vh * 0.85);
+    padding:20px;
+  }
+</style>

+ 144 - 0
src/views/crm/messageBox/teamAllDetails.vue

@@ -0,0 +1,144 @@
+<template>
+    <el-dialog
+      :visible.sync="visible"
+      ref="dialog"
+      :title="data[1]+' 年度销售详情'"
+      width="100%"
+      lock-scroll
+      append-to-body
+      fullscreen
+      close-on-press-escape
+      destroy-on-close
+      v-if="visible"
+      @close="handleClose">
+
+        <el-table
+        :data="tableData.slice((currpage - 1) * pagesize, currpage * pagesize)"
+        style="width: 100%"
+        :row-class-name="tableRowClassName">
+            <el-table-column
+            prop="he_tong_bian_hao_"
+            label="合同编号"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuan_huan_ke_hu_"
+            label="客户名称"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="sheng_xiao_shi_ji"
+            label="生效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="shi_xiao_shi_jian"
+            label="失效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuang_tai_"
+            label="合同状态"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="fu_kuan_fang_shi_"
+            label="付款方式"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="jiage"
+            label="总价(元)"
+            width="180">
+            </el-table-column>
+        </el-table>
+
+        <el-pagination
+        layout="prev, pager, next, jumper"
+        @size-change = 'handleSizeChange'
+        @current-change='handleCurrentChange'
+        :current-page='currpage'
+        :page-size='pagesize'
+        :total="tableData.length">
+
+        </el-pagination>
+    </el-dialog>
+</template>
+
+<script>
+  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+
+  export default {
+    props:{
+        dialogOff:{ //当前表单示例
+            type: Boolean,
+            default:false,
+        },
+        data:{
+            type:Array
+        },
+        date:{
+            type:String
+        },
+        height:{
+            type:String,
+            default:window.screen.height * 0.5 +'px'
+        }
+    },
+    beforeMount: function () {
+        let sql = "select e.*,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+ this.date.split('-')[0] +"%' and t_bjd.bian_zhi_ren_ = '"+this.data[0]+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ ORDER BY e.he_tong_bian_hao_ desc"
+        curdPost('sql',sql).then(res=>{
+
+          this.tableData = res.variables.data
+        })
+    },
+    watch:{
+        dialogOff: {
+            handler: function(val, oldVal) {
+                this.visible = JSON.parse(JSON.stringify(val));
+                this.itemShow = true
+            },
+            immediate: true
+        }
+    },
+    data() {
+        return {
+            visible:false,
+            itemShow:false,
+            tableData: [],
+            curentPage1: 1, //默认最开始是第几页
+            pagesize: 10, //每页数据条数
+            currpage: 1, //默认开始页面
+        }
+    },
+    methods:{
+        // 关闭窗口
+        handleClose(){
+            this.$emit('close', false)
+        },
+        tableRowClassName({row, rowIndex}) {
+            if (rowIndex === 1) {
+            return 'warning-row';
+            } else if (rowIndex === 3) {
+            return 'success-row';
+            }
+            return '';
+        },
+        handleSizeChange(val) {
+            this.pagesize = val
+        },
+        handleCurrentChange(val) {
+            this.currpage = val
+        }
+    }
+  }
+</script>
+
+<style scoped>
+  .dataCont{
+    border:0px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    height: calc(100vh * 0.85);
+    padding:20px;
+  }
+</style>

+ 144 - 0
src/views/crm/messageBox/teamMonthDetails.vue

@@ -0,0 +1,144 @@
+<template>
+    <el-dialog
+      :visible.sync="visible"
+      ref="dialog"
+      :title="data[1]+' 月度销售详情'"
+      width="100%"
+      lock-scroll
+      append-to-body
+      fullscreen
+      close-on-press-escape
+      destroy-on-close
+      v-if="visible"
+      @close="handleClose">
+
+        <el-table
+        :data="tableData.slice((currpage - 1) * pagesize, currpage * pagesize)"
+        style="width: 100%"
+        :row-class-name="tableRowClassName">
+            <el-table-column
+            prop="he_tong_bian_hao_"
+            label="合同编号"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuan_huan_ke_hu_"
+            label="客户名称"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="sheng_xiao_shi_ji"
+            label="生效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="shi_xiao_shi_jian"
+            label="失效时间"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="zhuang_tai_"
+            label="合同状态"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="fu_kuan_fang_shi_"
+            label="付款方式"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="jiage"
+            label="总价(元)"
+            width="180">
+            </el-table-column>
+        </el-table>
+
+        <el-pagination
+        layout="prev, pager, next, jumper"
+        @size-change = 'handleSizeChange'
+        @current-change='handleCurrentChange'
+        :current-page='currpage'
+        :page-size='pagesize'
+        :total="tableData.length">
+
+        </el-pagination>
+    </el-dialog>
+</template>
+
+<script>
+  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+
+  export default {
+    props:{
+        dialogOff:{ //当前表单示例
+            type: Boolean,
+            default:false,
+        },
+        data:{
+            type:Array
+        },
+        date:{
+            type:String
+        },
+        height:{
+            type:String,
+            default:window.screen.height * 0.5 +'px'
+        }
+    },
+    beforeMount: function () {
+        let sql = "select e.*,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+ this.date.split('-')[0] +"%' and t_bjd.bian_zhi_ren_ = '"+this.data[0]+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ ORDER BY e.he_tong_bian_hao_ desc"
+        curdPost('sql',sql).then(res=>{
+
+          this.tableData = res.variables.data
+        })
+    },
+    watch:{
+        dialogOff: {
+            handler: function(val, oldVal) {
+                this.visible = JSON.parse(JSON.stringify(val));
+                this.itemShow = true
+            },
+            immediate: true
+        }
+    },
+    data() {
+        return {
+            visible:false,
+            itemShow:false,
+            tableData: [],
+            curentPage1: 1, //默认最开始是第几页
+            pagesize: 10, //每页数据条数
+            currpage: 1, //默认开始页面
+        }
+    },
+    methods:{
+        // 关闭窗口
+        handleClose(){
+            this.$emit('close', false)
+        },
+        tableRowClassName({row, rowIndex}) {
+            if (rowIndex === 1) {
+            return 'warning-row';
+            } else if (rowIndex === 3) {
+            return 'success-row';
+            }
+            return '';
+        },
+        handleSizeChange(val) {
+            this.pagesize = val
+        },
+        handleCurrentChange(val) {
+            this.currpage = val
+        }
+    }
+  }
+</script>
+
+<style scoped>
+  .dataCont{
+    border:0px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    height: calc(100vh * 0.85);
+    padding:20px;
+  }
+</style>

+ 397 - 51
src/views/crm/tongji.vue

@@ -1,64 +1,410 @@
 <template>
-  <div>
-   <div id="chart" style="width:100%;height:376px"></div>
-  </div>
+  <dv-full-screen-container>
+    <!-- <el-scrollbar class="screen" ref="scrollDiv" > -->
+      <div class="bgAll">
+        <div class="editDate">
+        <!-- 标题装饰组件 -->
+          <header-decoration />
+          <div class="pickDate">
+            <el-date-picker
+              v-model="allDate"
+              style="color: #000 !important;
+              width: 12%;
+              height:2.825rem;
+              line-height: 2.825rem;
+              text-align:center;"
+              type="month"
+              value-format="yyyy-MM"
+              @change="refreshAll(allDate)"
+              placeholder="选择月">
+            </el-date-picker>
+            <div 
+              @click.prevent="goBack()" 
+              style="width: 12%;
+              height:2.825rem;
+              line-height: 2.825rem;
+              text-align:center;" >
+              <dv-border-box-8>返回</dv-border-box-8>
+            </div>
+          </div>
+        </div>
+        <div class="customerC" v-if="authority">
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="csArr.length>0" class="middleFont">各渠道客户数量</div>
+              <customer-statistics v-if="csArr.length>0" :data = 'csArr'></customer-statistics>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="msArr.length>0" class="middleFont">月度各渠道客户数量</div>
+              <customer-statistics-m v-if="msArr.length>0" :data = 'msArr'></customer-statistics-m>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="inArr.length>0" class="middleFont">月度各渠道客户销售量</div>
+              <individual-performance v-if="inArr.length>0" :data = 'inArr'></individual-performance>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+        </div>
+        <div class="customerD" v-if="authority">
+          <dv-border-box-7 style="width:32.67%;" backgroundColor="rgba(6, 30, 93, 0.5)">
+            <div class="middleFontC">月度客户销售量</div>
+            <dv-scroll-board style="height: 87%;"
+              v-if="tableData.data && tableData.data.length"
+              :config="tableData"
+            />
+          </dv-border-box-7>
+          
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="teArr.length>0" class="middleFont">年度团队绩效</div>
+              <team-performance v-if="teArr.length>0" :data = 'teArr' :date = 'allDate'></team-performance>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="tmArr.length>0" class="middleFont">月度团队绩效</div>
+              <team-performance-month v-if="tmArr.length>0" :data = 'tmArr' :date = 'allDate'></team-performance-month>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+        </div>
+        <div class="customerG" v-else>
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="peArr.length>0" class="middleFont">年度个人绩效</div>
+              <person-performance v-if="peArr.length>0" :data = 'peArr' :date = 'allDate'></person-performance>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+          <dv-border-box-7  backgroundColor="rgba(6, 30, 93, 0.5)" >
+            <div class="ttitle">
+              <div v-if="pmArr.length>0" class="middleFont">月度个人绩效</div>
+              <person-performance-month v-if="pmArr.length>0" :data = 'pmArr' :date = 'allDate'></person-performance-month>
+              <div class="nullDate" v-else>暂无数据</div>
+            </div>
+          </dv-border-box-7>
+          
+        </div>
+      </div>
+    <!-- </el-scrollbar> -->
+  </dv-full-screen-container>
 </template>
 <script>
-import echarts from 'echarts'
+//全屏展示
+  import screenfull from 'screenfull'
+  //大屏标题组件
+  import headerDecoration from '../crm/component/headerDecoration'
+  import customerStatistics from '../crm/component/customerStatistics'
+  import customerStatisticsM from '../crm/component/customerStatisticsM'
+  import individualPerformance from '../crm/component/individualPerformance'
+  import orderStatistics from '../crm/component/orderStatistics'
+  import teamPerformance from '../crm/component/teamPerformance'
+  import teamPerformanceMonth from '../crm/component/teamPerformanceMonth'
+  import personPerformance from '../crm/component/personPerformance'
+  import personPerformanceMonth from '../crm/component/personPerformanceMonth'
+
+  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
   export default {
     data() {
       return {
-             title:'人员培训',
-             dialogOff:false,
-           }
+        authority:false,
+        allDate: '',
+        dialogOff:false,
+        csArr:[],
+        msArr:[],
+        inArr:[],
+        orArr:[],
+        teArr:[],
+        tmArr:[],
+        pmArr:[],
+        peArr:[],
+        tableData:{
+          header: ['公司名称', '付款方式', '价格(元)'],
+          data: [
+            ['行1列1', '行1列2', '行1列3'],
+            ['行2列1', '行2列2', '行2列3'],
+            ['行3列1', '行3列2', '行3列3'],
+            ['行4列1', '行4列2', '行4列3'],
+            ['行5列1', '行5列2', '行5列3'],
+            ['行6列1', '行6列2', '行6列3'],
+            ['行7列1', '行7列2', '行7列3'],
+            ['行8列1', '行8列2', '行8列3'],
+            ['行9列1', '行9列2', '行9列3'],
+            ['行10列1', '行10列2', '行10列3']
+          ]
+        }
+      }
+    },
+    components:{
+      screenfull,
+      headerDecoration,
+      customerStatistics,
+      customerStatisticsM,
+      individualPerformance,
+      orderStatistics,
+      teamPerformance,
+      teamPerformanceMonth,
+      personPerformance,
+      personPerformanceMonth
     },
     mounted() {
-      this.getEchartData()
+      //权限
+      this.authorityJudgment()
+      //初始化
+      this.Date()
     },
     methods: {
-      getEchartData() {
-        if (true) {
-          let myChart =  echarts.init(document.getElementById("chart"))
-          let option = {
-                tooltip: {
-                  trigger: 'item'
-                },
-                legend: {
-                  top: '5%',
-                  left: 'center'
-                },
-                series: [
-                  {
-                    name: '类型',
-                    type: 'pie',
-                    radius: ['40%', '70%'],
-                    avoidLabelOverlap: false,
-                    label: {
-                      show: false,
-                      position: 'center'
-                    },
-                    emphasis: {
-                      label: {
-                        show: true,
-                        fontSize: '40',
-                        fontWeight: 'bold'
-                      }
-                    },
-                    labelLine: {
-                      show: false
-                    },
-                    data: [
-                      { value: 1048, name: '业务关系' },
-                      { value: 735, name: '商桥' },
-                      { value: 580, name: '供应商' },
-                      { value: 484, name: '合伙人' }
-                    ]
-                  }
-                ]
-              };
-          option && myChart.setOption(option);
-        }
+      Date() {
+        const nowDate = new Date();
+        const date = {
+          year: nowDate.getFullYear(),
+          month: nowDate.getMonth() + 1,
+          date: nowDate.getDate(),
+        };
+        const newmonth = date.month > 10 ? date.month : "0" + date.month;
+        this.allDate = date.year + "-" + newmonth 
+
+
+        let dateNum = new Date(date.year, date.month, 0).getDate();
+
+        this.getCustomerStatisticsYear(this.allDate)
+        this.getCustomerStatisticsMonth(this.allDate)
+        this.getIndividualPerformanceMonth(this.allDate)
+        this.getIndividualPerformanceCustomerMonth(this.allDate)
+        this.getTeamPerformance(this.allDate)
+        this.getTeamPerformanceMonth(this.allDate)
+        this.getpersonPerformanceAll(this.allDate)
+        this.getpersonPerformanceMonth(this.allDate,dateNum)
       },
-    },
+      goBack(){
+        this.$router.back(-1)
+      },
+      refreshAll(date){
+        let dateNum = new Date(this.allDate.split('-')[0], Number(this.allDate.split('-')[1])+'', 0).getDate();
+        this.getCustomerStatisticsYear(date)
+        this.getCustomerStatisticsMonth(date)
+        this.getIndividualPerformanceMonth(date)
+        this.getIndividualPerformanceCustomerMonth(date)
+        this.getTeamPerformance(date)
+        this.getTeamPerformanceMonth(date)
+        this.getpersonPerformanceAll(date)
+        this.getpersonPerformanceMonth(date,dateNum)
+      },
+      getCustomerStatisticsYear(date){
+        this.csArr.length = 0
+        let sql = "select * from (select a.lai_yuan_qu_dao_,SUM(IFNULL(a.qznum,0)) as qznum ,SUM(IFNULL(a.yxnum,0)) as ynnum,SUM(IFNULL(a.khnum,0)) as khnum,IFNULL(b.lei_bie_,'空') as lei_bie_ from (((select COUNT(lai_yuan_qu_dao_) as qznum, lai_yuan_qu_dao_, null as yxnum,null as khnum from t_qzkhb GROUP BY lai_yuan_qu_dao_) UNION (select null, lai_yuan_qu_dao_, COUNT(lai_yuan_qu_dao_) as yxnum,null from t_yxkh GROUP BY lai_yuan_qu_dao_) UNION (select null, lai_yuan_qu_dao_,null, COUNT(lai_yuan_qu_dao_) as khnum from t_khxx GROUP BY lai_yuan_qu_dao_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) GROUP BY b.lei_bie_ UNION select null,0,0,0,lei_bie_ from t_qdlbb) as c GROUP BY c.lei_bie_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            if (arr[i].lei_bie_ != "空") {//判断key为999的对象是否存在,
+              this.csArr.push(arr[i])
+            }
+          }
+        })
+      },
+      getCustomerStatisticsMonth(date){
+        this.msArr.length = 0
+        let sql = "select * from (select a.lai_yuan_qu_dao_,SUM(IFNULL(a.qznum,0)) as qznum ,SUM(IFNULL(a.yxnum,0)) as ynnum,SUM(IFNULL(a.khnum,0)) as khnum,IFNULL(b.lei_bie_,'空') as lei_bie_ from (((select COUNT(lai_yuan_qu_dao_) as qznum, lai_yuan_qu_dao_, null as yxnum,null as khnum from t_qzkhb where create_time_ like '"+date+"%' GROUP BY lai_yuan_qu_dao_) UNION (select null, lai_yuan_qu_dao_, COUNT(lai_yuan_qu_dao_) as yxnum,null from t_yxkh where create_time_ like '"+date+"%' GROUP BY lai_yuan_qu_dao_) UNION (select null, lai_yuan_qu_dao_,null, COUNT(lai_yuan_qu_dao_) as khnum from t_khxx where create_time_ like '"+date+"%' GROUP BY lai_yuan_qu_dao_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) GROUP BY b.lei_bie_ UNION select null,0,0,0,lei_bie_ from t_qdlbb) as c GROUP BY c.lei_bie_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            if (arr[i].lei_bie_ != "空") {//判断key为999的对象是否存在,
+              this.msArr.push(arr[i])
+            }
+          }
+        })
+      },
+      getIndividualPerformanceMonth(date){
+        this.inArr.length = 0
+        let sql = "select * from (select IFNULL(d.lei_bie_,'空') as lei_bie_ ,SUM(t_mjwtsqb.zong_jia_) as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+date+"%') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' GROUP BY d.lei_bie_ UNION select lei_bie_,0 from t_qdlbb) as c GROUP BY c.lei_bie_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            if (arr[i].lei_bie_ != "空") {//判断key为999的对象是否存在,
+              this.inArr.push(arr[i])
+            }
+          }
+        })
+      },
+      getIndividualPerformanceCustomerMonth(date){
+        this.tableData.data.length = 0
+        let sql = "select d.*,SUM(t_mjwtsqb.zong_jia_) as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where t_bjd.shi_xiao_shi_jian = '"+date+"%' or t_bjd.zhuang_tai_ ='生效中') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' and t_mjwtsqb.create_time_ like '"+date+"%' GROUP BY d.zhuan_huan_ke_hu_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            let changeArr = [arr[i].zhuan_huan_ke_hu_,arr[i].fu_kuan_fang_shi_,arr[i].jiage]
+            this.tableData.data.push(changeArr)
+          }
+          // }
+          // console.log(this.orArr,'oraaaaaaa')
+        })
+      },
+      getTeamPerformance(date){
+        this.teArr.length = 0
+        date = date.split('-')[0]
+        let sql = "select f.* from (select e.bian_zhi_ren_,ibps_party_employee.NAME_,e.jiage from (select d.bian_zhi_ren_,SUM(t_mjwtsqb.zong_jia_) as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+date+"%') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' GROUP BY d.bian_zhi_ren_) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ UNION select ibps_party_user_role.USER_ID_, ibps_party_employee.NAME_,0  from ibps_party_user_role left join ibps_party_employee on ibps_party_employee.id_ = ibps_party_user_role.USER_ID_ where ibps_party_user_role.ROLE_ID_ in ('975000880065544192','975002200981897218','975002506553720832','990951427796893696') and ibps_party_employee.NAME_ is not null) as f GROUP BY f.bian_zhi_ren_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            // if (arr[i].lei_bie_ != "空") {
+              this.teArr.push(arr[i])
+            // }
+          }
+        })
+      },
+      getTeamPerformanceMonth(date){
+        this.tmArr.length = 0
+        let sql = "select f.* from (select e.bian_zhi_ren_,ibps_party_employee.NAME_,e.jiage from (select d.bian_zhi_ren_,SUM(t_mjwtsqb.zong_jia_) as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+date+"%') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' GROUP BY d.bian_zhi_ren_) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ UNION select ibps_party_user_role.USER_ID_, ibps_party_employee.NAME_,0  from ibps_party_user_role left join ibps_party_employee on ibps_party_employee.id_ = ibps_party_user_role.USER_ID_ where ibps_party_user_role.ROLE_ID_ in ('975000880065544192','975002200981897218','975002506553720832','990951427796893696') and ibps_party_employee.NAME_ is not null) as f GROUP BY f.bian_zhi_ren_"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            // if (arr[i].lei_bie_ != "空") {//判断key为999的对象是否存在,
+              this.tmArr.push(arr[i])
+            // }
+          }
+        })
+      },
+      getpersonPerformanceAll(date){
+        this.peArr.length = 0
+        date = date.split('-')[0]
+        let tempid = this.$store.state.ibps.user.info.user.id
+
+        //生成月份和数据数组
+        let numArr=(new Array(12).fill('')).map((v,k)=>{
+          return ((k+1)+'')
+        })
+        let sqlArr=(new Array(12).fill(0))
+
+        let sql = "select e.*,SUM(e.jiage) as jiageAll,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+date+"%' and t_bjd.bian_zhi_ren_ = '"+tempid+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ GROUP BY MONTH(e.sheng_xiao_shi_ji) ORDER BY e.sheng_xiao_shi_ji desc"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            let getnum = new Date(arr[i].sheng_xiao_shi_ji).getMonth()
+            sqlArr[getnum] = arr[i].jiageAll
+          }
+          this.peArr.push(numArr)
+          this.peArr.push(sqlArr)
+        })
+      },
+      getpersonPerformanceMonth(date,num){
+        this.pmArr.length = 0
+        let tempid = this.$store.state.ibps.user.info.user.id
+
+        //生成月份和数据数组
+        let numArr=(new Array(num).fill('')).map((v,k)=>{
+          return ((k+1)+'')
+        })
+        let sqlArr=(new Array(num).fill(0))
+
+        let sql = "select e.*,SUM(e.jiage) as jiageAll,ibps_party_employee.NAME_ from (select d.*,t_mjwtsqb.zong_jia_ as jiage from (select * from t_bjd LEFT JOIN (select a.id_ as leibieid,a.lai_yuan_qu_dao_ as laiyuan,b.id_ as qudaoid, b.lei_bie_ from ((select id_, lai_yuan_qu_dao_ from t_qzkhb GROUP BY id_) UNION (select id_, lai_yuan_qu_dao_ from t_yxkh GROUP BY id_) UNION (select ke_hu_ming_cheng_, lai_yuan_qu_dao_ as khnum from t_khxx GROUP BY ke_hu_ming_cheng_)) as a LEFT JOIN (select t_qdgl.id_,t_qdlbb.lei_bie_ from t_qdgl LEFT JOIN t_qdlbb on t_qdgl.qu_dao_lei_bie_ = t_qdlbb.id_) as b on a.lai_yuan_qu_dao_ = b.id_) as c on t_bjd.ke_hu_ming_cheng_ = c.leibieid where c.lei_bie_ is not NULL and t_bjd.sheng_xiao_shi_ji like '"+date+"%' and t_bjd.bian_zhi_ren_ = '"+tempid+"') as d left join t_mjwtsqb on t_mjwtsqb.he_tong_bian_hao_ = d.id_ WHERE t_mjwtsqb.shi_fou_guo_shen_ = '1' ) as e LEFT JOIN ibps_party_employee on e.bian_zhi_ren_ = ibps_party_employee.id_ GROUP BY e.sheng_xiao_shi_ji ORDER BY e.sheng_xiao_shi_ji desc"
+        curdPost('sql',sql).then(res=>{
+          let arr = res.variables.data
+          for (var i = 0; i < arr.length; i++) {
+            let getnum = new Date(arr[i].sheng_xiao_shi_ji).getDate()
+            sqlArr[getnum-1] = arr[i].jiageAll
+          }
+          this.pmArr.push(numArr)
+          this.pmArr.push(sqlArr)
+        })
+      },
+      authorityJudgment(){
+        let roleArr = ['990951427796893696','991712425210281984','1016367180226232320','1017190907927068672']
+        let temp = this.$store.state.ibps.user.info.role
+        for (let i = 0; i < temp.length; i++) {
+          if(roleArr.indexOf(temp[i].id)!=-1){
+            this.authority = true
+            break;
+          }
+        }
+      }
+    }
   }
 </script>
+<style lang="scss" scoped>
+  #dv-full-screen-container {
+    background-image: url('./img/stars.png');
+    background-size: 100% 100%;
+    box-shadow: 0 0 3px blue;
+    display: flex;
+    flex-direction: column;
+    display: flex;
+    flex-direction:column;
+    align-items: stretch;
+    color: #fff;
+  }
+  .bgAll{
+    height: 100%;
+  }
+  
+  .pickDate{
+    height:2.825rem;
+    line-height: 2.825rem;
+    text-align:center;
+    // float: left;
+    display: flex;
+    justify-content: space-between;
+    margin: -3% 10% 0;
+  }
+  .customerC{
+    display: flex;
+    justify-content: space-between;
+    margin: 1% 1% 0;
+    height: 40% !important;
+    .dv-border-box-7{
+      width: 32.67%;
+    }
+  }
+  .customerD{
+    display: flex;
+    justify-content: space-between;
+    margin: 1% 1% 0;
+    height: 40% !important;
+    .dv-border-box-7{
+      width: 32.67%;
+    }
+  }
+  .customerG{
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    margin: 1% 1% 0;
+    height: 90% !important;
+    .dv-border-box-7{
+      width: 49.5%;
+      height: 97%;
+    }
+  }
+  .ttitle{
+    height: 100%;
+    div{height:100%;}
+    .middleFont{
+      text-align: center;
+      height: 13%;
+      display: flex;
+		  align-items: center;
+      justify-content: center;
+    }
+    .nullDate{
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: 36px;
+    }
+  }
+  .middleFontC{
+      font-size: 120%;
+      font-weight: 600;
+      text-align: center;
+      height: 13%;
+      display: flex;
+		  align-items: center;
+      justify-content: center;
+    }
+</style>

+ 4 - 4
src/views/platform/bo/boDef/list.vue

@@ -221,9 +221,9 @@ export default {
     /**
      * 加载数据
      */
-    loadData(id = '') {
+    loadData() {
       this.loading = true
-      queryPageList(this.getFormatParams(id)).then(response => {
+      queryPageList(this.getFormatParams()).then(response => {
             response.data.dataResult.forEach((item)=>{
               if(item.typeId && this.typeFiler.length>0){
                   this.typeFiler.forEach((val)=>{
@@ -246,9 +246,9 @@ export default {
     /**
      * 获取格式化参数
      */
-    getFormatParams(id = '') {
+    getFormatParams() {
       const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^TYPE_ID_^S'] = id
+      params['Q^TYPE_ID_^S'] = this.typeId
       return ActionUtils.formatParams(
         params,
         this.pagination,

+ 140 - 140
src/views/platform/data/dataTemplate/template-list.vue

@@ -1,155 +1,155 @@
 <template>
-  <div v-if="$utils.isNotEmpty(dataTemplate)">
-    <data-template-render
-      :data="dataTemplate"
-      :height="height"
-      :dynamic-params="dynamicParams"
-    />
-  </div>
-  <div v-else class="ibps-container-frame" />
-</template>
-<script>
-import { getBuildDataById } from '@/api/platform/data/dataTemplate'
-import { getFormDataByFormKey } from '@/api/platform/form/formDef'
+    <div v-if="$utils.isNotEmpty(dataTemplate)">
+      <data-template-render
+        :data="dataTemplate"
+        :height="height"
+        :dynamic-params="dynamicParams"
+      />
+    </div>
+    <div v-else class="ibps-container-frame" />
+  </template>
+  <script>
+  import { getBuildDataById } from '@/api/platform/data/dataTemplate'
+  import { getFormDataByFormKey } from '@/api/platform/form/formDef'
 
-import DataTemplateRender from '@/business/platform/data/templaterender'
-import { buildFelds } from '@/business/platform/data/templaterender/utils'
+  import DataTemplateRender from '@/business/platform/data/templaterender'
+  import { buildFelds } from '@/business/platform/data/templaterender/utils'
 
-export default {
-  components: {
-    DataTemplateRender
-  },
-  props: {
-    height: [String, Number],
-    dynamicParams: {
-      type: Object
+  export default {
+    components: {
+      DataTemplateRender
     },
-    templateId: String,
-  },
-  data() {
-    return {
-      dataTemplate: {},
-      dataTemplateId: ''
-    }
-  },
-  watch: {
-    '$route': {
-      handler(val, oldVal) {
-        if (val === oldVal) {
-          return
-        }
-        this.$nextTick(() => {
-          const defaultUrl = this.$route.meta.defaultUrl
-          const isDashboard = this.$route.name
-          if (this.$utils.isNotEmpty(defaultUrl)) {
-            // 判断地址是否正确
-            const url = defaultUrl.split('/')
-            this.dataTemplateId = url[url.length - 1]
-          } else if (isDashboard === 'dashboard') {
-            this.dataTemplateId = this.templateId
-          } else {
-            const params = this.$route.params
-            this.dataTemplateId = params.id
-          }
-          if (this.$utils.isEmpty(this.dataTemplateId)) {
-            this.$alert('参数错误,未获取模版ID')
-            return
-          }
-          this.loadDataTemplate()
-        })
+    props: {
+      height: [String, Number],
+      dynamicParams: {
+        type: Object
       },
-      deep: true,
-      immediate: true
+      templateId: String,
     },
- /*   templateId: {
-      handler(val) {
-        if (this.$utils.isNotEmpty(val)) {
-          this.dataTemplateId = val
-          this.loadDataTemplate()
-        }
+    data() {
+      return {
+        dataTemplate: {},
+        dataTemplateId: ''
+      }
+    },
+    watch: {
+      '$route': {
+        handler(val, oldVal) {
+          if (val === oldVal) {
+            return
+          }
+          this.$nextTick(() => {
+            const defaultUrl = this.$route.meta.defaultUrl
+            const isDashboard = this.$route.name
+            if (this.$utils.isNotEmpty(defaultUrl)) {
+              // 判断地址是否正确
+              const url = defaultUrl.split('/')
+              this.dataTemplateId = url[url.length - 1]
+            } else if (isDashboard === 'dashboard') {
+              this.dataTemplateId = this.templateId
+            } else {
+              const params = this.$route.params
+              this.dataTemplateId = params.id
+            }
+            if (this.$utils.isEmpty(this.dataTemplateId)) {
+              this.$alert('参数错误,未获取模版ID')
+              return
+            }
+            this.loadDataTemplate()
+          })
+        },
+        deep: true,
+        immediate: true
       },
-      immediate: true
-    } */
-   },
-  // created(){
-  //   this.loadDataTemplate()
-  // },
-  methods: {
-    loadDataTemplate() {
-      const loading = this.$loading({
-        lock: false,
-        background: 'transparent'
-      })
-      this.dataTemplate = {}
-      getBuildDataById({
-        dataTemplateId: this.templateId || this.dataTemplateId,
-        isFilterForm: false,
-        isRightsFilter: true
-      }).then(response => {
-        // 从后台获取数据
-        const data = this.$utils.parseData(response.data)
-        if (data && data.attrs && this.$utils.isNotEmpty(data.attrs.form_key)) {
-          getFormDataByFormKey({
-            formKey: data.attrs.form_key
-          }).then(response => {
-            const formData = this.$utils.parseData(response.data)
-            const datasets = buildFelds(formData.fields, data.datasets)
-            data.datasets = datasets
+   /*   templateId: {
+        handler(val) {
+          if (this.$utils.isNotEmpty(val)) {
+            this.dataTemplateId = val
+            this.loadDataTemplate()
+          }
+        },
+        immediate: true
+      } */
+     },
+    // created(){
+    //   this.loadDataTemplate()
+    // },
+    methods: {
+      loadDataTemplate() {
+        const loading = this.$loading({
+          lock: false,
+          background: 'transparent'
+        })
+        this.dataTemplate = {}
+        getBuildDataById({
+          dataTemplateId: this.templateId || this.dataTemplateId,
+          isFilterForm: false,
+          isRightsFilter: true
+        }).then(response => {
+          // 从后台获取数据
+          const data = this.$utils.parseData(response.data)
+          if (data && data.attrs && this.$utils.isNotEmpty(data.attrs.form_key)) {
+            getFormDataByFormKey({
+              formKey: data.attrs.form_key
+            }).then(response => {
+              const formData = this.$utils.parseData(response.data)
+              const datasets = buildFelds(formData.fields, data.datasets)
+              data.datasets = datasets
+              this.dataTemplate = data
+              setTimeout(() => {
+                loading.close()
+              }, 1000)
+            }).catch(() => {
+              loading.close()
+            })
+          } else {
             this.dataTemplate = data
             setTimeout(() => {
               loading.close()
             }, 1000)
-          }).catch(() => {
-            loading.close()
-          })
-        } else {
-          this.dataTemplate = data
-          setTimeout(() => {
-            loading.close()
-          }, 1000)
-        }
-      }).catch(() => {
-        loading.close()
-      })
-    },
-    buildFelds(fields, datasets) {
-      const fieldMap = {}
-      fields.forEach(field => {
-        if (field.field_type === 'grid' || field.field_type === 'tabs') {
-          field.field_options.columns.forEach(column => {
-            column.fields.forEach(cfield => {
-              fieldMap[cfield.field_name] = cfield
+          }
+        }).catch(() => {
+          loading.close()
+        })
+      },
+      buildFelds(fields, datasets) {
+        const fieldMap = {}
+        fields.forEach(field => {
+          if (field.field_type === 'grid' || field.field_type === 'tabs') {
+            field.field_options.columns.forEach(column => {
+              column.fields.forEach(cfield => {
+                fieldMap[cfield.field_name] = cfield
+              })
             })
-          })
-        } else {
-          fieldMap[field.field_name] = field
-        }
-      })
-      const rtn = []
-      datasets.forEach(dataset => {
-        const field = fieldMap[dataset.name]
-        if (this.$utils.isNotEmpty(field)) {
-          dataset.field_type = field.field_type
-          dataset.field_options = field.field_options
-        }
-        rtn.push(dataset)
-      })
-      return rtn
+          } else {
+            fieldMap[field.field_name] = field
+          }
+        })
+        const rtn = []
+        datasets.forEach(dataset => {
+          const field = fieldMap[dataset.name]
+          if (this.$utils.isNotEmpty(field)) {
+            dataset.field_type = field.field_type
+            dataset.field_options = field.field_options
+          }
+          rtn.push(dataset)
+        })
+        return rtn
+      }
     }
   }
-}
-</script>
-<style lang="scss" >
-  .data-template-renderer-dialog{
-    .el-dialog__header{
-      padding: 0;
-      border-bottom:0;
+  </script>
+  <style lang="scss" >
+    .data-template-renderer-dialog{
+      .el-dialog__header{
+        padding: 0;
+        border-bottom:0;
+      }
+      .el-dialog__body {
+        padding: 0;
+      }
+      .el-dialog__headerbtn{
+        z-index: 99999;
+      }
     }
-    .el-dialog__body {
-      padding: 0;
-    }
-    .el-dialog__headerbtn{
-      z-index: 99999;
-    }
-  }
-</style>
+  </style>

+ 2 - 1
src/views/platform/data/dataset/list.vue

@@ -102,7 +102,8 @@ export default {
           forms: [
             { prop: 'Q^NAME_^SL', label: '名称', labelWidth: 80, itemWidth: 200 },
             { prop: 'Q^KEY_^SL', label: '业务主键', labelWidth: 80, itemWidth: 200 },
-            { prop: 'Q^TYPE_^SL', label: '类型', fieldType: 'select', options: datasetTypeOptions, labelWidth: 80, itemWidth: 200 }
+            { prop: 'Q^TYPE_^SL', label: '类型', fieldType: 'select', options: datasetTypeOptions, labelWidth: 80, itemWidth: 200 },
+            { prop: 'Q^FROM_^SL', label: '来源', labelWidth: 80, itemWidth: 200 }
           ]
         },
         // 表格字段配置