Explorar el Código

Merge branch 'master' of http://192.168.1.218:3000/lianghanqiang/ldt-manger-web

lianghanqiang hace 4 años
padre
commit
086a6b44ee

+ 9 - 3
src/api/census/census.js

@@ -4,9 +4,7 @@ export const getTenantCensusCount = (params) => {
   return request({
     url: '/api/census/getTenantCensusCount',
     method: 'get',
-    params: {
-      ...params,
-    }
+    params: params
   })
 }
 
@@ -25,3 +23,11 @@ export const getTenantTodayCensusCount = (params) => {
     params: params
   })
 }
+
+export const getTenantAddTrend = (params) => {
+  return request({
+    url: '/api/census/getTenantAddTrend',
+    method: 'get',
+    params: params
+  })
+}

+ 9 - 0
src/api/ldt_mall/mall.js

@@ -48,3 +48,12 @@ export const update = (row) => {
   })
 }
 
+
+export const mallAudit = (row) => {
+  return request({
+    url: '/api/mall/mallAudit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 9 - 0
src/api/system/dictbiz.js

@@ -1,6 +1,7 @@
 import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
+  console.log(current,size,params);
   return request({
     url: '/api/blade-system/dict-biz/list',
     method: 'get',
@@ -87,3 +88,11 @@ export const getDictionary = (params) => {
     params,
   })
 }
+
+export const dictionaryPage = (params) => {
+  return request({
+    url: '/api/blade-system/dict-biz/dictionaryPage',
+    method: 'get',
+    params,
+  })
+}

+ 48 - 0
src/main.js

@@ -54,6 +54,54 @@ iconfontVersion.forEach(ele => {
   loadStyle(iconfontUrl.replace('$key', ele));
 });
 
+Vue.prototype.$isEmpty=function(value){
+	switch (typeof value) {
+		case 'undefined':
+			return true;
+		case 'string':
+			if(value=='undefined') return true
+			if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
+			break;
+		case 'boolean':
+			if (!value) return true;
+			break;
+		case 'number':
+			if (0 === value || isNaN(value)) return true;
+			break;
+		case 'object':
+			if (null === value || value.length === 0) return true;
+			for (var i in value) {
+				return false;
+			}
+			return true;
+	}
+	return false;
+}
+
+Vue.prototype.$isNotEmpty=function(value){
+	switch (typeof value) {
+		case 'undefined':
+			return false;
+		case 'string':
+			if(value=='undefined') return false
+			if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return false;
+			break;
+		case 'boolean':
+			if (!value) return false;
+			break;
+		case 'number':
+			if (0 === value || isNaN(value)) return false;
+			break;
+		case 'object':
+			if (null === value || value.length === 0) return false;
+			for (var i in value) {
+				return true;
+			}
+			return false;
+	}
+	return true;
+}
+
 Vue.config.productionTip = false;
 
 new Vue({

+ 1 - 0
src/views/ldt_goods/goods.vue

@@ -59,6 +59,7 @@
           selection: true,
           dialogClickModal: false,
           column: [
+           
             {
               label: "所属商户",
               prop: "shopId",

+ 7 - 1
src/views/ldt_goods/goodsproperty.vue

@@ -78,9 +78,15 @@
             {
               label: "内置的属性类型",
               prop: "category",
+              type:"select",
+              dicUrl: "/api/blade-system/dict-biz/dictionary?code=goods_property",
+              props: {
+                label: "dictValue",
+                value: "dictValue"
+              },
               rules: [{
                 required: true,
-                message: "请输入内置的属性类型",
+                message: "请选择内置的属性类型",
                 trigger: "blur"
               }]
             },

+ 240 - 101
src/views/ldt_mall/comps/mall_audit.vue

@@ -4,6 +4,7 @@
       <el-step title="商场法人信息"></el-step>
       <el-step title="商场联系人信息"></el-step>
       <el-step title="商场主体信息"></el-step>
+      <el-step v-if="totalStep==4" title="结算银行卡"></el-step>
     </el-steps>
 
 
@@ -17,9 +18,9 @@
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
         </el-form-item>
-        <el-form-item  prop="idCardContrary" label="法人身份证件反面照片" style="width: 45%;">
-          <el-upload :headers="headers" name="image" class="avatar-uploader" action="/api/ocr/idcard" :show-file-list="false"
-            :on-success="handleUploadLegalLicenceBack">
+        <el-form-item prop="idCardContrary" label="法人身份证件反面照片" style="width: 45%;">
+          <el-upload :headers="headers" name="image" class="avatar-uploader" action="/api/ocr/idcard"
+            :show-file-list="false" :on-success="handleUploadLegalLicenceBack">
             <img v-if="merchantCorporationForm.idCardContrary" :src="merchantCorporationForm.idCardContrary"
               class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -76,14 +77,15 @@
           <el-input v-model="merchantSubjectForm.openAccountLicenceNo"></el-input>
         </el-form-item>
         <el-form-item prop="openAccountLicenceUrl" label="开户许可证照片" style="width: 45%;">
-          <el-upload :headers="headers"  class="avatar-uploader" action="/api/blade-resource/oss/endpoint/put-file"
+          <el-upload :headers="headers" class="avatar-uploader" action="/api/blade-resource/oss/endpoint/put-file"
             :show-file-list="false" :on-success="handleUploadOpenAccountLicence">
-            <img v-if="merchantSubjectForm.openAccountLicenceUrl" :src="merchantSubjectForm.openAccountLicenceUrl" class="avatar">
+            <img v-if="merchantSubjectForm.openAccountLicenceUrl" :src="merchantSubjectForm.openAccountLicenceUrl"
+              class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
         </el-form-item>
         <el-form-item prop="handLicenceUrl" label="手持营业执照在经营场所的照片" style="width: 45%;">
-          <el-upload :headers="headers"  class="avatar-uploader" action="/api/blade-resource/oss/endpoint/put-file"
+          <el-upload :headers="headers" class="avatar-uploader" action="/api/blade-resource/oss/endpoint/put-file"
             :show-file-list="false" :on-success="handleUploadHandLicenceUrl">
             <img v-if="merchantSubjectForm.handLicenceUrl" :src="merchantSubjectForm.handLicenceUrl" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -92,25 +94,61 @@
       </el-form>
     </div>
 
+    <div v-show="active==4" style="margin-top: 50px;">
+      <el-form :model="settlementAccountForm" :rules="settlementAccountRules" ref="settlementAccountForm"
+        label-width="150px">
+        <el-form-item :required="true" label="银行账户号码" prop="bankCardNo">
+          <el-input v-model="settlementAccountForm.bankCardNo"></el-input>
+        </el-form-item>
+        <el-form-item label="银行账户类型">
+          <el-select @change="bankAccountTypeChange" v-model="settlementAccountForm.bankAccountTypeLabel"
+            placeholder="请选择银行账户类型">
+            <el-option v-for="(item,index) in bankAccountTypeList" :key="index" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="银行账户开户总行">
+          <el-select filterable remote :remote-method="remoteMethod" @change="bankCodeChange"
+            v-model="settlementAccountForm.bankCodeLabel" placeholder="请选择银行账户开户总行">
+            <el-option v-for="(item,index) in bankCodeList" :key="index" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+
+    </div>
+
     <div style="display: flex;justify-content: flex-end;margin-top: 50px">
       <el-button v-if="active!=1" @click="active--">上一步</el-button>
-      <el-button v-if="active!=3" type="primary" @click="next">下一步</el-button>
-      <el-button v-if="active==3" type="primary" @click="next">确认</el-button>
+      <el-button v-if="active!=totalStep" type="primary" @click="next">下一步</el-button>
+      <el-button v-else type="primary" @click="next">确认</el-button>
     </div>
 
   </basic-container>
 </template>
 
 <script>
-  import {getDetail} from "@/api/ldt_mall/mall";
+  import {
+    getDetail,
+    mallAudit
+  } from "@/api/ldt_mall/mall";
+  import {
+    dictionaryPage
+  } from "@/api/system/dictbiz.js";
+
+  import {
+    startList
+  } from "@/api/work/work.js"
+
   export default {
-    props:{
-      operateId:String
+    props: {
+      operateId: String
     },
     data() {
       return {
         active: 1,
-        mallDetail:{},
+        totalStep: 3,
+        mallDetail: {},
         //审核表单
         auditForm: {
           /**
@@ -125,51 +163,11 @@
            * 流程实例主键
            */
           processInstanceId: "",
-          /**
-           * 主体信息
-           */
-          entity: "",
-          /**
-           * 商户名称
-           */
-          shopName: "",
-          /**
-           * 商户logo
-           */
-          shopLogo: "",
-          /**
-           * 审核状态
-           */
-          auditStatus: "",
-          /**
-           * 商户申请号
-           */
-          requestNo: "",
-          /**
-           * 入网商户的业务角色
-           */
-          businessRole: "",
 
-          /**
-           * 结算方向
-           */
-          settlementDirection: "",
-          /**
-           * 银行账户类型
-           */
-          bankAccountType: "",
-          /**
-           * 银行账户号码
-           */
-          bankCardNo: "",
-          /**
-           * 银行账户开户总行编码
-           */
-          bankCode: "",
-          /**
-           * 注册地址
-           */
-          officeAddress: ""
+
+          idCard: '',
+          entityId: '',
+          entity: ''
         },
 
         //商场法人信息
@@ -235,12 +233,10 @@
            */
           servicePhone: "",
         },
-
-
         /**
          * 商场主体信息
          */
-        merchantSubjectForm:{
+        merchantSubjectForm: {
           /**
            * 商户签约类型
            */
@@ -314,8 +310,35 @@
         /**
          * 商城经营地址
          */
-        businessAddressForm:{},
+        businessAddressForm: {},
 
+        /**
+         * 结算账户信息
+         */
+        settlementAccountForm: {
+          /**
+           * 结算方向
+           */
+          settlementDirection: "",
+          /**
+           * 银行账户类型
+           */
+          bankAccountType: "",
+          bankAccountTypeLabel: "",
+          /**
+           * 银行账户号码
+           */
+          bankCardNo: "",
+          /**
+           * 银行账户开户总行编码
+           */
+          bankCode: "",
+          bankCodeLabel: ""
+        },
+        //银行账户开户总行编码
+        bankCodeList: [],
+        //账户类型
+        bankAccountTypeList: [],
 
         merchantCorporationRules: {
           idCardFront: [{
@@ -361,7 +384,7 @@
             trigger: 'blur'
           }],
         },
-        merchantSubjectRules:{
+        merchantSubjectRules: {
           businessLicense: [{
             required: true,
             message: '请上传商场营业执照',
@@ -393,6 +416,23 @@
             trigger: 'blur'
           }],
         },
+        settlementAccountRules: {
+          bankAccountType: [{
+            required: true,
+            message: '请选择银行账户类型',
+            trigger: 'blur'
+          }],
+          bankCardNo: [{
+            required: true,
+            message: '请输入银行账户号码',
+            trigger: 'blur'
+          }],
+          bankCode: [{
+            required: true,
+            message: '请选择银行账户开户总行',
+            trigger: 'blur'
+          }],
+        },
         headers: {}
       };
     },
@@ -400,18 +440,100 @@
       this.init()
     },
     methods: {
-      init(){
-          this.headers = {
-            "Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
-            "Blade-Auth": JSON.parse(localStorage.getItem("saber-token")).content
+      init() {
+        this.headers = {
+          "Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+          "Blade-Auth": JSON.parse(localStorage.getItem("saber-token")).content
+        }
+        this.getProcessDefinitionId()
+        this.getDetail()
+        this.getBankCode()
+        this.getBankAccountType()
+      },
+      /**
+       * 获取流程定义id
+       *
+       */
+      getProcessDefinitionId() {
+        let params = {
+          category: 'flow_5',
+          mode: 1
+        }
+        startList(1, 1, params).then(res => {
+          this.auditForm.processDefinitionId = res.data.data.records[0].id
+        })
+      },
+      //银行信息 begin
+      getBankCode(keyword) {
+        let params = {
+          current: 1,
+          size: 300,
+          code: 'bank_type',
+          keyword
+        }
+        dictionaryPage(params).then(res => {
+          let list = res.data.data.records
+          if (this.$isEmpty(keyword)) {
+            list.shift()
           }
-          this.getDetail()
+          list.forEach((item, index) => {
+            let obj = {
+              label: JSON.parse(item.dictValue).name,
+              value: item.dictKey
+            }
+            this.bankCodeList.push(obj)
+          })
+          if (this.$isNotEmpty(this.bankCodeList)) {
+            this.settlementAccountForm.bankCode = this.bankCodeList[0].value
+            this.settlementAccountForm.bankCodeLabel = this.bankCodeList[0].label
+          }
+        })
       },
-      getDetail(){
-          getDetail(this.operateId).then(res=>{
-            this.mallDetail=res.data.data
-            this.initBusinessAddressForm()
+      getBankAccountType() {
+        let params = {
+          current: 1,
+          size: 10,
+          code: 'bank_account_type',
+        }
+        dictionaryPage(params).then(res => {
+          let list = res.data.data.records
+          list.shift()
+          list.forEach((item, index) => {
+            let obj = {
+              label: item.dictValue,
+              value: item.dictKey
+            }
+            this.bankAccountTypeList.push(obj)
           })
+          if (this.$isNotEmpty(this.bankAccountTypeList)) {
+            this.settlementAccountForm.bankAccountType = this.bankAccountTypeList[0].value
+            this.settlementAccountForm.bankAccountTypeLabel = this.bankAccountTypeList[0].label
+          }
+        })
+      },
+      bankAccountTypeChange(e) {
+        let list = this.bankAccountTypeList.filter(item => item.value == e)
+        this.settlementAccountForm.bankAccountTypeLabel = list[0].label
+        this.settlementAccountForm.bankAccountType = list[0].value
+        this.$forceUpdate()
+      },
+      bankCodeChange(e) {
+        let list = this.bankCodeList.filter(item => item.value == e)
+        this.settlementAccountForm.bankCodeLabel = list[0].label
+        this.settlementAccountForm.bankCode = list[0].value
+        this.$forceUpdate()
+      },
+      remoteMethod(query) {
+        console.log(query);
+        this.bankCodeList = []
+        this.getBankCode(query)
+      },
+      //银行信息end
+      getDetail() {
+        getDetail(this.operateId).then(res => {
+          this.mallDetail = res.data.data
+          this.initBusinessAddressForm()
+        })
       },
       preview() {
         this.active--
@@ -428,6 +550,9 @@
           case 3:
             this.validForm('merchantSubjectForm')
             break;
+          case 4:
+            this.validForm('settlementAccountForm')
+            break;
           default:
             break;
         }
@@ -438,7 +563,7 @@
           if (!valid) {
             return false;
           }
-          if (this.active == 3) {
+          if (this.active == this.totalStep) {
             this.submit()
           } else {
             this.active++
@@ -448,8 +573,24 @@
       resetForm(formName) {
         this.$refs[formName].resetFields();
       },
-      submit(){
-        console.log("123");
+      submit() {
+        Object.assign(this.auditForm, this.merchantCorporationForm,
+          this.merchantContactForm, this.merchantSubjectForm,
+          this.businessAddressForm)
+
+        if (this.totalStep == 4) {
+          //银行卡信息
+          Object.assign(this.auditForm, this.settlementAccountForm)
+        }
+
+        this.auditForm.idCard = this.merchantCorporationForm.idCardFront
+        this.auditForm.entityId = this.operateId
+        this.auditForm.entity = this.merchantSubjectForm.enterpriseName
+
+        mallAudit(this.auditForm).then(res => {
+          console.log(res);
+        })
+
       },
       /**
        * 上传法人身份证正面照
@@ -473,26 +614,25 @@
           nationality: source.nationality,
           validDate: source.validDate,
         }
-        this.auditForm.idCard=this.merchantCorporationForm.idCardFront
-        this.auditForm.entityId=this.operateId
         this.initMerchantContactForm()
       },
-      initMerchantContactForm(){
-        this.merchantContactForm.contactLicenceNo=this.merchantCorporationForm.legalLicenceNo
-        this.merchantContactForm.contactName=this.mallDetail.personName
-        this.merchantContactForm.contactMobile=this.mallDetail.personTel
-        this.merchantContactForm.servicePhone=this.mallDetail.personTel
+      initMerchantContactForm() {
+        this.merchantContactForm.contactLicenceNo = this.merchantCorporationForm.legalLicenceNo
+        this.merchantContactForm.contactName = this.mallDetail.personName
+        this.merchantContactForm.contactMobile = this.mallDetail.personTel
+        this.merchantContactForm.servicePhone = this.mallDetail.personTel
       },
       /**
        * 初始化经营地址
        */
-      initBusinessAddressForm(){
-        let location= this.mallDetail.location.split("-")
-        this.businessAddressForm={
-          province:location[0],
-          city:location[1],
-          district:location[2],
-          address:this.mallDetail.address
+      initBusinessAddressForm() {
+        let locationCode = this.mallDetail.locationCode.split(",")
+
+        this.businessAddressForm = {
+          province: locationCode[0] + '0000',
+          city: locationCode[1] + '00',
+          district: locationCode[2],
+          address: this.mallDetail.address
         }
       },
       /**
@@ -504,45 +644,44 @@
           this.$message.error('非法证件照');
           return
         }
+        this.merchantCorporationForm.validDate = e.data[0].validDate
         this.merchantCorporationForm.idCardContrary = e.data[1].link
       },
       /**
        * 上传营业执照
        * @param {Object} e
        */
-      handleUploadBusinessLicense(e){
+      handleUploadBusinessLicense(e) {
         let source = e.data[0]
         if (source.errmsg != "ok") {
           this.$message.error('非法证件照');
           return
         }
-        Object.keys(this.merchantSubjectForm).forEach(key=>{
-          this.merchantSubjectForm[key]=source[key]
+        Object.keys(this.merchantSubjectForm).forEach(key => {
+          this.merchantSubjectForm[key] = source[key]
         })
-        this.merchantSubjectForm.signType="ENTERPRISE"
-        this.merchantSubjectForm.signName=this.merchantSubjectForm.enterpriseName
-        this.merchantSubjectForm.shortName=this.mallDetail.mallName
-        this.merchantSubjectForm.licenceNo=source.serial
-        this.merchantSubjectForm.businessLicense=e.data[1].link
+        this.merchantSubjectForm.signType = "ENTERPRISE"
+        this.merchantSubjectForm.signName = this.merchantSubjectForm.enterpriseName
+        this.merchantSubjectForm.shortName = this.mallDetail.mallName
+        this.merchantSubjectForm.licenceNo = source.serial
+        this.merchantSubjectForm.businessLicense = e.data[1].link
         console.log(this.merchantSubjectForm);
       },
       /**
        * 上传开户证件照
        * @param {Object} e
        */
-      handleUploadOpenAccountLicence(e){
-        this.merchantSubjectForm.openAccountLicenceUrl=e.data.link
+      handleUploadOpenAccountLicence(e) {
+        this.merchantSubjectForm.openAccountLicenceUrl = e.data.link
       },
       /**
        * 上传手持营业执照的照片
        * @param {Object} e
        */
-      handleUploadHandLicenceUrl(e){
-        this.merchantSubjectForm.handLicenceUrl=e.data.link
+      handleUploadHandLicenceUrl(e) {
+        this.merchantSubjectForm.handLicenceUrl = e.data.link
       },
 
-
-
     }
   };
 </script>

+ 359 - 301
src/views/system/dictbiz.vue

@@ -84,6 +84,13 @@
             @click="handleDelete"
           >删 除
           </el-button>
+          <el-button type="success"
+                     size="small"
+                     plain
+                     v-if="importBtn"
+                     icon="el-icon-upload2"
+                     @click="handleImport">导入
+          </el-button>
         </template>
         <template slot-scope="scope" slot="menu">
           <el-button
@@ -100,346 +107,397 @@
         </template>
       </avue-crud>
     </el-dialog>
+    <el-dialog :title="`${dictValue}数据导入`"
+               append-to-body
+               :visible.sync="excelBox"
+               width="555px">
+      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter" :upload-error="uploadError">
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="handleTemplate">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+    </el-dialog>
   </basic-container>
 </template>
 
 <script>
-  import {
-    getParentList,
-    getChildList,
-    remove,
-    update,
-    add,
-    getDict,
-    getDictTree
-  } from "@/api/system/dictbiz";
-  import {optionParent, optionChild} from "@/option/system/dictbiz";
-  import {mapGetters} from "vuex";
+import {add, getChildList, getDict, getDictTree, getParentList, remove, update} from "@/api/system/dictbiz";
+import {optionChild, optionParent} from "@/option/system/dictbiz";
+import {mapGetters} from "vuex";
+import {getToken} from '@/util/auth';
 
-  export default {
-    data() {
+export default {
+  data() {
+    return {
+      dictValue: '暂无',
+      importBtn: true,
+      excelBox: false,
+      parentId: -1,
+      formParent: {},
+      formChild: {},
+      selectionList: [],
+      query: {},
+      box: false,
+      loading: true,
+      loadingChild: true,
+      pageParent: {
+        pageSize: 10,
+        pageSizes: [10, 30, 50, 100, 200],
+        currentPage: 1,
+        total: 0
+      },
+      pageChild: {
+        pageSize: 10,
+        pageSizes: [10, 30, 50, 100, 200],
+        currentPage: 1,
+        total: 0
+      },
+      dataParent: [],
+      dataChild: [],
+      optionParent: optionParent,
+      optionChild: optionChild,
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '模板上传',
+            prop: 'excelFile',
+            type: 'upload',
+            drag: true,
+            loadText: '模板上传中,请稍等',
+            span: 24,
+            showFileList: false,
+            propsHttp: {
+              res: 'data'
+            },
+            tip: '请上传 .xls,.xlsx 标准格式文件',
+            action: "/api/blade-system/dict-biz/import-bank-type",
+          },
+          {
+            label: '模板下载',
+            prop: 'excelTemplate',
+            formslot: true,
+            span: 24,
+          }
+        ]
+      }
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
       return {
-        dictValue: '暂无',
-        parentId: -1,
-        formParent: {},
-        formChild: {},
-        selectionList: [],
-        query: {},
-        box: false,
-        loading: true,
-        loadingChild: true,
-        pageParent: {
-          pageSize: 10,
-          pageSizes: [10, 30, 50, 100, 200],
-          currentPage: 1,
-          total: 0
-        },
-        pageChild: {
-          pageSize: 10,
-          pageSizes: [10, 30, 50, 100, 200],
-          currentPage: 1,
-          total: 0
-        },
-        dataParent: [],
-        dataChild: [],
-        optionParent: optionParent,
-        optionChild: optionChild,
+        addBtn: this.vaildData(this.permission.dictbiz_add, false),
+        delBtn: this.vaildData(this.permission.dictbiz_delete, false),
+        editBtn: this.vaildData(this.permission.dictbiz_edit, false),
+        viewBtn: false,
       };
     },
-    computed: {
-      ...mapGetters(["userInfo", "permission"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.dictbiz_add, false),
-          delBtn: this.vaildData(this.permission.dictbiz_delete, false),
-          editBtn: this.vaildData(this.permission.dictbiz_edit, false),
-          viewBtn: false,
-        };
-      },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
-        });
-        return ids.join(",");
-      }
+    ids() {
+      let ids = [];
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    }
+  },
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    initData() {
+      getDictTree().then(res => {
+        const column = this.findObject(this.optionChild.column, "parentId");
+        column.dicData = res.data.data;
+      });
     },
-    mounted() {
-      this.initData();
+    handleAdd(row) {
+      this.formChild.dictValue = "";
+      this.formChild.dictKey = "";
+      this.formChild.sort = 0;
+      this.formChild.isSealed = 0;
+      this.formChild.remark = "";
+      this.formChild.parentId = row.id;
+      this.$refs.crudChild.rowAdd();
     },
-    methods: {
-      initData() {
-        getDictTree().then(res => {
-          const column = this.findObject(this.optionChild.column, "parentId");
-          column.dicData = res.data.data;
+    rowSave(row, done, loading) {
+      const form = {
+        ...row,
+        dictKey: -1,
+      };
+      add(form).then(() => {
+        this.onLoadParent(this.pageParent);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
         });
-      },
-      handleAdd(row) {
-        this.formChild.dictValue = "";
-        this.formChild.dictKey = "";
-        this.formChild.sort = 0;
-        this.formChild.isSealed = 0;
-        this.formChild.remark = "";
-        this.formChild.parentId = row.id;
-        this.$refs.crudChild.rowAdd();
-      },
-      rowSave(row, done, loading) {
-        const form = {
-          ...row,
-          dictKey: -1,
-        };
-        add(form).then(() => {
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(() => {
+        this.onLoadParent(this.pageParent);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        this.onLoadChild(this.pageChild);
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
           this.onLoadParent(this.pageParent);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          done();
-        }, error => {
-          window.console.log(error);
-          loading();
         });
-      },
-      rowUpdate(row, index, done, loading) {
-        update(row).then(() => {
+    },
+    handleRowClick(row) {
+      this.query = {};
+      this.parentId = row.id;
+      this.dictValue = row.dictValue;
+      this.importBtn = row.code === "bank_type";
+
+      const code = this.findObject(this.optionChild.column, "code");
+      code.value = row.code;
+      const parentId = this.findObject(this.optionChild.column, "parentId");
+      parentId.value = row.id;
+
+      this.box = true;
+      this.onLoadChild(this.pageChild);
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoadParent(this.pageParent);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.pageParent.currentPage = 1;
+      this.onLoadParent(this.pageParent, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
           this.onLoadParent(this.pageParent);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.onLoadChild(this.pageChild);
-          done();
-        }, error => {
-          window.console.log(error);
-          loading();
+          this.$refs.crud.toggleSelection();
         });
-      },
-      rowDel(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoadParent(this.pageParent);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-      handleRowClick(row) {
-        this.query = {};
-        this.parentId = row.id;
-        this.dictValue = row.dictValue;
-
-        const code = this.findObject(this.optionChild.column, "code");
-        code.value = row.code;
-        const parentId = this.findObject(this.optionChild.column, "parentId");
-        parentId.value = row.id;
-
-        this.box = true;
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDict(this.formParent.id).then(res => {
+          this.formParent = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.pageParent.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.pageParent.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoadParent(this.pageParent, this.query);
+    },
+    rowSaveChild(row, done, loading) {
+      add(row).then(() => {
         this.onLoadChild(this.pageChild);
-      },
-      searchReset() {
-        this.query = {};
-        this.onLoadParent(this.pageParent);
-      },
-      searchChange(params, done) {
-        this.query = params;
-        this.pageParent.currentPage = 1;
-        this.onLoadParent(this.pageParent, params);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
         done();
-      },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      selectionClear() {
-        this.selectionList = [];
-        this.$refs.crud.toggleSelection();
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
-        }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoadParent(this.pageParent);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
-          });
-      },
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDict(this.formParent.id).then(res => {
-            this.formParent = res.data.data;
-          });
-        }
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowUpdateChild(row, index, done, loading) {
+      update(row).then(() => {
+        this.onLoadChild(this.pageChild);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
         done();
-      },
-      currentChange(currentPage) {
-        this.pageParent.currentPage = currentPage;
-      },
-      sizeChange(pageSize) {
-        this.pageParent.pageSize = pageSize;
-      },
-      refreshChange() {
-        this.onLoadParent(this.pageParent, this.query);
-      },
-      rowSaveChild(row, done, loading) {
-        add(row).then(() => {
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowDelChild(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
           this.onLoadChild(this.pageChild);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          done();
-        }, error => {
-          window.console.log(error);
-          loading();
         });
-      },
-      rowUpdateChild(row, index, done, loading) {
-        update(row).then(() => {
+    },
+    searchResetChild() {
+      this.query = {};
+      this.onLoadChild(this.pageChild);
+    },
+    searchChangeChild(params, done) {
+      this.query = params;
+      this.pageChild.currentPage = 1;
+      this.onLoadChild(this.pageChild, params);
+      done();
+    },
+    selectionChangeChild(list) {
+      this.selectionList = list;
+    },
+    selectionClearChild() {
+      this.selectionList = [];
+      this.$refs.crudChild.toggleSelection();
+    },
+    handleDeleteChild() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
           this.onLoadChild(this.pageChild);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          done();
-        }, error => {
-          window.console.log(error);
-          loading();
-        });
-      },
-      rowDelChild(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoadChild(this.pageChild);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-      searchResetChild() {
-        this.query = {};
-        this.onLoadChild(this.pageChild);
-      },
-      searchChangeChild(params, done) {
-        this.query = params;
-        this.pageChild.currentPage = 1;
-        this.onLoadChild(this.pageChild, params);
-        done();
-      },
-      selectionChangeChild(list) {
-        this.selectionList = list;
-      },
-      selectionClearChild() {
-        this.selectionList = [];
-        this.$refs.crudChild.toggleSelection();
-      },
-      handleDeleteChild() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
-        }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoadChild(this.pageChild);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crudChild.toggleSelection();
-          });
-      },
-      beforeOpenChild(done, type) {
-        if (["add", "edit"].includes(type)) {
-          this.initData();
-        }
-        if (["edit", "view"].includes(type)) {
-          getDict(this.formChild.id).then(res => {
-            this.formChild = res.data.data;
-          });
-        }
-        done();
-      },
-      beforeCloseChild(done) {
-        this.$refs.crudChild.value.parentId = this.parentId;
-        this.$refs.crudChild.option.column.filter(item => {
-          if (item.prop === "parentId") {
-            item.value = this.parentId;
-          }
-        });
-        done();
-      },
-      currentChangeChild(currentPage) {
-        this.pageChild.currentPage = currentPage;
-      },
-      sizeChangeChild(pageSize) {
-        this.pageChild.pageSize = pageSize;
-      },
-      refreshChangeChild() {
-        this.onLoadChild(this.pageChild, this.query);
-      },
-      onLoadParent(page, params = {}) {
-        this.loading = true;
-        getParentList(
-          page.currentPage,
-          page.pageSize,
-          Object.assign(params, this.query)
-        ).then(res => {
-          const data = res.data.data;
-          this.pageParent.total = data.total;
-          this.dataParent = data.records;
-          this.loading = false;
-          this.selectionClear();
+          this.$refs.crudChild.toggleSelection();
         });
-      },
-      onLoadChild(page, params = {}) {
-        this.loadingChild = true;
-        getChildList(
-          page.currentPage,
-          page.pageSize,
-          this.parentId,
-          Object.assign(params, this.query)
-        ).then(res => {
-          const data = res.data.data;
-          this.pageChild.total = data.total;
-          this.dataChild = data.records;
-          this.loadingChild = false;
-          this.selectionClear();
+    },
+    beforeOpenChild(done, type) {
+      if (["add", "edit"].includes(type)) {
+        this.initData();
+      }
+      if (["edit", "view"].includes(type)) {
+        getDict(this.formChild.id).then(res => {
+          this.formChild = res.data.data;
         });
       }
+      done();
+    },
+    beforeCloseChild(done) {
+      this.$refs.crudChild.value.parentId = this.parentId;
+      this.$refs.crudChild.option.column.filter(item => {
+        if (item.prop === "parentId") {
+          item.value = this.parentId;
+        }
+      });
+      done();
+    },
+    currentChangeChild(currentPage) {
+      this.pageChild.currentPage = currentPage;
+    },
+    sizeChangeChild(pageSize) {
+      this.pageChild.pageSize = pageSize;
+    },
+    refreshChangeChild() {
+      this.onLoadChild(this.pageChild, this.query);
+    },
+    onLoadParent(page, params = {}) {
+      this.loading = true;
+      getParentList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then(res => {
+        const data = res.data.data;
+        this.pageParent.total = data.total;
+        this.dataParent = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+    onLoadChild(page, params = {}) {
+      this.loadingChild = true;
+      getChildList(
+        page.currentPage,
+        page.pageSize,
+        this.parentId,
+        Object.assign(params, this.query)
+      ).then(res => {
+        const data = res.data.data;
+        this.pageChild.total = data.total;
+        this.dataChild = data.records;
+        this.loadingChild = false;
+        this.selectionClear();
+      });
+    },
+    handleImport() {
+      this.excelBox = true;
+    },
+    uploadAfter(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox = false;
+      this.refreshChangeChild();
+      done();
+    },
+    uploadError(error, column) {
+      this.$message.success('上传失败')
+      console.log(error, column)
+    },
+    handleTemplate() {
+      window.open(`/api/blade-system/dict-biz/bank-type/export-template?${this.website.tokenHeader}=${getToken()}`);
     }
-  };
+  }
+};
 </script>

+ 318 - 137
src/views/wel/index.vue

@@ -8,225 +8,286 @@
       <avue-data-display :option="optionToday"></avue-data-display>
     </div>
     <div style="margin-top: 30px;">
-      <h3>平台收益趋势</h3>
-      <el-date-picker
-        v-model="tenantPlatformBills.time"
-        type="month"
-        @change="getTenantPlatformBills"
-        value-format="yyyy-MM"
-        placeholder="选择月">
-      </el-date-picker>
-      <div ref="tenantPlatformBills" style="height: 600px;width: 100%"></div>
+      <h3>新增趋势
+        <el-date-picker
+          size="mini"
+          :picker-options="tenantAddTrend.pickerOptions"
+          v-model="tenantAddTrend.time"
+          type="month"
+          @change="getTenantAddTrend"
+          value-format="yyyy-MM"
+          placeholder="选择月"
+          style="float: right">
+        </el-date-picker>
+      </h3>
+      <div ref="tenantAddTrend" style="height: 500px;width: 100%"></div>
+    </div>
+    <div style="margin-top: 30px;">
+      <h3>收益趋势
+        <el-date-picker
+          size="mini"
+          :picker-options="tenantPlatformBills.pickerOptions"
+          v-model="tenantPlatformBills.time"
+          type="month"
+          @change="getTenantPlatformBills"
+          value-format="yyyy-MM"
+          placeholder="选择月"
+          style="float: right">
+        </el-date-picker>
+      </h3>
+      <div ref="tenantPlatformBills" style="height: 500px;width: 100%"></div>
     </div>
   </basic-container>
 </template>
 <script>
 import * as echarts from 'echarts';
 import moment from "moment";
-import {getTenantCensusCount, getTenantPlatformBills, getTenantTodayCensusCount} from '@/api/census/census';
+import {getTenantCensusCount, getTenantPlatformBills, getTenantTodayCensusCount,getTenantAddTrend} from '@/api/census/census';
 
 export default {
   data() {
     return {
-      optionToday: {
+      optionTotal: {
         span: 4,
         data: [
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_mall/mall"});
             },
+            title: '商场总数',
             count: 0,
-            title: '新增商场',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-s-home',
+            color: '#00a7d0',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_shop/shop"});
             },
+            title: '商店总数',
             count: 0,
-            title: '新增商户',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-s-shop',
+            color: 'rgb(27, 201, 142)',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_user/loginuser"});
             },
+            title: '用户总数',
             count: 0,
-            title: '新增用户',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-user-solid',
+            color: 'rgb(230, 71, 88)',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_agent/agentrecord"});
             },
+            title: '代理总数',
             count: 0,
-            title: '新增代理',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-s-promotion',
+            color: '#5555ff',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_bills/bills"});
             },
+            title: '充值总额',
             count: 0,
             decimals: 2,
-            title: '今日充值',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-s-finance',
+            color: '#1cbbb4',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: function () {
+              alert(JSON.stringify());
             },
+            title: '收入总额',
             count: 0,
             decimals: 2,
-            title: '今日收入',
-            href: 'https://avuejs.com',
-            target: '_blank'
+            icon: 'el-icon-s-marketing',
+            color: '#f37b1d',
           },
           // {
-          //   click: function (item) {
-          //     alert(JSON.stringify(item));
+          //   click: function () {
+          //     alert(JSON.stringify());
           //   },
+          //   title: '提现总额',
           //   count: 0,
           //   decimals: 2,
-          //   title: '今日提现',
-          //   href: 'https://avuejs.com',
-          //   target: '_blank'
+          //   icon: 'el-icon-s-finance',
+          //   color: '#1cbbb4',
           // }
         ]
       },
-      optionTotal: {
+      optionToday: {
         span: 4,
         data: [
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_mall/mall"});
             },
-            title: '商场总数',
             count: 0,
-            icon: 'el-icon-s-home',
-            color: '#00a7d0',
+            title: '新增商场',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_shop/shop"});
             },
-            title: '商店总数',
             count: 0,
-            icon: 'el-icon-s-shop',
-            color: 'rgb(27, 201, 142)',
+            title: '新增商户',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_user/loginuser"});
             },
-            title: '用户总数',
             count: 0,
-            icon: 'el-icon-user-solid',
-            color: 'rgb(230, 71, 88)',
+            title: '新增用户',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_agent/agentrecord"});
             },
-            title: '代理总数',
             count: 0,
-            icon: 'el-icon-s-promotion',
-            color: '#5555ff',
+            title: '新增代理',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: () => {
+              this.$router.push({path:"/ldt_bills/bills"});
             },
-            title: '充值总额',
             count: 0,
             decimals: 2,
-            icon: 'el-icon-s-finance',
-            color: '#1cbbb4',
+            title: '今日充值',
           },
           {
-            click: function (item) {
-              alert(JSON.stringify(item));
+            click: function () {
+              alert(JSON.stringify());
             },
-            title: '收入总额',
             count: 0,
             decimals: 2,
-            icon: 'el-icon-s-marketing',
-            color: '#f37b1d',
+            title: '今日收入',
           },
           // {
-          //   click: function (item) {
-          //     alert(JSON.stringify(item));
+          //   click: function () {
+          //     alert(JSON.stringify());
           //   },
-          //   title: '提现总额',
           //   count: 0,
           //   decimals: 2,
-          //   icon: 'el-icon-s-finance',
-          //   color: '#1cbbb4',
+          //   title: '今日提现',
+          //   href: 'https://avuejs.com',
+          //   target: '_blank'
           // }
         ]
       },
-      tenantPlatformBills: {
+      tenantAddTrend: {
         dom: null,
-        time: "2021-09",
+        time: moment(Date.now()).format("yyyy-MM"),
+        pickerOptions: {
+          disabledDate(time) {
+            return time.getTime() > Date.now()
+          }
+        },
         option: {
-          // Make gradient line here
-          visualMap: [
+          legend: {},
+          tooltip: {
+            trigger: 'axis',
+            showContent: false
+          },
+          dataset: {
+            source: [
+              ['trend'],
+              ['用户新增'],
+              ['商户新增'],
+              ['代理新增'],
+              ['商场新增'],
+              ['会员新增']
+            ],
+            path:["/ldt_user/loginuser","/ldt_shop/shop","/ldt_agent/agentrecord","/ldt_mall/mall","/ldt_user/member"]
+          },
+          xAxis: { type: 'category' },
+          yAxis: { gridIndex: 0,splitNumber:1 },
+          grid: { top: '55%' },
+          series: [
             {
-              show: false,
-              type: 'continuous',
-              seriesIndex: 0,
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              emphasis: { focus: 'series' },
             },
             {
-              show: false,
-              type: 'continuous',
-              seriesIndex: 1,
-              dimension: 0,
-              min: 0,
-              max: 29
-            }
-          ],
-          title: [
-            {
-              left: 'center',
-              text: '平台收益趋势'
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              emphasis: { focus: 'series' }
             },
-          ],
-          tooltip: {
-            trigger: 'axis'
-          },
-          xAxis: [
             {
-              data: []
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              emphasis: { focus: 'series' }
             },
-          ],
-          yAxis: [
             {
-              // 纵轴标尺固定
-              type: 'value',
-              scale: true,
-              max: 100,
-              min: 0,
-              splitNumber: 5,
-              boundaryGap: [5, 5]
-            }
-          ],
-          grid: [
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              emphasis: { focus: 'series' }
+            },
             {
-              bottom: '60%'
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              emphasis: { focus: 'series' }
             },
             {
-              top: '60%'
+              type: 'pie',
+              id: 'pie',
+              radius: '30%',
+              center: ['50%', '25%'],
+              emphasis: {
+                focus: 'self'
+              },
+              label: {
+                formatter: '{b}: {@2012} ({d}%)'
+              },
+              encode: {
+                itemName: 'trend',
+                value: moment(Date.now()).format("yyyy-MM-DD"),
+                tooltip: moment(Date.now()).format("yyyy-MM-DD")
+              }
             }
-          ],
+          ]
+        }
+      },
+      tenantPlatformBills: {
+        dom: null,
+        time: moment(Date.now()).format("yyyy-MM"),
+        pickerOptions: {
+          disabledDate(time) {
+            return time.getTime() > Date.now()
+          }
+        },
+        option: {
+          legend: {},
+          tooltip: {
+            trigger: 'axis',
+            showContent: true
+          },
+          xAxis: [{
+            data: []
+          }],
+          yAxis: {gridIndex: 0},
+          grid: {top: '15%'},
           series: [
             {
+              name: '平台收益',
+              type: 'line',
+              smooth: true,
+              seriesLayoutBy: 'row',
+              data: []
+            },
+            {
+              name: '商户充值',
               type: 'line',
-              showSymbol: false,
+              smooth: true,
+              seriesLayoutBy: 'row',
               data: []
             },
           ]
@@ -242,6 +303,7 @@ export default {
     init() {
       this.getTenantCensusCount();
       this.getTenantTodayCensusCount();
+      this.getTenantAddTrend();
       this.getTenantPlatformBills();
     },
     //获取租户数据统计
@@ -266,6 +328,116 @@ export default {
         this.optionToday.data[4].count = res.data.data.rechargeTotal;
       });
     },
+    //获取租户平台新增趋势
+    getTenantAddTrend() {
+      let time = moment(this.tenantAddTrend.time);
+      //获取租户数量
+      getTenantAddTrend({
+        time: time.format("yyyy-MM-DD HH:mm:ss")
+      }).then(res => {
+        //清空内容
+        this.tenantAddTrend.option.dataset.source[0] = ["trend"];
+        this.tenantAddTrend.option.dataset.source[1] = ['用户新增'];
+        this.tenantAddTrend.option.dataset.source[2] = ['商户新增'];
+        this.tenantAddTrend.option.dataset.source[3] = ['代理新增'];
+        this.tenantAddTrend.option.dataset.source[4] = ['商场新增'];
+        this.tenantAddTrend.option.dataset.source[5] = ['会员新增'];
+
+        //获取某月总天数
+        const day = time.format("yyyy-MM") === moment(Date.now()).format("yyyy-MM") ? Number(moment(Date.now()).format("DD"))
+          : new Date(time.format("yyyy"), time.format("MM"), 0).getDate();
+
+        for (let i = 0; i < day; i++) {
+          //添加日期X坐标
+          const date = time.format("yyyy-MM-DD");
+          this.tenantAddTrend.option.dataset.source[0].push(date);
+
+          //添加Y坐标
+          let count = 0;
+          //添加用户新增
+          res.data.data.userAddCount.forEach(ele => {
+            if (ele.time === date) {
+              count = ele.count;
+            }
+          });
+          this.tenantAddTrend.option.dataset.source[1].push(count);
+          //添加商户新增
+          count = 0;
+          res.data.data.shopAddCount.forEach(ele => {
+            if (ele.time === date) {
+              count = ele.count;
+            }
+          });
+          this.tenantAddTrend.option.dataset.source[2].push(count);
+          //添加代理新增
+          count = 0;
+          res.data.data.agentAddCount.forEach(ele => {
+            if (ele.time === date) {
+              count = ele.count;
+            }
+          });
+          this.tenantAddTrend.option.dataset.source[3].push(count);
+          //添加商场新增
+          count = 0;
+          res.data.data.mallAddCount.forEach(ele => {
+            if (ele.time === date) {
+              count = ele.count;
+            }
+          });
+          this.tenantAddTrend.option.dataset.source[4].push(count);
+          //添加会员新增
+          count = 0;
+          res.data.data.memberAddCount.forEach(ele => {
+            if (ele.time === date) {
+              count = ele.count;
+            }
+          });
+          this.tenantAddTrend.option.dataset.source[5].push(count);
+
+          //加上一天
+          time.add(1, 'days');
+        }
+
+        //第一次渲染
+        if (this.tenantAddTrend.dom === null) {
+          this.tenantAddTrend.dom = echarts.init(this.$refs.tenantAddTrend);
+
+          //添加坐标点击
+          this.tenantAddTrend.dom.on('updateAxisPointer', (event) => {
+            const xAxisInfo = event.axesInfo[0];
+            if (xAxisInfo) {
+              const dimension = xAxisInfo.value + 1;
+              this.tenantAddTrend.dom.setOption({
+                series: {
+                  id: 'pie',
+                  label: {
+                    formatter: '{b}: {@[' + dimension + ']} ({d}%)'
+                  },
+                  encode: {
+                    value: dimension,
+                    tooltip: dimension
+                  }
+                }
+              });
+            }
+          });
+
+          //添加饼图点击
+          this.tenantAddTrend.dom.on('click', (params) => {
+            if(params.componentSubType==="pie"){
+              this.$router.push({path:this.tenantAddTrend.option.dataset.path[params.dataIndex]});
+            }
+          });
+
+          //适应屏幕变化
+          window.addEventListener("resize",()=>{
+            this.tenantAddTrend.dom.resize()
+          });
+        }
+
+        this.tenantAddTrend.dom.setOption(this.tenantAddTrend.option);
+      });
+    },
     //获取租户平台收益趋势
     getTenantPlatformBills() {
       let time = moment(this.tenantPlatformBills.time);
@@ -276,41 +448,50 @@ export default {
         //清空内容
         this.tenantPlatformBills.option.xAxis[0].data = [];
         this.tenantPlatformBills.option.series[0].data = [];
+        this.tenantPlatformBills.option.series[1].data = [];
 
         //获取某月总天数
-        const day = time.format("yyyy-MM") === moment(new Date()).format("yyyy-MM") ? Number(moment(new Date()).format("DD"))
+        const day = time.format("yyyy-MM") === moment(Date.now()).format("yyyy-MM") ? Number(moment(Date.now()).format("DD"))
           : new Date(time.format("yyyy"), time.format("MM"), 0).getDate();
+
         for (let i = 0; i < day; i++) {
           //添加日期X坐标
           const date = time.format("yyyy-MM-DD");
           this.tenantPlatformBills.option.xAxis[0].data.push(date);
+
           //添加金额Y坐标
-          let fee = 0;
-          res.data.data.forEach(ele => {
+          let price = 0;
+          res.data.data.platformBills.forEach(ele => {
             if (ele.time === date) {
-              fee = ele.fee;
+              price = ele.price;
             }
           });
+          //添加金额
+          this.tenantPlatformBills.option.series[0].data.push(price);
 
-          //添加价格
-          this.tenantPlatformBills.option.series[0].data.push(fee);
+          price = 0;
+          res.data.data.rechargeBills.forEach(ele => {
+            if (ele.time === date) {
+              price = ele.price;
+            }
+          });
+          //添加金额
+          this.tenantPlatformBills.option.series[1].data.push(price);
 
           //加上一天
           time.add(1, 'days');
         }
+
         //第一次渲染
         if (this.tenantPlatformBills.dom === null) {
           this.tenantPlatformBills.dom = echarts.init(this.$refs.tenantPlatformBills);
-          this.tenantPlatformBills.dom.setOption(this.tenantPlatformBills.option);
-
-          window.onresize = () => {
+          //适应屏幕变化
+          window.addEventListener("resize",()=>{
             this.tenantPlatformBills.dom.resize()
-          };
-        } else { //第二次渲染
-          this.tenantPlatformBills.dom.clear();
-          this.tenantPlatformBills.dom = echarts.init(this.$refs.tenantPlatformBills);
-          this.tenantPlatformBills.dom.setOption(this.tenantPlatformBills.option);
+          });
         }
+
+        this.tenantPlatformBills.dom.setOption(this.tenantPlatformBills.option);
       });
     },
   }